/* Scorecard, room screen, results. Owned by the night agent. */

.night-loading { background: var(--night); }

/* ---------- Scorecard (phone first) ---------- */
.taste { padding-bottom: 32px; }
.taste .stamp { font-size: 14px; }
.stage-cap { color: var(--flame); }
.stage-name { max-width: 14ch; text-wrap: balance; font-size: clamp(46px, 13vw, 96px); }
.stage-name.len-m { font-size: clamp(40px, 11vw, 84px); }
.stage-name.len-l { font-size: clamp(34px, 9.4vw, 72px); }
.taste .dram-stage .glass { width: min(34vw, 150px); }
@media (min-height: 900px) { .taste .dram-stage .glass { width: min(40vw, 190px); } }
.taste .dram-stage { align-content: start; gap: 6px; }
.taste .val { font-size: 60px; }
.stage-spec { font-size: 16px; color: rgba(239, 232, 217, 0.74); }
.stage-glass { margin-top: 6px; }
.stage-help { font-size: 15px; color: rgba(239, 232, 217, 0.74); margin-bottom: 8px; }
.notes-help { margin: 14px 0 0; }
.next-dram { margin-top: 18px; width: 100%; max-width: 560px; }
.taste .dots { flex-wrap: wrap; }

/* A reveal arriving on the phone: the name drops in on red, tap to go to that dram. */
.phone-reveal {
  position: fixed; z-index: 70; left: 0; right: 0; top: 0; border: 0; border-radius: 0; cursor: pointer;
  background: var(--red); color: var(--bone); text-align: left; display: grid; gap: 8px;
  padding: calc(18px + env(safe-area-inset-top)) var(--gutter) 22px; border-bottom: 5px solid var(--ink);
  animation: drop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
.phone-reveal b { font-family: var(--corp); font-weight: 700; text-transform: uppercase; font-size: clamp(40px, 11vw, 72px); line-height: 0.86; }
.phone-reveal .cap { opacity: 0.9; }
@keyframes drop { from { transform: translateY(-100%); } }

/* ---------- Results: the room's verdict ---------- */
.results { padding-bottom: 64px; }
.results-h { font-size: clamp(46px, 13.2vw, 150px); line-height: 0.82; margin: 22px 0 14px; }
.results-h span { white-space: nowrap; }
.results-h span { display: block; }
.results-lede { font-size: 20px; color: rgba(239, 232, 217, 0.82); margin-bottom: 26px; }
.verdict-rows { list-style: none; margin: 0 0 22px; padding: 0; border-top: 3px solid var(--bone); }
.verdict-rows li { display: grid; grid-template-columns: 1.6ch minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid rgba(239, 232, 217, 0.18); }
.v-rank { font-family: var(--corp); font-weight: 700; font-size: 48px; line-height: 0.9; color: var(--flame); }
.v-name b { display: block; font-family: var(--corp); font-weight: 700; text-transform: uppercase; font-size: clamp(24px, 6vw, 40px); line-height: 0.92; }
.v-name small { display: block; font-size: 14px; color: rgba(239, 232, 217, 0.7); margin-top: 5px; }
.v-score { font-family: var(--corp); font-weight: 700; font-size: clamp(40px, 9vw, 64px); line-height: 0.9; }
.verdict-rows li.first .v-rank, .verdict-rows li.first .v-score { color: var(--flame); }
.verdict-rows li.first .v-name b { font-size: clamp(30px, 8vw, 52px); }
.results-note { font-size: 16px; color: rgba(239, 232, 217, 0.7); margin-bottom: 16px; }

/* ---------- Room screen ---------- */
.room { position: relative; overflow: hidden; isolation: isolate; background: var(--night); color: var(--bone); }
.room > *:not(.grain):not(.elk):not(.takeover) { position: relative; z-index: 2; }
.room-red { background: var(--red); }
.room-elk { right: -16vw; bottom: -9vh; height: 76vh; opacity: 0.95; z-index: 0; }
.room-closed .room-elk { right: -18vw; bottom: -18vh; height: 70vh; opacity: 0.5; }
.room-id { display: flex; align-items: flex-end; gap: 2.4vw; }
.room-title { font-family: var(--corp); font-weight: 700; text-transform: uppercase; font-size: clamp(18px, 1.7vw, 34px); line-height: 0.9; padding-left: 2.4vw; border-left: 3px solid rgba(239, 232, 217, 0.35); }
.room-qr span { font-family: var(--corp); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: clamp(11px, 0.9vw, 16px); line-height: 1.25; opacity: 0.85; }
.room-now h1 { max-width: 9ch; text-wrap: balance; }
.room-now .now-name { font-size: clamp(56px, 7.4vw, 150px); max-width: 11ch; }
.room-now .now-name.len-l { font-size: clamp(44px, 5.4vw, 112px); max-width: 16ch; }
.room-main .flight { align-items: start; }
.room-main .flight .slot span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.room-now .avg b.dim { opacity: 0.35; }
.room-side { display: grid; gap: 5vh; }
.room-words-wrap { display: grid; gap: 1vh; }
.room-words-wrap .cap { color: var(--flame); font-size: clamp(12px, 1vw, 18px); }
.room-words { min-height: 0; line-height: 0.95; row-gap: 0.6vh; }

/* Before the night: the board on the red */
.tonight { display: grid; gap: 3.4vh; max-width: 60vw; }
.board-title { font-family: var(--corp); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; font-size: clamp(12px, 1vw, 18px); color: rgba(239, 232, 217, 0.8); }
.tonight-side { display: grid; grid-template-columns: auto 1fr; gap: 2.6vw; align-items: end; }
.tonight-side .flight { width: 26vw; gap: 1vw; }
.tonight-side .slot b { font-size: clamp(20px, 1.8vw, 34px); }
.tonight-note { font-family: var(--corp); font-weight: 700; text-transform: uppercase; font-size: clamp(18px, 1.9vw, 36px); line-height: 0.98; }
.tonight-note span { display: block; white-space: nowrap; }
.room-red .flight .slot .glass svg path[stroke] { stroke: var(--bone); }

/* The reveal: the whole screen turns red and the name arrives */
.takeover {
  position: absolute; inset: 0; z-index: 50; background: var(--red); color: var(--bone);
  display: grid; align-content: center; gap: 2.4vh; padding: 0 6vw; overflow: hidden;
  animation: takeover 7s ease both;
}
.takeover > *:not(.grain):not(.t-glass) { position: relative; z-index: 2; max-width: 64vw; }
.takeover .t-glass { position: absolute; z-index: 2; right: 7vw; top: 50%; width: min(22vw, 40vh); transform: translateY(-50%); animation: pourIn 1.2s 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes pourIn { from { opacity: 0; transform: translateY(-40%); } }
.takeover .cap { font-size: clamp(16px, 1.6vw, 30px); letter-spacing: 0.14em; }
.takeover h1 { font-size: clamp(80px, 13vw, 260px); line-height: 0.82; max-width: 16ch; text-wrap: balance; animation-delay: 0.35s; }
.takeover h1.len-m { font-size: clamp(64px, 10vw, 210px); }
.takeover h1.len-l { font-size: clamp(54px, 7.6vw, 160px); }
.takeover .t-spec { font-family: var(--corp); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: clamp(16px, 1.6vw, 30px); opacity: 0.85; }
.takeover .t-avg { font-family: var(--corp); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: clamp(16px, 1.5vw, 28px); display: flex; align-items: baseline; gap: 1.4vw; margin-top: 2vh; }
.takeover .t-avg b { font-size: clamp(70px, 8vw, 160px); line-height: 0.8; letter-spacing: 0; }
@keyframes takeover { 0% { clip-path: inset(0 0 100% 0); } 8% { clip-path: inset(0 0 0 0); } 90% { opacity: 1; } 100% { opacity: 0; } }

/* After the night: the ranking on the red */
.final { display: grid; align-content: center; gap: 3vh; max-width: 60vw; }
.room-closed .board .r { grid-template-columns: 3.4vw minmax(0, 1fr) 13vw 6vw; }
.final-h { font-size: clamp(54px, 6vw, 130px); line-height: 0.82; white-space: nowrap; }
.board .r { border-bottom: 1px solid rgba(239, 232, 217, 0.25); padding-bottom: 1.2vh; }
.room-red .board .r .rank { color: var(--bone); }
.room-red .board .r .bar { background: rgba(23, 17, 13, 0.22); }
.room-red .board .r .bar i { background: var(--ink); }
.board .r.first .rank, .board .r.first b { font-size: 1.9em; }
.b-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 899px) {
  .room-main { grid-template-columns: 1fr; }
  .tonight { max-width: none; }
  .tonight-side { grid-template-columns: 1fr; }
  .tonight-side .flight { width: 100%; }
  .room-stats { gap: 18px; }
  .room-elk { height: 50vh; }
}
@media (prefers-reduced-motion: reduce) { .takeover, .phone-reveal { animation: none; } }
