/* Big-screen projector mode. Sized in viewport units so it fills any projector. */

.screen-body { overflow: hidden; height: 100vh; }

.screen-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card-lite { max-width: 440px; text-align: left; }
.gate-title { font-family: var(--font-display); font-size: 40px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.gate-text { color: var(--muted); margin: 0 0 24px; }

.stage {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 3vh 3.5vw;
  background:
    radial-gradient(60vw 50vh at 100% 0%, rgba(121, 184, 176, 0.12), transparent 70%),
    radial-gradient(50vw 50vh at 0% 100%, rgba(228, 143, 153, 0.1), transparent 70%),
    var(--night);
}
.stage-top { position: relative; z-index: 5; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.stage-logo { width: 13vw; min-width: 150px; height: 3.4vw; min-height: 38px; }
.stage-tools { display: flex; align-items: center; gap: 16px; }
.stage-clock { font-family: var(--font-display); font-size: 1.6vw; font-weight: 600; color: var(--cream-dim); font-variant-numeric: tabular-nums; }
.sound-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(242, 237, 225, 0.18);
  background: rgba(14, 18, 34, 0.55);
  color: var(--cream-dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.sound-btn .snd-off { display: none; }
.sound-btn.muted .snd-on, .sound-btn.needs .snd-on { display: none; }
.sound-btn.muted .snd-off, .sound-btn.needs .snd-off { display: block; }
.sound-btn.needs { background: var(--rose); border-color: var(--rose); color: #2a0d12; animation: pulse-rose 2s infinite; }
.sound-btn:not(.needs) .snd-label { display: none; }
.sound-btn:not(.needs) { width: 40px; padding: 0; justify-content: center; }
@keyframes pulse-rose { 0% { box-shadow: 0 0 0 0 rgba(228, 143, 153, 0.6); } 70% { box-shadow: 0 0 0 12px rgba(228, 143, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(228, 143, 153, 0); } }
:fullscreen .stage-tools .icon-btn, :fullscreen .stage-tools .sound-btn:not(.needs) { opacity: 0; }
:fullscreen .stage-tools .sound-btn:hover { opacity: 1; }
:fullscreen .stage-tools .icon-btn:hover { opacity: 1; }

/* ---------- voting view ---------- */

.vote-view {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 4vw;
  align-items: center;
  padding-top: 2vh;
}

.stage-title {
  font-family: var(--font-display);
  font-size: 5.2vw;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-variation-settings: 'wdth' 88;
  margin: 0 0 4vh;
}

.qr-bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 1.8vw;
  padding: 1.6vw;
  border-radius: 1.6vw;
  background: var(--cream);
  color: var(--night);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.qr-bubble::after {
  content: '';
  position: absolute;
  left: 3vw;
  bottom: -1.4vw;
  width: 2.4vw;
  height: 1.6vw;
  background: var(--cream);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.qr { width: 12vw; height: 12vw; min-width: 140px; min-height: 140px; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr svg rect { fill: transparent; }
.qr svg path { fill: var(--night); }
.qr-text span { display: block; font-size: 1.2vw; font-weight: 600; color: #4b5170; }
.qr-text strong { display: block; font-family: var(--font-display); font-size: 1.9vw; font-weight: 800; letter-spacing: -0.01em; max-width: 18vw; word-break: break-all; }
.is-closed .qr-bubble { opacity: 0.35; filter: grayscale(1); }

.live-count { position: relative; display: flex; align-items: baseline; gap: 1vw; margin-top: 5.5vh; }
.count-num { font-family: var(--font-display); font-size: 7vw; font-weight: 800; line-height: 1; color: var(--teal); font-variant-numeric: tabular-nums; }
.count-label { font-size: 1.8vw; color: var(--cream-dim); font-weight: 600; }
.count-bump {
  position: absolute;
  left: 0;
  top: -1vw;
  font-family: var(--font-display);
  font-size: 2.4vw;
  font-weight: 800;
  color: var(--rose);
  opacity: 0;
  pointer-events: none;
}
.count-bump.go { animation: bump 1.4s var(--ease-out); }
@keyframes bump { 0% { opacity: 0; transform: translateY(1vw); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-3vw); } }

.stage-deadline { margin-top: 1.5vh; font-size: 1.6vw; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-deadline strong { color: var(--cream); }

.wall {
  height: 100%;
  max-height: 78vh;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.2vh 1.4vw;
  align-content: center;
}
.wall[data-n="1"], .wall[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 6vw; }
.wall[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wall[data-n="5"], .wall[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wall[data-n="9"], .wall[data-n="10"], .wall[data-n="11"], .wall[data-n="12"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.wall-item { margin: 0; min-width: 0; }
.wall-item .poster { border-radius: 0.9vw; font-size: 4vw; max-height: 30vh; margin: 0 auto; }
.wall[data-n="9"] .wall-item .poster, .wall[data-n="10"] .wall-item .poster,
.wall[data-n="11"] .wall-item .poster, .wall[data-n="12"] .wall-item .poster { max-height: 26vh; }
.wall-item figcaption {
  margin-top: 1vh;
  font-weight: 600;
  font-size: 1.1vw;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--cream-dim);
}
.wall-more, .wall-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 1.4vw; margin: 0; }

/* ---------- drumroll ---------- */

.drum {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5vh;
  background: rgba(10, 13, 26, 0.96);
}
.drum-label { font-family: var(--font-display); font-size: 3vw; font-weight: 700; color: var(--cream-dim); margin: 0; }
.drum-poster { width: 22vw; max-height: 62vh; font-size: 8vw; border-radius: 1.4vw; box-shadow: 0 0 0 0.3vw var(--rose), 0 40px 120px -20px rgba(228, 143, 153, 0.45); }
.drum-poster.landed { animation: land 0.7s var(--ease-out); box-shadow: 0 0 0 0.35vw var(--gold), 0 40px 140px -10px rgba(240, 195, 106, 0.55); }
@keyframes land { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
.drum-title { font-family: var(--font-display); font-size: 2.6vw; font-weight: 800; margin: 0; min-height: 1.2em; text-align: center; padding: 0 4vw; }

/* ---------- winner ---------- */

.win-view { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; isolation: isolate; }
.win-bg {
  position: fixed;
  inset: -120px;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: blur(50px) saturate(1.3);
  opacity: 0.45;
}
.win-view::before { content: ''; position: fixed; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(14, 18, 34, 0.55), rgba(14, 18, 34, 0.92)); }
.win-grid { display: grid; grid-template-columns: auto 1fr; gap: 4.5vw; align-items: center; width: 100%; }
.win-poster {
  width: 24vw;
  aspect-ratio: 2 / 3;
  max-height: 76vh;
  border-radius: 1.4vw;
  background: var(--panel-3) center / cover;
  box-shadow: 0 0 0 0.35vw var(--gold), 0 50px 120px -30px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 9vw;
  font-weight: 800;
  animation: winner-in 1s var(--ease-out) both;
}
.win-poster.sm { width: 13vw; font-size: 5vw; box-shadow: 0 0 0 0.25vw var(--rose); }
.win-kicker { color: var(--gold); font-weight: 700; font-size: 1.8vw; margin: 0 0 1vh; }
.win-title {
  font-family: var(--font-display);
  font-size: 5.6vw;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 1.6vh;
}
.win-meta { color: var(--cream-dim); font-size: 1.6vw; margin: 0 0 2.4vh; }
.win-bubble { font-size: 1.4vw; padding: 1.2vw 1.5vw; max-width: 44vw; border-radius: 1.2vw; }
.win-by { color: var(--muted); font-size: 1.2vw; margin: 2vh 0 0; }
.tie-row { display: flex; gap: 2vw; margin-top: 3vh; }

.rank-list { margin-top: 3.5vh; display: grid; gap: 1.1vh; max-width: 44vw; }
.rank-row { display: grid; grid-template-columns: 2.4vw 1fr 3vw; gap: 1vw; align-items: center; }
.thumb-s { width: 2.4vw; height: 3.5vw; border-radius: 0.3vw; background: var(--panel-3) center / cover; display: flex; align-items: center; justify-content: center; font-size: 1vw; font-weight: 700; }
.rank-title { font-size: 1.1vw; font-weight: 600; margin-bottom: 0.5vh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-track { height: 0.6vw; border-radius: 99px; background: rgba(242, 237, 225, 0.08); overflow: hidden; }
.rank-fill { height: 100%; width: 0; border-radius: 99px; background: var(--rule-strong); transition: width 1.4s var(--ease-out) 0.4s; }
.rank-row.first .rank-fill { background: var(--gold); }
.rank-row.first .rank-title { color: var(--gold); }
.rank-count { font-family: var(--font-display); font-weight: 800; font-size: 1.3vw; text-align: right; font-variant-numeric: tabular-nums; }

/* Small windows (testing on a laptop) */
/* ---------- phones, tablets and portrait screens ----------
   The projector layout scales with the screen width, which makes text tiny on a phone,
   so here everything switches to fixed, readable sizes and the page scrolls. */
@media (max-width: 900px), (max-aspect-ratio: 1/1) {
  .screen-body { overflow: auto; height: auto; }
  .stage { height: auto; min-height: 100vh; padding: 16px 16px 40px; }
  .stage-logo { width: 120px; min-width: 0; height: 30px; min-height: 0; }
  .stage-tools { gap: 8px; }
  .stage-clock { font-size: 14px; }
  .sound-btn { height: 36px; font-size: 13px; padding: 0 12px; }
  .sound-btn:not(.needs) { width: 36px; }
  .stage-tools .icon-btn { width: 36px; height: 36px; }

  .vote-view { display: block; padding-top: 24px; }
  .stage-title { font-size: clamp(34px, 10vw, 60px); margin-bottom: 24px; }
  .qr-bubble { display: flex; gap: 16px; padding: 16px; border-radius: 18px; width: 100%; max-width: 460px; }
  .qr-bubble::after { left: 28px; bottom: -14px; width: 24px; height: 16px; }
  .qr { width: 38vw; height: 38vw; max-width: 190px; max-height: 190px; min-width: 120px; min-height: 120px; flex-shrink: 0; }
  .qr-text span { font-size: 13px; }
  .qr-text strong { font-size: clamp(15px, 4.4vw, 20px); max-width: none; word-break: normal; overflow-wrap: anywhere; line-height: 1.25; }
  .live-count { margin-top: 36px; gap: 10px; }
  .count-num { font-size: 64px; }
  .count-label { font-size: 17px; }
  .count-bump { font-size: 24px; top: -18px; }
  .stage-deadline { font-size: 15px; margin-top: 6px; }

  .wall, .wall[data-n] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 12px; padding: 0; margin-top: 32px; max-height: none; height: auto; }
  .wall[data-n="1"], .wall[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-item .poster, .wall[data-n] .wall-item .poster { max-height: none; border-radius: 10px; font-size: 32px; }
  .wall-item figcaption { font-size: 13px; margin-top: 6px; }
  .wall-more, .wall-empty { font-size: 15px; }

  .drum { position: fixed; gap: 16px; padding: 24px; }
  .drum-label { font-size: 22px; }
  .drum-poster { width: min(62vw, 280px); max-height: 60vh; font-size: 64px; border-radius: 16px; box-shadow: 0 0 0 3px var(--rose), 0 30px 80px -20px rgba(228, 143, 153, 0.45); }
  .drum-poster.landed { box-shadow: 0 0 0 3px var(--gold), 0 30px 90px -10px rgba(240, 195, 106, 0.55); }
  .drum-title { font-size: 22px; padding: 0 8px; }

  .win-view { display: block; padding-top: 24px; }
  .win-grid { grid-template-columns: 1fr; gap: 24px; }
  .win-poster { width: min(58vw, 260px); max-height: none; border-radius: 16px; font-size: 72px; box-shadow: 0 0 0 3px var(--gold), 0 30px 70px -25px rgba(0, 0, 0, 0.9); margin: 0 auto; }
  .win-poster.sm { width: 34vw; font-size: 40px; box-shadow: 0 0 0 2px var(--rose); margin: 0; }
  .win-kicker { font-size: 16px; margin-bottom: 6px; }
  .win-title { font-size: clamp(36px, 11vw, 60px); margin-bottom: 10px; }
  .win-meta { font-size: 16px; margin-bottom: 18px; }
  .win-bubble { font-size: 15px; padding: 12px 16px; max-width: none; border-radius: 14px; }
  .win-by { font-size: 14px; margin-top: 16px; }
  .tie-row { gap: 12px; margin-top: 20px; }
  .rank-list { max-width: none; margin-top: 28px; gap: 12px; }
  .rank-row { grid-template-columns: 30px 1fr 32px; gap: 12px; }
  .thumb-s { width: 30px; height: 44px; border-radius: 4px; font-size: 13px; }
  .rank-title { font-size: 15px; margin-bottom: 6px; }
  .rank-track { height: 7px; }
  .rank-count { font-size: 17px; }
}

/* narrow phones: hide the clock so the buttons fit */
@media (max-width: 420px) {
  .stage-clock { display: none; }
  .sound-btn.needs .snd-label { font-size: 12px; }
}
