:root {
  --navy: #071629;
  --navy-2: #102744;
  --cream: #fff4d8;
  --paper: #fffaf0;
  --paper-2: #f6e8c5;
  --red: #c62828;
  --red-dark: #7f1818;
  --gold: #d9a822;
  --green: #2f9c95;
  --chalk: #173b35;
  --chalk-light: #eaf5dd;
  --ink: #182235;
  --muted: #756b5a;
  --shadow: 0 18px 60px rgba(7, 22, 41, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.notebook-grid {
  background:
    linear-gradient(rgba(7, 22, 41, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 22, 41, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 12% 16%, rgba(217, 168, 34, 0.22), transparent 24rem),
    radial-gradient(circle at 84% 72%, rgba(47, 156, 149, 0.16), transparent 22rem),
    var(--cream);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.motto {
  margin: 0;
  color: var(--gold);
  font-weight: 900;
}

.button,
.icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.85rem 1.1rem;
  box-shadow: 0 10px 22px rgba(7, 22, 41, 0.18);
}

.button:hover,
.icon-button:hover,
.answer-button:hover {
  transform: translateY(-2px);
}

.button.primary {
  color: white;
  background: linear-gradient(135deg, var(--red), #e5483f);
}

.button.secondary {
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold), #ffe08a);
}

.button.ghost {
  color: var(--cream);
  background: var(--navy-2);
}

.button.full {
  width: 100%;
}

.icon-button {
  min-height: 2.6rem;
  padding: 0.6rem 0.8rem;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.icon-button.small {
  color: var(--navy);
  background: rgba(7, 22, 41, 0.08);
  border-color: rgba(7, 22, 41, 0.15);
}

.landing-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 2rem;
}

.hero-ticket {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14rem;
  width: min(980px, 100%);
  overflow: hidden;
  color: var(--cream);
  background:
    linear-gradient(135deg, rgba(7, 22, 41, 0.96), rgba(16, 39, 68, 0.94)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  border: 2px solid rgba(217, 168, 34, 0.58);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-ticket::before,
.hero-ticket::after {
  position: absolute;
  top: 50%;
  width: 2.2rem;
  height: 2.2rem;
  content: "";
  background: var(--cream);
  border-radius: 50%;
  transform: translateY(-50%);
}

.hero-ticket::before {
  left: -1.1rem;
}

.hero-ticket::after {
  right: -1.1rem;
}

.ticket-main {
  padding: 3rem;
}

.ticket-main h1 {
  margin: 0 0 1rem;
  font-size: 3rem;
  line-height: 1.02;
}

.hero-copy {
  max-width: 38rem;
  margin: 1.4rem 0 1.8rem;
  color: rgba(255, 244, 216, 0.82);
  font-size: 1.1rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.boarding-stub {
  display: grid;
  align-content: center;
  gap: 0.35rem;
  padding: 2rem;
  color: var(--navy);
  background:
    linear-gradient(var(--paper), var(--paper-2)),
    repeating-linear-gradient(0deg, transparent 0 20px, rgba(7, 22, 41, 0.06) 21px 22px);
  border-left: 2px dashed rgba(7, 22, 41, 0.28);
}

.stub-label {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.boarding-stub strong {
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

.math-cloud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.math-cloud span {
  position: absolute;
  color: rgba(7, 22, 41, 0.15);
  font-family: Georgia, serif;
  font-size: 2.4rem;
  font-weight: 900;
  transform: rotate(-8deg);
}

.math-cloud span:nth-child(1) { left: 8%; top: 16%; }
.math-cloud span:nth-child(2) { right: 7%; top: 14%; transform: rotate(8deg); }
.math-cloud span:nth-child(3) { left: 12%; bottom: 14%; transform: rotate(10deg); }
.math-cloud span:nth-child(4) { right: 18%; bottom: 10%; }
.math-cloud span:nth-child(5) { right: 4%; top: 48%; transform: rotate(-14deg); }
.math-cloud span:nth-child(6) { left: 4%; top: 52%; transform: rotate(14deg); }

.host-page {
  color: var(--cream);
  background:
    radial-gradient(circle at 20% 0%, rgba(217, 168, 34, 0.18), transparent 22rem),
    linear-gradient(135deg, #040b16, var(--navy));
}

.host-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.2rem;
}

.host-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

.host-header h1,
.phone-header h1 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.05;
}

.host-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.8fr 0.95fr;
  gap: 1rem;
  align-items: stretch;
}

.departure-board,
.leaderboard-panel,
.event-panel,
.qr-panel,
.chalk-panel,
.blackboard,
.timer-tower {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.departure-board {
  padding: 1.1rem;
  background: #08111e;
  border: 1px solid rgba(217, 168, 34, 0.45);
}

.board-top,
.blackboard-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.split-flap {
  display: grid;
  grid-template-columns: 10rem 1fr;
  align-items: center;
  min-height: 5.2rem;
  margin-bottom: 0.55rem;
  padding: 0.75rem;
  background:
    linear-gradient(#16243a, #0d1727),
    repeating-linear-gradient(0deg, transparent 0 21px, rgba(255, 255, 255, 0.06) 22px 23px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.split-flap span {
  color: rgba(255, 244, 216, 0.65);
  font-weight: 900;
}

.split-flap strong {
  color: #fff7cc;
  font-size: 2.2rem;
}

.room-code-row strong {
  color: var(--gold);
  font-size: 4.2rem;
  line-height: 1;
}

.start-button {
  width: 100%;
  margin-top: 0.8rem;
  font-size: 1.2rem;
}

.qr-panel,
.chalk-panel,
.leaderboard-panel,
.event-panel {
  padding: 1rem;
  background: rgba(255, 250, 240, 0.96);
  color: var(--ink);
}

.panel-title {
  margin-bottom: 0.85rem;
  color: var(--red);
  font-weight: 900;
  text-transform: uppercase;
}

.qr-image {
  display: block;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto 1rem;
  border: 8px solid var(--paper);
  border-radius: 8px;
}

.join-url {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.9rem;
}

.chalk-panel {
  background:
    linear-gradient(rgba(23, 59, 53, 0.96), rgba(19, 48, 44, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(255, 255, 255, 0.035) 28px 29px);
  color: var(--chalk-light);
  border: 6px solid #815b3c;
}

.big-number {
  margin-bottom: 0.8rem;
  color: var(--gold);
  font-size: 4.6rem;
  font-weight: 950;
  line-height: 1;
}

.joined-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.player-chip,
.empty-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  padding: 0.4rem 0.7rem;
  color: var(--chalk-light);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  font-weight: 800;
}

.player-chip.disconnected {
  opacity: 0.55;
}

.game-host {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 15rem 25rem;
  grid-template-areas:
    "board timer leaders"
    "board events leaders";
  gap: 1rem;
}

.blackboard {
  grid-area: board;
  min-height: 35rem;
  padding: 1.35rem;
  color: var(--chalk-light);
  background:
    linear-gradient(rgba(23, 59, 53, 0.97), rgba(12, 36, 32, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255, 255, 255, 0.035) 32px 33px);
  border: 8px solid #7b5737;
}

.blackboard h2 {
  margin: 1.8rem 0 0.9rem;
  color: #fff7cf;
  font-size: 3rem;
  line-height: 1.05;
}

.blackboard p {
  margin: 0;
  font-size: 2rem;
  font-weight: 850;
  line-height: 1.25;
}

.round-flavor {
  margin-top: 1rem !important;
  color: rgba(234, 245, 221, 0.76);
  font-size: 1.1rem !important;
  font-weight: 700 !important;
}

.host-options {
  display: grid;
  gap: 0.8rem;
  margin-top: 2rem;
}

.host-option {
  padding: 0.95rem 1rem;
  color: var(--chalk-light);
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(234, 245, 221, 0.35);
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: 900;
}

.timer-tower {
  grid-area: timer;
  display: grid;
  align-content: center;
  gap: 1rem;
  padding: 1rem;
  text-align: center;
  background: var(--paper);
  color: var(--navy);
}

.timer-circle {
  display: grid;
  width: 11rem;
  height: 11rem;
  place-items: center;
  margin: 0 auto;
  color: white;
  background: conic-gradient(var(--red), var(--gold), var(--green), var(--red));
  border: 0.6rem solid var(--navy);
  border-radius: 50%;
}

.timer-circle span {
  display: grid;
  width: 7.5rem;
  height: 7.5rem;
  place-items: center;
  background: var(--navy);
  border-radius: 50%;
  font-size: 4rem;
  font-weight: 950;
}

.timer-track {
  width: 100%;
  height: 0.8rem;
  overflow: hidden;
  background: rgba(7, 22, 41, 0.15);
  border-radius: 8px;
}

.timer-track > div {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
}

.correct-reveal {
  min-height: 3rem;
  margin: 0;
  color: var(--red);
  font-weight: 950;
}

.leaderboard-panel {
  grid-area: leaders;
}

.event-panel {
  grid-area: events;
}

.leaderboard,
.final-top {
  display: grid;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr) 3rem 3rem;
  gap: 0.45rem;
  align-items: center;
  min-height: 3rem;
  padding: 0.5rem;
  background: rgba(7, 22, 41, 0.06);
  border: 1px solid rgba(7, 22, 41, 0.08);
  border-radius: 8px;
}

.final-top .leaderboard-row {
  grid-template-columns: 2.1rem minmax(0, 1fr) 3rem 3rem minmax(8rem, 0.8fr);
}

.rank {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--navy);
  background: var(--gold);
  border-radius: 50%;
  font-weight: 950;
}

.name {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.points {
  display: grid;
  min-height: 2rem;
  place-items: center;
  color: white;
  border-radius: 8px;
  font-weight: 950;
}

.points.red {
  background: var(--red);
}

.points.black {
  background: var(--navy);
}

.title {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.empty-row {
  padding: 0.8rem;
  color: var(--muted);
  background: rgba(7, 22, 41, 0.05);
  border-radius: 8px;
}

.event-feed {
  display: grid;
  gap: 0.5rem;
}

.event {
  padding: 0.55rem 0.65rem;
  color: var(--navy);
  background: rgba(7, 22, 41, 0.05);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  font-weight: 750;
}

.event.red {
  border-color: var(--red);
}

.event.black {
  border-color: var(--navy);
}

.event.join {
  border-color: var(--green);
}

.boarding-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 22%, rgba(217, 168, 34, 0.32), transparent 25rem),
    radial-gradient(circle at 82% 68%, rgba(47, 156, 149, 0.18), transparent 20rem),
    linear-gradient(135deg, rgba(4, 11, 22, 0.96), rgba(7, 22, 41, 0.9)),
    rgba(4, 11, 22, 0.92);
  text-align: center;
  overflow: hidden;
}

.plane-scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.boarding-content {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  width: min(58rem, calc(100vw - 2rem));
  padding: 1.2rem;
  text-shadow: 0 2px 18px rgba(4, 11, 22, 0.85);
}

.luxury-badge {
  margin: 0;
  padding: 0.55rem 0.85rem;
  color: var(--navy);
  background: linear-gradient(135deg, #fff4bd, var(--gold));
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(217, 168, 34, 0.28);
  font-size: 0.9rem;
  font-weight: 950;
  text-transform: uppercase;
  text-shadow: none;
}

.boarding-overlay h2 {
  margin: 1.5rem 0 0.3rem;
  font-size: 3.4rem;
  line-height: 1;
  text-transform: uppercase;
}

.boarding-overlay p {
  max-width: 46rem;
  margin: 0;
  color: rgba(255, 244, 216, 0.92);
  font-size: 1.25rem;
  font-weight: 850;
}

.boarding-overlay .praise-line {
  margin-top: 0.35rem;
  padding: 0.75rem 0.9rem;
  color: #fff8d8;
  background: rgba(7, 22, 41, 0.9);
  border: 1px solid rgba(217, 168, 34, 0.55);
  border-left: 8px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

.runway {
  position: relative;
  width: min(52rem, 84vw);
  height: 8rem;
}

.runway-line {
  position: absolute;
  right: 0;
  bottom: 1.3rem;
  left: 0;
  height: 0.35rem;
  background: repeating-linear-gradient(90deg, var(--cream) 0 42px, transparent 42px 70px);
}

.plane {
  position: absolute;
  bottom: 2.2rem;
  left: -12rem;
  width: 10rem;
  padding: 0.7rem 1rem;
  color: var(--navy);
  background: var(--gold);
  border-radius: 8px 8px 8px 2px;
  font-weight: 950;
  animation: takeoff 3.1s cubic-bezier(0.22, 0.78, 0.28, 1) forwards;
}

.plane::after {
  position: absolute;
  right: -1.8rem;
  top: 50%;
  content: "";
  border-top: 1.1rem solid transparent;
  border-bottom: 1.1rem solid transparent;
  border-left: 2rem solid var(--gold);
  transform: translateY(-50%);
}

@keyframes takeoff {
  0% { transform: translate(0, 0) rotate(0deg); }
  70% { transform: translate(62vw, -0.5rem) rotate(-2deg); }
  100% { transform: translate(82vw, -5.5rem) rotate(-12deg); }
}

.final-view {
  position: relative;
  min-height: calc(100vh - 2.4rem);
  overflow: hidden;
  padding: 2rem;
  text-align: center;
  background:
    linear-gradient(rgba(7, 22, 41, 0.9), rgba(7, 22, 41, 0.96)),
    radial-gradient(circle at center, rgba(217, 168, 34, 0.22), transparent 28rem);
  border: 1px solid rgba(217, 168, 34, 0.45);
  border-radius: 8px;
}

.final-view h2 {
  margin: 0.4rem 0;
  color: var(--cream);
  font-size: 4rem;
  line-height: 1;
}

.class-name {
  margin: 0 0 0.4rem;
  color: var(--green);
  font-size: 2rem;
  font-weight: 950;
}

.final-top {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  margin: 2rem auto;
  color: var(--ink);
}

.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.player-page {
  color: var(--ink);
}

.phone-shell {
  width: min(520px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1rem;
}

.phone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  padding: 0.85rem;
  background: rgba(255, 250, 240, 0.88);
  border: 1px solid rgba(7, 22, 41, 0.12);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(7, 22, 41, 0.12);
}

.phone-panel {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  background: rgba(255, 250, 240, 0.96);
  border: 1px solid rgba(7, 22, 41, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.phone-panel label {
  display: block;
  margin: 1rem 0 0.35rem;
  color: var(--navy);
  font-weight: 900;
}

.phone-panel input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.85rem;
  color: var(--navy);
  background: white;
  border: 2px solid rgba(7, 22, 41, 0.18);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 850;
}

.phone-panel h2 {
  margin: 0.5rem 0 0.8rem;
  color: var(--navy);
  font-size: 1.85rem;
  line-height: 1.1;
}

.phone-panel .button {
  margin-top: 1rem;
}

.error-text {
  min-height: 1.4rem;
  color: var(--red);
  font-weight: 800;
}

.ticket-code {
  display: inline-grid;
  min-width: 9rem;
  min-height: 4.5rem;
  place-items: center;
  margin: 0.5rem 0;
  color: var(--gold);
  background: var(--navy);
  border-radius: 8px;
  font-size: 2.4rem;
  font-weight: 950;
}

.status-line {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.mini-plane {
  width: 9rem;
  margin-bottom: 1rem;
  padding: 0.7rem 1rem;
  color: var(--navy);
  background: var(--gold);
  border-radius: 8px 8px 8px 2px;
  font-weight: 950;
  animation: miniTakeoff 1.6s ease-in-out infinite alternate;
}

@keyframes miniTakeoff {
  from { transform: translateX(0) rotate(0deg); }
  to { transform: translateX(1.4rem) translateY(-0.5rem) rotate(-5deg); }
}

.play-panel {
  background:
    linear-gradient(rgba(255, 250, 240, 0.96), rgba(255, 250, 240, 0.98)),
    linear-gradient(rgba(7, 22, 41, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 22, 41, 0.055) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
}

.play-panel .round-flavor {
  margin-top: 0.75rem !important;
  padding: 0.75rem 0.85rem;
  color: var(--navy) !important;
  background: linear-gradient(135deg, #eaf8df, #fff3bf);
  border: 3px solid rgba(47, 156, 149, 0.55);
  border-left: 8px solid var(--green);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(7, 22, 41, 0.12);
  font-size: 1rem !important;
  font-weight: 950 !important;
  line-height: 1.35;
}

.score-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.score-strip span {
  min-height: 2.7rem;
  padding: 0.55rem;
  color: white;
  background: var(--navy);
  border-radius: 8px;
  font-weight: 900;
  text-align: center;
}

.score-strip span:first-child {
  background: var(--red);
}

.round-mini {
  display: grid;
  grid-template-columns: 4.2rem 1fr 2.2rem;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 950;
}

.answer-buttons {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.answer-button {
  min-height: 4.2rem;
  padding: 0.8rem;
  color: var(--cream);
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  border: 3px solid transparent;
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(7, 22, 41, 0.16);
  font-size: 1.08rem;
  font-weight: 950;
  line-height: 1.2;
  text-align: left;
}

.answer-button.selected {
  background: linear-gradient(135deg, var(--gold), #f0c74b);
  color: var(--navy);
}

.answer-button.correct,
.answer-button.correct:disabled {
  color: #ffffff;
  background: linear-gradient(135deg, #087344, #12a66a);
  border-color: #b7ffd2;
  box-shadow:
    0 0 0 3px rgba(18, 166, 106, 0.2),
    0 12px 24px rgba(8, 115, 68, 0.32);
  opacity: 1;
}

.answer-button.correct::after {
  content: "  ✓";
}

.answer-button.wrong,
.answer-button.wrong:disabled {
  color: #ffffff;
  background: linear-gradient(135deg, #9e1e1e, var(--red));
  border-color: #ffd0c9;
  box-shadow:
    0 0 0 3px rgba(198, 40, 40, 0.17),
    0 12px 24px rgba(127, 24, 24, 0.28);
  opacity: 1;
}

.answer-button.wrong::after {
  content: "  ✕";
}

.answer-button.muted,
.answer-button:disabled {
  cursor: default;
  color: #f8fbff;
  background: #697582;
  opacity: 0.72;
  transform: none;
}

.feedback {
  min-height: 3rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.35;
}

.feedback.good {
  color: #1f7d50;
}

.feedback.bad {
  color: var(--red);
}

.final-phone {
  min-height: 70vh;
  display: grid;
  align-content: center;
  text-align: center;
}

.final-phone h2 {
  color: var(--red);
  font-size: 2.4rem;
}

.final-score {
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 950;
}

.leaderboard.mini .leaderboard-row {
  grid-template-columns: 2.1rem minmax(0, 1fr) 2.6rem 2.6rem;
}

.flash-correct::after,
.flash-wrong::after {
  position: fixed;
  z-index: 100;
  inset: 0;
  content: "";
  pointer-events: none;
  animation: flashFade 420ms ease-out forwards;
}

.flash-correct::after {
  background: rgba(47, 156, 149, 0.32);
}

.flash-wrong::after {
  background: rgba(198, 40, 40, 0.32);
}

@keyframes flashFade {
  from { opacity: 1; }
  to { opacity: 0; }
}

.pulse-red {
  animation: pulseRed 520ms ease-out;
}

.pulse-black {
  animation: pulseBlack 520ms ease-out;
}

.pulse-gold,
.danger-mode {
  animation: pulseGold 620ms ease-out;
}

@keyframes pulseRed {
  0% { box-shadow: inset 0 0 0 0 rgba(198, 40, 40, 0.0); }
  40% { box-shadow: inset 0 0 0 16px rgba(198, 40, 40, 0.28); }
  100% { box-shadow: inset 0 0 0 0 rgba(198, 40, 40, 0); }
}

@keyframes pulseBlack {
  0% { box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0); }
  40% { box-shadow: inset 0 0 0 16px rgba(0, 0, 0, 0.32); }
  100% { box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0); }
}

@keyframes pulseGold {
  0% { box-shadow: inset 0 0 0 0 rgba(217, 168, 34, 0); }
  40% { box-shadow: inset 0 0 0 18px rgba(217, 168, 34, 0.32); }
  100% { box-shadow: inset 0 0 0 0 rgba(217, 168, 34, 0); }
}

@media (max-width: 1100px) {
  .host-grid,
  .game-host {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .blackboard,
  .timer-tower,
  .leaderboard-panel,
  .event-panel {
    grid-area: auto;
  }

  .timer-tower {
    grid-template-columns: 13rem 1fr;
    align-items: center;
  }
}

@media (max-width: 760px) {
  .landing-shell {
    padding: 1rem;
  }

  .hero-ticket {
    grid-template-columns: 1fr;
  }

  .ticket-main {
    padding: 1.4rem;
  }

  .ticket-main h1 {
    font-size: 2.05rem;
  }

  .hero-actions {
    display: grid;
  }

  .boarding-stub {
    border-top: 2px dashed rgba(7, 22, 41, 0.28);
    border-left: 0;
  }

  .host-header,
  .phone-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .host-header h1 {
    font-size: 1.35rem;
  }

  .split-flap {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .room-code-row strong {
    font-size: 3.2rem;
  }

  .blackboard {
    min-height: auto;
  }

  .blackboard h2 {
    font-size: 2rem;
  }

  .blackboard p {
    font-size: 1.35rem;
  }

  .timer-tower {
    grid-template-columns: 1fr;
  }

  .final-view h2 {
    font-size: 2.4rem;
  }

  .final-top .leaderboard-row {
    grid-template-columns: 2.1rem minmax(0, 1fr) 2.7rem 2.7rem;
  }

  .final-top .title {
    grid-column: 2 / -1;
  }
}
