:root {
  color-scheme: dark;
  --bg: #030914;
  --bg-soft: #071321;
  --panel: rgba(8, 25, 42, 0.92);
  --panel-strong: #0a1b2d;
  --line: rgba(76, 209, 236, 0.24);
  --line-strong: rgba(76, 209, 236, 0.58);
  --cyan: #4cd1ec;
  --cyan-bright: #7be8f8;
  --orange: #ff7a32;
  --text: #eef9fc;
  --muted: #9eb6c3;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(39, 156, 190, 0.18), transparent 38rem),
    linear-gradient(180deg, #06101d 0%, var(--bg) 52%, #020711 100%);
  font-family: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(76, 209, 236, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76, 209, 236, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--cyan-bright);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  color: #001018;
  background: var(--cyan-bright);
  border-radius: 8px;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 9, 20, 0.82);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 32px, 1344px);
  min-height: 66px;
  margin: 0 auto;
}

.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-cluster {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-quick-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-site-link {
  display: inline-flex;
  padding: 5px 8px;
  align-items: center;
  gap: 4px;
  color: var(--cyan-bright);
  border: 1px solid rgba(76, 209, 236, 0.3);
  background: rgba(8, 25, 42, 0.48);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.brand-site-link:hover {
  color: #031610;
  border-color: #69f5b8;
  background: #69f5b8;
}

.feedback-site-link {
  color: #ffb267;
  border-color: rgba(255, 136, 61, 0.42);
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid rgba(84, 198, 174, 0.38);
  border-radius: 11px;
  box-shadow: 0 0 24px rgba(84, 198, 174, 0.2);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  line-height: 1.25;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.education-entry {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  color: var(--muted);
  border: 1px solid rgba(158, 182, 195, 0.24);
  background: rgba(8, 25, 42, 0.62);
  border-radius: 7px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.education-entry.is-active {
  color: #69f5b8;
  border-color: rgba(105, 245, 184, 0.48);
}

.education-login-badge {
  display: inline-flex;
  max-width: 300px;
  padding: 7px 11px;
  align-items: center;
  overflow: hidden;
  color: var(--muted);
  border: 1px solid rgba(158, 182, 195, 0.24);
  background: rgba(8, 25, 42, 0.8);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.education-login-badge::before {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  flex: 0 0 auto;
  background: #8196a1;
  border-radius: 50%;
  content: "";
}

.education-login-badge[data-state="active"] {
  color: #d9fff4;
  border-color: rgba(92, 255, 199, 0.55);
  background: rgba(21, 115, 88, 0.24);
}

.education-login-badge[data-state="active"]::before {
  background: #5cffc7;
  box-shadow: 0 0 10px rgba(92, 255, 199, 0.8);
}

.staff-login-entry {
  color: var(--cyan-bright);
  border-color: rgba(76, 209, 236, 0.42);
}

.header-status.is-unavailable {
  color: #8196a1;
}

.header-status.is-unavailable .status-dot {
  background: #8196a1;
  box-shadow: none;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #66f4ba;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(102, 244, 186, 0.8);
}

main {
  width: min(100% - 32px, 1344px);
  margin: 0 auto;
}

.hero-copy {
  max-width: none;
  max-height: 110px;
  padding: 22px 0 18px;
  overflow: hidden;
  opacity: 1;
  transition: max-height 220ms ease, padding 220ms ease, opacity 160ms ease;
}

.eyebrow,
.card-eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-copy h1,
.section-heading h2,
.sponsor-callout h2 {
  margin: 0;
  letter-spacing: -0.035em;
}

.hero-copy h1 {
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.08;
}

.hero-copy > p:last-child {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

@media (min-width: 1200px) {
  .hero-copy > p:last-child {
    white-space: nowrap;
  }
}

.experience-grid {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) 136px;
  gap: 16px;
  align-items: start;
}

.ad-rail-left {
  grid-column: 1;
}

.simulator-card {
  width: 100%;
  min-width: 0;
  grid-column: 2;
}

.ad-rail-right {
  grid-column: 3;
}

.ad-rail,
.simulator-card,
.feature-card,
.sponsor-callout {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 31, 51, 0.94), rgba(5, 16, 29, 0.96));
  box-shadow: var(--shadow);
}

.ad-rail {
  position: sticky;
  top: 82px;
  display: flex;
  height: 510px;
  min-height: 510px;
  padding: 12px;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
}

.ad-rail::after {
  position: absolute;
  right: -50%;
  bottom: 12%;
  width: 180px;
  height: 180px;
  content: "";
  background: rgba(76, 209, 236, 0.1);
  border-radius: 50%;
  filter: blur(24px);
}

.ad-label {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  padding: 4px 7px;
  color: var(--cyan-bright);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ad-visual {
  position: relative;
  height: 128px;
  flex-shrink: 0;
  margin: 12px -12px 14px;
}

.ad-orbit,
.ad-crosshair {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.ad-orbit {
  width: 118px;
  height: 118px;
  border: 1px solid var(--line-strong);
  border-top-color: var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 36px rgba(76, 209, 236, 0.14);
}

.ad-orbit::before,
.ad-orbit::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(76, 209, 236, 0.32);
  border-radius: 50%;
}

.ad-orbit::before {
  inset: 18px;
}

.ad-orbit::after {
  inset: 40px;
  background: rgba(76, 209, 236, 0.18);
}

.ad-crosshair {
  width: 140px;
  height: 1px;
  background: var(--line);
}

.ad-crosshair::after {
  position: absolute;
  top: -70px;
  left: 70px;
  width: 1px;
  height: 140px;
  content: "";
  background: var(--line);
}

.ad-copy {
  position: relative;
  z-index: 1;
}

.ad-kicker {
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ad-copy h2 {
  margin: 8px 0 10px;
  font-size: 20px;
  line-height: 1.25;
}

.ad-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ad-image {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 170px;
  margin-top: 18px;
  object-fit: contain;
  border-radius: 8px;
}

.ad-action {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: auto;
  padding: 11px 9px;
  color: #031018;
  background: var(--cyan);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.is-disabled {
  color: #79909c !important;
  background: rgba(121, 144, 156, 0.1) !important;
  border-color: rgba(121, 144, 156, 0.2) !important;
  cursor: not-allowed;
  pointer-events: none;
}

.simulator-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.simulator-heading {
  display: flex;
  max-height: 90px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  overflow: hidden;
  opacity: 1;
  border-bottom: 1px solid var(--line);
  transition: max-height 220ms ease, padding 220ms ease, opacity 160ms ease, border-color 160ms ease;
}

@media (min-width: 1200px) {
  body.is-playing .hero-copy,
  body.is-playing .simulator-heading {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    border-color: transparent;
    pointer-events: none;
  }
}

.simulator-heading h2 {
  margin: 0;
  font-size: 22px;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.simulator-overlay-actions {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 20;
}

.heading-start-action {
  min-height: 42px;
  padding: 0 16px;
  gap: 12px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(76, 209, 236, 0.16);
  font-size: 13px;
  white-space: nowrap;
}

.education-heading-action {
  min-height: 42px;
  padding: 0 14px;
  color: #69f5b8;
  border: 1px solid rgba(105, 245, 184, 0.55);
  background: rgba(22, 125, 94, 0.16);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.education-heading-action[aria-expanded="true"] {
  color: #031610;
  background: #69f5b8;
}

.poster-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  color: var(--cyan-bright);
  border: 1px solid var(--line-strong);
  background: rgba(76, 209, 236, 0.06);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.desktop-experience {
  position: relative;
  min-width: 0;
}

.promo-poster,
.loading-panel,
.unity-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 8 / 5;
  min-height: 420px;
}

.promo-poster {
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(2, 10, 21, 0.97) 0%, rgba(2, 10, 21, 0.80) 44%, rgba(2, 10, 21, 0.22) 100%),
    linear-gradient(180deg, rgba(7, 22, 37, 0.05), rgba(2, 10, 21, 0.82)),
    radial-gradient(circle at 74% 40%, #1a6f83, #071829 52%, #020915);
}

.poster-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(76, 209, 236, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76, 209, 236, 0.1) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(90deg, black, transparent 80%);
}

.poster-content {
  width: min(610px, 76%);
  padding: clamp(22px, 4vw, 42px);
}

.poster-content h3 {
  max-width: 520px;
  margin: 14px 0 10px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.poster-content > p {
  max-width: 520px;
  margin: 0;
  color: #c2d6df;
  font-size: 15px;
}

.control-hints {
  display: flex;
  margin: 22px 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.control-hints li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  color: var(--muted);
  border: 1px solid rgba(158, 182, 195, 0.18);
  background: rgba(2, 10, 21, 0.58);
  border-radius: 7px;
  font-size: 11px;
}

kbd {
  color: var(--text);
  font-family: inherit;
  font-weight: 800;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 48px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 28px;
  color: #00131b;
  border: 1px solid var(--cyan-bright);
  background: linear-gradient(135deg, var(--cyan-bright), var(--cyan));
  border-radius: 9px;
  box-shadow: 0 12px 28px rgba(76, 209, 236, 0.18);
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(76, 209, 236, 0.28);
}

.secondary-action {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(76, 209, 236, 0.08);
  box-shadow: none;
}

.loading-panel {
  display: flex;
  padding: 40px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: radial-gradient(circle at center, #0e3547, #05111f 58%, #020915);
}

.loading-radar {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  isolation: isolate;
  background:
    linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat,
    linear-gradient(90deg, var(--line), var(--line)) center / 1px 100% no-repeat;
}

.loading-radar-logo {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  z-index: 1;
  border-radius: 50%;
  object-fit: cover;
}

.loading-radar-logo-base {
  opacity: 0.09;
  filter: saturate(0.7) brightness(0.8);
}

.loading-radar-logo-scan {
  --radar-angle: 0deg;
  opacity: 0.88;
  filter: brightness(1.28) saturate(1.15) drop-shadow(0 0 8px rgba(76, 209, 236, 0.5));
  -webkit-mask-image: conic-gradient(
    from var(--radar-angle),
    transparent 0deg,
    transparent 270deg,
    rgba(0, 0, 0, 0.08) 292deg,
    rgba(0, 0, 0, 0.35) 322deg,
    #000 350deg,
    #000 360deg
  );
  mask-image: conic-gradient(
    from var(--radar-angle),
    transparent 0deg,
    transparent 270deg,
    rgba(0, 0, 0, 0.08) 292deg,
    rgba(0, 0, 0, 0.35) 322deg,
    #000 350deg,
    #000 360deg
  );
  animation: radar-logo-scan 1.4s linear infinite;
}

.loading-radar::after {
  position: absolute;
  top: calc(50% - 1px);
  left: 50%;
  width: 50%;
  height: 2px;
  z-index: 2;
  content: "";
  background: linear-gradient(90deg, var(--cyan-bright), rgba(76, 209, 236, 0.28));
  transform-origin: 0 50%;
  animation: radar-spin 1.4s linear infinite;
  box-shadow: 0 0 16px var(--cyan);
}

.loading-label {
  margin: 0 0 16px;
  font-weight: 800;
}

.progress-track {
  width: min(430px, 100%);
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.4);
  border-radius: 999px;
}

#progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-bright));
  box-shadow: 0 0 14px rgba(76, 209, 236, 0.7);
  transition: width 160ms ease;
}

.load-status {
  min-height: 26px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.unity-stage {
  min-height: 0;
  aspect-ratio: auto;
  background: #000;
}

.unity-viewport {
  position: relative;
  width: 100%;
  min-height: 0;
  height: min(var(--natural-game-height, 62.5vw), max(300px, calc(100dvh - var(--portal-header-height, 90px) - var(--portal-toolbar-height, 68px) - 28px)));
  overflow: hidden;
  aspect-ratio: 8 / 5;
  background: #000;
}

.unity-stage:fullscreen,
.unity-stage:-webkit-full-screen,
.unity-stage.is-fallback-fullscreen {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  max-width: none;
  aspect-ratio: auto;
}

.unity-stage:fullscreen .unity-viewport,
.unity-stage:-webkit-full-screen .unity-viewport,
.unity-stage.is-fallback-fullscreen .unity-viewport {
  min-height: 0;
  flex: 1 1 auto;
  height: auto;
  aspect-ratio: auto;
}

body.has-fallback-fullscreen {
  overflow: hidden;
}

.unity-stage.is-fallback-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  max-width: none;
  background: #000;
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.unity-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.unity-warning {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 3;
  width: min(90%, 660px);
  transform: translateX(-50%);
}

.unity-warning > div {
  margin-bottom: 8px;
  padding: 10px 14px;
  color: #12100a;
  background: #ffd27a;
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.unity-warning > div.is-error {
  color: white;
  background: #a92f37;
}

.game-toolbar {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 38px;
  padding: 8px 10px 8px 15px;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid rgba(76, 209, 236, 0.16);
  background: rgba(2, 9, 18, 0.94);
  backdrop-filter: blur(10px);
  font-size: 11px;
  pointer-events: none;
}

.game-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  margin-left: auto;
  gap: 7px;
  pointer-events: auto;
}

.game-toolbar-actions .education-heading-action {
  min-height: 28px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 11px;
}

#keyboard-focus-status {
  color: #e6f6fb;
  font-weight: 700;
}

#keyboard-focus-status.is-active {
  color: #69f5b8;
}

#restart-button,
#fullscreen-button {
  min-height: 28px;
  padding: 0 11px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(76, 209, 236, 0.1);
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.education-settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 7, 14, 0.62);
  backdrop-filter: blur(2px);
  animation: education-backdrop-in 180ms ease both;
}

.education-settings-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 1001;
  width: min(520px, calc(100vw - 24px));
  height: 100dvh;
  max-height: 100dvh;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  background: rgba(3, 13, 24, 0.96);
  border-radius: 16px 0 0 16px;
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.48);
  animation: education-drawer-in 220ms ease both;
}

body.education-drawer-open {
  overflow: hidden;
}

@keyframes education-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes education-drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h3,
.education-dialog h2 {
  margin: 2px 0 0;
}

.panel-kicker {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

#education-settings-close,
.education-dialog-close {
  width: 32px;
  height: 32px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(76, 209, 236, 0.08);
  border-radius: 7px;
  cursor: pointer;
}

.education-session-status {
  margin: 8px 0 14px;
  color: #69f5b8;
  font-size: 12px;
}

.education-panel-help {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.education-presets {
  display: grid;
  margin-bottom: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.education-presets button {
  display: grid;
  min-height: 58px;
  padding: 9px 10px;
  align-content: center;
  gap: 3px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(76, 209, 236, 0.06);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.education-presets button small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.education-presets button.is-active {
  color: #031610;
  border-color: #69f5b8;
  background: #69f5b8;
}

.education-presets button.is-active small {
  color: #164737;
}

.education-preset-status {
  margin: 0 0 14px;
  color: var(--cyan-bright);
  font-size: 11px;
  font-weight: 800;
}

.education-controller-card {
  display: grid;
  margin-bottom: 16px;
  padding: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  border: 1px solid rgba(105, 245, 184, 0.32);
  background: rgba(22, 125, 94, 0.1);
  border-radius: 10px;
}

.education-controller-card h4 {
  margin: 2px 0 4px;
  font-size: 14px;
}

.education-controller-card p {
  margin: 0;
}

.controller-kicker {
  color: #69f5b8;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

#education-controller-status {
  color: var(--cyan-bright);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.controller-switch {
  display: flex;
  min-height: 34px;
  padding: 0 10px;
  align-items: center;
  gap: 7px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(2, 9, 18, 0.55);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.controller-switch input {
  accent-color: #69f5b8;
}

.controller-map {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.controller-map span {
  padding: 7px 8px;
  color: var(--muted);
  border: 1px solid rgba(76, 209, 236, 0.16);
  background: rgba(2, 9, 18, 0.5);
  border-radius: 6px;
  font-size: 9px;
}

.controller-map b {
  display: block;
  color: var(--text);
  font-size: 10px;
}

.controller-note {
  grid-column: 1 / -1;
  color: #7897a8;
  font-size: 9px;
  line-height: 1.55;
}

.controller-calibration-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 10px;
}

.controller-calibration-actions button,
.controller-calibration-buttons button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(2, 9, 18, 0.62);
  border-radius: 7px;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.controller-calibration-actions button:hover,
.controller-calibration-buttons button:first-child:hover {
  color: #031610;
  border-color: #69f5b8;
  background: #69f5b8;
}

#education-calibration-summary {
  color: #9bb8c7;
  font-size: 10px;
}

.controller-calibration-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(76, 209, 236, 0.28);
  background: rgba(2, 9, 18, 0.72);
  border-radius: 8px;
}

.controller-calibration-panel[hidden] {
  display: none;
}

.controller-calibration-panel > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#education-calibration-prompt {
  color: var(--text);
  font-size: 12px;
}

#education-calibration-progress {
  flex: 0 0 auto;
  color: #69f5b8;
  font-size: 9px;
  font-weight: 800;
}

.controller-calibration-panel > p {
  color: #8cabb9;
  font-size: 9px;
}

#education-calibration-axes {
  padding: 8px 10px;
  color: var(--cyan-bright);
  background: rgba(76, 209, 236, 0.07);
  border-radius: 6px;
  font: 700 9px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.controller-calibration-buttons {
  display: flex;
  gap: 8px;
}

.controller-calibration-buttons button:first-child {
  border-color: rgba(105, 245, 184, 0.55);
}

.education-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.education-control-grid label,
#education-login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.education-control-grid label > small {
  min-height: 16px;
  color: #7897a8;
  font-size: 9px;
  font-weight: 500;
}

.education-control-grid output {
  justify-self: end;
  margin-top: -25px;
  color: var(--text);
}

.education-control-grid input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

.education-panel-action {
  margin-top: 16px;
  padding: 8px 12px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(76, 209, 236, 0.08);
  border-radius: 7px;
  cursor: pointer;
}

.simulation-config-card,
.portal-result-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(96, 211, 255, 0.32);
  border-radius: 14px;
  background: rgba(5, 17, 28, 0.72);
}

.simulation-config-card h4,
.portal-result-panel h3 {
  margin: 4px 0;
}

.simulation-config-card p,
.portal-result-panel p {
  color: var(--muted);
}

.simulation-switches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.simulation-switches label {
  padding: 10px;
  border: 1px solid rgba(96, 211, 255, 0.2);
  border-radius: 9px;
  color: #dcf6ff;
}

.simulation-control-grid [aria-disabled="true"] {
  opacity: 0.42;
  pointer-events: none;
}

.feature-access-status {
  margin-left: auto;
  color: #91acc0;
  font-size: 14px;
  line-height: 1.5;
  min-width: 0;
  white-space: normal;
}

.portal-result-panel {
  margin-bottom: 14px;
  flex: 0 0 auto;
  max-height: 32vh;
  overflow: auto;
}

.portal-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-result-actions button {
  border: 1px solid rgba(106, 225, 255, 0.58);
  border-radius: 8px;
  background: #10283b;
  color: #eaf9ff;
  padding: 10px 14px;
  cursor: pointer;
}

#portal-history-list {
  margin: 14px 0 0;
  padding-left: 24px;
  color: #bcd6e8;
}

#portal-history-list li { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
#portal-history-list button { flex-shrink: 0; padding: 8px 12px; color: var(--text); background: #10283b; border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer; }
.history-modal .education-dialog { width: min(760px, 100%); }
dialog.education-modal { margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; color: var(--text); box-sizing: border-box; }
dialog.education-modal:not([open]) { display: none; }
dialog.education-modal::backdrop { background: rgba(0, 5, 12, .75); }
dialog.education-modal .education-dialog { max-height: calc(100dvh - 40px); overflow: auto; box-sizing: border-box; }

#pdf-identity-form {
  display: grid;
  gap: 14px;
}

#pdf-identity-form label {
  display: grid;
  gap: 6px;
}

#pdf-identity-form input {
  border: 1px solid rgba(96, 211, 255, 0.42);
  border-radius: 9px;
  background: #06111d;
  color: white;
  padding: 12px;
}

.site-footer a {
  color: #8ce3ff;
}

@media (max-width: 1260px) {
  .simulation-switches {
    grid-template-columns: 1fr;
  }

  .feature-access-status {
    display: none;
  }
}

.education-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(0, 5, 12, 0.82);
  backdrop-filter: blur(10px);
}

.education-dialog {
  position: relative;
  width: min(440px, 100%);
  padding: 26px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #0b2034, #05111f);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.education-dialog > p:not(.panel-kicker) {
  color: var(--muted);
}

.education-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

#education-login-form {
  display: grid;
  margin-top: 18px;
  gap: 14px;
}

#education-login-form input {
  min-height: 42px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(1, 8, 16, 0.72);
  border-radius: 7px;
}

.education-auth-status {
  min-height: 24px;
  margin-bottom: 0;
  color: #ffd27a !important;
  font-size: 12px;
}

.education-account-actions {
  display: flex;
  margin-top: 14px;
  align-items: center;
  gap: 14px;
}

.education-account-actions a {
  color: var(--cyan-bright);
  font-size: 12px;
}

.narrow-message {
  display: none;
  min-height: 320px;
  padding: 54px 34px;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(76, 209, 236, 0.06), transparent 48%),
    #061321;
}

.narrow-icon {
  display: grid;
  min-width: 64px;
  height: 64px;
  place-items: center;
  color: var(--cyan-bright);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 28px;
}

.narrow-message h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.narrow-message p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

.feature-section {
  padding: 86px 0 32px;
}

.section-heading h2 {
  font-size: clamp(30px, 4vw, 46px);
}

.feature-grid {
  display: grid;
  margin-top: 28px;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  min-height: 230px;
  padding: 25px;
  border-radius: 14px;
}

.feature-index {
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.feature-card h3 {
  margin: 34px 0 8px;
  font-size: 22px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

.sponsor-callout {
  display: flex;
  margin: 48px 0 80px;
  padding: clamp(24px, 4vw, 42px);
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border-radius: var(--radius);
}

.sponsor-callout h2 {
  font-size: clamp(28px, 3.5vw, 42px);
}

.sponsor-callout p:last-child {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
}

.sponsor-callout .primary-action {
  min-width: 210px;
  flex-shrink: 0;
}

.site-footer {
  display: flex;
  width: min(100% - 32px, 1344px);
  margin: 0 auto;
  padding: 24px 0 34px;
  justify-content: space-between;
  gap: 24px;
  color: #77909d;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.site-footer p {
  margin: 0;
}

.noscript-message {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 1000;
  padding: 14px;
  color: #201600;
  background: #ffd27a;
  border-radius: 8px;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@property --radar-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes radar-spin {
  from { transform: rotate(-90deg); }
  to { transform: rotate(270deg); }
}

@keyframes radar-logo-scan {
  from { --radar-angle: 0deg; }
  to { --radar-angle: 360deg; }
}

@media (max-width: 1199.98px) {
  .experience-grid {
    grid-template-columns: 1fr;
  }

  .simulator-card {
    order: 1;
    grid-column: 1;
  }

  .ad-rail-left {
    order: 2;
    grid-column: 1;
  }

  .ad-rail-right {
    order: 3;
    grid-column: 1;
  }

  .ad-rail {
    position: relative;
    top: auto;
    display: grid;
    min-height: 220px;
    grid-template-columns: 130px minmax(0, 1fr) minmax(180px, auto);
    align-items: center;
    gap: 20px;
  }

  .ad-label {
    position: absolute;
    top: 14px;
    left: 14px;
  }

  .ad-visual {
    height: 170px;
    margin: 18px 0 0;
  }

  .ad-action {
    margin-top: 18px;
  }
}

@media (max-width: 1199.98px) {
  .education-heading-action,
  .education-settings-backdrop,
  .education-settings-panel {
    display: none !important;
  }
  .heading-start-action {
    display: none;
  }

  .desktop-experience {
    display: none;
  }

  .narrow-message {
    display: flex;
  }
}

@media (max-width: 760px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 0;
  }

  .brand-cluster {
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand-quick-links {
    gap: 4px;
  }

  .brand-site-link {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 14px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .header-status {
    gap: 5px;
    font-size: 10px;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .education-entry {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 14px;
    white-space: nowrap;
  }

  .education-login-badge {
    max-width: 180px;
    padding: 5px 7px;
    font-size: 9px;
  }

  .education-control-grid {
    grid-template-columns: 1fr;
  }

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

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

  .status-dot {
    width: 6px;
    height: 6px;
  }

  .hero-copy {
    padding: 24px 0 20px;
  }

  .hero-copy > p:last-child {
    font-size: 15px;
  }

  .simulator-heading {
    align-items: flex-start;
    gap: 12px;
  }

  .narrow-message {
    padding: 40px 22px;
    align-items: flex-start;
    flex-direction: column;
  }

  .ad-rail {
    display: flex;
    min-height: 320px;
  }

  .ad-visual {
    width: 140px;
    height: 120px;
    margin: 42px auto 8px;
  }

  .ad-action {
    width: 100%;
  }

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

  .feature-card {
    min-height: 190px;
  }

  .sponsor-callout,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .sponsor-callout .primary-action {
    width: 100%;
  }
}

.calibration-mode-label { display: grid; gap: 8px; }
#calibration-guide-mode { min-height: 44px; width: 100%; background: #081a29; color: #eef9fc; border: 1px solid #4d91ae; border-radius: 8px; padding: 8px; font: inherit; }
#calibration-position-help { font-size: 18px; color: #fff; font-weight: 700; }
.calibration-stick-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }
.calibration-stick-guide > div { text-align: center; color: #9eb6c3; opacity: .45; }
.calibration-stick-guide > .is-active { color: #84eeff; opacity: 1; }
.calibration-stick-face { position: relative; margin: 10px auto; width: 136px; height: 136px; border: 2px solid #47809c; border-radius: 50%; background: linear-gradient(transparent 49.5%, #47809c 49.5%, #47809c 50.5%, transparent 50.5%), linear-gradient(90deg, transparent 49.5%, #47809c 49.5%, #47809c 50.5%, transparent 50.5%), #08131f; }
.calibration-stick-target { position: absolute; width: 26px; height: 26px; left: calc(50% - 13px); top: calc(50% - 13px); transform: translate(var(--target-x, 0px), var(--target-y, 0px)); border: 2px solid white; border-radius: 50%; background: #8093a3; }
.is-active .calibration-stick-target { background: #7feaff; box-shadow: 0 0 0 7px #7feaff22; }
.calibration-step-list { display: grid; grid-template-columns: 1fr 1fr; padding: 0; list-style: none; gap: 8px; font-size: 14px; }
.calibration-step-list li { padding: 8px; border: 1px solid #254258; border-radius: 6px; color: #bbd2df; }
.calibration-step-list [aria-current] { background: #164052; border-color: #7feaff; color: #fff; font-weight: 700; }
.calibration-safety-note { border-left: 3px solid #f3b26a; padding-left: 10px; }
/* Readable teaching controls. Keep these rules after the compact legacy theme. */
.header-inner { flex-wrap: wrap; gap: 10px 20px; padding-block: 10px; }
.brand-cluster, .header-actions { flex-wrap: wrap; }
.header-actions { gap: 8px; }
.brand small, .header-status, .education-login-badge { font-size: 14px; }
.brand-site-link, .education-entry, .game-toolbar-actions .education-heading-action,
#restart-button, #fullscreen-button, .game-guide-link {
  min-height: 44px; min-width: 44px; padding: 10px 12px; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.game-guide-link { color: var(--cyan-bright); background: #102536; border: 1px solid var(--line-strong); border-radius: 6px; text-decoration: none; cursor: pointer; }
.education-dialog-close { min-width: 44px; min-height: 44px; font-size: 20px; }
.education-auth-status, .education-account-actions a { font-size: 16px; }
.game-toolbar { font-size: 14px; gap: 8px 16px; }
.game-toolbar-actions { align-items: center; }
.education-settings-panel { width: min(660px, calc(100vw - 24px)); }
.education-settings-panel h3 { font-size: 26px; }
.education-settings-panel h4 { font-size: 20px; }
.education-settings-panel p, .education-settings-panel small,
.education-settings-panel .panel-kicker, .education-settings-panel .controller-kicker,
.education-settings-panel output, .education-settings-panel .controller-map span,
.education-settings-panel .controller-calibration-actions span { font-size: 14px; line-height: 1.65; }
.education-settings-panel label, .education-settings-panel button,
.education-settings-panel .controller-map b { font-size: 16px; }
.education-settings-panel button { min-height: 44px; min-width: 44px; }
.education-settings-panel input[type="range"] { min-height: 44px; }
.education-settings-panel input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; }
.education-settings-panel label:has(input[type="checkbox"]) { min-height: 44px; display: flex; gap: 10px; align-items: center; }
.settings-step { border: 1px solid var(--line-strong); border-radius: 12px; margin: 16px 0; padding: 0 16px 16px; background: #0a1b2b; }
.settings-step:not([open]) { padding-bottom: 0; }
.settings-step summary { padding: 18px 0; cursor: pointer; font-size: 18px; }
.settings-step summary span { display: block; padding: 6px 0 0 24px; font-size: 14px; color: var(--muted); }
.settings-step .education-controller-card, .settings-step .simulation-config-card { margin-top: 0; }
.settings-step .education-presets { grid-template-columns: 1fr; }
.settings-step .education-presets button { text-align: left; padding: 12px 16px; }
.history-preference { padding: 8px 0; }
.simulation-control-grid [hidden] { display: none !important; }
.keyboard-guide { max-width: 1344px; margin: 32px auto; padding: 24px; border: 1px solid var(--line-strong); border-radius: 18px; background: #0a1928; scroll-margin-top: calc(var(--portal-header-height, 90px) + 16px); }
.keyboard-guide h3 { font-size: 18px; margin: 0 0 12px; }
.keyboard-guide p, .keyboard-guide caption { font-size: 16px; line-height: 1.7; color: #bbd2df; }
.arming-guide { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 20px; }
.arming-guide > div { padding: 20px; border: 1px solid var(--line); border-radius: 12px; }
.arming-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.arming-keys kbd { display: inline-grid; place-items: center; min-width: 44px; height: 48px; border: 1px solid var(--cyan); border-bottom-width: 4px; border-radius: 8px; font-size: 22px; color: #e9fbff; background: #16364a; }
.mode-guide { overflow-x: auto; margin-top: 24px; }
.mode-guide table { width: 100%; border-collapse: collapse; font-size: 16px; }
.mode-guide caption { text-align: left; padding: 12px 0; }
.mode-guide th, .mode-guide td { text-align: left; padding: 16px; border-bottom: 1px solid var(--line); }
.mode-guide th { color: var(--cyan-bright); }
.keyboard-guide .eyebrow { font-size: 14px; letter-spacing: .06em; }
.guide-modal .education-dialog { width: min(1080px, calc(100vw - 40px)); }
.guide-modal .keyboard-guide { margin: 16px 0 0; }
.guide-modal .arming-guide { grid-template-columns: 1fr; }
summary:focus-visible, .game-guide-link:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }
@media (max-width: 1000px) {
  .arming-guide { grid-template-columns: 1fr; }
  .keyboard-guide { margin-inline: 12px; }
  .mode-guide th, .mode-guide td { min-width: 160px; }
}
@media (max-width: 760px) {
  .header-inner { padding-block: 12px; }
  .education-login-badge { font-size: 14px; max-width: 100%; }
  .header-status { font-size: 14px; }
  .keyboard-guide { padding: 16px; }
}

/* Practice-first UI: preserve lateral sponsor slots; no below-game rail relocation. */
.ad-rail { top: calc(var(--portal-header-height, 90px) + 12px); }
.ad-label { font-size: 12px; letter-spacing: 0; }
.ad-kicker { font-size: 12px; letter-spacing: .02em; }
.ad-copy h2 { font-size: 18px; line-height: 1.4; }
.ad-copy p { color: #bed0dc; font-size: 14px; line-height: 1.6; }
.ad-action { min-height: 44px; font-size: 14px; }
.ad-orbit { width: 104px; height: 104px; }
.ad-crosshair { width: 116px; }
.ad-crosshair::after { top: -58px; left: 58px; height: 116px; }
.keyboard-guide { margin-block: 20px; padding: 20px; }
.keyboard-guide .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.keyboard-guide .section-heading h2 { font-size: 22px; margin: 0; }
.arming-guide { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.arming-guide > div { padding: 16px; }
.arming-guide p { margin-bottom: 0; }
.guide-modal .education-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.guide-modal p { color: #bed0dc; font-size: 16px; line-height: 1.7; }
.guide-modal h3 { margin: 24px 0 8px; font-size: 20px; }
.guide-pause-note { background: #123044; border-left: 3px solid #7be8f8; padding: 12px; }
.result-next { padding: 12px 16px; border-left: 3px solid #7be8f8; color: #e5f5fc; background: #102b3c; }
#portal-result-summary { font-size: 20px; font-weight: 700; }
.result-details summary { min-height: 44px; padding: 12px 0; cursor: pointer; }
.result-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 16px; }
.result-table th, .result-table td { padding: 12px; border-bottom: 1px solid #355064; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-table th:first-child { width: 40%; text-align: left; }
.result-table td, .result-table th:not(:first-child) { text-align: right; }
.result-table th { color: #a6edff; }
.portal-result-actions button { min-height: 44px; font-size: 16px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #7be8f8; outline-offset: 3px; }
@media (min-width: 1200px) {
  .ad-rail { grid-column: auto; display: flex; }
  .ad-rail-left { grid-column: 1; }
  .ad-rail-right { grid-column: 3; }
  .simulator-card { grid-column: 2; }
}
@media (max-width: 1199.98px) {
  .ad-rail, #keyboard-guide { display: none; }
  .experience-grid { grid-template-columns: minmax(0, 1fr); }
  .simulator-card { grid-column: 1; }
  .mode-guide th, .mode-guide td { min-width: 0; padding: 10px; }
  .site-footer { gap: 16px; flex-wrap: wrap; }
  .brand-cluster, .header-actions { min-width: 0; max-width: 100%; }
  .brand { min-width: 0; }
}

/* Validated education sessions use the full game column, without sponsor rails.
   Keep after the desktop rail rules; no iframe reparenting or reload is needed. */
body.has-education-access .experience-grid { grid-template-columns: minmax(0, 1fr); max-width: 1040px; margin-inline: auto; }
body.has-education-access .simulator-card { grid-column: 1 / -1; }
body.has-education-access .ad-rail,
body.has-education-access .guest-sponsor-contact { display: none !important; }

/* The launch screen is content-sized, not a game-sized 8:5 empty canvas. */
.promo-poster { aspect-ratio: auto; min-height: 0; align-items: center; }
.poster-content { width: 100%; padding: 84px 28px 26px; }
.poster-content h3 { max-width: 660px; margin: 12px 0 10px; font-size: clamp(26px, 2.3vw, 32px); line-height: 1.3; }
.poster-content > p { max-width: 700px; line-height: 1.6; }
.control-hints { margin: 16px 0 0; }
.loading-panel { aspect-ratio: auto; min-height: min(340px, max(260px, calc(100dvh - var(--portal-header-height, 90px) - 140px))); }
body.has-education-access #keyboard-guide,
body.has-education-access .innocurie-brand { max-width: 1040px; margin-inline: auto; }

.innocurie-brand {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 0;
  grid-column: 1 / -1;
}
.innocurie-brand > img { width: 36px; height: 36px; flex-shrink: 0; border-radius: 6px; object-fit: contain; }
.innocurie-brand-copy { min-width: 0; flex: 1; }
.innocurie-brand h2 { margin: 0; color: #e9f6fc; font-size: 16px; line-height: 1.4; white-space: nowrap; }
.innocurie-brand p { margin: 0; color: #bed0dc; font-size: 15px; line-height: 1.7; }
.innocurie-brand-links { display: flex; gap: 12px; }
.innocurie-brand-links a { white-space: nowrap; background: none; border: 0; padding: 8px 0; font-size: 14px; }
.site-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; padding: 16px 0 24px; font-size: 14px; }
.site-footer p a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer .footer-release { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
.site-footer .footer-copyright { grid-column: 1 / -1; }
.site-footer .guest-sponsor-contact { justify-self: end; grid-column: 2; grid-row: 2; }
.site-footer .guest-sponsor-contact a { min-height: 44px; padding: 8px 10px; font-size: 14px; white-space: nowrap; }
.header-more { position: relative; }
.header-more summary { display: flex; gap: 6px; align-items: center; justify-content: center; cursor: pointer; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--cyan-bright); list-style: none; }
.header-more summary::-webkit-details-marker { display: none; }
.header-more summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.header-menu { position: absolute; right: 0; top: calc(100% + 8px); width: min(280px, calc(100vw - 32px)); padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: #0b1b29; box-shadow: var(--shadow); max-height: calc(100dvh - 132px); overflow-y: auto; }
.header-menu .brand-quick-links { display: grid; gap: 8px; }
.header-menu .education-entry { width: 100%; margin-top: 8px; }
.header-menu .header-status { margin: 12px 0 4px; font-size: 13px; }
.ad-action { white-space: nowrap; }
@media (min-width: 1200px) {
  body:not(.is-playing) .experience-grid { align-items: stretch; }
  body:not(.is-playing) .ad-rail { height: auto; min-height: 0; position: relative; top: auto; gap: 8px; }
  body:not(.is-playing) .ad-visual { height: 52px; margin: 0; transform: scale(.55); }
  body:not(.is-playing) .ad-kicker { display: none; }
  body:not(.is-playing) .ad-copy h2 { margin: 0 0 8px; }
  body:not(.is-playing) .ad-image { max-height: 90px; margin-top: 0; }
  body:not(.is-playing) .ad-action { margin-top: auto; }
}
@media (min-width: 1024px) and (max-width: 1365px) {
  body:not(.has-education-access) .ad-rail { border-color: rgba(120, 151, 172, .16); box-shadow: none; background: #0b1723; }
  body:not(.has-education-access) .ad-rail::after { display: none; }
  body:not(.has-education-access) .ad-visual { opacity: .35; }
  body:not(.has-education-access) .ad-copy p,
  body:not(.has-education-access) .ad-kicker { display: none; }
  body:not(.has-education-access) .ad-copy h2 { font-size: 18px; line-height: 1.5; }
  body:not(.has-education-access) .ad-action { color: var(--cyan-bright); background: #102333; border: 1px solid rgba(120, 151, 172, .25); }
  .feature-access-status { flex: 1 1 270px; }
}
@media (max-width: 760px) {
  .header-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding-block: 8px; }
  .brand-cluster { flex-wrap: nowrap; }
  .brand { gap: 10px; }
  .brand-logo { width: 36px; height: 36px; }
  .brand small { font-size: 14px; margin-top: 2px; letter-spacing: .02em; }
  .header-actions { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; }
  .header-actions > .education-entry { font-size: 14px; padding: 8px; }
  .header-actions > .education-login-badge { min-width: 0; max-width: 100%; font-size: 14px; padding: 4px; white-space: nowrap; text-overflow: ellipsis; display: block; }
  .header-more summary { font-size: 14px; padding: 8px; }
  .hero-copy { padding: 12px 0; }
  .hero-copy > p:last-child { font-size: 14px; }
  .narrow-message { min-height: 0; padding: 24px 18px; gap: 12px; }
  .narrow-message .narrow-icon { display: none; }
  .site-footer { grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: 14px; }
  .site-footer .guest-sponsor-contact { display: none; }
  .innocurie-brand { gap: 8px; }
  .innocurie-brand > img { width: 28px; height: 28px; }
  .innocurie-brand h2 { font-size: 14px; }
  .innocurie-brand-links { gap: 10px; }
  .innocurie-brand-links a { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
/* Shared game-toolbar sizing includes dynamically inserted battle controls. */
.game-toolbar-actions { gap: 8px; align-items: stretch; }
.game-toolbar-actions > button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 76px; padding: 10px 14px;
  border: 1px solid #385568; border-radius: 9px;
  background: #102230; color: #dcebf4;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.4;
  white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s;
}
.game-toolbar-actions > button[hidden] { display: none !important; }
.game-toolbar-actions > button:hover { background: #193749; border-color: #6acbdf; }
.game-toolbar-actions > button:active { background: #21495d; }
.game-toolbar-actions > #duel-open { color: #051a25; border-color: #79d5e9; background: #79d5e9; font-weight: 800; }
.game-toolbar-actions > #duel-open:hover { background: #a2e8f4; border-color: #a2e8f4; }
.game-toolbar-actions > #education-settings-button { color: #9ce8c7; background: #102a27; border-color: #3a7866; font-size: 14px; padding: 10px 14px; }
.game-toolbar-actions > #game-guide-open { font-weight: 600; font-size: 14px; }
.game-toolbar-actions > #restart-button, .game-toolbar-actions > #fullscreen-button { font-size: 14px; font-weight: 600; padding: 10px 14px; }
.game-toolbar-actions > button:disabled { opacity: .5; cursor: not-allowed; }
.duel-modal .education-dialog { width: min(650px, calc(100vw - 32px)); }
.spectator-bar { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 18px; background: #0c2434; border-top: 1px solid #42687b; color: #dbf5ff; }
.spectator-bar[hidden] { display: none; }
.spectator-modal label, .spectator-modal select { min-width: 0; max-width: 100%; }
.spectator-bar label { display: flex; align-items: center; gap: 8px; }
.spectator-bar select, .spectator-modal select { background: #0b1a26; color: #eefaff; border: 1px solid #47768c; border-radius: 8px; padding: 10px 12px; min-height: 44px; font: inherit; }
.spectator-bar button { margin-left: auto; background: #14374b; border: 1px solid #58859a; color: #def6ff; border-radius: 8px; padding: 10px 14px; min-height: 44px; cursor: pointer; }
.spectator-entry { width: 100%; margin-top: 12px; }
.spectator-entry[hidden] { display: none !important; }
.duel-modal p { line-height: 1.7; }
.duel-modal [data-duel="entry"], .duel-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.duel-modal form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.duel-modal label { display: grid; gap: 6px; }
.duel-modal input { width: 100%; min-width: 0; box-sizing: border-box; padding: 10px 12px; background: #06121d; color: #e6f5ff; border: 1px solid #547c90; border-radius: 8px; font: inherit; }
.duel-modal select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; background: #06121d; color: #e6f5ff; border: 1px solid #547c90; border-radius: 8px; font: inherit; }
.duel-modal input[data-duel="code"], .duel-modal input[data-team="code"], .duel-modal input[data-watch="code"] { text-transform: uppercase; letter-spacing: .12em; }
.duel-modal button:not(.education-dialog-close) { padding: 11px 15px; border: 1px solid #547c90; border-radius: 8px; background: #123044; color: #e6f5ff; cursor: pointer; }
.duel-modal button:disabled { opacity: .45; cursor: default; }
.duel-modal [data-duel="room-code"] { font: 700 24px monospace; color: #8ee6f4; letter-spacing: .12em; }
.duel-modal [data-duel="status"] { padding: 12px; border-left: 3px solid #8ee6f4; background: #071621; }
.duel-modal .duel-note { font-size: 14px; color: #a2b9c9; }
.duel-requirements { padding-left: 22px; font-size: 16px; line-height: 1.8; }
.duel-connection-help { margin-top: 16px; border-top: 1px solid var(--line-strong); }
.duel-connection-help summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 14px; }
.duel-modal button, .duel-modal input { min-height: 44px; }
.duel-result { margin: 16px 0; padding: 20px; border: 1px solid var(--line-strong); border-radius: 14px; background: #071621; text-align: center; }
.duel-result[hidden] { display: none; }
.duel-modal .duel-result-round { margin: 0; color: var(--muted); font-size: 14px; letter-spacing: .1em; }
.duel-modal .duel-winner { margin: 10px 0 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.3; color: var(--text); }
.duel-modal [data-duel="outcome"] { margin: 6px 0 16px; }
.duel-scoreboard { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; font-variant-numeric: tabular-nums; }
.duel-scoreboard > div { display: grid; gap: 6px; padding: 16px 8px; border-radius: 10px; background: #102438; }
.duel-scoreboard strong { font-size: clamp(42px, 7vw, 72px); line-height: 1.1; }
.duel-score-red { color: #ff8a8f; border-top: 3px solid #ff727a; }
.duel-score-blue { color: #81d9ff; border-top: 3px solid #53c6ff; }
.duel-score-separator { font-size: 32px; color: var(--muted); }
.duel-modal [data-duel="rematch"] { background: #8de4f0; color: #062033; border-color: #8de4f0; font-weight: 700; }
.duel-modal .education-dialog { padding: 28px; border: 1px solid #36566b; box-shadow: 0 24px 90px #0008; }
.duel-modal h2 { margin: 6px 0 14px; font-size: 26px; letter-spacing: .02em; }
.duel-modal .eyebrow { margin: 0; font-size: 11px; color: #7bcddd; }
.duel-modal [data-duel="entry"], .duel-modal [data-team="entry"], .spectator-modal form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; margin: 20px 0; }
.duel-modal [data-duel="entry"][hidden], .duel-modal [data-team="entry"][hidden] { display: none; }
.duel-modal .duel-player-field, .duel-modal div.duel-connection-help { margin: 0; padding: 14px; border: 1px solid #2b495d; border-radius: 12px; background: #0a1c29; }
.duel-modal .duel-player-field { align-self: stretch; }
.duel-modal .duel-note { margin: 8px 0 0; font-size: 12px; line-height: 1.65; }
.duel-modal [data-duel="entry"] > button, .duel-modal [data-team="entry"] > button,
.duel-modal [data-duel="entry"] > form, .duel-modal [data-team="entry"] > form { grid-column: 1 / -1; }
.duel-modal [data-duel="entry"] > form, .duel-modal [data-team="entry"] > form { padding-top: 16px; border-top: 1px solid #2b495d; }
.duel-modal form > label { flex: 1; min-width: 120px; }
.duel-modal button[data-duel="create"], .duel-modal button[data-team="create"], .duel-modal button[data-watch="join"], .duel-modal button[data-duel="start"], .duel-modal button[data-team="start"] { background: #85dceb; color: #062131; border-color: #85dceb; font-weight: 700; }
.duel-modal button:not(:disabled):hover { filter: brightness(1.12); }
.duel-modal :is(input,select,button):focus-visible { outline: 2px solid #8fe9fc; outline-offset: 3px; }
.duel-modal [data-team="room-code"] { font: 700 24px monospace; color: #8ee6f4; letter-spacing: .12em; }
.duel-modal [data-team="roster"] { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.duel-modal [data-team="roster"] li { padding: 12px; border-radius: 8px; background: #0a1c29; border-left: 3px solid #f2828b; overflow-wrap: anywhere; }
.duel-modal [data-team="roster"] li:nth-child(even) { border-color: #73cfee; }
.spectator-modal form > .duel-connection-help { grid-column: 1 / -1; }
.spectator-bar .spectator-name-toggle { cursor: pointer; white-space: nowrap; }
.spectator-name-toggle input { width: 18px; height: 18px; accent-color: #85dceb; }
.spectator-bar select { max-width: min(360px,60vw); }
@media(max-width:600px) {
  .duel-modal .education-dialog { padding: 22px 18px; }
  .duel-modal [data-duel="entry"], .duel-modal [data-team="entry"], .spectator-modal form { grid-template-columns: minmax(0,1fr); }
  .duel-modal [data-team="roster"] { grid-template-columns: minmax(0,1fr); }
}
