:root {
  --ink: #263047;
  --muted: #64708b;
  --panel: #ffffff;
  --line: #d9e0ee;
  --team-one: #1597d4;
  --team-one-dark: #006fab;
  --team-two: #ff2630;
  --team-two-dark: #c80d18;
  --sun: #ffd166;
  --sky: #dff4ff;
  --grass: #d9f6cf;
  --shadow: 0 18px 40px rgba(38, 48, 71, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(90deg, rgba(38, 48, 71, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(38, 48, 71, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, #edf8ff 0%, #f8fbff 46%, #e8f4ee 100%);
  background-size: 42px 42px, 42px 42px, auto;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
}

[hidden] {
  display: none !important;
}

.game-shell {
  width: min(1440px, 100%);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding: clamp(10px, 2vw, 22px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vw, 18px);
  overflow: hidden;
}

.game-shell:has(.board:not([hidden])) {
  width: 100%;
  max-width: none;
  padding: clamp(6px, 1vw, 14px) clamp(10px, 1.2vw, 24px);
  gap: clamp(6px, 1vh, 10px);
}

.home-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 4px 18px;
}

.home-nav {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 2px solid rgba(38, 48, 71, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(38, 48, 71, 0.1);
  backdrop-filter: blur(8px);
}

.home-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 900;
  text-decoration: none;
}

.home-brand img {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.home-nav-actions,
.home-actions,
.home-proof {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.home-primary-btn,
.home-secondary-btn,
.home-link-btn {
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(38, 48, 71, 0.13);
}

.home-primary-btn {
  background: var(--sun);
}

.home-secondary-btn {
  background: #ffffff;
}

.home-link-btn {
  background: #ffffff;
}

.home-primary-btn:hover,
.home-secondary-btn:hover,
.home-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 rgba(38, 48, 71, 0.18);
}

.home-hero {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(360px, 1.06fr);
  gap: 22px;
  align-items: center;
  min-height: 460px;
  padding: clamp(18px, 3vw, 34px);
  border: 2px solid rgba(38, 48, 71, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 249, 255, 0.92)),
    linear-gradient(90deg, rgba(255, 209, 102, 0.24), rgba(47, 184, 166, 0.16));
  box-shadow: var(--shadow);
}

.home-hero-copy {
  min-width: 0;
}

.home-kicker {
  margin: 0 0 10px;
  color: var(--team-one-dark);
  font-size: .88rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.home-hero h1 {
  margin: 0;
  max-width: 680px;
  font-size: 4.6rem;
  line-height: .96;
}

.home-lede {
  max-width: 640px;
  margin: 18px 0 22px;
  color: #415067;
  font-size: 1.24rem;
  font-weight: 800;
  line-height: 1.45;
}

.home-proof {
  margin-top: 18px;
}

.home-proof span {
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #415067;
  font-weight: 900;
}

.home-visual {
  position: relative;
  min-height: 380px;
  display: grid;
  place-items: end center;
  overflow: hidden;
  border: 2px solid rgba(38, 48, 71, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #eaf8ff 0 56%, #d9f6cf 56% 100%);
}

.home-visual img {
  width: min(100%, 760px);
  height: auto;
  display: block;
}

.home-score-card {
  position: absolute;
  left: 16px;
  bottom: 16px;
  min-width: 170px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 0 rgba(38, 48, 71, 0.14);
}

.home-score-card span,
.home-score-card strong {
  display: block;
}

.home-score-card span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.home-score-card strong {
  margin: 4px 0;
  font-size: 2rem;
  line-height: 1;
}

.home-feature-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 4px 0;
}

.home-section-head h2 {
  margin: 0;
  font-size: 2rem;
}

.home-section-note {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.4;
}

.home-game-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-game-card {
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  border: 2px solid rgba(38, 48, 71, 0.16);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(38, 48, 71, 0.1);
}

.home-game-card.math-card {
  background: linear-gradient(180deg, #fff7d9, #ffffff);
}

.home-game-card.english-card {
  background: linear-gradient(180deg, #dff4ff, #ffffff);
}

.home-game-card.memory-card {
  background: linear-gradient(180deg, #e7fbf3, #ffffff);
}

.home-game-icon {
  width: 72px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(38, 48, 71, 0.14);
}

.home-game-card h3 {
  margin: 0;
  font-size: 1.55rem;
}

.home-game-card p {
  margin: 0;
  color: #46566c;
  font-weight: 800;
  line-height: 1.45;
}

.home-game-action {
  align-self: end;
  min-height: 46px;
  margin-top: auto;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(38, 48, 71, 0.18);
}

.home-game-action:hover {
  transform: translateY(-2px);
}

.home-feature-grid article {
  min-height: 178px;
  padding: 18px;
  border: 2px solid rgba(38, 48, 71, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 24px rgba(38, 48, 71, 0.08);
}

.home-feature-grid span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #ffefb0;
  font-weight: 900;
}

.home-feature-grid h2 {
  margin: 12px 0 8px;
  font-size: 1.25rem;
}

.home-feature-grid p {
  margin: 0;
  color: #4c5d73;
  font-weight: 800;
  line-height: 1.45;
}

.app-release-home {
  gap: 24px;
  padding: 0 0 24px;
  color: #172033;
}

.app-release-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.app-release-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #172033;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
}

.app-release-brand img {
  width: 44px;
  height: 44px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.app-release-nav-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.app-release-nav-actions a,
.app-release-nav-actions button,
.app-release-actions button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: none;
}

.app-release-nav-actions a {
  color: #475569;
}

.app-release-nav-actions a:hover {
  background: #f1f5f9;
}

.app-release-login,
.app-release-secondary {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.app-release-primary {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.app-release-primary:hover {
  background: #1d4ed8;
}

.app-release-large {
  min-height: 50px;
  padding-inline: 24px;
  border-radius: 16px;
  font-size: 1rem;
}

.app-release-hero {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
  gap: 40px;
  align-items: center;
  overflow: hidden;
  padding: clamp(36px, 5vw, 64px) clamp(18px, 4vw, 42px);
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 24px 60px rgba(23, 32, 51, 0.10);
}

.app-release-hero > * {
  position: relative;
  z-index: 1;
}

.app-release-pill {
  width: fit-content;
  margin: 0 0 18px;
  padding: 5px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.88rem;
  font-weight: 900;
}

.app-release-hero h1 {
  max-width: 720px;
  margin: 0;
  color: #020617;
  font-size: clamp(3.2rem, 6vw, 6.3rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.app-release-lede {
  max-width: 660px;
  margin: 24px 0 0;
  color: #475569;
  font-size: 1.13rem;
  font-weight: 700;
  line-height: 1.7;
}

.app-release-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.app-release-free-tag {
  width: fit-content;
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px solid #a7f3d0;
  border-radius: 16px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.92rem;
  font-weight: 900;
}

.app-release-ai-rail {
  max-width: 680px;
  margin-top: 24px;
}

.app-release-stats {
  max-width: 580px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 34px 0 0;
}

.app-release-stats div {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}

.app-release-stats dt {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.app-release-stats dd {
  margin: 4px 0 0;
  color: #020617;
  font-size: 1.45rem;
  font-weight: 900;
}

.app-release-visual {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  display: grid;
  align-items: end;
  border: 1px solid #e2e8f0;
  border-radius: 32px;
  background: linear-gradient(180deg, #eff6ff, #d1fae5);
  box-shadow: 0 24px 60px rgba(23, 32, 51, 0.14);
}

.app-release-visual img {
  width: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: center;
}

.app-release-score-card {
  position: absolute;
  left: 20px;
  bottom: 20px;
  max-width: min(320px, calc(100% - 40px));
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(10px);
}

.app-release-score-card p,
.app-release-score-card span {
  margin: 0;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 900;
}

.app-release-score-card strong {
  display: block;
  margin: 4px 0;
  color: #020617;
  font-size: 1.8rem;
  line-height: 1;
}

.app-release-builder-band,
.app-release-section-head {
  display: grid;
  gap: 22px;
  padding: 24px;
  border: 1px solid #bfdbfe;
  border-radius: 32px;
  background: #eff6ff;
}

.app-release-builder-band {
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  align-items: center;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.app-release-kicker {
  margin: 0;
  color: #1d4ed8;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.app-release-builder-band h2,
.app-release-section-head h2 {
  margin: 8px 0 0;
  color: #020617;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.05;
}

.app-release-builder-band p,
.app-release-section-head p,
.app-release-game-grid p {
  margin: 12px 0 0;
  color: #475569;
  font-weight: 700;
  line-height: 1.65;
}

.app-release-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.app-release-mini-grid article,
.app-release-game-grid article {
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.app-release-mini-grid article {
  padding: 20px;
}

.app-release-mini-grid strong {
  display: block;
  color: #1d4ed8;
  font-weight: 900;
}

.app-release-mini-grid span {
  display: block;
  margin-top: 8px;
  color: #475569;
  font-weight: 700;
  line-height: 1.45;
}

.app-release-section-head {
  grid-template-columns: minmax(0, 0.85fr) minmax(260px, 0.55fr);
  align-items: end;
  border-color: transparent;
  background: transparent;
  padding: 8px 2px 0;
}

.app-release-game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.app-release-game-grid article {
  min-height: 290px;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 24px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.app-release-game-grid article:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.app-release-game-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 1.1rem;
  font-weight: 900;
}

.app-release-sun {
  background: #fef3c7;
  color: #78350f;
}

.app-release-blue {
  background: #dbeafe;
  color: #1e3a8a;
}

.app-release-green {
  background: #d1fae5;
  color: #064e3b;
}

.app-release-game-grid h3 {
  margin: 0;
  color: #020617;
  font-size: 1.35rem;
}

.app-release-game-grid button {
  align-self: end;
  min-height: 46px;
  margin-top: auto;
  border-radius: 14px;
  background: #172033;
  color: #fff;
  font-weight: 900;
}

.game-header,
.game-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.game-header {
  padding: 8px 10px;
  border: 3px solid rgba(38, 48, 71, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(3px);
}

.game-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.game-selection {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  grid-template-areas: "profile games";
  gap: clamp(10px, 1.4vw, 18px);
  align-items: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.profile-strip {
  grid-area: profile;
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 7px 0 rgba(38, 48, 71, 0.12);
}

.profile-avatar {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--sun);
  font-size: 2.2rem;
  font-weight: 900;
}

.profile-strip strong,
.profile-strip span {
  display: block;
}

.profile-strip strong {
  font-size: clamp(1.15rem, 2.6vw, 1.65rem);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.profile-strip span {
  color: var(--muted);
  font-weight: 900;
}

.profile-copy {
  min-width: 0;
}

.profile-label {
  margin-bottom: 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.profile-status {
  padding: 9px 12px;
  border: 3px dashed var(--line);
  border-radius: 8px;
  background: #fff8e8;
}

.profile-status span {
  font-size: 0.75rem;
  text-transform: uppercase;
}

.profile-status strong {
  font-size: 1rem;
}

.profile-referral {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #f3fbff;
  min-width: 0;
}

.profile-referral span {
  font-size: 0.75rem;
  text-transform: uppercase;
}

.profile-referral-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.profile-referral input {
  min-width: 0;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-referral button {
  min-height: 44px;
  width: 100%;
  padding: 0 14px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 3px 0 rgba(38, 48, 71, 0.18);
}

.profile-referral small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.logout-btn {
  min-height: 48px;
  padding: 0 14px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(38, 48, 71, 0.18);
}

.game-menu {
  grid-area: games;
}

.student-screen {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 36px) 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  isolation: isolate;
}

.student-screen::before,
.student-screen::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.student-screen::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(223, 244, 255, 0.5)),
    repeating-linear-gradient(90deg, rgba(38, 48, 71, 0.04) 0 1px, transparent 1px 42px);
  animation: wallpaperDrift 16s ease-in-out infinite alternate;
}

.student-screen::after {
  background:
    linear-gradient(110deg, transparent 0 38%, rgba(255, 255, 255, 0.26) 42%, transparent 48%),
    repeating-linear-gradient(0deg, rgba(38, 48, 71, 0.025) 0 1px, transparent 1px 38px);
  transform: translateX(-14%);
  animation: wallpaperShine 9s ease-in-out infinite;
}

.student-card {
  width: min(560px, 100%);
  padding: clamp(18px, 4vw, 32px);
  border: 3px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(white, white) padding-box,
    linear-gradient(135deg, var(--sun), var(--team-one), var(--team-two)) border-box;
  border-color: transparent;
  box-shadow: 0 24px 54px rgba(38, 48, 71, 0.18);
  position: relative;
  z-index: 1;
}

.auth-card {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(18px, 3vw, 28px);
  align-items: stretch;
}

.auth-intro {
  min-height: 100%;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(236, 253, 245, 0.94));
  overflow: hidden;
}

.auth-intro h2 {
  margin: 14px 0 14px;
  color: #0f172a;
  font-size: clamp(2.45rem, 4.5vw, 4.5rem);
  letter-spacing: 0;
  line-height: 0.98;
}

.auth-intro p:not(.eyebrow) {
  margin: 0;
  color: #475569;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.65;
}

.auth-page {
  align-content: center;
  gap: clamp(16px, 3vw, 28px);
  padding: clamp(10px, 2vw, 22px);
}

.student-screen.auth-page::before {
  animation: aiGridRun 22s linear infinite;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.08) 1px, transparent 1px),
    linear-gradient(115deg, transparent 0 42%, rgba(251, 191, 36, 0.12) 42% 43%, transparent 43% 100%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 54%, #eef6ff 100%);
  background-size: 48px 48px, 48px 48px, 160px 160px, auto;
  opacity: 1;
  transform: none;
}

.student-screen.auth-page::after {
  background: linear-gradient(110deg, transparent 0 38%, rgba(255, 255, 255, 0.42) 42%, transparent 48%);
  opacity: 0.8;
}

.auth-page-nav {
  width: min(1120px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 2;
}

.auth-page-brand,
.auth-page-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-page-brand {
  min-width: 0;
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 900;
  text-decoration: none;
}

.auth-page-brand img {
  width: 44px;
  height: 44px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 4px;
}

.auth-page-link,
.auth-page-primary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border-radius: 14px;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: none;
}

.auth-page-link {
  border: 1px solid #cbd5e1;
  background: #fff;
}

.auth-page-primary {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.auth-card.student-card {
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(14px);
}

.auth-card.student-card::before {
  content: "AI";
  top: 18px;
  right: 18px;
  border: 0;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
}

.auth-pill {
  width: fit-content;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.86rem;
  font-weight: 900;
}

.auth-visual {
  min-height: 230px;
  margin-top: 24px;
  display: grid;
  place-items: end center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 24px;
  background: linear-gradient(180deg, #eaf8ff 0 56%, #d9f6cf 56% 100%);
}

.auth-visual img {
  width: min(100%, 520px);
  display: block;
}

.auth-score-card {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: min(230px, calc(100% - 28px));
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.auth-score-card span,
.auth-score-card small {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-score-card strong {
  display: block;
  margin: 4px 0;
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 900;
}

.auth-ai-rail {
  margin-top: 18px;
}

.auth-form-card {
  min-width: 0;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 28px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.auth-form-card .eyebrow {
  color: #2563eb;
}

.auth-form-card .player-panel h2 {
  margin: 8px 0 18px;
  color: #0f172a;
  font-size: clamp(2rem, 4vw, 3rem);
}

.auth-form-card .login-tabs {
  padding: 5px;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: #f8fafc;
}

.auth-form-card .login-tab {
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  color: #64748b;
}

.auth-form-card .login-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.auth-form-card label {
  color: #475569;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.auth-field-hint {
  margin: -6px 0 14px;
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.4;
}

.auth-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.4;
}

.auth-error.is-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.auth-error.is-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.phone-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.32fr) minmax(0, 1fr);
  gap: 10px;
}

.phone-row label {
  min-width: 0;
}

.auth-location-btn {
  width: 100%;
  min-height: 44px;
  margin: -4px 0 14px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.95rem;
  font-weight: 900;
}

.auth-location-btn:hover {
  background: #dbeafe;
}

.auth-form-card input,
.auth-form-card select {
  width: 100%;
  min-height: 56px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.auth-form-card input:focus,
.auth-form-card select:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

.auth-form-card .start-btn,
.auth-form-card .secondary-profile-btn {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  box-shadow: none;
  font-size: 1rem;
}

.auth-form-card .start-btn {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

.auth-form-card .start-btn.is-loading {
  position: relative;
  color: transparent;
}

.auth-form-card .start-btn.is-loading::after {
  content: attr(data-loading-label);
  color: #fff;
  inset: 0;
  display: grid;
  place-items: center;
  position: absolute;
}

.auth-form-card .start-btn.is-loading::before {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  display: inline-block;
  animation: authSpin 800ms linear infinite;
  vertical-align: middle;
}

@keyframes authSpin {
  to {
    transform: rotate(360deg);
  }
}

.auth-form-card .secondary-profile-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
}

.auth-form-card .auth-text-btn {
  min-height: 42px;
  margin-top: 10px;
  border: 0;
  color: #2563eb;
  box-shadow: none;
}

.auth-step-line {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.auth-step-line span {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #10b981);
}

.auth-form-card .server-note {
  margin-top: 18px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #f8fafc;
}

.bio-card {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.12);
}

.bio-card::before {
  display: none;
}

.bio-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(280px, 1.14fr);
  grid-template-areas:
    "pill art"
    "title art"
    "copy art"
    "points points";
  gap: 14px 24px;
  align-items: center;
  min-height: 0;
  padding: clamp(18px, 3vw, 28px);
  border-bottom: 1px solid #e2e8f0;
  background:
    linear-gradient(90deg, rgba(14, 165, 233, 0.13) 1px, transparent 1px),
    linear-gradient(180deg, rgba(14, 165, 233, 0.13) 1px, transparent 1px),
    linear-gradient(135deg, #f8fcff, #fff7ed);
  background-size: 48px 48px, 48px 48px, auto;
  color: #0f172a;
  overflow: hidden;
}

.bio-hero h2 {
  grid-area: title;
  max-width: 430px;
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.85rem, 3vw, 2.7rem);
  line-height: 1.05;
}

.bio-hero p:not(.auth-pill) {
  grid-area: copy;
  max-width: 470px;
  margin: 0;
  color: #475569;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.55;
}

.bio-hero .auth-pill {
  grid-area: pill;
  width: fit-content;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.bio-hero-art {
  grid-area: art;
  position: relative;
  min-height: clamp(180px, 22vw, 260px);
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(14, 165, 233, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, rgba(14, 165, 233, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 242, 254, 0.92), #fff 48%, rgba(255, 237, 213, 0.78));
  background-size: 50px 50px, 50px 50px, auto;
  overflow: hidden;
  box-shadow: inset 0 0 28px rgba(15, 23, 42, 0.08);
}

.bio-hero-art::after {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: 50%;
  border-left: 5px dashed rgba(71, 85, 105, 0.9);
  transform: translateX(-50%);
}

.bio-hero-art img {
  position: relative;
  z-index: 1;
  width: min(104%, 590px);
  max-width: none;
  object-fit: contain;
  transform: translateY(8px);
}

.bio-hero-points {
  grid-area: points;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.bio-hero-points span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: #334155;
  font-weight: 900;
}

.bio-hero-points span::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #facc15;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.18);
}

.bio-form {
  padding: clamp(20px, 3vw, 30px);
}

.bio-section-head {
  margin-bottom: 18px;
}

.bio-section-head h3 {
  margin: 6px 0 0;
  color: #0f172a;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.12;
}

.bio-form label,
.bio-label {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.bio-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  padding: 10px 14px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.bio-form input:focus {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  border-color: #2563eb;
  background: #fff;
}

.bio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.bio-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bio-choice-group {
  margin-bottom: 4px;
}

.bio-option-card {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  font-weight: 900;
  text-align: left;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.bio-option-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.bio-option-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 950;
}

.bio-option-card.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #2563eb, 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.bio-form .start-btn {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

.student-card::before {
  content: "ABC";
  position: absolute;
  top: -22px;
  right: 18px;
  padding: 8px 12px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--sun);
  font-weight: 900;
}

@keyframes wallpaperDrift {
  0% {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }

  50% {
    transform: translate3d(1.5%, 1%, 0) scale(1.03);
  }

  100% {
    transform: translate3d(-1%, 1.5%, 0) scale(1.01);
  }
}

@keyframes wallpaperShine {
  0% {
    transform: translateX(-28%);
    opacity: 0.25;
  }

  50% {
    opacity: 0.55;
  }

  100% {
    transform: translateX(28%);
    opacity: 0.25;
  }
}

.student-card h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

.run-mode-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px);
}

.run-mode-card {
  width: min(520px, 100%);
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid #dbe3ef;
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(16, 185, 129, 0.06) 1px, transparent 1px),
    #fff;
  background-size: 38px 38px, 38px 38px, auto;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
}

.run-mode-card h2 {
  margin: 4px 0 8px;
  color: #0f172a;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.02;
  text-transform: none;
  text-shadow: none;
}

.run-mode-copy {
  margin: 0 0 18px;
  color: #475569;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.5;
}

.run-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.run-mode-option {
  min-height: 128px;
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  text-align: left;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.run-mode-option:first-child {
  background: #fff8e8;
}

.run-mode-option:last-child {
  background: #eff6ff;
}

.run-mode-option:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
}

.run-mode-option strong {
  color: #0f172a;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 950;
}

.run-mode-option span {
  color: #475569;
  font-weight: 850;
  line-height: 1.3;
}

.student-card label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.student-card input {
  width: 100%;
  min-height: 62px;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 900;
}

.server-note-text {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.student-card .start-btn {
  width: 100%;
  margin-top: 8px;
}

#bio-screen {
  align-content: center;
  padding-block: clamp(18px, 4vw, 44px);
}

#bio-screen .bio-hero h2 {
  max-width: 430px;
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.85rem, 3vw, 2.7rem);
  line-height: 1.05;
}

#bio-screen .bio-form label,
#bio-screen .bio-label {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

#bio-screen .bio-form input {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

#bio-screen .bio-form input:focus {
  border-color: #2563eb;
  background: #fff;
  outline: 3px solid rgba(37, 99, 235, 0.16);
}

#bio-screen .bio-form .start-btn {
  min-height: 54px;
  margin-top: 4px;
  border: 0;
  border-radius: 14px;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

#bio-screen .bio-card {
  width: min(980px, calc(100% - 28px));
  border-radius: 18px;
  background: #fff;
}

#bio-screen .bio-hero {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  grid-template-areas:
    "pill art"
    "title art"
    "copy art";
  gap: 10px 22px;
  padding: 22px;
  background: linear-gradient(135deg, #f8fafc, #eff6ff);
}

#bio-screen .bio-hero-art {
  height: clamp(240px, 24vw, 310px);
  min-height: 240px;
  max-height: none;
  border-radius: 16px;
  background: #fff;
}

#bio-screen .bio-hero-art::after {
  display: none;
}

#bio-screen .bio-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
}

#bio-screen .bio-hero-points {
  display: none;
}

#bio-screen .bio-form {
  padding: 24px;
}

#bio-screen .bio-section-head {
  margin-bottom: 16px;
}

#bio-screen .bio-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#bio-screen .bio-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#bio-screen .bio-option-card {
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 12px;
}

#bio-screen .bio-option-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
}

#bio-screen .bio-student-details {
  margin: 4px 0 16px;
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #f8fafc;
}

#bio-screen .bio-student-details .bio-grid {
  margin-bottom: 0;
}

#bio-screen .bio-feedback {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.4;
}

#bio-screen .bio-feedback.is-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

#bio-screen .bio-feedback.is-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.login-tab {
  min-height: 48px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(38, 48, 71, 0.18);
}

.login-tab.active {
  background: var(--sun);
}

.player-panel h2 {
  margin-bottom: 18px;
}

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.wizard-progress span {
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
}

.wizard-progress span.active {
  background: var(--team-two);
}

.wizard-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.wizard-actions #continue-btn {
  grid-column: 1 / -1;
}

.secondary-profile-btn {
  width: 100%;
  min-height: 48px;
  margin: 8px 0 0;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #eef3fb;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(38, 48, 71, 0.18);
}

.server-note {
  display: grid;
  gap: 4px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff8e8;
}

.server-note span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.server-note strong {
  font-size: 1rem;
}

.server-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 0 rgba(38, 48, 71, 0.12);
}

.server-panel strong {
  display: block;
  font-size: 1.15rem;
}

.server-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.server-actions button {
  min-height: 44px;
  padding: 0 14px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(38, 48, 71, 0.18);
}

.menu-card {
  min-height: 168px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  box-shadow: 0 5px 0 rgba(38, 48, 71, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease;
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: end;
}

.menu-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
}

.game-icon {
  position: absolute;
  top: 12px;
  left: 14px;
  min-width: 64px;
  min-height: 54px;
  display: grid !important;
  place-items: center;
  padding: 6px 10px;
  border: 3px solid rgba(38, 48, 71, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink) !important;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 900;
}

.menu-card:nth-child(1) {
  background: #fff3bf;
}

.menu-card:nth-child(2) {
  background: #dff4ff;
}

.menu-card:nth-child(3) {
  background: #ffe3d8;
}

.menu-card:nth-child(4) {
  background: #e5ffd9;
}

.menu-card:nth-child(5) {
  background: #f1edff;
}

.menu-card:nth-child(6) {
  background: #ecfff5;
}

.menu-card:nth-child(7) {
  background: #fff8e8;
}

.menu-card:nth-child(8) {
  background: #eaf7ff;
}

.menu-card:nth-child(9) {
  background: #ecfff5;
}

.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(38, 48, 71, 0.18);
}

.menu-card strong,
.menu-card span {
  display: block;
}

.menu-card strong {
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 900;
  line-height: 1.02;
  position: relative;
  z-index: 1;
}

.menu-card span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.menu-card .game-icon {
  margin-top: 0;
}

.menu-card.active {
  background: var(--sun);
  outline: 4px solid rgba(255, 122, 89, 0.34);
}

.game-selection {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0;
  background: #f8fafc;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.profile-strip {
  position: static;
  height: 100%;
  align-content: start;
  gap: 18px;
  padding: 18px;
  border: 0;
  border-right: 1px solid #e2e8f0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.profile-avatar {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: none;
}

.profile-label {
  color: #64748b !important;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.profile-strip strong {
  color: #0f172a;
  font-size: 1.05rem;
  line-height: 1.25;
}

.profile-strip span {
  color: #64748b;
}

.profile-status {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.profile-status span {
  color: #64748b;
  letter-spacing: 0.04em;
}

.profile-status strong {
  color: #0f172a;
  font-size: 0.92rem;
  line-height: 1.4;
}

.logout-btn {
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.game-menu {
  height: 100%;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding: 18px;
}

.game-menu::before {
  display: none;
}

.game-menu::after {
  display: none;
}

.workspace-section-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 2px;
  border-bottom: 1px solid #e2e8f0;
}

.workspace-section-head span {
  color: #2563eb;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-section-head strong {
  color: #0f172a;
  font-size: 1.12rem;
  font-weight: 900;
}

.workspace-featured-head {
  padding-top: 0;
}

.workspace-custom-game-head span {
  color: #059669;
}

.workspace-presentation-head span {
  color: #be123c;
}

.workspace-my-own-head span {
  color: #7c3aed;
}

.workspace-empty-card {
  min-height: 118px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 12px;
  row-gap: 4px;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #fff;
}

.workspace-empty-card strong,
.workspace-empty-card span {
  display: block;
}

.workspace-empty-card strong {
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.2;
}

.workspace-empty-card > span:not(.game-icon) {
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.menu-card {
  min-height: 118px;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 12px;
  row-gap: 4px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.menu-card::after {
  display: none;
}

.game-icon {
  position: static;
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: #eef2ff;
  color: #3730a3 !important;
  font-size: 0.8rem;
  box-shadow: none;
}

.menu-card:nth-child(n) {
  background: #fff;
}

.menu-card:hover {
  transform: none;
  border-color: #bfdbfe;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.menu-card strong {
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.2;
}

.menu-card span {
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.menu-card.active {
  background: #eff6ff;
  outline: 0;
  border-color: #93c5fd;
  box-shadow: inset 3px 0 0 #2563eb;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: #006fab;
  font-size: clamp(2.3rem, 6vw, 4.8rem);
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: 0 4px 18px rgba(0, 111, 171, 0.28);
}

.timer-box {
  min-width: 132px;
  padding: 12px 16px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--sun);
  text-align: center;
  box-shadow: 6px 6px 0 rgba(38, 48, 71, 0.16);
}

.timer-box strong {
  font-variant-numeric: tabular-nums;
}

.timer-box span {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

.timer-box strong {
  display: block;
  font-size: 1.8rem;
}

.board {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 0.68fr) minmax(560px, 1.9fr) minmax(240px, 0.68fr);
  grid-template-areas: "team-one race team-two";
  gap: clamp(12px, 1.6vw, 24px);
  align-items: stretch;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(76px, 9vh, 104px) 4px 0 0;
}

.game-shell:has(.board:not([hidden])) .board {
  grid-template-columns: clamp(270px, 17vw, 340px) minmax(620px, 1fr) clamp(270px, 17vw, 340px);
  gap: clamp(14px, 1.35vw, 28px);
  overflow: hidden;
  padding: clamp(58px, 7.8vh, 76px) 0 0;
}

body[data-mode="math"] .board::before {
  content: "TUG OF WAR, MATHEMATICS";
  position: absolute;
  top: clamp(12px, 2vh, 22px);
  left: 50%;
  width: min(760px, 90%);
  color: #006fab;
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  transform: translateX(-50%);
  text-shadow: 0 6px 22px rgba(0, 111, 171, 0.3);
  pointer-events: none;
}

.game-shell:has(.board:not([hidden])) body[data-mode="math"] .board::before {
  width: min(920px, 76%);
}

.team-panel,
.race-panel {
  min-height: 0;
  border: 1px solid rgba(0, 111, 171, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 26px 70px rgba(0, 60, 90, 0.18), inset 0 0 28px rgba(255, 255, 255, 0.82);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.team-panel {
  padding: 0 clamp(14px, 1.5vw, 20px) clamp(14px, 1.5vw, 20px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: clamp(8px, 1vw, 14px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.team-one {
  grid-area: team-one;
}

.team-two {
  grid-area: team-two;
}

.team-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 calc(clamp(14px, 1.5vw, 20px) * -1) clamp(12px, 1.4vw, 18px);
  padding: clamp(12px, 1.5vw, 18px) clamp(16px, 1.8vw, 22px);
  color: #fff;
  min-width: 0;
}

.team-one .team-title {
  background: linear-gradient(180deg, #1ba9e8, #008bd0);
}

.team-two .team-title {
  background: linear-gradient(180deg, #ff3440, #f01623);
}

.team-title h2 {
  margin-bottom: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  overflow-wrap: anywhere;
}

.team-badge {
  width: clamp(32px, 3vw, 42px);
  height: clamp(32px, 3vw, 42px);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: #fff !important;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 900;
}

.team-one .team-badge,
.team-one .submit-btn {
  color: var(--team-one-dark);
  background: var(--team-one);
}

.team-two .team-badge,
.team-two .submit-btn {
  color: var(--team-two-dark);
  background: var(--team-two);
}

.question-card {
  padding: clamp(10px, 1.3vw, 16px);
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(0, 111, 171, 0.18), 0 10px 32px rgba(0, 60, 90, 0.08);
}

.question-card[data-kind="picture"],
.question-card[data-kind="memory"] {
  background: #fff8e8;
}

.question-card[data-kind="balloon"] {
  background: #eaf7ff;
}

.question-card[data-kind="missing"] {
  background: #f1edff;
}

.question-card[data-kind="counting"] {
  background: #ecfff5;
}

.question-card p {
  display: none;
}

.question-card strong {
  display: block;
  font-size: clamp(2rem, 3.6vw, 3.05rem);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.team-one .question-card strong {
  color: var(--team-one-dark);
}

.team-two .question-card strong {
  color: var(--team-two-dark);
}

.answer-display {
  min-height: clamp(52px, 8vh, 70px);
  padding: clamp(6px, 1vw, 12px);
  border: 1px solid rgba(0, 111, 171, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  font-size: clamp(1.6rem, 3.6vw, 2.35rem);
  font-weight: 900;
  text-align: center;
  box-shadow: inset 0 0 18px rgba(0, 111, 171, 0.06);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(52px, 1fr));
  gap: clamp(6px, 0.8vw, 10px);
  min-height: 232px;
  position: relative;
  z-index: 1;
}

.keypad button:nth-child(10) {
  grid-column: 2;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.option-grid[data-kind="memory"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.keypad button,
.option-grid button,
.panel-actions button,
.start-btn,
.restart-btn {
  min-height: clamp(46px, 6.8vh, 64px);
  border: 1px solid rgba(0, 111, 171, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 900;
  box-shadow: 0 9px 22px rgba(0, 60, 90, 0.08);
  white-space: pre-line;
  overflow-wrap: anywhere;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.keypad button:hover,
.option-grid button:hover,
.panel-actions button:hover,
.start-btn:hover,
.restart-btn:hover {
  filter: brightness(1.04);
}

.option-grid[data-kind="picture"] button {
  min-height: 68px;
  background: #fff8e8;
}

.balloon-option {
  min-height: 92px !important;
  border-radius: 999px 999px 72px 72px !important;
  background: #ff7a59 !important;
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 2.4rem) !important;
  line-height: 1.05;
  position: relative;
}

.balloon-option::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 16px;
  height: 16px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 14px solid #ff7a59;
  transform: translateX(-50%);
}

.letter-option,
.number-option,
.memory-card {
  min-height: 76px !important;
  font-size: clamp(1.7rem, 4vw, 2.6rem) !important;
}

.letter-option {
  background: #f1edff !important;
}

.number-option {
  background: #ecfff5 !important;
}

.memory-card {
  min-height: 92px !important;
  background: #fff !important;
  font-size: clamp(2rem, 5vw, 3rem) !important;
}

.keypad button:active,
.option-grid button:active,
.panel-actions button:active,
.start-btn:active,
.restart-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(38, 48, 71, 0.2);
}

.panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(6px, 0.8vw, 10px);
  margin-top: 0;
  position: relative;
  z-index: 2;
}

.panel-actions .secondary-btn {
  background: #ff2630;
  color: #fff;
  border-color: #d90f19;
}

.panel-actions .submit-btn {
  color: #fff;
  background: #1597d4 !important;
  border-color: #0078b8;
}

[hidden] {
  display: none !important;
}

.race-panel {
  grid-area: race;
  padding: clamp(8px, 1vw, 14px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(8px, 1.3vw, 18px);
  background:
    radial-gradient(circle at 30% 60%, rgba(0, 145, 214, 0.18), transparent 34%),
    radial-gradient(circle at 72% 58%, rgba(255, 38, 48, 0.18), transparent 34%),
    rgba(255, 255, 255, 0.62);
}

.adventure-game {
  flex: 1;
  min-height: 0;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2vw, 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.custom-games-screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.custom-games-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 0.65fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: start;
}

.custom-game-form,
.custom-game-preview {
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: clamp(16px, 2vw, 24px);
}

.custom-game-form h2,
.custom-game-preview h3 {
  margin-bottom: 16px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.custom-game-wizard-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.custom-game-wizard-progress span {
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(38, 48, 71, 0.12);
}

.custom-game-wizard-progress span.active {
  background: var(--sun);
  color: var(--ink);
}

.custom-game-wizard-progress span.skipped {
  opacity: 0.38;
}

.custom-game-wizard-step {
  min-height: 250px;
}

.custom-game-form label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.custom-game-form input,
.custom-game-form textarea {
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
}

.custom-game-form input {
  min-height: 56px;
  padding: 10px 14px;
}

.custom-game-form textarea {
  min-height: 220px;
  padding: 12px 14px;
  line-height: 1.35;
  resize: vertical;
}

.custom-team-name-grid,
.custom-game-idea-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.custom-game-idea-grid label:last-child {
  max-width: 180px;
}

.custom-game-type {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.custom-game-type legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.custom-game-type label {
  margin: 0;
}

.custom-game-type input {
  position: absolute;
  width: auto;
  min-height: 0;
  opacity: 0;
  border: 0;
  pointer-events: none;
}

.custom-game-type span {
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
  box-shadow: 0 5px 0 rgba(38, 48, 71, 0.14);
  cursor: pointer;
}

.custom-game-type input:checked + span {
  background: var(--sun);
  transform: translateY(2px);
  box-shadow: 0 3px 0 rgba(38, 48, 71, 0.18);
}

.custom-game-type input:focus-visible + span {
  outline: 4px solid rgba(21, 151, 212, 0.28);
  outline-offset: 3px;
}

.custom-presentation-export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.custom-presentation-export-actions .custom-game-secondary-link {
  width: 100%;
}

.presentation-fullscreen-viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #07111f;
}

.presentation-fullscreen-viewer[hidden] {
  display: none;
}

.presentation-fullscreen-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #0f172a;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.presentation-fullscreen-toolbar div {
  display: flex;
  gap: 8px;
}

.presentation-fullscreen-toolbar a,
.presentation-fullscreen-toolbar button {
  min-height: 38px;
  padding: 8px 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.presentation-fullscreen-viewer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.custom-game-rules {
  margin: 0 0 14px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink);
}

.custom-game-rules summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}

.custom-game-rules ul {
  margin: 0;
  padding: 0 18px 14px 34px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.custom-game-rules li + li {
  margin-top: 6px;
}

.custom-game-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.custom-game-actions .start-btn,
.custom-game-actions .restart-btn {
  min-width: 0;
}

.custom-game-preview {
  position: sticky;
  top: 0;
  display: grid;
  gap: 12px;
}

.custom-game-preview p:not(.eyebrow) {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.custom-game-link {
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  box-shadow: 0 5px 0 rgba(38, 48, 71, 0.18);
}

.custom-game-credit-status {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 8px 12px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #eaf7ff;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}

.custom-game-secondary-link {
  min-height: 44px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(38, 48, 71, 0.14);
}

.custom-saved-games {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 3px solid rgba(38, 48, 71, 0.14);
}

.custom-game-saved-list {
  display: grid;
  gap: 10px;
}

.custom-game-saved-list > p {
  margin: 0;
}

.custom-game-saved-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
}

.custom-game-saved-item strong {
  font-size: 1.05rem;
}

.custom-game-saved-item span {
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.custom-game-saved-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.custom-game-saved-actions a,
.custom-game-saved-actions button {
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--sun);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.custom-game-saved-actions button {
  background: #fff;
}

.custom-game-code-output {
  display: grid;
  gap: 12px;
}

.custom-game-code-output label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.custom-game-code-output textarea {
  width: 100%;
  min-height: 128px;
  padding: 10px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: #f8fbff;
  font: 800 0.82rem/1.35 Consolas, "Courier New", monospace;
  resize: vertical;
}

.custom-games-screen {
  padding: 0;
  background: #f8fafc;
}

.custom-games-layout {
  min-height: 100%;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 0;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.custom-game-form,
.custom-game-preview {
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.custom-game-form {
  min-width: 0;
  padding: 22px;
}

.custom-game-preview {
  top: 0;
  align-content: start;
  min-height: 100%;
  padding: 22px;
  border-left: 1px solid #e2e8f0;
  background: #f8fafc;
}

.custom-game-form > .eyebrow,
.custom-game-preview > .eyebrow {
  color: #2563eb;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

.custom-game-form h2,
.custom-game-preview h3 {
  margin-bottom: 16px;
  color: #0f172a;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.18;
  text-transform: none;
  text-shadow: none;
}

.custom-game-wizard-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.custom-game-wizard-progress span {
  min-height: 32px;
  flex: 1 1 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  box-shadow: none;
  font-size: 0.86rem;
}

.custom-game-wizard-progress span.active {
  background: #2563eb;
  color: #fff;
}

.custom-game-wizard-step {
  min-height: 220px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.custom-game-form label {
  gap: 7px;
  margin-bottom: 13px;
  color: #475569;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.custom-game-form input,
.custom-game-form textarea,
.custom-game-form select {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 0.96rem;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.custom-game-form input {
  min-height: 44px;
}

.custom-game-form textarea {
  min-height: 180px;
}

.custom-game-pdf-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 4px 0 16px;
}

.custom-game-pdf-tool label {
  margin-bottom: 0;
}

.custom-game-pdf-tool input[type="file"] {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 8px;
  background: #f8fafc;
  cursor: pointer;
}

.custom-game-pdf-tool input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 12px;
  border: 0;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 7px 12px;
  cursor: pointer;
}

.custom-game-pdf-tool .custom-game-secondary-link {
  min-width: 126px;
  min-height: 52px;
  align-self: end;
}

.custom-game-check {
  display: flex !important;
  align-items: flex-start;
  gap: 10px !important;
  margin: 14px 0 0 !important;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a !important;
  font-size: 0.92rem !important;
  line-height: 1.35;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.custom-game-check input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: #2563eb;
  box-shadow: none;
}

.custom-game-check span {
  display: block;
  font-weight: 800;
}

.custom-game-form input:focus,
.custom-game-form textarea:focus,
.custom-game-form select:focus {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  border-color: #2563eb;
}

.custom-game-type {
  gap: 8px;
}

.custom-game-type legend {
  color: #475569;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.custom-game-type span {
  min-height: 48px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  color: #0f172a;
}

.custom-game-type input:checked + span {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  transform: none;
  box-shadow: inset 3px 0 0 #2563eb;
}

.custom-game-rules {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.custom-game-rules summary {
  min-height: 42px;
  color: #0f172a;
}

.custom-game-actions {
  margin-top: 14px;
  grid-template-columns: auto auto 1fr;
}

.custom-game-actions .restart-btn,
.custom-game-actions .start-btn,
.custom-game-secondary-link {
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: none;
}

.custom-game-actions .start-btn,
.custom-game-link {
  background: #2563eb;
  color: #fff;
}

.custom-game-actions .restart-btn,
.custom-game-secondary-link {
  background: #fff;
  color: #0f172a;
}

.custom-game-link,
.custom-game-credit-status {
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: none;
}

.custom-game-link {
  border-color: #2563eb;
}

.custom-game-credit-status {
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.88rem;
}

.custom-saved-games {
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.custom-game-saved-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.custom-game-saved-actions a,
.custom-game-saved-actions button {
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #eff6ff;
  color: #1d4ed8;
}

.custom-game-saved-actions button {
  background: #fff;
  color: #0f172a;
}

.custom-game-code-output textarea {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-weight: 700;
}

.adventure-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: stretch;
}

.adventure-scene,
.adventure-task {
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  padding: clamp(14px, 2vw, 22px);
}

.adventure-scene {
  background:
    linear-gradient(180deg, #eaf7ff 0 56%, #e5ffd9 56% 100%);
  text-align: center;
}

.adventure-art {
  min-height: 180px;
  display: grid;
  place-items: center;
  font-size: clamp(4rem, 12vw, 8rem);
}

.adventure-scene h2,
.adventure-task h3 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.adventure-scene p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 800;
}

.adventure-task h3 {
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}

.adventure-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.adventure-choices button {
  min-height: 118px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff8e8;
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(38, 48, 71, 0.2);
  white-space: pre-line;
}

.adventure-choices button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(38, 48, 71, 0.2);
}

.adventure-progress {
  height: 22px;
  margin: 18px 0;
  border: 3px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.adventure-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--team-two), var(--sun));
  transition: width 280ms ease;
}

.adventure-controls {
  margin-top: 0;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
}

.score-chip,
.race-goal {
  min-height: clamp(48px, 7vh, 68px);
  padding: clamp(6px, 0.8vw, 10px);
  border: 1px solid rgba(0, 111, 171, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-weight: 900;
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.72);
}

.score-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.score-chip strong {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.team-one-score {
  color: var(--team-one-dark);
}

.team-two-score {
  color: var(--team-two-dark);
}

.race-goal {
  display: grid;
  place-items: center;
  padding-inline: 14px;
  color: #004c76;
  background: rgba(255, 255, 255, 0.86);
}

.track-wrap {
  --tug-shift: 0px;
  --team-one-shift: 0px;
  --team-two-shift: 0px;
  --snatch-offset: 0px;
  position: relative;
  flex: 1;
  min-height: 380px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}

.tug-motion-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  transform: translateX(var(--snatch-offset));
  transition: transform 420ms cubic-bezier(0.2, 0.9, 0.25, 1.1);
}

.track-wrap.is-snatching .tug-motion-layer {
  transition: none;
}

.tug-art {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100%, 1120px);
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 20px 35px rgba(0, 60, 90, 0.18));
  z-index: 3;
  pointer-events: none;
  user-select: none;
  transition: transform 420ms cubic-bezier(0.2, 0.9, 0.25, 1.1);
}

.tug-art-left {
  clip-path: none;
  transform: translate(calc(-50% + var(--tug-shift)), -50%);
}

.tug-art-right {
  display: none;
}

.track-wrap::before {
  display: none;
}

.tug-center-line {
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: 50%;
  width: 6px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    180deg,
    rgba(38, 48, 71, 0.72) 0 10px,
    transparent 10px 20px
  );
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.64), 0 8px 22px rgba(0, 60, 90, 0.2);
  z-index: 6;
}

.tug-rope {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 56%;
  height: 7px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #3e3326 0 8px, #9f6939 8px 16px, #d19a5f 16px 24px);
  transform: translateY(-50%);
  box-shadow: 0 3px 0 rgba(38, 48, 71, 0.12);
  z-index: 5;
}

.track-wrap > .tug-rope {
  display: none;
}

.tug-rope::before,
.tug-rope::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff2cf;
  transform: translateY(-50%);
}

.tug-rope::before {
  left: 23%;
}

.tug-rope::after {
  right: 23%;
}

body.is-playing .tug-rope {
  animation: ropeTension 520ms ease-in-out infinite alternate;
}

.tug-team {
  position: absolute;
  top: 58%;
  width: clamp(150px, 18vw, 220px);
  height: clamp(125px, 17vh, 170px);
  display: flex;
  align-items: flex-end;
  gap: clamp(6px, 1vw, 12px);
  transform: translateY(-50%);
  transition: left 420ms cubic-bezier(0.2, 0.9, 0.25, 1.1);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

.tug-team-two {
  justify-content: flex-end;
}

.tug-player {
  position: relative;
  width: clamp(58px, 7.2vw, 84px);
  height: clamp(110px, 15vh, 148px);
  transform: rotate(-18deg) skewX(-2deg);
  transform-origin: 50% 100%;
}

.tug-team-two .tug-player {
  transform: rotate(18deg) skewX(2deg);
}

.tug-player:nth-child(2) {
  margin-left: -14px;
  transform: rotate(-20deg) translateY(7px) skewX(-2deg);
}

.tug-team-two .tug-player:nth-child(2) {
  margin-left: 0;
  margin-right: -14px;
  transform: rotate(20deg) translateY(7px) skewX(2deg);
}

body.is-playing .tug-player {
  animation: childPullLeft 520ms ease-in-out infinite alternate;
}

body.is-playing .tug-team-two .tug-player {
  animation-name: childPullRight;
}

.child-head,
.child-cap,
.child-face,
.child-body,
.child-arm,
.child-leg {
  position: absolute;
  display: block;
}

.child-head {
  left: 50%;
  top: clamp(11px, 1.5vw, 16px);
  width: clamp(21px, 2.8vw, 30px);
  height: clamp(24px, 3vw, 34px);
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #ffe2bf;
  transform: translateX(-50%);
  z-index: 3;
}

.child-cap {
  left: 50%;
  top: clamp(2px, 0.5vw, 5px);
  width: clamp(30px, 4vw, 42px);
  height: clamp(16px, 2vw, 22px);
  border: 2px solid var(--ink);
  border-radius: 16px 16px 5px 5px;
  background: #263047;
  transform: translateX(-50%) rotate(-8deg);
  z-index: 4;
}

.child-cap::after {
  content: "";
  position: absolute;
  right: -13px;
  bottom: 1px;
  width: 16px;
  height: 7px;
  border: 2px solid var(--ink);
  border-left: 0;
  border-radius: 0 999px 999px 0;
  background: #263047;
}

.tug-team-two .child-cap {
  transform: translateX(-50%) rotate(8deg);
}

.tug-team-two .child-cap::after {
  right: auto;
  left: -13px;
  border-left: 2px solid var(--ink);
  border-right: 0;
  border-radius: 999px 0 0 999px;
}

.child-face {
  left: 50%;
  top: clamp(22px, 2.6vw, 30px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 8px 0 0 var(--ink), 4px 7px 0 -1px #d94c2f;
  transform: translateX(-50%);
  z-index: 5;
}

.child-body {
  position: absolute;
  left: 50%;
  top: clamp(40px, 5vw, 56px);
  width: clamp(33px, 4.8vw, 50px);
  height: clamp(34px, 5.4vh, 48px);
  border: 2px solid var(--ink);
  border-radius: 8px 8px 12px 12px;
  background: #12a8e0;
  transform: translateX(-50%);
  z-index: 2;
}

.tug-team-two .child-body {
  background: #ff6f3d;
}

.child-arm {
  top: clamp(51px, 6.3vw, 70px);
  width: clamp(34px, 5.4vw, 58px);
  height: 7px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #ffe2bf;
  z-index: 6;
}

.child-arm-front {
  left: 46%;
  transform: rotate(-7deg);
}

.child-arm-back {
  left: 40%;
  top: clamp(58px, 7vw, 78px);
  transform: rotate(8deg);
  z-index: 4;
}

.tug-team-two .child-arm-front {
  left: auto;
  right: 46%;
  transform: rotate(7deg);
}

.tug-team-two .child-arm-back {
  left: auto;
  right: 40%;
  transform: rotate(-8deg);
}

.child-leg {
  bottom: 0;
  width: clamp(9px, 1.4vw, 13px);
  height: clamp(31px, 4.8vh, 44px);
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #1f2a3d;
  transform-origin: 50% 0;
  z-index: 1;
}

.child-leg::after {
  content: "";
  position: absolute;
  left: -6px;
  bottom: -6px;
  width: clamp(16px, 2.1vw, 24px);
  height: 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #101521;
}

.child-leg-front {
  left: 50%;
  transform: rotate(23deg);
}

.child-leg-back {
  left: 27%;
  transform: rotate(-25deg);
}

.tug-team-two .child-leg-front {
  left: auto;
  right: 50%;
  transform: rotate(-23deg);
}

.tug-team-two .child-leg-back {
  left: auto;
  right: 27%;
  transform: rotate(25deg);
}

@keyframes childPullLeft {
  from {
    translate: 0 0;
  }

  to {
    translate: -4px 1px;
  }
}

@keyframes childPullRight {
  from {
    translate: 0 0;
  }

  to {
    translate: 4px 1px;
  }
}

@keyframes ropeTension {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 20px 0;
  }
}

.status-message {
  min-height: clamp(28px, 5vh, 44px);
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 900;
  text-align: center;
}

.game-controls {
  flex: 0 0 auto;
  justify-content: center;
}

.game-selection,
.student-screen,
.board,
.team-panel,
.adventure-game {
  scrollbar-width: thin;
}

.start-btn,
.restart-btn {
  min-width: 180px;
  padding: 0 24px;
}

.start-btn {
  background: var(--sun);
}

.restart-btn {
  background: #ffffff;
}

.winner-dialog {
  width: min(440px, calc(100% - 32px));
  border: 0;
  padding: 0;
  background: transparent;
}

.winner-dialog::backdrop {
  background: rgba(38, 48, 71, 0.55);
}

.winner-card {
  padding: 28px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.winner-card h2 {
  margin-bottom: 8px;
  font-size: 2.4rem;
}

.winner-card p {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 980px) {
  .game-shell {
    width: 100%;
    max-width: none;
  }

  .home-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .home-visual {
    min-height: 300px;
  }

  .home-feature-grid {
    grid-template-columns: 1fr;
  }

  .home-game-grid {
    grid-template-columns: 1fr;
  }

  .app-release-hero,
  .app-release-builder-band,
  .app-release-section-head {
    grid-template-columns: 1fr;
  }

  .app-release-mini-grid,
  .app-release-game-grid {
    grid-template-columns: 1fr;
  }

  .app-release-visual,
  .app-release-visual img {
    min-height: 300px;
  }

  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: auto;
  }

  .auth-visual {
    min-height: 190px;
  }

  .bio-card,
  .bio-hero,
  .bio-grid,
  .bio-grid-two {
    grid-template-columns: 1fr;
  }

  .bio-hero {
    grid-template-areas:
      "pill"
      "title"
      "copy"
      "art"
      "points";
    min-height: auto;
  }

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

  #bio-screen .bio-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "pill"
      "title"
      "copy"
      "art";
  }

  #bio-screen .bio-grid,
  #bio-screen .bio-grid-two {
    grid-template-columns: 1fr;
  }

  .board {
    grid-template-columns: minmax(170px, 0.62fr) minmax(340px, 1.5fr) minmax(170px, 0.62fr);
    grid-template-areas: "team-one race team-two";
    gap: 10px;
    overflow-y: auto;
    padding-top: clamp(58px, 8vh, 76px);
    padding-bottom: 4px;
  }

  body[data-mode="math"] .board::before {
    font-size: clamp(1.35rem, 3.5vw, 2rem);
    width: min(620px, 92%);
  }

  .track-wrap {
    min-height: 260px;
  }

  .team-panel,
  .race-panel {
    min-width: 0;
  }

  .team-panel {
    padding: 0 10px 10px;
    gap: 8px;
  }

  .team-title {
    margin-inline: -10px;
    padding: 10px 12px;
  }

  .team-title h2 {
    font-size: clamp(0.9rem, 1.9vw, 1.15rem);
  }

  .team-badge {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .question-card {
    padding: 10px;
  }

  .question-card strong {
    font-size: clamp(1.35rem, 2.6vw, 2rem);
  }

  .answer-display {
    min-height: 46px;
    font-size: clamp(1.25rem, 2.7vw, 1.8rem);
  }

  .keypad {
    grid-template-rows: repeat(4, minmax(42px, 1fr));
    gap: 6px;
    min-height: 184px;
  }

  .option-grid {
    gap: 8px;
  }

  .keypad button,
  .option-grid button,
  .panel-actions button {
    min-height: 42px;
    font-size: clamp(0.9rem, 1.9vw, 1.1rem);
    border-radius: 10px;
  }

  .adventure-stage {
    grid-template-columns: 1fr;
  }

  .custom-games-layout {
    grid-template-columns: 1fr;
  }

  .custom-game-preview {
    position: static;
    border-left: 0;
    border-top: 1px solid #e2e8f0;
  }

  .custom-team-name-grid,
  .custom-game-idea-grid {
    grid-template-columns: 1fr;
  }

  .custom-presentation-export-actions {
    grid-template-columns: 1fr;
  }

  .custom-game-idea-grid label:last-child {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .auth-card {
    padding: 14px;
  }

  .auth-intro {
    display: none;
  }

  .auth-card.student-card::before {
    display: none;
  }

  .auth-form-card {
    padding: 14px;
    border: 0;
    border-radius: 22px;
  }

  .auth-page-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-page-actions {
    width: 100%;
  }

  .auth-page-link,
  .auth-page-primary {
    flex: 1 1 0;
  }

  .home-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-release-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .app-release-nav-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .app-release-nav-actions a,
  .app-release-nav-actions button {
    width: 100%;
  }

  .home-nav-actions,
  .home-actions {
    width: 100%;
  }

  .home-primary-btn,
  .home-secondary-btn,
  .home-link-btn {
    flex: 1 1 150px;
  }

  .home-hero {
    padding: 16px;
  }

  .home-hero h1 {
    font-size: 3rem;
  }

  .app-release-hero {
    padding: 24px 16px;
  }

  .app-release-actions {
    display: grid;
  }

  .app-release-actions button {
    width: 100%;
  }

  .app-release-stats {
    grid-template-columns: 1fr;
  }

  .home-lede {
    font-size: 1.06rem;
  }

  .home-visual {
    min-height: 240px;
  }

  .home-score-card {
    left: 10px;
    bottom: 10px;
  }

  .home-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .game-selection {
    grid-template-columns: 1fr;
    grid-template-areas:
      "profile"
      "games";
  }

  .profile-strip {
    position: static;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .profile-status,
  .profile-referral,
  .logout-btn {
    grid-column: 1 / -1;
  }

  .profile-avatar {
    width: 58px;
    height: 58px;
    font-size: 1.65rem;
  }

  .logout-btn {
    width: 100%;
  }

  .game-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .timer-box {
    width: 100%;
  }

  .server-panel {
    grid-template-columns: 1fr;
  }

  .server-actions {
    justify-content: stretch;
  }

  .server-actions button {
    flex: 1 1 120px;
  }

  .game-menu {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .menu-card {
    min-height: 118px;
    padding: 12px;
  }

  .board {
    grid-template-columns: 1fr;
    grid-template-areas:
      "race"
      "team-one"
      "team-two";
    align-items: start;
  }

  .game-controls {
    flex-wrap: wrap;
  }

  .game-controls button {
    flex: 1 1 150px;
  }

  .score-row {
    grid-template-columns: 1fr;
  }

  .adventure-choices {
    grid-template-columns: 1fr;
  }

  .custom-game-actions {
    grid-template-columns: 1fr;
  }

  .custom-game-pdf-tool {
    grid-template-columns: 1fr;
  }

  .custom-game-pdf-tool .custom-game-secondary-link {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .game-shell {
    padding: 8px;
    gap: 8px;
  }

  .home-screen {
    gap: 12px;
  }

  .home-hero {
    padding: 12px;
  }

  .home-hero h1 {
    font-size: 2.45rem;
  }

  .app-release-hero h1 {
    font-size: 2.75rem;
  }

  .app-release-lede {
    font-size: 1rem;
  }

  .app-release-builder-band,
  .app-release-game-grid article {
    padding: 18px;
  }

  .home-feature-grid article {
    min-height: 0;
    padding: 14px;
  }

  .game-header {
    gap: 8px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .timer-box {
    min-width: 84px;
    padding: 5px;
  }

  .timer-box strong {
    font-size: 1.15rem;
  }

  .board {
    gap: 12px;
  }

  .student-card {
    padding: 14px;
  }

  .student-card h2 {
    margin-bottom: 12px;
    font-size: 1.7rem;
  }

  .run-mode-options {
    grid-template-columns: 1fr;
  }

  .run-mode-option {
    min-height: 104px;
    padding: 14px;
  }

  .student-card label {
    gap: 5px;
    margin-bottom: 9px;
    font-size: 0.82rem;
  }

  .student-card input {
    min-height: 48px;
    font-size: 1.05rem;
  }

  .menu-card {
    min-height: 56px;
    padding: 8px 10px;
  }

  .server-panel {
    padding: 8px;
  }

  .team-panel,
  .race-panel {
    border-width: 3px;
    padding: 10px;
  }

  .team-title {
    gap: 6px;
  }

  .team-title h2 {
    font-size: 1.6rem;
  }

  .team-badge {
    width: 44px;
    height: 44px;
    border-width: 3px;
    font-size: 1.4rem;
  }

  .question-card,
  .answer-display,
  .keypad button,
  .panel-actions button,
  .option-grid button,
  .score-chip,
  .race-goal,
  .track-wrap {
    border-width: 3px;
  }

  .question-card {
    padding: 10px;
  }

  .question-card strong {
    font-size: 2rem;
  }

  .answer-display {
    min-height: 58px;
    padding: 8px;
    font-size: 2rem;
  }

  .keypad,
  .panel-actions,
  .score-row {
    gap: 7px;
  }

  .keypad {
    grid-template-rows: repeat(4, 46px);
    min-height: 205px;
  }

  .keypad button,
  .option-grid button,
  .panel-actions button {
    min-height: 46px;
    font-size: 1.2rem;
    box-shadow: 0 4px 0 rgba(38, 48, 71, 0.2);
  }

  .panel-actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 0;
  }

  .option-grid {
    gap: 8px;
  }

  .score-chip,
  .race-goal {
    min-height: 38px;
    padding: 4px;
    font-size: 0.72rem;
  }

  .score-chip strong {
    font-size: 1.1rem;
  }

  .track-wrap {
    padding: 10px 6px;
    min-height: 190px;
  }

  .tug-team {
    width: 110px;
    height: 92px;
  }

  .tug-player {
    width: 42px;
    height: 78px;
  }

  .tug-rope {
    left: 5%;
    right: 5%;
  }

  .start-btn,
  .restart-btn {
    min-width: 112px;
    min-height: 38px;
  }

  .status-message {
    min-height: 22px;
    font-size: 0.82rem;
  }

  .adventure-art {
    min-height: 120px;
  }

  .adventure-choices button {
    min-height: 76px;
  }
}

@media (max-height: 640px) {
  .eyebrow,
  .question-card p,
  .timer-box span,
  .score-chip span {
    display: none;
  }

  .game-header {
    min-height: 0;
  }

  h1 {
    font-size: clamp(1.8rem, 6vh, 3rem);
  }

  .question-card strong {
    font-size: clamp(1.4rem, 5vh, 2.1rem);
  }
}
