/* Stranica za učesnike: izbor jezika, Slušaj / Čitaj. Pravljena prvo za telefon. */

body {
  background: var(--ink);
  color: var(--paper);
  min-height: 100vh;
  min-height: 100dvh;
}

.stage {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 36px) 16px calc(40px + env(safe-area-inset-bottom));
}

/* --- logo i naslov --- */
.brand {
  display: block;
  height: clamp(34px, 3vw + 22px, 56px);
  max-width: min(300px, 70vw);
  object-fit: contain;
  object-position: left center;
  margin-bottom: 14px;
}
.event { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.event h1 { font-size: clamp(1.375rem, 1.1rem + 1.6vw, 2.125rem); line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.event #subtitle { margin-top: 6px; color: var(--mist); font-size: 1rem; }
.onair {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  background: var(--onair);
  color: #2a0704;
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.4;
}
.onair-dot { width: 8px; height: 8px; border-radius: 50%; background: #2a0704; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.onair.is-calm { background: transparent; color: var(--mist); box-shadow: inset 0 0 0 1px var(--booth-line); font-weight: 500; }
.onair.is-calm .onair-dot { display: none; }
.onair.is-pause { background: var(--signal); color: var(--ink); }
.onair.is-pause .onair-dot { background: var(--ink); animation: none; }

/* --- jezik i način --- */
.picker {
  background: var(--booth);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.picker h2 { font-size: 0.875rem; font-weight: 500; color: var(--mist); margin-bottom: 10px; }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.key {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--booth-line);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-align: left;
  line-height: 1.2;
}
.key:hover { border-color: var(--mist); }
.key-code {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 4px;
  border-radius: 5px;
  background: var(--booth);
  color: var(--mist);
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.key[aria-pressed='true'] { background: var(--signal); border-color: var(--signal); color: var(--ink); }
.key[aria-pressed='true'] .key-code { background: var(--ink); color: var(--signal); }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 12px; border: 1px solid var(--booth-line); border-radius: 10px; overflow: hidden; }
.mode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  border: 0;
  background: var(--ink);
  color: var(--mist);
  font-weight: 700;
  font-size: 1.0625rem;
}
.mode + .mode { border-left: 1px solid var(--booth-line); }
.mode small { font-weight: 500; font-size: 0.8125rem; margin-left: 2px; opacity: 0.8; }
.mode[aria-pressed='true'] { background: var(--paper); color: var(--ink); }
.mode:disabled { opacity: 0.35; cursor: default; }

/* --- čekanje --- */
.standby {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 44px 20px;
  text-align: center;
  background: var(--booth);
  border-radius: 12px;
}
.standby p { max-width: 34ch; font-size: 1.125rem; line-height: 1.4; text-wrap: balance; }
.standby-bars { display: flex; align-items: flex-end; gap: 6px; height: 30px; }
.standby-bars i { width: 6px; border-radius: 3px; background: var(--mist); height: 30%; animation: idle 2.4s ease-in-out infinite; }
.standby-bars i:nth-child(2) { animation-delay: 0.3s; }
.standby-bars i:nth-child(3) { animation-delay: 0.6s; }
.standby-bars i:nth-child(4) { animation-delay: 0.9s; }
@keyframes idle { 0%, 100% { height: 22%; opacity: 0.5; } 50% { height: 60%; opacity: 1; } }

/* --- Slušaj --- */
.listen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 30px 20px 26px;
  background: var(--booth);
  border-radius: 12px;
  text-align: center;
}
.play {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  color: var(--paper);
  font-weight: 700;
  font-size: 1.125rem;
}
.play-icon {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--signal);
  color: var(--ink);
  box-shadow: 0 0 0 12px rgba(255, 194, 71, 0.18);
}
.play-icon .i-play { margin-left: 5px; }
.play-icon .i-stop { display: none; }
body.is-playing .play-icon { background: var(--paper); box-shadow: 0 0 0 12px rgba(238, 242, 240, 0.12); }
body.is-playing .play-icon .i-play { display: none; }
body.is-playing .play-icon .i-stop { display: block; }
.play:hover .play-icon { filter: brightness(1.06); }
.listen-bars { display: flex; align-items: center; gap: 5px; height: 26px; }
.listen-bars i { width: 5px; height: 25%; border-radius: 3px; background: var(--booth-line); }
body.is-playing .listen-bars i { background: var(--signal); animation: level 0.9s ease-in-out infinite; }
body.is-playing .listen-bars i:nth-child(2) { animation-delay: 0.15s; }
body.is-playing .listen-bars i:nth-child(3) { animation-delay: 0.35s; }
body.is-playing .listen-bars i:nth-child(4) { animation-delay: 0.1s; }
body.is-playing .listen-bars i:nth-child(5) { animation-delay: 0.5s; }
@keyframes level { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.listen-status { min-height: 1.5em; color: var(--paper); font-weight: 600; }
.listen-hint { color: var(--mist); font-size: 0.875rem; max-width: 40ch; }

/* --- Čitaj --- */
.read {
  --read-size: 1.375rem;
  --sheet-bg: #0b1a22;
  --sheet-text: #eef2f0;
  --sheet-soft: #8fa6b2;
  --sheet-line: #22404f;
  position: relative;
}
.read.is-light {
  --sheet-bg: #fbfaf6;
  --sheet-text: #10212b;
  --sheet-soft: #5c707b;
  --sheet-line: #dfe4e2;
}
.read-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tool {
  min-width: 48px;
  height: 44px;
  padding: 0 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--booth-line);
  border-radius: 8px;
  background: var(--booth);
  color: var(--paper);
  font-weight: 700;
  font-size: 1.0625rem;
}
.tool:hover { border-color: var(--mist); }
.read-status { margin-left: auto; color: var(--mist); font-size: 0.875rem; text-align: right; }
.sheet {
  height: max(300px, calc(100vh - 390px));
  height: max(300px, calc(100dvh - 390px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 18px 26px;
  border-radius: 12px;
  background: var(--sheet-bg);
  color: var(--sheet-text);
  border: 1px solid var(--sheet-line);
  font-size: var(--read-size);
  line-height: 1.45;
  scroll-behavior: smooth;
}
.sheet:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.lines p { margin: 0 0 0.6em; overflow-wrap: anywhere; opacity: 0.72; }
.lines p:last-child, .lines p.empty, .replay-on .lines p { opacity: 1; }
.lines p.is-new { animation: arrive 0.6s ease-out; }
@keyframes arrive { from { opacity: 0.2; } to { opacity: 1; } }
.lines .t { display: block; font-size: 0.6em; color: var(--sheet-soft); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.replay-on .lines p { padding-left: 12px; }
.lines p.is-now { color: var(--sheet-text); box-shadow: inset 4px 0 0 var(--signal); }
.replay-on .lines p { color: var(--sheet-soft); cursor: pointer; }
.replay-on .lines p.is-now { color: var(--sheet-text); }
.partial { margin: 0; color: var(--sheet-soft); min-height: 1.45em; overflow-wrap: anywhere; }
.empty { color: var(--sheet-soft); font-size: 1rem; }
.latest {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  min-height: 44px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--signal);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

/* --- snimak --- */
.replay { margin-bottom: 12px; }
.replay-meta { color: var(--mist); margin-bottom: 10px; }
.replay-audio { width: 100%; margin-bottom: 8px; }
.replay-downloads { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.9375rem; }
.replay-downloads a { color: var(--paper); }

/* --- stanja stranice --- */
body.is-offline .listen, body.is-offline .read, body.is-offline .modes { display: none; }
body:not(.is-offline) .standby { display: none; }

/* --- agenda --- */
.info { margin-top: 28px; max-width: 68ch; }
.info h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
.info-body { color: #d5dee2; font-size: 1.0625rem; line-height: 1.6; }
.info-body p { margin: 0 0 4px; }
.info-body .gap { height: 14px; }
.info-body h3 { font-size: 1.0625rem; font-weight: 700; color: var(--paper); margin: 18px 0 6px; }
.info-body h3:first-child { margin-top: 0; }
.info-body ul { margin: 4px 0 8px; padding-left: 1.2em; }
.info-body strong { color: var(--paper); font-weight: 650; }
.info-body .slot { display: grid; grid-template-columns: 6.5ch 1fr; gap: 14px; padding: 10px 0; border-top: 1px solid var(--booth-line); margin: 0; }
.info-body .slot time { color: var(--signal); font-weight: 650; font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  /* Na telefonu jezici staju u jedan red koji se pomjera prstom, da tekst dobije više mjesta. */
  .keys { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; scroll-padding: 14px; }
  .keys::-webkit-scrollbar { display: none; }
  .key { flex: none; min-height: 48px; padding-right: 14px; }
  .key-code { min-width: 34px; height: 34px; }
  .picker { padding: 12px 14px; }
  .picker h2 { margin-bottom: 8px; }
  .modes { margin-top: 10px; }
  .mode { min-height: 50px; }
}
@media (max-width: 420px) {
  .mode small { display: none; }
  .event { flex-direction: column-reverse; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .onair-dot, .standby-bars i, .listen-bars i, .lines p.is-new { animation: none !important; }
  .sheet { scroll-behavior: auto; }
}
