/* Stranica za gledaoce: video i prijemnik sa tasterima za jezik. */

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

.stage {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 40px) clamp(12px, 3vw, 32px) 48px;
}

/* --- Naslov događaja --- */
.event {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(14px, 2vw, 22px);
}
.event h1 {
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.event #subtitle {
  margin-top: 8px;
  color: var(--mist);
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.125rem);
  max-width: 68ch;
}
.onair {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 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; } }

/* Snimak: ista oznaka, mirnija — nije uživo. */
.onair.is-rec { background: transparent; color: var(--mist); box-shadow: inset 0 0 0 1px var(--booth-line); font-weight: 500; padding-left: 12px; }
.onair.is-rec .onair-dot { display: none; }

/* --- Ekran --- */
.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}
.screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}
.standby {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px;
  text-align: center;
  background: var(--booth);
}
.standby p {
  max-width: 34ch;
  font-size: clamp(1rem, 0.9rem + 0.8vw, 1.375rem);
  line-height: 1.35;
  text-wrap: balance;
}
.standby-bars { display: flex; align-items: flex-end; gap: 6px; height: 34px; }
.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; } }

body.is-live .standby, body.is-rec .standby { display: none; }
body:not(.is-live):not(.is-rec) .screen video { visibility: hidden; }

.play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 88px;
  height: 88px;
  border: 0;
  border-radius: 50%;
  background: var(--signal);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 10px rgba(255, 194, 71, 0.22);
}
.play svg { margin-left: 4px; }
.play:hover { background: #ffd070; }

/* --- Prijemnik: tasteri za jezik --- */
.receiver {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px 24px;
  padding: 16px clamp(14px, 2vw, 22px);
  background: var(--booth);
  border-radius: 0 0 10px 10px;
}
.receiver h2 {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--mist);
  white-space: nowrap;
}
.keys { display: flex; flex-wrap: wrap; gap: 8px; }
.key {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 16px 6px 6px;
  border: 1px solid var(--booth-line);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 1rem;
  text-align: left;
}
.key:hover { border-color: var(--mist); }
.key-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 5px;
  background: var(--booth);
  color: var(--mist);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.key[aria-pressed='true'] {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--ink);
}
.key[aria-pressed='true'] .key-num { background: var(--ink); color: var(--signal); }

/* Tri crtice na izabranom tasteru se pomjeraju dok zvuk ide. */
.key-bars { display: none; align-items: flex-end; gap: 2px; height: 14px; margin-left: 2px; }
.key-bars i { width: 3px; height: 40%; border-radius: 1px; background: var(--ink); }
.key[aria-pressed='true'] .key-bars { display: inline-flex; }
body.is-playing .key[aria-pressed='true'] .key-bars i { animation: level 0.9s ease-in-out infinite; }
body.is-playing .key[aria-pressed='true'] .key-bars i:nth-child(2) { animation-delay: 0.2s; }
body.is-playing .key[aria-pressed='true'] .key-bars i:nth-child(3) { animation-delay: 0.45s; }
@keyframes level { 0%, 100% { height: 30%; } 50% { height: 100%; } }

.notice { grid-column: 1 / -1; color: var(--signal); font-size: 0.9375rem; }

/* Titl: manji tasteri, bez broja kanala */
.keys-sub .key { min-height: 40px; padding: 6px 14px; font-weight: 500; }
.keys-sub .key[aria-pressed='true'] { background: var(--paper); border-color: var(--paper); color: var(--ink); }

/* Titl preko slike (radi i preko cijelog ekrana jer ga crta sam pregledač) */
video::cue {
  font-family: var(--font);
  font-size: 1.15em;
  line-height: 1.35;
  color: #fff;
  background: rgba(16, 33, 43, 0.82);
}

/* --- Ugrađivanje (/embed): samo player i jezici --- */
body.embed .stage { max-width: none; padding: 0; }
body.embed .event { display: none; }
body.embed .screen, body.embed .receiver { border-radius: 0; }

@media (max-width: 640px) {
  .event { flex-direction: column-reverse; align-items: flex-start; gap: 10px; }
  .receiver { grid-template-columns: 1fr; }
  .keys { display: grid; grid-template-columns: 1fr 1fr; }
  .key { width: 100%; }
  .play { width: 72px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .onair-dot, .standby-bars i, .key-bars i { animation: none !important; }
  .key-bars i:nth-child(2) { height: 100%; }
  .key-bars i:nth-child(3) { height: 65%; }
}
