/* Host (projector, 16:9). Placeholder layout until F7 visuals. */

.lobby {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "head head"
    "join side"
    "row  row";
  gap: 2rem;
  padding: 2rem 3rem;
}

.lobby-head { grid-area: head; text-align: center; }
.lobby-title[data-logo] img { width: auto; height: clamp(110px, 17vh, 190px); }

.lobby-join {
  grid-area: join;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.join-label { margin: 0; color: var(--c-parchment); font-size: 1.1rem; }
.join-url { margin: 0 0 1.25rem; font-size: 1.5rem; font-weight: 700; word-break: break-all; }
.room-code {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 900;
  font-size: clamp(4rem, 9vw, 8rem);
  letter-spacing: 0.15em;
  color: var(--c-lantern);
  line-height: 1;
}

.qr {
  flex: 0 0 auto;
  width: clamp(160px, 18vw, 280px);
  aspect-ratio: 1;
  background: var(--c-bone);
  border: var(--line) solid var(--c-ink);
  border-radius: 12px;
  padding: 8px;
}
.qr svg { width: 100%; height: 100%; display: block; }
.qr svg rect { fill: var(--c-bone); }
.qr svg path { fill: var(--c-ink); }

.lobby-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}
.count { margin: 0; font-size: 1.75rem; font-weight: 700; }
.btn-start { margin-top: 1rem; font-size: 2rem; padding: 0.75rem 3rem; }

.avatar-row {
  grid-area: row;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 0.5rem;
}

.slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.slot .avatar, .slot > .avatar-img { width: 100%; max-width: 96px; aspect-ratio: 1; }
.slot .avatar-img { width: 100%; height: 100%; display: block; }
.slot-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-bone);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot.disconnected { opacity: 0.35; }
.slot.choosing .avatar { animation: pulse 1.2s ease-in-out infinite; }

.kick {
  position: absolute;
  top: -6px;
  right: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--c-ink);
  background: var(--c-blood);
  color: var(--c-bone);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.slot:hover .kick, .kick:focus-visible { opacity: 1; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---- Room shell: stage on top, avatar row at the bottom ---- */
.room { min-height: 100vh; display: flex; flex-direction: column; padding: 1.5rem 3rem 1rem; gap: 1rem; }
.room > .stage { flex: 1; }
.room > .lobby { padding: 0; min-height: 0; grid-template-rows: auto 1fr; grid-template-areas: "head head" "join side"; }
.room > .screen { min-height: 0; }

/* ---- Trivia question ---- */
.trivia, .result { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.q-counter { margin: 0; color: var(--c-parchment); font-weight: 700; font-size: 1.25rem; }
.q-panel {
  width: min(1200px, 100%);
  background: var(--c-midnight);
  border: var(--line) solid var(--c-blood);
  outline: 3px solid var(--c-lantern);
  outline-offset: -12px;
  border-radius: 28px / 40px;
  padding: 2rem 3rem;
  box-shadow: 0 0 0 var(--line) var(--c-ink);
}
.q-prompt { margin: 0; text-align: center; font-size: clamp(1.75rem, 3.2vw, 3rem); font-weight: 800; color: var(--c-bone); line-height: 1.25; }
.blank { display: inline-block; width: 4.5em; border-bottom: 5px solid var(--c-lantern); margin: 0 0.15em; transform: translateY(-0.15em); }

.cards { width: min(1200px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; }
.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 5rem;
  padding: 1rem 1.5rem 1rem 1rem;
  background: var(--c-bone);
  color: var(--c-ink);
  border: var(--line) solid var(--c-lantern);
  border-radius: 14px;
  box-shadow: 0 0 0 3px var(--c-ink), inset 0 -6px 0 var(--c-parchment);
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  font-weight: 800;
}
.seal {
  flex: 0 0 auto;
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 4px solid var(--c-ink);
  color: var(--c-bone);
  font-weight: 900;
  font-size: 1.4rem;
}
.seal-blue { background: var(--c-seal-blue); }
.seal-orange { background: var(--c-seal-orange); }
.seal-green { background: var(--c-seal-green); }
.seal-red { background: var(--c-seal-red); }

.type-hint { margin: 0; font-size: 2rem; font-weight: 800; color: var(--c-lantern); }
.q-status { margin: 0; font-size: 1.25rem; color: var(--c-parchment); }

.timer {
  width: min(1200px, 100%);
  height: 18px;
  margin-top: auto;
  border: 4px solid var(--c-lantern);
  border-radius: 999px;
  background: var(--c-ink);
  overflow: hidden;
}
.timer-fill { height: 100%; width: 100%; background: var(--c-toxic); box-shadow: var(--glow); transition: background var(--t-fast); }
.timer-fill.danger { background: var(--c-blood); box-shadow: 0 0 12px var(--c-blood); }

/* ---- Result ---- */
.r-answer {
  margin: 0;
  padding: 0.6rem 2rem;
  background: var(--c-toxic);
  color: var(--c-ink);
  border: var(--line) solid var(--c-ink);
  border-radius: 14px;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 900;
}
.r-message { margin: 0; font-size: 1.75rem; font-weight: 700; text-align: center; max-width: 1200px; }
.r-caretaker { margin: 0; max-width: 1100px; text-align: center; font-size: 1.5rem; color: var(--c-toxic); }
.r-caretaker strong { color: var(--c-blood); font-size: 2rem; }


/* ---- Avatar row badges ---- */
.slot-score { font-size: 13px; color: var(--c-lantern); font-weight: 800; }
.badge {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  padding: 0 6px; border-radius: 8px; border: 3px solid var(--c-ink);
  font-size: 13px; font-weight: 900; line-height: 1.4;
}
.badge.done { background: var(--c-plum); color: var(--c-bone); }
.badge.ok { background: var(--c-toxic); color: var(--c-ink); }
.badge.bad { background: var(--c-blood); color: var(--c-bone); }

/* ---- Detention ---- */
.detention { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.det-title { color: var(--c-toxic); text-shadow: var(--glow); }
.det-text { margin: 0; max-width: 1100px; font-size: 1.6rem; font-weight: 700; }
.det-people { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.det-people li { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; font-weight: 800; }
.det-people .avatar { width: 88px; aspect-ratio: 1; }
.det-people .avatar .avatar-img { width: 100%; height: 100%; }
.det-people li.is-dead span { color: var(--c-blood); text-decoration: line-through; }
.det-outcome { margin: 0; font-size: 2rem; font-weight: 900; color: var(--c-blood); }

.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; width: min(1000px, 100%); }
.tile {
  position: relative; min-height: 5.5rem; padding: 0.5rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
  background: var(--c-parchment); color: var(--c-ink);
  border: var(--line) solid var(--c-ink); border-radius: 14px; font-weight: 800;
}
.tile-n { font-size: 1.6rem; font-weight: 900; }
.tile-who { font-size: 0.9rem; }
.tile-mark { font-size: 0.8rem; font-weight: 900; color: var(--c-bone); background: var(--c-blood); border-radius: 6px; padding: 0 6px; }
.tile.cake { border-radius: 50% 50% 14px 14px; }
.tile.nail { box-shadow: 0 0 0 4px var(--c-blood); }
.tiles.ledger .tile { background: var(--c-bone); border-radius: 6px; }
.tile.struck::after {
  content: ''; position: absolute; left: 8%; right: 8%; top: 50%; height: 6px;
  background: var(--c-ink); transform: rotate(-8deg); border-radius: 3px;
}
.scores { font-size: 1.4rem; text-align: left; columns: 2; }
.scores li.in-det { color: var(--c-lantern); }

/* ---- Escape ---- */
.escape { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; }
.esc-board {
  position: relative;
  width: min(1500px, 100%);
  aspect-ratio: 1600 / 520;
  background: var(--c-midnight);
  border: var(--line) solid var(--c-plum);
  border-radius: 24px;
  box-shadow: 0 0 0 3px var(--c-ink);
  overflow: hidden;
}
.path-layer, .piece-layer { position: absolute; inset: 0; }
.path-svg { width: 100%; height: 100%; display: block; }
/* Stepping stones on the maze picture's gravel path (2026-11-11); the Headmistress's tiles go dark. */
.ptile { fill: var(--c-bone); stroke: var(--c-ink); stroke-width: 5; transition: fill var(--t-max) ease, stroke var(--t-max) ease; }
.ptile.dark { fill: var(--c-ink); stroke: var(--c-blood); filter: drop-shadow(0 0 6px var(--c-blood)); }
.mistress { transition: opacity var(--t-max) ease; opacity: 0.35; }
.mistress.active { opacity: 1; }
.mistress image { filter: drop-shadow(0 0 12px var(--c-blood)); }
.mistress-mist { fill: var(--c-blood); opacity: 0.35; filter: blur(10px); }

.piece {
  position: absolute;
  width: clamp(36px, 3.6vw, 64px);
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  transition: opacity var(--t-max) ease;
}
.piece .avatar { width: 100%; aspect-ratio: 1; }
.piece .avatar .avatar-img { width: 100%; height: 100%; display: block; }
.piece-name {
  font-size: 12px; font-weight: 800; color: var(--c-bone); white-space: nowrap;
  text-shadow: 0 2px 0 var(--c-ink), 0 0 4px var(--c-ink);
}
.piece-steps, .piece-shortcut {
  position: absolute; top: -10px; right: -14px;
  padding: 0 5px; border-radius: 8px; border: 3px solid var(--c-ink);
  font-size: 13px; font-weight: 900; line-height: 1.4;
  background: var(--c-toxic); color: var(--c-ink);
}
.piece-shortcut { right: auto; left: -14px; background: var(--c-lantern); animation: pulse 0.6s ease-in-out infinite; }
.piece.caught { opacity: 0.35; }
.piece.caught .avatar .avatar-img { filter: grayscale(1) brightness(0.5); }

.esc-text { margin: 0; max-width: 1200px; font-size: 1.5rem; font-weight: 700; min-height: 1.5em; }
.esc-q { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.esc-q .q-panel { padding: 1rem 2rem; }
.esc-q .q-prompt { font-size: clamp(1.4rem, 2.4vw, 2.25rem); }
.esc-cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.esc-cards .card { min-height: 3.5rem; font-size: clamp(1rem, 1.6vw, 1.5rem); }
.card.is-right { border-color: var(--c-toxic); box-shadow: 0 0 0 3px var(--c-ink), var(--glow); }
.card.is-wrong { opacity: 0.45; }
.card.ghost-card { background: color-mix(in srgb, var(--c-bone) 70%, var(--c-toxic)); }

/* ---- Closing ---- */
.ended { gap: 1rem; }
.end-winner .avatar { height: 42vh; display: flex; justify-content: center; }
.end-winner .avatar-full { height: 100%; width: auto; filter: drop-shadow(0 0 24px color-mix(in srgb, var(--c-lantern) 55%, transparent)); }
.end-cols { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.end-cols .panel { min-width: 320px; text-align: left; }
.end-cols h3 { margin: 0 0 0.5rem; color: var(--c-lantern); }
.end-list { margin: 0; padding-left: 1.5rem; font-size: 1.25rem; columns: 2; }
.end-actions { display: flex; gap: 1rem; }
.btn-ghost { background: transparent; }
/* During the Escape the pieces on the path show everyone; the avatar row would only crowd the screen. */
.room:has(> [data-stage="escape"]:not([hidden])) > .avatar-row { display: none; }
.piece-shortcut svg { width: 10px; height: 14px; display: block; }
.piece-shortcut path { fill: var(--c-ink); }

/* ---- F5 Detention games ---- */
.big-word { margin: 0; font-size: clamp(3rem, 7vw, 6rem); font-weight: 900; color: var(--c-lantern); text-transform: lowercase; }
.det-quote { margin: 0; font-size: 1.5rem; font-style: italic; color: var(--c-toxic); }
.speaker { margin: 0; font-size: 5rem; line-height: 1; animation: pulse 1.2s ease-in-out infinite; }
.scores.live { columns: 3; font-size: 1.2rem; }
.col-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 0.4rem 2rem; font-size: 1.4rem; text-align: left; }
.col-list .is-dead { color: var(--c-blood); }
.col-list .is-ok { color: var(--c-toxic); }
.letter-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; width: min(520px, 90%); }
.letter-grid span {
  aspect-ratio: 1; display: grid; place-items: center; font-weight: 900; font-size: 1.4rem;
  background: var(--c-parchment); color: var(--c-ink); border: 3px solid var(--c-ink); border-radius: 6px;
}
.letter-grid span.hit { background: var(--c-toxic); }
.drawings { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.drawings figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; font-weight: 800; }
.drawings canvas { width: clamp(150px, 15vw, 240px); height: clamp(150px, 15vw, 240px); border: var(--line) solid var(--c-ink); border-radius: 12px; box-shadow: 0 0 0 3px var(--c-lantern); }
.obj-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; width: min(900px, 100%); }
.obj {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.5rem;
  background: var(--c-midnight); border: 4px solid var(--c-plum); border-radius: 14px; color: var(--c-parchment); font-weight: 800;
  transition: box-shadow var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.obj-svg { width: 72px; height: 72px; }
.obj-shape { fill: var(--c-plum); stroke: var(--c-parchment); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.obj.lit { border-color: var(--c-toxic); background: color-mix(in srgb, var(--c-toxic) 25%, var(--c-midnight)); box-shadow: var(--glow), 0 0 30px var(--c-toxic); }
.obj.lit .obj-shape { fill: var(--c-toxic); stroke: var(--c-ink); }

/* Audience vote: a quick pie (no names, no leaderboard) */
.aud-pie { display: inline-flex; align-items: center; gap: 0.75rem; animation: pie-in 400ms ease-out; }
.aud-pie svg { width: 64px; height: 64px; }
.aud-pie-bg { fill: none; stroke: var(--c-plum); stroke-width: 6; }
.aud-pie-fill { fill: none; stroke: var(--c-toxic); stroke-width: 6; filter: drop-shadow(0 0 4px var(--c-toxic)); }
@keyframes pie-in { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: none; } }

/* Narration: Skip (button or Space) while the narrator talks or the rules are being read out */
.btn-skip { position: fixed; right: 24px; bottom: 24px; z-index: 20; font-size: 1.1rem; padding: 0.45rem 1.1rem; }
.btn-skip[hidden] { display: none; }

/* Escape: the ghosts' extra option, shown on the projector all the time */
.ghost-card { position: relative; }
.ghost-tag { position: absolute; top: 6px; right: 10px; font-size: 0.8rem; font-weight: 800; color: var(--c-toxic); text-transform: uppercase; letter-spacing: 0.05em; }

/* Opening screen (before question 1) */
.stage.intro { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: 2rem; padding: 2rem 3rem;
  background: var(--c-midnight) url('/assets/bg/bg_classroom.webp') center / cover no-repeat; }
.stage.intro[hidden] { display: none; }
.intro-char { width: 100%; max-height: 78vh; object-fit: contain; filter: drop-shadow(0 0 24px color-mix(in srgb, var(--c-toxic) 35%, transparent)); }
.intro-title { font-family: var(--font-display); font-size: clamp(3rem, 7vw, 6rem); color: var(--c-lantern); margin: 0 0 1rem; }
.intro-rules { margin: 0; padding-left: 1.2em; font-size: clamp(1.2rem, 2.2vw, 2rem); line-height: 1.4; color: var(--c-bone); }
.intro-rules li { margin: 0.6em 0; }

/* Phase backgrounds (style bible "Helyszínek", F7 2026-11-10), darkened so the text stays readable. */
.room {
  --bg-shade: linear-gradient(color-mix(in srgb, var(--c-midnight) 62%, transparent), color-mix(in srgb, var(--c-midnight) 78%, transparent));
  background: var(--c-midnight) center / cover no-repeat;
}
.room:has(> [data-stage="lobby"]:not([hidden])) { background-image: var(--bg-shade), url('/assets/bg/bg_lobby.webp'); }
.room:has(> [data-stage="question"]:not([hidden])),
.room:has(> [data-stage="evaluate"]:not([hidden])),
.room:has(> [data-stage="restart"]:not([hidden])) { background-image: var(--bg-shade), url('/assets/bg/bg_classroom.webp'); }
.room:has(> [data-stage="detention"]:not([hidden])) { background-image: var(--bg-shade), url('/assets/bg/bg_detention.webp'); }
.room:has(> [data-stage="escape"]:not([hidden])) { background-image: var(--bg-shade), url('/assets/bg/bg_escape_room.webp'); }
.room:has(> [data-stage="ended"]:not([hidden])) { background-image: var(--bg-shade), url('/assets/bg/bg_ledger.webp'); }
.room:has(> [data-stage="ended"]:not([hidden]) #end-winner:not(:empty)) { background-image: var(--bg-shade), url('/assets/bg/bg_victory.webp'); }

/* Staff portrait: round frame in the top right corner (style bible: Headmaster "kör-portré a sarokban"). */
.room { position: relative; }
.staff-portrait {
  position: absolute; top: 1rem; right: 1.5rem; z-index: 2; pointer-events: none;
  width: clamp(120px, 13vw, 220px); aspect-ratio: 1; box-sizing: border-box;
  object-fit: cover;
  border-radius: 50%; border: 5px solid var(--c-lantern);
  background: radial-gradient(circle at 50% 35%, var(--c-royal), var(--c-midnight));
  box-shadow: 0 0 18px color-mix(in srgb, var(--c-toxic) 45%, transparent);
}
.staff-portrait[data-who="headmistress"] { border-color: var(--c-blood); }
.staff-portrait[data-who="caretaker"] { border-color: var(--c-toxic); }
.staff-portrait.staff-in { animation: staff-in 450ms ease-out; }
@keyframes staff-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
.room:has(> [data-stage="lobby"]:not([hidden])) .staff-portrait { display: none; }

/* The portrait "talks": a soft pulse and a stronger green glow while its character's lines play
   (body[data-speaker] is set by the Narrator; style bible: no separate image for speaking). */
body[data-speaker="headmaster"] .staff-portrait[data-who="headmaster"],
body[data-speaker="caretaker"] .staff-portrait[data-who="caretaker"],
body[data-speaker="headmistress"] .staff-portrait[data-who="headmistress"] {
  animation: staff-talk 0.5s ease-in-out infinite alternate;
}
@keyframes staff-talk {
  from { transform: scale(1); box-shadow: 0 0 18px color-mix(in srgb, var(--c-toxic) 45%, transparent); }
  to { transform: scale(1.05); box-shadow: 0 0 34px var(--c-toxic), 0 0 60px color-mix(in srgb, var(--c-toxic) 50%, transparent); }
}

/* Full figure on the transition screens, standing at the bottom right above the avatar row. */
.staff-figure {
  position: absolute; right: 2rem; bottom: 5.5rem; z-index: 0; pointer-events: none;
  height: min(62vh, 640px); width: auto; max-width: 30vw; object-fit: contain; object-position: bottom;
  filter: drop-shadow(0 0 22px color-mix(in srgb, var(--c-toxic) 40%, transparent));
}
.staff-figure.staff-in { animation: figure-in 600ms ease-out; }
@keyframes figure-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.room > .stage { position: relative; z-index: 1; }
body[data-speaker="headmaster"] .staff-figure[data-who="headmaster"],
body[data-speaker="caretaker"] .staff-figure[data-who="caretaker"],
body[data-speaker="headmistress"] .staff-figure[data-who="headmistress"] {
  filter: drop-shadow(0 0 34px var(--c-toxic));
}

/* ---- Honour Board (2026-11-11): the places at the end of every round, written on the board's empty surface ---- */
.room:has(> [data-stage="board"]:not([hidden])) { background-image: url('/assets/bg/bg_honourboard.webp'); }
.room:has(> [data-stage="board"]:not([hidden])) > .avatar-row { display: none; }
.room > .stage.board { position: static; }
.stage.board[hidden] { display: none; }
/* The board's surface in the picture (percent of the 16:9 image, variant 1, fitted by eye); placed on the room, like the picture. */
.hb-surface {
  position: absolute; z-index: 1; inset: 13% 29.8% 25% 29.8%;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem; overflow: hidden;
}
.hb-title { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.6rem); color: var(--c-lantern); text-shadow: 0 3px 0 var(--c-ink); }
.hb-sub { margin: 0 0 0.4rem; font-weight: 800; color: var(--c-parchment); }
.hb-list { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: 1fr; gap: 0.35rem; }
.hb-list.two-cols { grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(8, auto); column-gap: 1.5rem; }
.hb-row {
  display: grid; grid-template-columns: 3.2rem 2.6rem 1fr auto auto 4.5rem; align-items: center; gap: 0.6rem;
  padding: 0.2rem 0.7rem; border-radius: 12px;
  background: color-mix(in srgb, var(--c-ink) 55%, transparent);
  font-size: clamp(1rem, 1.6vw, 1.5rem); font-weight: 800; color: var(--c-bone);
  animation: hb-in 450ms ease-out both; animation-delay: calc(var(--i) * 40ms);
}
.hb-row.top { outline: var(--line) solid var(--c-lantern); outline-offset: -4px; }
.hb-row .avatar { width: 2.6rem; aspect-ratio: 1; }
.hb-rank { color: var(--c-lantern); text-align: right; }
.hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-score { text-align: right; color: var(--c-lantern); }
.hb-gain { color: var(--c-toxic); font-size: 0.85em; }
.hb-move { font-size: 0.8em; }
.hb-move.up { color: var(--c-toxic); }
.hb-move.down { color: var(--c-blood); }
@keyframes hb-in { from { opacity: 0; transform: translateX(-16px); } }

/* ---- Race board in Detention (2026-11-11): everyone racing with points; solo: the student on top, the class below ---- */
.race { width: min(100%, 1100px); margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.race-solo, .race-list { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: 1fr; gap: 0.3rem; }
.race-solo { width: min(100%, 540px); }
.race-list.two-cols { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; }
.race-row {
  display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: 0.6rem;
  padding: 0.15rem 0.8rem; border-radius: 12px; text-align: left;
  background: color-mix(in srgb, var(--c-ink) 55%, transparent);
  font-size: clamp(1rem, 1.5vw, 1.4rem); font-weight: 800; color: var(--c-bone);
}
.race-row .avatar { width: 2.4rem; aspect-ratio: 1; }
.race-row.in-det { outline: var(--line) solid var(--c-lantern); outline-offset: -4px; color: var(--c-lantern); }
.race-solo .race-row { font-size: clamp(1.2rem, 2vw, 1.8rem); }
.race-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-pts { color: var(--c-lantern); min-width: 2ch; text-align: right; }
.race-vs { margin: 0; font-weight: 800; color: var(--c-blood); text-transform: uppercase; letter-spacing: 0.08em; }
/* Two columns (9–16 students): tighter rows so the names fit. */
.hb-list.two-cols .hb-row { grid-template-columns: 2.1em 1.8em minmax(0, 1fr) auto auto 2.2em; gap: 0.3em; padding: 0.15rem 0.45rem; font-size: clamp(0.8rem, 1.05vw, 1.2rem); }
.hb-list.two-cols .hb-gain { font-size: 0.75em; }
.hb-list.two-cols .hb-row .avatar { width: 1.8em; }
.hb-list.two-cols { column-gap: 0.8rem; }
.hb-list.two-cols .hb-row {
  grid-template-columns: 2.1em 1.8em auto minmax(0, 1fr) 2.2em; row-gap: 0;
  grid-template-areas: "rank av name name score" "rank av move gain score";
}
.hb-list.two-cols .hb-rank { grid-area: rank; }
.hb-list.two-cols .hb-row .avatar { grid-area: av; height: 1.8em; align-self: center; overflow: hidden; }
.hb-list.two-cols .hb-name { grid-area: name; }
.hb-list.two-cols .hb-move { grid-area: move; line-height: 1; }
.hb-list.two-cols .hb-gain { grid-area: gain; line-height: 1; }
.hb-list.two-cols .hb-score { grid-area: score; }
.hb-row .avatar .avatar-img, .race-row .avatar .avatar-img { width: 100%; height: 100%; display: block; }

/* ---- The class's map (cooperative frame, 2026-11-11): 10 pieces of the maze picture, 5 × 2 ---- */
.map { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.map-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(2, 1fr); gap: 3px;
  width: min(34vw, 640px); aspect-ratio: 1600 / 520; padding: 4px;
  border: var(--line) solid var(--c-ink); border-radius: 10px; background: var(--c-ink);
}
.map.small .map-grid { width: min(24vw, 440px); }
.map-cell {
  border-radius: 4px;
  background: color-mix(in srgb, var(--c-parchment) 12%, var(--c-midnight)) ;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c-parchment) 25%, transparent);
}
.map-cell.found {
  background: url('/assets/bg/bg_escape_board.webp') var(--bx) var(--by) / 500% 200% no-repeat;
  box-shadow: none;
}
/* The map moment: a scrap flies from each right answerer, a completed piece snaps in, a full map glows. */
.map-scrap {
  position: fixed; z-index: 50; pointer-events: none; width: 26px; height: 20px;
  background: var(--c-parchment); border: 3px solid var(--c-ink); border-radius: 3px 8px 4px 9px;
  box-shadow: 0 0 12px var(--c-toxic);
}
.map-cell.snap { animation: map-snap 500ms ease-out both; }
@keyframes map-snap {
  0% { transform: scale(1.5); opacity: 0; box-shadow: 0 0 0 0 var(--c-toxic); }
  60% { transform: scale(0.92); opacity: 1; box-shadow: 0 0 22px 6px var(--c-toxic); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
}
.map.complete .map-grid { animation: map-done 600ms ease-out 2 alternate; }
@keyframes map-done { to { box-shadow: 0 0 34px 10px var(--c-toxic); transform: scale(1.05); } }
.map-count { margin: 0; font-weight: 800; color: var(--c-parchment); }
.map-count b { color: var(--c-lantern); }
/* On the Honour Board: under the board, on the carpet. */
.hb-map { position: absolute; z-index: 1; left: 2.5%; bottom: 4%; display: flex; }
.hb-map .map-grid { width: min(23vw, 440px); }

/* Cooperative Escape (2026-11-11): those who got out wait at the gate; the closing screen shows all of them. */
.piece.safe .avatar { box-shadow: 0 0 0 4px var(--c-toxic), 0 0 18px var(--c-toxic); border-radius: 50%; }
.end-escaped { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 1.5rem; }
.end-escaped li { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; font-weight: 800; color: var(--c-bone); }
.end-escaped .avatar { width: clamp(64px, 7vw, 120px); height: auto; aspect-ratio: 1; display: block; }
.end-escaped .avatar .avatar-img { width: 100%; height: 100%; display: block; }
.end-winner:has(.end-escaped) { height: auto; }

/* ---- Comic interludes (2026-11-11): panels appear one by one, the bubble is coded ---- */
.room:has(> [data-stage="interlude"]:not([hidden])) { background: var(--c-ink); }
.room:has(> [data-stage="interlude"]:not([hidden])) > .avatar-row { display: none; }
.stage.interlude[hidden] { display: none; }
.stage.interlude { display: flex; align-items: center; justify-content: center; }
.comic { display: grid; gap: 14px; width: min(100%, calc((100vh - 4rem) * 16 / 9)); }
.comic.n2 { grid-template-columns: 1fr 1fr; }
.comic.n4 { grid-template-columns: 1fr 1fr; }
.comic.n2 .comic-panel { aspect-ratio: 16 / 9; }
.comic.n4 .comic-panel { aspect-ratio: 16 / 9; max-height: calc((100vh - 5rem) / 2); }
.comic-panel {
  position: relative; margin: 0; overflow: hidden;
  border: var(--line) solid var(--c-bone); border-radius: 6px; background: var(--c-midnight);
  box-shadow: 0 0 0 3px var(--c-ink);
}
.comic-panel:not(.shown) { border-color: color-mix(in srgb, var(--c-bone) 20%, transparent); }
.comic-panel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.comic-panel.shown:not(.now) img { filter: brightness(0.7) saturate(0.85); }
.comic-panel.enter { animation: panel-in 550ms ease-out both; }
@keyframes panel-in { from { opacity: 0; transform: scale(0.96) translateY(10px); } }
.bubble {
  position: absolute; top: 4%; left: 4%; max-width: 78%;
  padding: 0.55em 0.9em; border: 4px solid var(--c-ink); border-radius: 18px;
  background: var(--c-bone); color: var(--c-ink); font-weight: 800; line-height: 1.25;
  font-size: clamp(0.9rem, 1.55vw, 1.6rem); box-shadow: 0 4px 0 var(--c-ink);
}
.comic-panel.now .bubble { animation: bubble-in 400ms ease-out 250ms both; }
@keyframes bubble-in { from { opacity: 0; transform: scale(0.85); transform-origin: top left; } }
.bubble::after { /* the tail */
  content: ''; position: absolute; left: 2.2em; bottom: -18px; width: 22px; height: 22px;
  background: var(--c-bone); border: 4px solid var(--c-ink); border-top: 0; border-left: 0;
  transform: rotate(45deg); transform-origin: center;
}
.bubble.caption { border-radius: 4px; background: var(--c-parchment); font-style: italic; }
.bubble.caption::after { display: none; }
.bubble.headmistress { border-color: var(--c-blood); box-shadow: 0 4px 0 var(--c-blood); }
.bubble.caretaker { border-color: color-mix(in srgb, var(--c-toxic) 70%, var(--c-ink)); }
.bubble-who { display: block; font-size: 0.65em; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; }
/* Bubble corners per panel (interludes.js "at"), narrow so faces stay visible. */
.bubble { max-width: 44%; }
.bubble.at-tr { left: auto; right: 4%; }
.bubble.at-bl, .bubble.at-br { top: auto; bottom: 6%; }
.bubble.at-br { left: auto; right: 4%; }
.bubble.at-tr::after { left: auto; right: 2.2em; }
.bubble.at-bl::after, .bubble.at-br::after { bottom: auto; top: -18px; transform: rotate(-135deg); }

/* ---- The lobby (2026-11-11): an enrolment notice, the class register in the middle, the Headmaster greeting ---- */
.room > .lobby { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); grid-template-areas: "head head" "notice side"; padding-right: 22vw; align-items: center; }
.notice {
  grid-area: notice; display: flex; align-items: center; gap: 2rem; padding: 1.5rem 2rem;
  background: var(--c-parchment); color: var(--c-ink); border: var(--line) solid var(--c-ink); border-radius: 10px;
  box-shadow: 0 0 0 4px var(--c-lantern), 0 18px 40px var(--c-ink); transform: rotate(-1deg); position: relative;
}
.notice::before, .notice::after { /* two pins */
  content: ''; position: absolute; top: 10px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--c-blood); box-shadow: 0 0 0 3px var(--c-ink);
}
.notice::before { left: 14px; } .notice::after { right: 14px; }
.notice .qr { width: clamp(180px, 17vw, 300px); border-color: var(--c-ink); }
.notice-text { min-width: 0; }
.notice-kicker { margin: 0; font-size: 0.95rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-blood); }
.notice-title { margin: 0.1rem 0 0.8rem; font-family: var(--font-display); font-size: clamp(2rem, 3.2vw, 3.2rem); line-height: 1.05; color: var(--c-ink); }
.join-line { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.notice .join-url { margin: 0; font-size: clamp(1rem, 1.4vw, 1.4rem); font-weight: 800; color: var(--c-ink); word-break: break-all; }
.btn-copy {
  border: 3px solid var(--c-ink); border-radius: 999px; padding: 0.3rem 0.9rem; cursor: pointer;
  background: var(--c-lantern); color: var(--c-ink); font: 800 0.95rem var(--font-body);
}
.btn-copy:hover, .btn-copy:focus-visible { background: var(--c-ink); color: var(--c-lantern); }
.notice .join-label { color: color-mix(in srgb, var(--c-ink) 70%, transparent); font-weight: 800; }
.notice .room-code { display: flex; gap: 0.5rem; margin: 0.3rem 0 0.9rem; letter-spacing: 0; font-size: clamp(2.6rem, 5vw, 5rem); }
.notice .room-code span {
  display: grid; place-items: center; width: 1.25em; height: 1.35em; border-radius: 10px;
  background: var(--c-ink); color: var(--c-lantern); box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--c-lantern) 25%, transparent);
}
.notice-steps { margin: 0; padding-left: 1.3em; font-size: clamp(0.95rem, 1.2vw, 1.2rem); font-weight: 700; line-height: 1.5; }
.room > .lobby .lobby-side .btn-start { font-size: clamp(1.3rem, 1.8vw, 2rem); padding: 0.7rem 1.6rem; }
/* The class register: the avatar row, bigger, in the middle of the room. */
.room:has(> [data-stage="lobby"]:not([hidden])) > .avatar-row {
  grid-template-columns: repeat(8, 1fr); gap: 0.6rem 1rem; padding: 1rem 22vw 1rem 3rem; margin-top: auto;
}
.room:has(> [data-stage="lobby"]:not([hidden])) .slot .avatar { max-width: 92px; }
.room:has(> [data-stage="lobby"]:not([hidden])) .slot-name { font-size: 16px; }
.slot.pop { animation: slot-pop 550ms cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes slot-pop { from { transform: scale(0.3); opacity: 0; } }
.room:has(> [data-stage="lobby"]:not([hidden])) .staff-figure { height: min(78vh, 760px); max-width: 24vw; bottom: 1rem; }
/* Lobby: fit one 16:9 screen. */
.room:has(> [data-stage="lobby"]:not([hidden])) { height: 100vh; overflow: hidden; }
.room > .lobby { gap: 1.2rem; }
.room > .lobby .lobby-title[data-logo] img { height: clamp(80px, 13vh, 140px); }
.notice { padding: 1.1rem 1.6rem; gap: 1.6rem; }
.notice .qr { width: clamp(150px, 13vw, 230px); }
.notice-title { font-size: clamp(1.7rem, 2.6vw, 2.7rem); margin-bottom: 0.5rem; }
.notice .room-code { font-size: clamp(2.2rem, 3.8vw, 3.8rem); margin: 0.2rem 0 0.6rem; }
.notice-steps { line-height: 1.35; font-size: clamp(0.9rem, 1.05vw, 1.1rem); }
.room:has(> [data-stage="lobby"]:not([hidden])) .slot .avatar { max-width: 74px; }
.room:has(> [data-stage="lobby"]:not([hidden])) > .avatar-row { gap: 0.3rem 1rem; padding-top: 0.4rem; padding-bottom: 0.4rem; }

/* Detention props on the projector (2026-11-11): cakes on a tray, the ledger page with ink lines. */
.tiles:has(.tile.cake) { padding: 1rem; border-radius: 22px; background: color-mix(in srgb, var(--c-bone) 18%, var(--c-midnight)); border: var(--line) solid var(--c-ink); box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--c-lantern) 40%, transparent); }
.tile.cake { border-radius: 16px; padding: 0.3rem; min-height: 0; }
.tile.cake .tile-n { position: absolute; top: 4px; left: 8px; font-size: 1rem; }
.tile-art { position: relative; width: 74%; }
.tile-art .cake-img { width: 100%; height: auto; display: block; }
.tile-art .nail-svg { position: absolute; inset: -10% -10% 0 0; width: 120%; animation: nail-in 500ms ease-out both; }
@keyframes nail-in { from { transform: translateY(-30%); opacity: 0; } }
.tile.nail { box-shadow: 0 0 0 5px var(--c-blood), 0 0 24px var(--c-blood); }
.tiles.ledger {
  width: min(860px, 100%); grid-template-columns: 1fr 1fr; gap: 0.2rem 2.5rem; padding: 1.4rem 2rem; border-radius: 6px;
  background: var(--c-parchment); border: var(--line) solid var(--c-ink); box-shadow: 0 0 0 4px var(--c-lantern);
}
.tiles.ledger .tile {
  min-height: 3.2rem; flex-direction: row; justify-content: flex-start; gap: 0.8rem;
  background: none; border: 0; border-bottom: 3px solid color-mix(in srgb, var(--c-ink) 35%, transparent); border-radius: 0;
}
.tiles.ledger .tile-n { font-family: var(--font-display); color: var(--c-blood); width: 2ch; }
.line-ink { font-family: var(--font-display); font-size: 1.5rem; color: color-mix(in srgb, var(--c-toxic) 55%, var(--c-ink)); animation: ink-in 900ms ease-out both; }
@keyframes ink-in { from { opacity: 0; filter: blur(6px); } }
.tile.struck::after { display: none; }
.tiles.ledger .scribble-svg { position: absolute; inset: 10% 0; width: 100%; height: 80%; fill: none; stroke: var(--c-ink); stroke-width: 6; stroke-dasharray: 100; animation: scribble 600ms ease-out both; }
@keyframes scribble { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
/* Reveal: a picked cake without a nail glows green (user, 2026-11-11). */
.tile.cake.picked { box-shadow: 0 0 0 5px var(--c-toxic), 0 0 22px var(--c-toxic); background: color-mix(in srgb, var(--c-toxic) 22%, var(--c-parchment)); }

/* ---- The lobby on any projector (user, 2026-11-12: at school the enrolment notice ran into the register and
   the page had to be zoomed out to 80%). Everything in the lobby is sized from --u, 1/100 of the width of the
   largest 16:9 box that fits the window, so a low or narrow screen shrinks the whole scene instead of
   letting its parts overlap. At 1920×1080 --u is 19.2px. ---- */
.room:has(> [data-stage="lobby"]:not([hidden])) {
  --u: min(1vw, 1.78vh);
  padding: calc(1.2 * var(--u)) calc(2.5 * var(--u)) calc(0.8 * var(--u)); gap: calc(0.8 * var(--u));
}
.room > .lobby { gap: calc(1 * var(--u)); min-height: 0; }
.room > .lobby .lobby-title[data-logo] img { height: calc(7.5 * var(--u)); }
.room > .lobby .notice { padding: calc(1.2 * var(--u)) calc(1.7 * var(--u)); gap: calc(1.6 * var(--u)); max-height: 100%; }
.room > .lobby .notice .qr { width: calc(13 * var(--u)); flex: none; }
.room > .lobby .notice-kicker { font-size: max(10px, calc(0.85 * var(--u))); }
.room > .lobby .notice-title { font-size: calc(2.4 * var(--u)); margin: 0 0 calc(0.5 * var(--u)); }
.room > .lobby .join-line { gap: calc(0.7 * var(--u)); margin-bottom: calc(0.6 * var(--u)); }
.room > .lobby .notice .join-url { font-size: max(12px, calc(1.15 * var(--u))); }
.room > .lobby .btn-copy { font-size: max(10px, calc(0.85 * var(--u))); padding: calc(0.25 * var(--u)) calc(0.8 * var(--u)); }
.room > .lobby .notice .join-label { margin: 0; font-size: max(10px, calc(0.9 * var(--u))); }
.room > .lobby .notice .room-code { font-size: calc(3.4 * var(--u)); gap: calc(0.45 * var(--u)); margin: calc(0.2 * var(--u)) 0 calc(0.6 * var(--u)); }
.room > .lobby .notice-steps { font-size: max(11px, calc(1 * var(--u))); line-height: 1.3; }
.room > .lobby .lobby-side { gap: calc(0.4 * var(--u)); }
.room > .lobby .lobby-side .count { font-size: max(13px, calc(1.5 * var(--u))); }
.room > .lobby .lobby-side .btn-start { font-size: max(15px, calc(1.6 * var(--u))); padding: calc(0.6 * var(--u)) calc(1.5 * var(--u)); margin-top: calc(0.8 * var(--u)); }
.room > .lobby .lobby-side #start-hint { font-size: max(10px, calc(0.8 * var(--u))); margin: 0; }
.room:has(> [data-stage="lobby"]:not([hidden])) > .avatar-row {
  gap: calc(0.3 * var(--u)) calc(1 * var(--u)); padding: calc(0.4 * var(--u)) 22vw calc(0.4 * var(--u)) calc(2.5 * var(--u));
}
.room:has(> [data-stage="lobby"]:not([hidden])) .slot .avatar { max-width: calc(4.2 * var(--u)); }
.room:has(> [data-stage="lobby"]:not([hidden])) .slot-name { font-size: max(10px, calc(0.85 * var(--u))); }
.room:has(> [data-stage="lobby"]:not([hidden])) .slot { gap: calc(0.15 * var(--u)); }

/* Honour Board reshuffle (2026-11-12): the points pop up, the rows slide to their new places. */
.hb-row { position: relative; }
.hb-gain.pop { animation: hb-pop 450ms ease-out both; }
.hb-row.rising { z-index: 2; box-shadow: 0 0 0 3px var(--c-toxic); }
.hb-row.falling { z-index: 1; }
.hb-list.two-cols .hb-move, .hb-list.two-cols .hb-gain { min-height: 1em; }
@keyframes hb-pop { 0% { opacity: 0; transform: scale(0.4); } 60% { opacity: 1; transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---- The Keys (2026-11-16): the scene line by line, then everyone's lock live ---- */
.dialogue { display: flex; flex-direction: column; gap: 0.6rem; max-width: 1100px; margin-bottom: 0.5rem; }
.det-line { margin: 0; font-size: 1.45rem; font-style: italic; color: var(--c-bone); }
.det-who {
  display: block; font-size: 0.7em; font-style: normal; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-toxic);
}
.key-cards {
  list-style: none; margin: 0; padding: 0; width: min(92vw, 1500px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem;
}
.key-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.6rem 0.7rem;
  background: color-mix(in srgb, var(--c-midnight) 85%, transparent);
  border: var(--line) solid var(--c-ink); border-radius: 12px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-bone) 25%, transparent);
  transition: box-shadow 300ms ease-out, background-color 300ms ease-out;
}
.kc-head { display: flex; align-items: center; gap: 0.5rem; font-size: 1.3rem; max-width: 100%; }
.kc-head strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-head .avatar { width: 52px; aspect-ratio: 1; flex: none; }
.kc-head .avatar .avatar-img { width: 100%; height: 100%; }
.kc-lock { position: relative; width: 96px; height: 120px; }
.kc-lock .lock-svg { width: 100%; height: 100%; display: block; }
.kc-key { position: absolute; left: 50%; top: 18%; width: 40px; translate: -50% 0; transform-origin: 50% 40%; }
.kc-key svg { width: 100%; height: auto; display: block; }
.kc-key.turned { transform: rotate(90deg); transition: transform 400ms ease-out; }
.kc-ring { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px 6px; width: 220px; }
.kc-k { display: grid; place-items: center; height: 46px; }
.kc-k svg { height: 100%; width: auto; }
.kc-k.used { opacity: 0.22; filter: grayscale(1); }
.kc-k.in { visibility: hidden; }
.kc-status { font-weight: 800; font-size: 1.25rem; color: var(--c-parchment); }
.key-card.jammed { border-color: var(--c-blood); }
.key-card.jammed .kc-lock { animation: shake 0.15s linear infinite; }
.key-card.jammed .kc-lock .lock-svg { filter: drop-shadow(0 0 10px var(--c-blood)); }
.key-card.jammed .kc-status { color: var(--c-blood); }
.key-card.is-out { border-color: var(--c-toxic); box-shadow: 0 0 0 3px var(--c-ink), 0 0 26px var(--c-toxic); }
.key-card.is-out .kc-status { color: var(--c-toxic); font-size: 1.3rem; }
.key-card.is-dead { opacity: 0.55; }
.key-card.is-dead .kc-status { color: var(--c-blood); }
.key-cards.many { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0.5rem; }
.key-cards.many .key-card { padding: 0.45rem 0.4rem; }
/* 9–16 players: two rows of 8, sized by the screen height so a 768 px projector fits them too. */
.key-cards.many .kc-lock { width: min(60px, 5.6vh); height: min(75px, 7vh); }
.key-cards.many .kc-head { font-size: clamp(0.8rem, 1.9vh, 1.05rem); gap: 0.3rem; }
.key-cards.many .kc-head .avatar { width: min(38px, 3.6vh); }
.key-cards.many .kc-status { font-size: clamp(0.8rem, 1.8vh, 1rem); }
.key-cards.many .key-card { gap: 0.2rem; }
.key-cards.many .kc-key { width: min(25px, 2.3vh); }
.key-cards.many .kc-ring { width: 100%; max-width: 160px; }
.key-cards.many .kc-k { height: min(30px, 2.8vh); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
