/* ==========================================================================
   DETENTION: ROOM 64
   Handmade classroom UI — warm paper, ink, chalk, and far too much mischief.
   ========================================================================== */

:root {
  --ink: #26323d;
  --ink-2: #43524f;
  --ink-3: #6e7972;
  --paper: #f6edd9;
  --paper-2: #efe1c6;
  --paper-3: #e6d3b1;
  --cream: #fff8e9;
  --white: #fffdf6;
  --green: #2f6357;
  --green-2: #21483f;
  --green-3: #17362f;
  --green-soft: #d9e5d7;
  --red: #c95848;
  --red-2: #a94437;
  --coral: #e78063;
  --gold: #f2b44b;
  --gold-2: #d99a2e;
  --blue: #507e9d;
  --navy: #283a55;
  --rose: #d95f8a;
  --shadow: rgba(38, 50, 61, .18);
  --shadow-strong: rgba(23, 30, 32, .3);
  --border: 2px solid var(--ink);
  --radius: 6px;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
  --hand: "Chalkboard SE", "Bradley Hand", "Marker Felt", "Comic Sans MS", cursive;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --hud-h: 76px;
  --foot-h: 48px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-playing { overflow: hidden; }
body.modal-open { overflow: hidden; }

::selection { background: var(--gold); color: var(--ink); }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }
svg { display: block; }

:focus-visible {
  outline: 3px solid var(--gold-2);
  outline-offset: 3px;
}

.hidden, [hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Shared bits
   -------------------------------------------------------------------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .18em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow-line {
  display: inline-block;
  width: 32px;
  height: 2px;
  background: currentColor;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
}

.brand-seal {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: none;
  color: var(--cream);
  background: var(--green-2);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--display);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -1px;
  transform: rotate(-4deg);
}

.brand-seal::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(255, 248, 233, .38);
  border-radius: 50%;
}

.brand-seal.small { width: 42px; height: 42px; font-size: 18px; box-shadow: 2px 2px 0 var(--ink); }
.brand-seal.tiny { width: 34px; height: 34px; font-size: 15px; box-shadow: 2px 2px 0 rgba(38, 50, 61, .8); }
.brand-seal.gold { background: var(--gold); color: var(--ink); border-color: var(--ink); }

.brand-type { display: flex; flex-direction: column; line-height: 1; }
.brand-type b { font-family: var(--display); font-size: 17px; letter-spacing: .16em; }
.brand-type small { margin-top: 5px; font-size: 9px; font-weight: 800; letter-spacing: .28em; color: var(--green); }
.brand.on-dark, .brand.on-dark .brand-type { color: var(--cream); }
.brand.on-dark .brand-type small { color: var(--gold); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  padding: 12px 20px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .11em;
  line-height: 1.2;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease;
}

.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.btn-primary { background: var(--green); color: var(--cream); }
.btn-primary:hover { background: var(--green-2); }
.btn-ink { background: var(--ink); color: var(--cream); }
.btn-ink:hover { background: var(--green-2); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: rgba(38, 50, 61, .07); box-shadow: none; transform: none; }
.btn-wide { width: 100%; justify-content: space-between; min-height: 54px; padding-inline: 22px; font-size: 12.5px; }
.btn-arrow { font-size: 20px; line-height: 1; transition: transform .16s ease; }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn-disabled, .btn:disabled { background: var(--paper-3); color: var(--ink-3); box-shadow: 2px 2px 0 rgba(38, 50, 61, .35); opacity: .78; transform: none; }
.on-dark-btn { border-color: var(--cream); color: var(--cream); box-shadow: 2px 2px 0 rgba(0, 0, 0, .25); }
.on-dark-btn:hover { background: rgba(255, 248, 233, .1); }

.form-error {
  min-height: 19px;
  margin-top: 9px;
  color: var(--red-2);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.hand-note {
  color: var(--green);
  font-family: var(--hand);
  font-size: 17px;
  line-height: 1.2;
  transform: rotate(-2deg);
}

/* --------------------------------------------------------------------------
   Boot
   -------------------------------------------------------------------------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 30% 20%, rgba(242, 180, 75, .17), transparent 36%),
    radial-gradient(circle at 76% 74%, rgba(80, 126, 157, .14), transparent 42%),
    var(--green-2);
  color: var(--cream);
  transition: opacity .35s ease, visibility .35s ease;
}

.boot-screen.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-card { text-align: center; }
.boot-card .brand-seal { margin: 0 auto 18px; background: var(--gold); color: var(--ink); }
.boot-card .eyebrow { justify-content: center; color: var(--gold); }
.boot-card h1 { margin: 6px 0 8px; font-family: var(--display); font-size: clamp(36px, 6vw, 58px); letter-spacing: .1em; }
.boot-card p { color: rgba(255, 248, 233, .73); font-size: 13px; }
.boot-dots { display: flex; justify-content: center; gap: 6px; margin-top: 22px; }
.boot-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: boot-bounce 1s infinite; }
.boot-dots span:nth-child(2) { animation-delay: .14s; }
.boot-dots span:nth-child(3) { animation-delay: .28s; }
@keyframes boot-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-7px); opacity: 1; } }

/* --------------------------------------------------------------------------
   Screens
   -------------------------------------------------------------------------- */

.app { min-height: 100dvh; }
.screen { display: none; min-height: 100dvh; }
.screen.active { display: block; animation: screen-in .4s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   LANDING
   ========================================================================== */

.landing-screen {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(38, 50, 61, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 50, 61, .035) 1px, transparent 1px),
    radial-gradient(circle at 12% 4%, rgba(242, 180, 75, .24), transparent 24%),
    radial-gradient(circle at 87% 35%, rgba(80, 126, 157, .1), transparent 30%),
    var(--paper);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
}

.landing-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .25;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.landing-screen::after {
  content: "64";
  position: absolute;
  right: -70px;
  bottom: -150px;
  z-index: 0;
  font-family: var(--display);
  font-size: 560px;
  font-weight: 900;
  line-height: .8;
  color: transparent;
  -webkit-text-stroke: 2px rgba(47, 99, 87, .11);
  transform: rotate(-9deg);
  pointer-events: none;
}

.landing-inner {
  position: relative;
  z-index: 2;
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto;
  padding-bottom: 28px;
}

.landing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 22px;
  border-bottom: 1.5px solid rgba(38, 50, 61, .18);
}

.topbar-actions { display: flex; align-items: center; gap: 18px; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .16em;
}
.live-pill i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 99, 87, .13);
  animation: live-pulse 2s infinite;
}
@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(47, 99, 87, .12); } 50% { box-shadow: 0 0 0 6px rgba(47, 99, 87, .04); } }

.landing-main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
  gap: clamp(34px, 5vw, 74px);
  align-items: start;
  padding: 54px 0 34px;
}

.hero-copy { min-width: 0; padding-top: 10px; }
.hero-title {
  margin: 15px 0 22px;
  font-family: var(--display);
  font-size: clamp(58px, 6vw, 94px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: .92;
  color: var(--ink);
}
.hero-title em {
  position: relative;
  display: inline-block;
  color: var(--green);
  font-weight: 700;
  font-style: italic;
}
.hero-title em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 0;
  bottom: -4px;
  height: 13px;
  border-radius: 50%;
  border-top: 4px solid var(--gold-2);
  transform: rotate(-1.6deg);
  opacity: .85;
}

.hero-lede {
  max-width: 680px;
  color: var(--ink-2);
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.62;
}
.hero-lede strong { color: var(--ink); background: linear-gradient(transparent 62%, rgba(242, 180, 75, .55) 62%); }

.hero-art-wrap {
  position: relative;
  margin: 36px 0 28px;
  padding: 11px;
  background: var(--cream);
  border: var(--border);
  border-radius: 3px;
  box-shadow: 7px 8px 0 rgba(38, 50, 61, .14), 0 16px 30px rgba(38, 50, 61, .1);
  transform: rotate(-.65deg);
}
.hero-art-wrap::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(38, 50, 61, .16);
  pointer-events: none;
}
.tape {
  position: absolute;
  z-index: 4;
  width: 96px;
  height: 24px;
  background: rgba(242, 201, 123, .75);
  border-left: 1px dashed rgba(131, 95, 45, .4);
  border-right: 1px dashed rgba(131, 95, 45, .4);
  box-shadow: 0 2px 3px rgba(38, 50, 61, .12);
}
.tape-top { top: -13px; left: 50%; transform: translateX(-50%) rotate(1.5deg); }
.hero-art { width: 100%; height: auto; border-radius: 1px; }
.art-caption {
  position: absolute;
  right: 20px;
  bottom: 17px;
  padding: 3px 8px;
  color: rgba(255, 248, 233, .78);
  background: rgba(38, 50, 61, .44);
  font-family: var(--hand);
  font-size: 10.5px;
  transform: rotate(-1deg);
  pointer-events: none;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 0;
  margin-top: 20px;
  list-style: none;
}
.hero-facts li {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding-right: 22px;
  margin-right: 22px;
  border-right: 1px solid rgba(38, 50, 61, .2);
}
.hero-facts li:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.hero-facts b { font-family: var(--display); font-size: 28px; line-height: 1; color: var(--red); }
.hero-facts span { max-width: 105px; color: var(--ink-3); font-size: 10px; font-weight: 700; letter-spacing: .045em; line-height: 1.35; text-transform: uppercase; }

.landing-doodle {
  position: absolute;
  z-index: 1;
  color: rgba(47, 99, 87, .28);
  font-family: var(--hand);
  pointer-events: none;
  user-select: none;
}
.doodle-star { top: 135px; left: calc(50% - 80px); font-size: 36px; transform: rotate(12deg); animation: doodle-drift 7s ease-in-out infinite; }
.doodle-plane { top: 26%; right: 3.5%; font-size: 34px; transform: rotate(20deg); opacity: .45; }
.doodle-spiral { bottom: 10%; left: 2.5%; font-size: 64px; opacity: .28; transform: rotate(-10deg); }
@keyframes doodle-drift { 0%,100% { transform: translateY(0) rotate(12deg); } 50% { transform: translateY(-9px) rotate(4deg); } }

/* Entry card ------------------------------------------------------------------ */

.entry-card {
  position: sticky;
  top: 24px;
  padding: 38px 30px 25px;
  background:
    linear-gradient(rgba(47, 99, 87, .035) 1px, transparent 1px),
    var(--cream);
  background-size: 100% 27px;
  border: var(--border);
  border-radius: 3px;
  box-shadow: 9px 10px 0 rgba(38, 50, 61, .2), 0 24px 50px rgba(38, 50, 61, .13);
  transform: rotate(.4deg);
}
.entry-card::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 28px;
  width: 54px;
  height: 18px;
  background: rgba(199, 93, 75, .7);
  transform: rotate(3deg);
  box-shadow: 0 2px 3px rgba(38, 50, 61, .16);
}
.entry-tape {
  position: absolute;
  top: -9px;
  left: 30px;
  width: 84px;
  height: 20px;
  background: rgba(242, 201, 123, .72);
  transform: rotate(-4deg);
  box-shadow: 0 1px 2px rgba(38, 50, 61, .12);
}
.entry-card .hand-note { margin-bottom: 8px; color: var(--red); }
.entry-card h2 {
  font-family: var(--display);
  font-size: 37px;
  line-height: 1.05;
  letter-spacing: -.02em;
}
.entry-sub { margin-top: 8px; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }

.field { display: block; margin-top: 22px; }
.field > span, .role-picker legend {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .16em;
}
.field input, .code-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 253, 246, .72);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  font-size: 15px;
  font-weight: 700;
  transition: background .15s ease, box-shadow .15s ease;
}
.field input::placeholder, .code-field input::placeholder { color: #9b998d; font-weight: 400; }
.field input:focus, .code-field input:focus { background: var(--white); box-shadow: inset 0 0 0 3px rgba(242, 180, 75, .26); outline: none; border-color: var(--green); }

.role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 0;
  margin: 19px 0 0;
  border: 0;
}
.role-picker legend { grid-column: 1 / -1; padding: 0; }
.role-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 74px;
  padding: 9px 10px;
  text-align: left;
  background: rgba(255, 253, 246, .65);
  border: 1.5px solid rgba(38, 50, 61, .42);
  border-radius: 3px;
  transition: border-color .14s ease, background .14s ease, transform .14s ease, box-shadow .14s ease;
}
.role-card:hover { background: var(--white); border-color: var(--ink); transform: translateY(-1px); }
.role-card.selected {
  background: var(--green-soft);
  border-color: var(--green-2);
  box-shadow: inset 0 0 0 2px var(--green-2);
}
.role-card.teacher-role.selected { background: #efe3cc; border-color: var(--red-2); box-shadow: inset 0 0 0 2px var(--red-2); }
.role-icon { width: 40px; height: 43px; flex: none; }
.role-icon svg { width: 100%; height: 100%; }
.role-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.role-copy b { font-family: var(--display); font-size: 17px; line-height: 1.1; }
.role-copy small { color: var(--ink-3); font-size: 8.5px; font-weight: 700; letter-spacing: .015em; line-height: 1.2; }
.checkmark {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  place-items: center;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--green-2);
  color: var(--cream);
  font-size: 10px;
  font-weight: 900;
}
.teacher-role.selected .checkmark { background: var(--red-2); }
.role-card.selected .checkmark { display: grid; }
#createBtn { margin-top: 17px; }

.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 19px 0 12px;
  color: var(--ink-3);
  font-family: var(--hand);
  font-size: 13px;
  text-align: center;
}
.or-divider::before, .or-divider::after { content: ""; height: 1px; flex: 1; background: rgba(38, 50, 61, .22); }

.join-row { display: flex; gap: 8px; }
.code-field { flex: 1; }
.code-field input {
  height: 47px;
  padding-left: 17px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .32em;
  text-transform: uppercase;
}
.join-row .btn { min-width: 88px; min-height: 47px; padding-inline: 15px; }
.entry-footnote {
  margin-top: 13px;
  color: var(--ink-3);
  font-size: 9.5px;
  line-height: 1.45;
}
.entry-footnote span { color: var(--gold-2); font-size: 14px; }

/* Rules strip ---------------------------------------------------------------- */

.rules-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 26px;
  padding: 28px 0 34px;
  border-top: 1.5px solid rgba(38, 50, 61, .25);
  border-bottom: 1.5px solid rgba(38, 50, 61, .25);
}
.rule-card {
  position: relative;
  min-width: 0;
  padding: 0 clamp(18px, 2.3vw, 34px);
  border-right: 1px solid rgba(38, 50, 61, .18);
}
.rule-card:first-child { padding-left: 0; }
.rule-card:last-child { border-right: 0; padding-right: 0; }
.rule-num {
  position: absolute;
  top: -8px;
  right: 24px;
  color: rgba(38, 50, 61, .2);
  font-family: var(--display);
  font-size: 31px;
  font-style: italic;
}
.rule-illu {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 13px;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 rgba(38, 50, 61, .2);
  font-family: var(--hand);
  font-size: 19px;
  font-weight: 700;
  transform: rotate(-3deg);
}
.rule-illu-score { background: #f6d68d; }
.rule-illu-tie { background: #d8e3d9; }
.rule-illu-ruler { background: #efd0c2; }
.rule-illu-win { background: var(--green); color: var(--cream); border-color: var(--green-2); font-family: var(--display); font-size: 16px; }
.rule-card h3 { margin-bottom: 6px; font-family: var(--display); font-size: 18px; line-height: 1.15; }
.rule-card p { color: var(--ink-3); font-size: 11.5px; line-height: 1.55; }
.rule-card kbd, .help-list kbd {
  display: inline-block;
  min-width: 19px;
  padding: 1px 5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(38, 50, 61, .35);
  border-bottom-width: 2px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.landing-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 2px;
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.footer-doodle { font-family: var(--hand); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; transform: rotate(-.8deg); }

/* ==========================================================================
   LOBBY
   ========================================================================== */

.lobby-screen {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 18%, rgba(242, 180, 75, .14), transparent 26%),
    radial-gradient(circle at 84% 100%, rgba(80, 126, 157, .16), transparent 36%),
    var(--green-2);
  color: var(--cream);
}
.lobby-grid-bg {
  position: absolute;
  inset: 0;
  opacity: .38;
  background:
    linear-gradient(rgba(246, 237, 217, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 237, 217, .06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}
.lobby-inner { position: relative; z-index: 2; width: min(1220px, calc(100% - 52px)); margin: 0 auto; padding: 0 0 40px; }

.lobby-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(246, 237, 217, .18);
}
.lobby-code-ticket {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 5px 7px 5px 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .2);
  transform: rotate(.7deg);
}
.lobby-code-ticket > span { font-size: 8px; font-weight: 800; letter-spacing: .15em; color: var(--ink-3); }
.lobby-code-ticket strong { font-family: var(--mono); font-size: 20px; letter-spacing: .19em; color: var(--red-2); }
.copy-link-btn {
  min-height: 28px;
  padding: 5px 9px;
  color: var(--cream);
  background: var(--green);
  border: 1px solid var(--green-2);
  border-radius: 2px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  transition: background .14s ease;
}
.copy-link-btn:hover { background: var(--green-2); }

.lobby-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 305px;
  gap: 26px;
  align-items: start;
  padding-top: 30px;
}

.lobby-card {
  padding: clamp(22px, 3.4vw, 38px);
  color: var(--ink);
  background:
    linear-gradient(rgba(47, 99, 87, .04) 1px, transparent 1px),
    var(--cream);
  background-size: 100% 28px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  box-shadow: 9px 10px 0 rgba(0, 0, 0, .24);
}
.lobby-heading .eyebrow { color: var(--green); }
.lobby-heading h2 { margin: 8px 0 7px; font-family: var(--display); font-size: clamp(32px, 3.7vw, 47px); line-height: 1; letter-spacing: -.025em; }
.lobby-heading > p:last-child { max-width: 510px; color: var(--ink-3); font-size: 12px; line-height: 1.55; }

.seat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 25px;
}
.seat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 82px;
  padding: 12px;
  background: rgba(255, 253, 246, .68);
  border: 1.5px dashed rgba(38, 50, 61, .38);
  border-radius: 3px;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.seat.teacher-seat { grid-column: 1 / -1; min-height: 91px; background: rgba(255, 248, 233, .86); border-style: solid; }
.seat.is-filled { border-style: solid; border-color: rgba(38, 50, 61, .6); background: var(--white); }
.seat.is-you { border-color: var(--gold-2); box-shadow: inset 0 0 0 2px rgba(242, 180, 75, .5); }
.seat.is-empty .seat-avatar { opacity: .5; filter: grayscale(1); }
.seat-label {
  position: absolute;
  top: 7px;
  right: 9px;
  color: var(--ink-3);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .13em;
}
.seat-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 62px;
  flex: none;
  background: var(--paper-2);
  border: 1.5px solid rgba(38, 50, 61, .4);
  border-radius: 50% 50% 46% 46%;
  overflow: hidden;
}
.seat-avatar svg { width: 100%; height: 100%; }
.teacher-avatar { width: 58px; height: 66px; background: #d8e3d9; }
.seat-body { min-width: 0; padding-right: 28px; }
.seat-body h3 {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seat-body p { color: var(--ink-3); font-size: 9.5px; line-height: 1.35; }
.seat-body p b { color: var(--ink-2); }
.seat-tag {
  position: absolute;
  right: 9px;
  bottom: 8px;
  padding: 2px 6px;
  color: var(--ink-3);
  background: var(--paper-2);
  border: 1px solid rgba(38, 50, 61, .23);
  border-radius: 2px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .1em;
}
.seat.is-filled .seat-tag { color: var(--cream); background: var(--green); border-color: var(--green-2); }
.seat.is-you .seat-tag { color: var(--ink); background: var(--gold); border-color: var(--ink); }
.seat.is-bot .seat-tag { color: var(--ink-2); background: var(--paper-3); }
.seat.is-bot .seat-body h3 { font-style: italic; }
.seat.is-bot .seat-body p::after { content: " · substitute"; color: var(--red-2); }
.seat.is-host .seat-label::after { content: " · HOST"; color: var(--red-2); }

.lobby-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px dashed rgba(38, 50, 61, .28);
}
.fill-note { display: flex; align-items: center; gap: 10px; }
.fill-note-icon {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  flex: none;
  color: var(--green);
  background: var(--paper-2);
  border: 1px solid rgba(38, 50, 61, .3);
  border-radius: 50%;
  font-size: 17px;
}
.fill-note p { max-width: 230px; color: var(--ink-3); font-size: 10.5px; line-height: 1.4; }
.lobby-buttons { flex: none; }
.lobby-buttons .btn { min-width: 205px; }
.lobby-card #lobbyError { margin-bottom: -4px; }

.lobby-side { display: flex; flex-direction: column; gap: 15px; }
.lobby-note {
  position: relative;
  padding: 20px 20px 18px;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  box-shadow: 5px 6px 0 rgba(0, 0, 0, .2);
}
.lobby-note.pinned { background: #fbf1cf; transform: rotate(-.7deg); }
.pin {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--red-2);
  box-shadow: 0 2px 2px rgba(0, 0, 0, .2);
}
.lobby-note h3 { font-family: var(--display); font-size: 24px; line-height: 1.1; margin: 4px 0 7px; }
.lobby-note p { color: var(--ink-3); font-size: 10.5px; line-height: 1.5; }
.lobby-note .hand-note { color: var(--red-2); font-size: 16px; }
.mini-heading { font-size: 17px !important; margin: 0 0 10px !important; }
.quick-rules { display: flex; flex-direction: column; gap: 9px; margin: 0; list-style: none; }
.quick-rules li { display: flex; align-items: center; gap: 9px; color: var(--ink-2); font-size: 10.5px; line-height: 1.35; }
.quick-rules span {
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  flex: none;
  color: var(--cream);
  background: var(--green);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 11px;
}
.dark-note { background: var(--green-3); color: var(--cream); border-color: rgba(246, 237, 217, .4); }
.dark-note .eyebrow { color: var(--gold); font-size: 8px; }
.dark-note p:not(.eyebrow):not(.big-room-code) { color: rgba(246, 237, 217, .6); }
.big-room-code {
  margin: 2px 0 4px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .22em;
  line-height: 1.2;
}

/* ==========================================================================
   GAME
   ========================================================================== */

.game-screen {
  height: 100dvh;
  min-height: 480px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #182822;
}
.game-screen.active { display: grid; }

.game-hud {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(250px, 440px) minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: var(--hud-h);
  padding: 9px 18px;
  color: var(--ink);
  background:
    linear-gradient(rgba(38, 50, 61, .04) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 22px;
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
}
.hud-left, .hud-right { display: flex; align-items: center; gap: 11px; min-width: 0; }
.hud-right { justify-content: flex-end; }
.hud-brand { display: flex; align-items: center; gap: 9px; min-width: 0; text-decoration: none; color: var(--ink); }
.hud-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1; }
.hud-brand-text b { font-family: var(--display); font-size: 13px; letter-spacing: .13em; }
.hud-brand-text small { margin-top: 4px; color: var(--ink-3); font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.hud-brand-text small span { color: var(--red-2); font-family: var(--mono); font-size: 9px; }
.copy-chip {
  min-height: 26px;
  padding: 4px 8px;
  color: var(--green);
  background: transparent;
  border: 1px solid rgba(47, 99, 87, .35);
  border-radius: 2px;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .1em;
  white-space: nowrap;
  transition: background .14s ease, color .14s ease;
}
.copy-chip:hover { background: var(--green); color: var(--cream); }

.score-block { min-width: 0; }
.score-labels {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: var(--ink-3);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .15em;
}
.score-labels > span:last-child { display: flex; align-items: baseline; gap: 4px; color: var(--ink); }
.score-labels b { font-family: var(--display); font-size: 23px; line-height: .8; letter-spacing: -.03em; color: var(--red-2); }
.score-labels em { font-size: 9px; font-style: normal; letter-spacing: .06em; color: var(--ink-3); }
.score-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  background: rgba(38, 50, 61, .13);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}
.score-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background:
    repeating-linear-gradient(118deg, rgba(255, 248, 233, .23) 0 7px, transparent 7px 14px),
    linear-gradient(90deg, var(--green), #3c7d6b);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.score-fill.is-hot { background: repeating-linear-gradient(118deg, rgba(255, 248, 233, .23) 0 7px, transparent 7px 14px), linear-gradient(90deg, var(--gold-2), var(--red)); }
.score-ticks { position: absolute; inset: 0; display: flex; justify-content: space-evenly; pointer-events: none; }
.score-ticks i { width: 1px; height: 100%; background: rgba(38, 50, 61, .22); }
.score-spark {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 1.5px solid var(--ink);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
}
.score-spark.pop { animation: score-pop .4s ease-out; }
@keyframes score-pop { 0% { transform: translate(-50%, -50%) scale(0); } 40% { transform: translate(-50%, -50%) scale(2.1); } 100% { transform: translate(-50%, -50%) scale(0); } }

.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 37px;
  line-height: 1;
}
.hud-stat span { font-family: var(--mono); font-size: 13px; font-weight: 800; letter-spacing: -.03em; }
.hud-stat small { margin-top: 4px; color: var(--ink-3); font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.tied-stat span { color: var(--red-2); }
.hud-icon-group { display: flex; align-items: center; gap: 3px; margin-left: 3px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  padding: 0;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.icon-btn:hover { color: var(--ink); background: rgba(38, 50, 61, .07); border-color: rgba(38, 50, 61, .2); }
.icon-btn svg { width: 17px; height: 17px; }
.text-btn {
  min-height: 28px;
  padding: 4px 9px;
  color: var(--red-2);
  background: transparent;
  border: 1px solid rgba(169, 68, 55, .35);
  border-radius: 2px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .1em;
  transition: background .14s ease, color .14s ease;
}
.text-btn:hover { background: var(--red); color: var(--white); border-color: var(--red-2); }

/* Stage ---------------------------------------------------------------------- */

.stage-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #1b2b26;
  isolation: isolate;
}
#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
#gameCanvas:active { cursor: crosshair; }
.stage-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 90px rgba(10, 20, 17, .33);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  opacity: .42;
  mix-blend-mode: soft-light;
}

.stage-top-left {
  position: absolute;
  top: 13px;
  left: 14px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}
.role-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 11px 6px 8px;
  color: var(--ink);
  background: rgba(255, 248, 233, .94);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(10, 20, 17, .28);
  transform: rotate(-.6deg);
}
.role-banner-icon {
  display: grid;
  place-items: center;
  width: 23px; height: 23px;
  color: var(--cream);
  background: var(--green);
  border-radius: 50%;
  font-size: 12px;
}
.role-banner > div { display: flex; flex-direction: column; line-height: 1; }
.role-banner small { color: var(--ink-3); font-size: 6.5px; font-weight: 800; letter-spacing: .14em; }
.role-banner b { margin-top: 4px; font-family: var(--display); font-size: 12px; letter-spacing: .035em; }
.role-banner.is-teacher { background: rgba(251, 234, 214, .96); border-color: var(--red-2); }
.role-banner.is-teacher .role-banner-icon { background: var(--red); }

.ability-panel {
  width: 166px;
  padding: 7px 9px 8px;
  color: var(--cream);
  background: rgba(26, 45, 38, .88);
  border: 1px solid rgba(246, 237, 217, .22);
  border-radius: 2px;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.ability-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ability-top span { font-size: 7px; font-weight: 800; letter-spacing: .14em; }
.ability-top small { color: var(--gold); font-size: 6.5px; font-weight: 800; letter-spacing: .08em; }
.ability-panel.is-cooling .ability-top small { color: rgba(246, 237, 217, .5); }
.ability-bar { height: 4px; margin-top: 5px; overflow: hidden; background: rgba(255, 248, 233, .15); border-radius: 2px; }
.ability-bar span { display: block; width: 0; height: 100%; background: var(--gold); transition: width .12s linear; }
.ability-hint {
  margin-top: 5px;
  overflow: hidden;
  color: rgba(246, 237, 217, .6);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-power {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(246, 237, 217, .16);
}
.power-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  color: rgba(246, 237, 217, .62);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .12em;
}
.power-line b {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: .04em;
}
.stamina-bar {
  height: 4px;
  margin-top: 3px;
  overflow: hidden;
  background: rgba(255, 248, 233, .15);
  border-radius: 2px;
}
.stamina-bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--green-2, #6fb79a);
  transition: width .12s linear, background .2s;
}
.stamina-bar.is-low span { background: var(--red); }
.anger-line { margin-top: 5px; }
.anger-bar {
  height: 4px;
  margin-top: 3px;
  overflow: hidden;
  background: rgba(255, 248, 233, .15);
  border-radius: 2px;
}
.anger-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--red);
  transition: width .12s linear, background .2s;
}
.ability-panel.is-enraged .anger-bar span { background: #ff5b3f; box-shadow: 0 0 8px #ff5b3f; }
.power-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 6px;
  padding: 5px 6px;
  color: var(--ink);
  background: var(--gold);
  border: 1px solid #ffe1a1;
  border-radius: 2px;
  font-family: var(--body);
  font-size: 6.5px;
  font-weight: 900;
  letter-spacing: .08em;
  cursor: pointer;
}
.power-btn b { font-family: var(--mono); font-size: 9px; }
.power-btn:active { transform: translateY(1px); }
.book-line { margin-top: 5px; }
.book-pips { display: flex; gap: 3px; margin-top: 3px; }
.book-pips i {
  flex: 1;
  height: 5px;
  border: 1px solid rgba(246, 237, 217, .24);
  border-radius: 1px;
  background: rgba(255, 248, 233, .08);
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.book-pips i.is-filled {
  background: var(--gold);
  border-color: #ffe1a1;
  box-shadow: 0 0 7px rgba(242, 180, 75, .65);
}
.ability-panel.is-teaching { border-color: rgba(111, 183, 154, .55); }
.ability-panel.is-ultimate {
  border-color: rgba(242, 180, 75, .85);
  background: rgba(55, 43, 18, .94);
  box-shadow: 0 0 0 1px rgba(242, 180, 75, .18), 0 0 22px rgba(242, 180, 75, .22);
}
.ability-panel.is-ultimate .ability-hint { color: rgba(255, 238, 198, .9); }
@keyframes ultimateGlow {
  from { box-shadow: 0 0 0 1px rgba(242, 180, 75, .18), 0 0 16px rgba(242, 180, 75, .18); }
  to { box-shadow: 0 0 0 1px rgba(242, 180, 75, .34), 0 0 28px rgba(242, 180, 75, .34); }
}
.ability-panel.is-ultimate { animation: ultimateGlow 1.4s ease-in-out infinite alternate; }
.alert.is-ultimate { border-color: var(--gold); background: #4d3a17; color: #fff4d2; }

.alerts {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: min(280px, 56vw);
  pointer-events: none;
}
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 10px;
  color: var(--ink);
  background: rgba(255, 248, 233, .95);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(10, 20, 17, .25);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
  animation: alert-in .24s ease both;
}
.alert::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 16px; height: 16px;
  flex: none;
  color: var(--cream);
  background: var(--red);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 10px;
  font-weight: 800;
}
.alert.is-tie { background: #f8ded0; }
.alert.is-good { background: #e4eedd; }
.alert.is-good::before { content: "✓"; background: var(--green); font-size: 9px; }
.alert.is-warn { background: #fbeccb; }
.alert.is-warn::before { content: "!"; background: var(--gold-2); }
.alert.is-grab { background: #f4ddd2; }
@keyframes alert-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

.ticker {
  position: absolute;
  left: 14px;
  bottom: 13px;
  z-index: 6;
  max-width: min(510px, 68vw);
  min-height: 24px;
  padding: 6px 11px;
  color: rgba(255, 248, 233, .88);
  background: rgba(21, 37, 31, .76);
  border-left: 2px solid var(--gold);
  font-family: var(--hand);
  font-size: 11.5px;
  line-height: 1.15;
  pointer-events: none;
  transition: opacity .2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ticker:empty { opacity: 0; }
.ticker.is-new { animation: ticker-in .3s ease; }
@keyframes ticker-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.context-prompt {
  position: absolute;
  left: 50%;
  bottom: 23px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(430px, calc(100% - 40px));
  padding: 8px 13px 8px 8px;
  color: var(--ink);
  background: rgba(255, 248, 233, .96);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  box-shadow: 3px 3px 0 rgba(10, 20, 17, .27);
  transform: translateX(-50%) translateY(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.context-prompt.is-visible { opacity: 1; transform: translateX(-50%); }
.context-prompt.is-progress { padding-right: 8px; padding-bottom: 13px; }
.prompt-key {
  display: grid;
  place-items: center;
  width: 29px; height: 29px;
  flex: none;
  color: var(--cream);
  background: var(--green);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  box-shadow: 1px 1px 0 var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  transition: background .14s ease;
}
.context-prompt.is-teacher .prompt-key { background: var(--red); }
.context-prompt.is-progress .prompt-key { background: var(--gold); color: var(--ink); }
.context-prompt > div:nth-child(2) { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.context-prompt b { font-family: var(--display); font-size: 13px; letter-spacing: .015em; }
.context-prompt small { margin-top: 3px; color: var(--ink-3); font-size: 8.5px; font-weight: 600; }
.prompt-progress {
  position: absolute;
  right: 8px;
  bottom: 5px;
  left: 47px;
  display: none;
  height: 3px;
  overflow: hidden;
  background: rgba(38, 50, 61, .14);
  border-radius: 2px;
}
.context-prompt.is-progress .prompt-progress { display: block; }
.prompt-progress span { display: block; width: 0; height: 100%; background: var(--green); transition: width .08s linear; }

/* Stage overlays -------------------------------------------------------------- */

.stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  padding: 20px;
}
.countdown-overlay { pointer-events: none; background: rgba(16, 30, 25, .2); }
.countdown-card {
  padding: 22px 34px 25px;
  color: var(--cream);
  text-align: center;
  background: rgba(27, 49, 41, .93);
  border: 2px solid rgba(246, 237, 217, .4);
  border-radius: 3px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .25);
  transform: rotate(-.6deg);
  animation: countdown-card-in .28s ease both;
}
.countdown-card .eyebrow { color: var(--gold); font-size: 8px; }
.countdown-number {
  margin: 2px 0;
  color: var(--gold);
  font-family: var(--display);
  font-size: clamp(64px, 10vw, 106px);
  font-weight: 800;
  line-height: .95;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, .25);
  animation: countdown-tick .55s ease infinite alternate;
}
.countdown-hint { color: rgba(246, 237, 217, .68); font-family: var(--hand); font-size: 14px; }
@keyframes countdown-card-in { from { transform: scale(.92) rotate(-2deg); opacity: 0; } to { transform: rotate(-.6deg); opacity: 1; } }
@keyframes countdown-tick { from { transform: scale(1); } to { transform: scale(1.035); } }

.connection-banner {
  position: absolute;
  top: 13px;
  left: 50%;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  color: var(--ink);
  background: #fbeccb;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .2);
  font-size: 9px;
  font-weight: 700;
  transform: translateX(-50%);
}
.spinner {
  width: 12px; height: 12px;
  border: 2px solid rgba(38, 50, 61, .25);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.rotate-hint {
  position: absolute;
  right: 12px;
  bottom: 75px;
  z-index: 9;
  padding: 6px 9px;
  color: rgba(255, 248, 233, .7);
  background: rgba(21, 37, 31, .72);
  border: 1px solid rgba(246, 237, 217, .17);
  font-size: 8px;
  pointer-events: none;
}

/* Result --------------------------------------------------------------------- */

.result-overlay {
  z-index: 25;
  background: rgba(16, 30, 25, .73);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in .35s ease both;
}
.result-card {
  position: relative;
  width: min(560px, 100%);
  padding: 29px 32px 26px;
  overflow: hidden;
  color: var(--ink);
  text-align: center;
  background:
    linear-gradient(rgba(47, 99, 87, .045) 1px, transparent 1px),
    var(--cream);
  background-size: 100% 27px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  box-shadow: 10px 11px 0 rgba(0, 0, 0, .35);
  animation: result-in .5s cubic-bezier(.2, .9, .25, 1.1) both;
}
.result-card::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 110px;
  height: 22px;
  background: rgba(242, 201, 123, .78);
  transform: translateX(-50%) rotate(-1.5deg);
  box-shadow: 0 2px 3px rgba(38, 50, 61, .16);
}
@keyframes result-in { from { opacity: 0; transform: translateY(18px) rotate(-1deg) scale(.96); } to { opacity: 1; transform: none; } }
.result-card .eyebrow { justify-content: center; font-size: 8px; }
.result-stamp {
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 9px;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
  transform: rotate(-1.8deg);
  opacity: .74;
}
.result-card.is-teacher .result-stamp { color: var(--red-2); border-color: var(--red-2); }
.result-card h2 {
  margin: 4px 0 3px;
  font-family: var(--display);
  font-size: clamp(33px, 5vw, 48px);
  line-height: 1;
  letter-spacing: -.03em;
}
.result-copy { max-width: 400px; margin: 0 auto 18px; color: var(--ink-3); font-size: 11.5px; line-height: 1.5; }
.result-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  margin: 0 0 20px;
  background: rgba(38, 50, 61, .18);
  border: 1px solid rgba(38, 50, 61, .18);
}
.result-stats > div { display: flex; flex-direction: column; gap: 3px; padding: 9px 3px; background: rgba(255, 253, 246, .8); }
.result-stats b { font-family: var(--display); font-size: 20px; line-height: 1; color: var(--ink); }
.result-stats span { color: var(--ink-3); font-size: 6.5px; font-weight: 800; letter-spacing: .1em; }
.result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.result-actions .btn { min-width: 142px; min-height: 43px; padding: 9px 16px; font-size: 9.5px; }
.result-actions .btn-primary { flex: 1 1 168px; }
.rematch-note { margin-top: 13px; color: var(--ink-3); font-size: 9px; }

/* Touch controls -------------------------------------------------------------- */

.touch-controls {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 18px 18px;
  pointer-events: none;
}
.joystick {
  position: relative;
  display: grid;
  place-items: center;
  width: 106px; height: 106px;
  border-radius: 50%;
  background: rgba(255, 248, 233, .11);
  border: 2px solid rgba(255, 248, 233, .26);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, .16);
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.joystick-ring {
  position: absolute;
  inset: 17px;
  border: 1px dashed rgba(255, 248, 233, .24);
  border-radius: 50%;
}
.stick {
  position: relative;
  width: 46px; height: 46px;
  background: rgba(255, 248, 233, .8);
  border: 2px solid rgba(38, 50, 61, .75);
  border-radius: 50%;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .2);
  transform: translate(0, 0);
  will-change: transform;
}
.touch-actions { position: relative; display: flex; align-items: flex-end; gap: 12px; pointer-events: auto; }
.touch-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 69px; height: 69px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 248, 233, .9);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, .24);
  font-family: var(--display);
  line-height: 1;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.touch-action b { font-family: var(--mono); font-size: 19px; }
.touch-action span { margin-top: 3px; font-family: var(--body); font-size: 6.5px; font-weight: 800; letter-spacing: .09em; }
.touch-action:active { transform: translate(1px, 2px); box-shadow: 1px 1px 0 rgba(0, 0, 0, .2); }
.swing-action { width: 84px; height: 84px; color: var(--cream); background: var(--red); border-color: var(--red-2); }
.swing-action b { font-size: 25px; }
.use-action { background: var(--gold); }
.sprint-action {
  width: 52px; height: 52px;
  color: var(--cream);
  background: var(--blue);
  border-color: var(--navy);
}
.sprint-action b { font-size: 22px; }
.emote-action {
  position: absolute;
  right: 4px;
  bottom: 96px;
  width: 52px;
  height: 52px;
  color: var(--ink);
  background: #e8c7d0;
  border-color: #9c5d70;
}
.emote-action b { font-size: 20px; }
.sprint-action.is-active {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(242, 180, 75, .28);
}
.touch-action.is-disabled { opacity: .4; }

@media (hover: none), (pointer: coarse) {
  .touch-controls { display: flex; }
  .context-prompt { bottom: 118px; }
  .ticker { bottom: 15px; max-width: calc(100% - 36px); }
}

/* Footer --------------------------------------------------------------------- */

.game-footer {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--foot-h);
  padding: 6px 18px;
  color: var(--cream);
  background: var(--green-3);
  border-top: 1px solid rgba(246, 237, 217, .17);
}
.footer-tip { display: flex; align-items: center; gap: 9px; min-width: 0; }
.footer-role-chip {
  flex: none;
  padding: 3px 7px;
  color: var(--ink);
  background: var(--gold);
  border-radius: 2px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .12em;
}
.footer-role-chip.is-teacher { color: var(--cream); background: var(--red); }
.footer-tip p { overflow: hidden; color: rgba(246, 237, 217, .65); font-size: 9px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.footer-roster { display: flex; align-items: center; gap: 6px; }
.roster-dot {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 3px 7px;
  background: rgba(255, 248, 233, .08);
  border: 1px solid rgba(246, 237, 217, .14);
  border-radius: 20px;
  color: rgba(246, 237, 217, .65);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  white-space: nowrap;
}
.roster-dot i { width: 6px; height: 6px; border-radius: 50%; background: #82b08e; }
.roster-dot.is-tied { color: #f4b49d; background: rgba(201, 88, 72, .14); border-color: rgba(231, 128, 99, .25); }
.roster-dot.is-tied i { background: var(--coral); }
.roster-dot.is-you { border-color: var(--gold); color: var(--gold); }
.roster-dot.is-stunned i { background: var(--gold); animation: live-pulse 1s infinite; }
.roster-dot.is-bot { font-style: italic; opacity: .7; }
.footer-meta { display: flex; align-items: center; gap: 10px; }
.live-status { display: flex; align-items: center; gap: 5px; color: #9bc4a6; font-size: 7px; font-weight: 800; letter-spacing: .13em; white-space: nowrap; }
.live-status i { width: 5px; height: 5px; border-radius: 50%; background: #83be94; box-shadow: 0 0 0 3px rgba(131, 190, 148, .11); }
.live-status.is-offline { color: var(--coral); }
.live-status.is-offline i { background: var(--coral); box-shadow: none; }
.footer-controls {
  padding: 4px 7px;
  color: rgba(246, 237, 217, .65);
  background: transparent;
  border: 1px solid rgba(246, 237, 217, .2);
  border-radius: 2px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .1em;
}
.footer-controls:hover { color: var(--cream); border-color: rgba(246, 237, 217, .5); }

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 31, 27, .68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in .2s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 31px 34px 28px;
  color: var(--ink);
  background:
    linear-gradient(rgba(47, 99, 87, .04) 1px, transparent 1px),
    var(--cream);
  background-size: 100% 27px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  box-shadow: 11px 12px 0 rgba(0, 0, 0, .3);
  animation: modal-in .28s cubic-bezier(.2, .9, .3, 1.05) both;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(13px) scale(.97) rotate(-.4deg); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 31px; height: 31px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(38, 50, 61, .24);
  border-radius: 50%;
  font-family: var(--body);
  font-size: 21px;
  line-height: 1;
  transition: background .14s ease, color .14s ease;
}
.modal-close:hover { color: var(--cream); background: var(--red); border-color: var(--red-2); }
.modal-card .eyebrow { color: var(--green); font-size: 8.5px; }
.modal-card h2 { margin: 7px 0 19px; font-family: var(--display); font-size: clamp(32px, 4.4vw, 44px); line-height: 1; letter-spacing: -.03em; }
.help-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.help-columns h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; font-family: var(--display); font-size: 19px; line-height: 1.1; }
.help-badge { padding: 3px 6px; border-radius: 2px; font-family: var(--body); font-size: 6.5px; font-weight: 800; letter-spacing: .1em; }
.help-badge.student { color: var(--ink); background: var(--gold); }
.help-badge.teacher { color: var(--cream); background: var(--red); }
.help-list { display: flex; flex-direction: column; gap: 9px; margin: 0; padding-left: 17px; }
.help-list li { padding-left: 2px; color: var(--ink-3); font-size: 11px; line-height: 1.45; }
.help-list li::marker { color: var(--red); font-size: 11px; }
.help-list b { color: var(--ink); }
.help-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 23px;
  padding-top: 17px;
  border-top: 1px dashed rgba(38, 50, 61, .28);
}
.help-footer p { max-width: 420px; color: var(--ink-3); font-size: 10px; line-height: 1.45; }
.help-footer b { color: var(--ink); }
.help-footer .btn { flex: none; min-height: 40px; padding: 9px 14px; font-size: 8.5px; }

.confirm-modal { width: min(410px, 100%); padding: 29px 30px 25px; text-align: center; }
.confirm-modal h2 { margin-bottom: 8px; font-size: 36px; }
.confirm-modal > p:not(.eyebrow) { color: var(--ink-3); font-size: 11.5px; line-height: 1.5; }
.confirm-actions { display: flex; justify-content: center; gap: 9px; margin-top: 22px; }
.confirm-actions .btn { min-width: 104px; min-height: 42px; padding: 9px 15px; font-size: 9.5px; }

/* ==========================================================================
   TOASTS
   ========================================================================== */

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 9px 13px;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-left: 4px solid var(--green);
  border-radius: 2px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .2);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  animation: toast-in .25s ease both;
}
.toast.is-error { border-left-color: var(--red); }
.toast.is-warn { border-left-color: var(--gold-2); }
.toast.is-leaving { animation: toast-out .25s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(10px); } }

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 9999;
  padding: 14px;
  color: var(--cream);
  background: var(--red);
  border: 2px solid var(--ink);
  text-align: center;
  font-weight: 700;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1200px) {
  .landing-inner { width: min(1180px, calc(100% - 48px)); }
  .landing-main { gap: 38px; }
  .hero-title { font-size: clamp(54px, 6.4vw, 78px); }
  .entry-card { padding-inline: 25px; }
  .game-hud { grid-template-columns: minmax(150px, 1fr) minmax(230px, 370px) minmax(230px, 1fr); gap: 12px; padding-inline: 13px; }
  .hud-brand-text { display: none; }
  .copy-chip { margin-left: 1px; }
  .hud-icon-group { gap: 0; }
}

@media (max-width: 980px) {
  .landing-main { grid-template-columns: 1fr; gap: 34px; padding-top: 38px; }
  .hero-copy { padding-top: 0; }
  .hero-title { font-size: clamp(58px, 10vw, 86px); }
  .entry-card { position: relative; top: auto; width: min(530px, 100%); margin: 0 auto; transform: rotate(.25deg); }
  .entry-tape { left: 34px; }
  .rules-strip { grid-template-columns: 1fr 1fr; gap: 26px 0; }
  .rule-card { padding: 0 24px; }
  .rule-card:nth-child(2) { border-right: 0; }
  .rule-card:nth-child(3) { padding-left: 0; }
  .rule-card:nth-child(4) { padding-right: 0; }
  .rule-num { right: 13px; }
  .lobby-main { grid-template-columns: 1fr; }
  .lobby-side { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .lobby-side .dark-note { grid-column: 1 / -1; }
  .game-hud { grid-template-columns: minmax(104px, 1fr) minmax(220px, 1.4fr) auto; gap: 9px; padding: 7px 10px; min-height: 64px; }
  .hud-left { gap: 7px; }
  .hud-stat { min-width: 31px; }
  .hud-stat span { font-size: 11px; }
  .hud-icon-group .icon-btn { width: 27px; height: 27px; }
  .hud-icon-group .icon-btn svg { width: 15px; height: 15px; }
  .copy-chip { padding-inline: 5px; font-size: 6.5px; }
  .game-footer { padding-inline: 10px; gap: 9px; }
  .footer-tip p { font-size: 8.5px; }
  .footer-roster { gap: 4px; }
  .roster-dot { padding-inline: 5px; }
}

@media (max-width: 760px) {
  :root { --hud-h: 85px; --foot-h: 43px; }
  .landing-inner { width: calc(100% - 32px); }
  .landing-topbar { padding-top: 18px; padding-bottom: 15px; }
  .live-pill { display: none; }
  .landing-topbar .btn { min-height: 38px; padding: 8px 11px; font-size: 9px; }
  .landing-main { padding-top: 30px; gap: 27px; }
  .hero-title { font-size: clamp(48px, 13vw, 67px); }
  .hero-lede { font-size: 14.5px; }
  .hero-art-wrap { margin-top: 28px; }
  .art-caption { display: none; }
  .hero-facts li { padding-right: 13px; margin-right: 13px; }
  .hero-facts b { font-size: 23px; }
  .hero-facts span { font-size: 8px; max-width: 84px; }
  .entry-card { padding: 32px 20px 22px; }
  .entry-card h2 { font-size: 33px; }
  .role-card { flex-direction: column; align-items: flex-start; min-height: 108px; gap: 5px; padding: 9px; }
  .role-icon { width: 34px; height: 37px; }
  .role-copy b { font-size: 16px; }
  .role-copy small { font-size: 8px; }
  .rules-strip { grid-template-columns: 1fr; gap: 23px; padding: 25px 0 29px; }
  .rule-card { padding: 0 !important; border-right: 0; border-bottom: 1px dashed rgba(38, 50, 61, .19); padding-bottom: 20px !important; }
  .rule-card:last-child { border-bottom: 0; padding-bottom: 0 !important; }
  .rule-num { top: -5px; right: 3px; }
  .rule-illu { width: 39px; height: 39px; margin-bottom: 9px; font-size: 16px; }
  .landing-footer { flex-direction: column; gap: 3px; font-size: 8px; }
  .footer-doodle { font-size: 10px; }

  .lobby-inner { width: calc(100% - 24px); }
  .lobby-topbar { flex-wrap: wrap; gap: 12px; padding: 15px 0; }
  .lobby-topbar .brand-type { display: none; }
  .lobby-code-ticket { order: 3; width: 100%; justify-content: center; }
  .lobby-code-ticket > span { flex: 1; }
  .lobby-main { padding-top: 18px; gap: 17px; }
  .lobby-card { padding: 22px 15px 19px; box-shadow: 6px 7px 0 rgba(0, 0, 0, .24); }
  .lobby-heading h2 { font-size: 33px; }
  .seat-grid { grid-template-columns: 1fr; margin-top: 19px; }
  .seat.teacher-seat { grid-column: auto; }
  .seat { min-height: 76px; }
  .lobby-actions { flex-direction: column; align-items: stretch; gap: 14px; }
  .fill-note p { max-width: none; }
  .lobby-buttons .btn { width: 100%; min-width: 0; }
  .lobby-side { grid-template-columns: 1fr; }
  .lobby-side .dark-note { grid-column: auto; }

  .game-hud {
    grid-template-columns: 1fr auto;
    grid-template-areas: "left right" "score score";
    gap: 5px 8px;
    min-height: var(--hud-h);
    padding: 7px 9px 8px;
  }
  .hud-left { grid-area: left; }
  .score-block { grid-area: score; }
  .hud-right { grid-area: right; gap: 4px; }
  .copy-chip { display: none; }
  .brand-seal.tiny { width: 29px; height: 29px; font-size: 12px; }
  .score-labels { margin-bottom: 3px; }
  .score-labels b { font-size: 19px; }
  .score-track { height: 9px; }
  .hud-stat { min-width: 28px; }
  .hud-stat span { font-size: 10px; }
  .hud-stat small { font-size: 6px; margin-top: 3px; }
  .tied-stat { display: flex; }
  .hud-icon-group .icon-btn { width: 25px; height: 25px; }
  .hud-icon-group #soundBtn, .hud-icon-group #fullscreenBtn { display: none; }
  .text-btn { min-height: 24px; padding: 3px 6px; font-size: 7px; }
  .stage-top-left { top: 8px; left: 8px; gap: 5px; }
  .role-banner { padding: 4px 8px 4px 5px; }
  .role-banner-icon { width: 19px; height: 19px; font-size: 10px; }
  .role-banner b { font-size: 10px; }
  .role-banner small { font-size: 5.5px; }
  .ability-panel { width: 137px; padding: 5px 7px 6px; }
  .ability-hint { font-size: 6px; }
  .alerts { top: 8px; right: 8px; gap: 4px; max-width: 48vw; }
  .alert { padding: 5px 7px; font-size: 7.5px; gap: 5px; }
  .alert::before { width: 13px; height: 13px; font-size: 8px; }
  .ticker { left: 8px; bottom: 8px; max-width: calc(100% - 16px); font-size: 9.5px; padding: 4px 8px; min-height: 20px; }
  .context-prompt { bottom: 15px; max-width: calc(100% - 22px); padding: 6px 10px 6px 6px; }
  .context-prompt b { font-size: 11px; }
  .context-prompt small { font-size: 7.5px; }
  .prompt-key { width: 25px; height: 25px; font-size: 10px; }
  .prompt-progress { left: 39px; }
  .game-footer { padding: 5px 8px; min-height: var(--foot-h); gap: 6px; }
  .footer-role-chip { font-size: 6px; padding: 2px 5px; }
  .footer-tip { gap: 5px; }
  .footer-tip p { max-width: 44vw; font-size: 7.5px; }
  .footer-roster { display: none; }
  .footer-meta { margin-left: auto; }
  .live-status { font-size: 6px; }
  .footer-controls { font-size: 6px; padding: 3px 5px; }
  .result-card { padding: 25px 17px 19px; }
  .result-card h2 { font-size: 34px; }
  .result-stats { grid-template-columns: repeat(5, 1fr); }
  .result-stats b { font-size: 16px; }
  .result-stats span { font-size: 5.5px; }
  .result-actions { flex-direction: column; }
  .result-actions .btn { width: 100%; }
  .countdown-card { padding: 18px 24px 22px; }
  .modal-card { padding: 25px 19px 21px; max-height: calc(100dvh - 24px); }
  .help-columns { grid-template-columns: 1fr; gap: 19px; }
  .help-footer { flex-direction: column; align-items: stretch; text-align: center; }
  .help-footer .btn { width: 100%; }
  .help-list li { font-size: 10.5px; }
  .toast-stack { right: 10px; bottom: 10px; }
}

@media (max-width: 760px) and (hover: none), (max-width: 760px) and (pointer: coarse) {
  .context-prompt { bottom: clamp(132px, 18vh, 168px); }
  .rotate-hint { display: none; }
}

@media (max-width: 440px) {
  .hero-title { font-size: 48px; }
  .entry-card h2 { font-size: 30px; }
  .role-copy small { font-size: 7.5px; }
  .role-icon { width: 29px; height: 32px; }
  .lobby-heading h2 { font-size: 29px; }
  .lobby-code-ticket strong { font-size: 17px; }
  .hud-stat.tied-stat { display: none; }
  .hud-icon-group #gameHelpBtn { display: none; }
  .result-stats { grid-template-columns: repeat(3, 1fr); }
  .result-stats > div:nth-child(4), .result-stats > div:nth-child(5) { display: none; }
}

@media (max-height: 620px) and (min-width: 761px) {
  .landing-topbar { padding-block: 14px; }
  .landing-main { padding-top: 22px; }
  .hero-title { font-size: 56px; }
  .hero-art-wrap { margin-block: 20px; }
  .entry-card { padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
