/* Teaching-first presentation only; no access, input or simulation policy. */
.company-contact { grid-column: 1 / -1; display: grid; gap: 4px; margin: 0; font-style: normal; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.company-contact a { color: #bfe7f1; text-underline-offset: .2em; }
.company-contact strong { font-weight: 600; }
/* Watching must not present a parallel solo-practice workflow. Keep fullscreen. */
.unity-stage:has(.spectator-bar:not([hidden])) :is(#portal-workflow-status, #keyboard-focus-status, #feature-access-status, .toolbar-guides, .toolbar-settings, #restart-button, #home-button, #duel-open, #portal-result-panel) { display: none !important; }
.unity-stage:has(.spectator-bar:not([hidden])) .game-toolbar-actions { justify-content: flex-end; }
.unity-stage { scroll-margin-top: calc(var(--portal-header-height, 90px) + 8px); }
.guide-dialog-header {
  position: sticky;
  top: -26px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -26px -26px 16px;
  padding: 16px 26px;
  background: #0b2034;
  border-bottom: 1px solid var(--line-strong);
}
.guide-dialog-header .education-dialog-close { position: static; flex: 0 0 44px; }
:root {
  --muted: #b4c9d8;
  --control-response: 140ms;
  --control-ease: cubic-bezier(.2, .8, .2, 1);
}
body { font-family: system-ui, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif; font-optical-sizing: auto; }
#main-content { scroll-margin-top: calc(var(--portal-header-height, 90px) + 16px); }
.hero-copy { max-width: 1040px; margin-inline: auto; padding: 24px 0 16px; }
.hero-copy h1 { margin: 0 0 12px; color: #edf7fc; font-size: 32px; font-weight: 650; line-height: 1.3; letter-spacing: -.02em; text-wrap: balance; }
.hero-copy #brand-tagline { max-width: none; margin: 0; font-size: 16px; line-height: 1.7; color: #b9cfdd; }
.simulator-heading { display: none; }
.experience-grid:not(:has(.ad-rail[data-active="true"])) { grid-template-columns: minmax(0, 1fr); max-width: 1040px; margin-inline: auto; }
.ad-rail[data-active="false"] { display: none !important; }
.simulator-card { border-radius: 18px; }
body:not(.is-playing) .experience-grid { align-items: start; }
.promo-poster {
  border: 0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 94% 50%, transparent 0 67px, #80d4e51a 68px 69px, transparent 70px),
    radial-gradient(circle at 94% 50%, transparent 0 108px, #80d4e50d 109px 110px, transparent 111px),
    linear-gradient(115deg, #153445, #102635 62%, #132c3c);
}
.poster-grid { display: none; }
.poster-content { max-width: 880px; margin: auto; padding: 28px; }
.launch-routes { max-width: none; margin: 0; gap: 24px; }
.launch-route, .launch-route-keyboard { padding: 8px 0; border: 0; border-radius: 0; background: transparent; }
.launch-route + .launch-route { padding-left: 24px; border-left: 1px solid #395668; }
.launch-route .route-caption { display: flex; align-items: center; gap: 8px; color: #c2d5e1; font-size: 14px; }
.launch-route .route-caption::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #7895aa; }
.launch-route-keyboard .route-caption::before { background: #8ae0ee; box-shadow: 0 0 0 4px #8ae0ee12; }
.launch-route-keyboard .primary-action { color: #072331; border-color: #8ae0ee; background: #8ae0ee; }
.launch-route-keyboard .primary-action:hover { background: #b0eff7; transform: none; }
.launch-route .secondary-action { color: #d2e5ef; background: #182e3e; border-color: #587487; }
.launch-route button { border-radius: 9px; white-space: nowrap; font-size: 16px; min-height: 48px; }
.home-assistance { max-width: 1040px; margin: 20px auto; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: #bfd2df; font-size: 16px; }
.home-assistance button { min-height: 44px; font-size: 16px; background: transparent; color: #b6e7f0; border-color: #3e6074; white-space: nowrap; }
.home-assistance button:hover { background: #163342; border-color: #7eb5c7; }
body.is-playing .home-assistance { display: none; }
.guide-modal #keyboard-guide { display: block; margin: 0 0 20px; padding: 0; border: 0; background: transparent; }
.guide-modal .arming-guide { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.guide-modal .arming-guide > div { border: 0; border-left: 2px solid #52798b; border-radius: 0; background: #152e3e; padding: 12px 16px; }
.guide-modal .arming-guide h3 { font-size: 16px; }
.guide-modal .arming-guide p, .guide-modal p, .guide-modal td, .guide-modal th { font-size: 14px; line-height: 1.7; color: #c4d8e4; }
.guide-tour-actions { margin: 20px 0; }
.guide-tour-actions button { min-height: 44px; font-size: 16px; }
body:not(.is-playing) #portal-tour-game-open, body.is-playing #portal-tour-open { display: none; }
.guide-modal .control-hints { margin: 20px 0 0; }
.game-toolbar-actions #education-settings-button { color: #d1e4ef; border-color: #527184; background: #142937; }
.game-toolbar-actions #duel-open { color: #c9eaf2; border-color: #648c9d; background: #193545; }
.game-toolbar-actions #restart-button:not(:disabled) { color: #f5d39e; }
.ad-action { white-space: nowrap; font-size: 14px; box-shadow: none; background: #193341; color: #c3e0ea; }
.guest-sponsor-contact { padding-top: 8px; border-top: 1px solid #2c4759; }
.guest-sponsor-contact a { min-height: 44px; font-size: 14px; background: transparent; border: 0; color: #a9c6d6; }
body:not(.has-education-access) .site-footer .guest-sponsor-contact { display: block; }
.result-kicker, .result-stats dt { font-size: 14px; }
.education-control-grid label { grid-template-columns: minmax(0,1fr) auto; font-size: 16px; }
.education-control-grid label > span { grid-column: 1; grid-row: 1; }
.education-control-grid label > output { grid-column: 2; grid-row: 1; margin-top: 0; font-size: 14px; }
.education-control-grid label > small, .education-control-grid label > input { grid-column: 1 / -1; }
.education-control-grid label > small { font-size: 14px; color: #adc6d5; }
.narrow-message p { font-size: 16px; line-height: 1.7; color: #bed3e0; }
.narrow-message h3 { font-size: 22px; line-height: 1.4; }

/* Desktop controls react on press without moving their hit area or delaying actions. */
:where(.header-actions, .launch-routes, .home-assistance, .game-toolbar, .education-dialog, .education-settings-panel) :is(button, summary, .education-entry) {
  transition: background-color var(--control-response) var(--control-ease), border-color var(--control-response) var(--control-ease), box-shadow var(--control-response) var(--control-ease);
}
.launch-route .primary-action { box-shadow: 0 4px 14px #0003; font-weight: 650; }
.launch-route .primary-action:hover { box-shadow: 0 6px 18px #0004; }
:where(.header-actions, .launch-routes, .home-assistance, .game-toolbar, .education-dialog, .education-settings-panel) :is(button, summary, .education-entry):not(:disabled):not([aria-disabled="true"]):active {
  transform: none;
  filter: brightness(.9);
  box-shadow: inset 0 2px 4px #0004;
  transition-duration: 0s;
}
.site-header { background: #06111ee8; backdrop-filter: blur(18px) saturate(125%); }
.header-menu { transform-origin: top right; background: #102331f5; border-color: #425b6e; box-shadow: 0 12px 32px #0005; }
.education-dialog { background: #102331; border-color: #425b6e; border-radius: 18px; box-shadow: 0 20px 60px #0006; }
.education-dialog h2 { font-weight: 650; line-height: 1.3; letter-spacing: -.02em; }
.education-dialog input:focus-visible, .education-dialog select:focus-visible { outline-offset: 2px; }
.site-footer { color: #a5bccb; }
@media (max-width: 1199.98px) {
  /* This is the existing desktop window-size guard, not a mobile game layout. */
  body.is-playing .home-assistance { display: flex; }
  .site-footer { grid-template-columns: minmax(0, 1fr); }
  .site-footer > * { min-width: 0; grid-column: 1 / -1; }
  .site-footer .guest-sponsor-contact { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header, .header-menu, .education-dialog { background: #102331; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .site-header, .header-menu, .education-dialog { background: #06111e; backdrop-filter: none; border-color: #bfd9e8; }
  .home-assistance button, .launch-route .secondary-action { border-color: #bfd9e8; color: #f3fbff; }
}
@media (prefers-reduced-motion: reduce) {
  :where(.header-actions, .launch-routes, .home-assistance, .game-toolbar, .education-dialog, .education-settings-panel) :is(button, summary, .education-entry) { transition: none; }
}
@media (min-width: 1200px) {
  body:not(.has-education-access) .experience-grid:has(.ad-rail-left[data-active="true"]):has(.ad-rail-right[data-active="false"]) { grid-template-columns: 160px minmax(0,1fr); }
  body:not(.has-education-access) .experience-grid:has(.ad-rail-left[data-active="false"]):has(.ad-rail-right[data-active="true"]) { grid-template-columns: minmax(0,1fr) 160px; }
  body:not(.has-education-access) .experience-grid:has(.ad-rail-left[data-active="false"]) .simulator-card { grid-column: 1; }
  body:not(.has-education-access) .experience-grid:has(.ad-rail-left[data-active="false"]) .ad-rail-right { grid-column: 2; }
}
@media (max-width: 760px) {
  .hero-copy { padding: 20px 0 12px; }
  .hero-copy h1 { font-size: 28px; }
  .home-assistance { gap: 8px; }
  .home-assistance > span { flex-basis: 100%; }
  .guide-modal .keyboard-guide .section-heading h2 { font-size: 20px; }
  .guide-modal .control-hints { display: flex; flex-wrap: wrap; }
}
/* Classroom connection information stays collapsed except actionable warnings. */
.room-diagnostics { margin-block: 16px; }
.promotion-referee { margin: 16px; padding: 18px; border: 1px solid #35576b; border-radius: 18px; background: #102030; color: #e4edf4; flex: 0 0 auto; }
/* Normal pages use document scrolling, not a second cropped mobile viewport. */
.unity-stage:is(:fullscreen, .is-fallback-fullscreen) .promotion-referee { flex: 0 1 auto; min-height: 0; max-height: 45dvh; overflow: auto; scroll-padding-block: 18px; }
.promotion-referee :is(h3, [data-ref="message"]) { scroll-margin-block: 18px; }
.promotion-referee[hidden] { display: none; }
.promotion-referee h3 { margin: 0 0 12px; font-size: 18px; }
.promotion-referee p { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.promotion-referee form { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px 16px; }
.promotion-referee label { display: grid; gap: 6px; min-width: 0; font-size: 14px; }
.promotion-referee select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #55788c; border-radius: 7px; background: #0b1723; color: #edf6ff; padding: 8px; font: inherit; }
.promotion-referee label:has(input) { grid-column: 1 / 3; display: flex; align-items: center; }
.promotion-referee button { min-height: 44px; border-radius: 7px; padding: 8px 16px; font: inherit; background: #8cdeec; color: #06202b; border: 1px solid #8cdeec; font-weight: 700; }
.promotion-referee button:disabled { opacity: .5; }
.promotion-referee :is(button,select,input):focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 760px) { .promotion-referee { margin: 8px; padding: 14px; } .promotion-referee form { grid-template-columns: 1fr; } .promotion-referee label:has(input) { grid-column: auto; } }
.room-diagnostics summary { min-height: 44px; display: list-item; align-content: center; cursor: pointer; }
.room-diagnostics summary:focus-visible { outline: 2px solid #84dced; outline-offset: 3px; }
.room-diagnostics pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 14px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.room-connection-notice { margin: 8px 14px; padding: 12px; color: #ffe0a6; background: #20212a; border: 1px solid #b58d50; border-radius: 9px; font-size: 14px; line-height: 1.6; }

/* Compact footer: identity and contact details share the desktop row. */
.site-footer {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand company contact" "disclaimer scope scope" "release release copyright";
  align-items: center;
  gap: 2px 20px;
  padding-block: 10px 12px;
  line-height: 1.6;
}
.site-footer > * { min-width: 0; }
.site-footer .innocurie-brand {
  grid-area: brand; display: flex; flex-wrap: wrap;
  gap: 0 10px; max-width: none; margin: 0;
}
.site-footer .innocurie-brand-links { grid-column: 1 / -1; flex-wrap: wrap; gap: 0 16px; }
.site-footer .innocurie-brand-links a { min-height: 32px; display: inline-flex; align-items: center; }
.site-footer .company-contact { grid-area: company; display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 0; margin: 0; }
.site-footer .company-contact strong { flex-basis: 100%; }
.site-footer .innocurie-brand > img { width: 28px; height: 28px; }
.site-footer p { margin: 0; }
.site-footer .footer-release a { min-height: 28px; }
.site-footer .guest-sponsor-contact { grid-area: contact; justify-self: end; border: 0; padding: 0; }
.site-footer .guest-sponsor-contact:has(> a[hidden]) { display: none; }
.site-footer .footer-disclaimer { grid-area: disclaimer; }
.site-footer .footer-scope { grid-area: scope; justify-self: end; }
.site-footer .footer-release { grid-area: release; }
.site-footer .footer-copyright { grid-area: copyright; justify-self: end; }
@media (max-width: 1100px) {
  .site-footer {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "brand company" "contact company" "disclaimer disclaimer" "scope scope" "release copyright";
  }
  .site-footer .guest-sponsor-contact { justify-self: start; }
}
@media (max-width: 760px) {
  .site-footer {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "brand" "company" "contact" "disclaimer" "scope" "release" "copyright";
    gap: 6px;
  }
  .site-footer .innocurie-brand { grid-template-columns: 28px minmax(0, 1fr); }
  .site-footer .innocurie-brand > img { width: 28px; height: 28px; }
  .site-footer .footer-copyright { justify-self: start; }
}
.game-toolbar #feature-access-status[hidden] { display: none; }

/* One centred settings surface instead of a right drawer plus arena modal. */
#education-settings-panel {
  inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  width: min(820px, calc(100vw - 32px)); height: auto;
  max-height: calc(100dvh - 32px); box-sizing: border-box;
  border: 1px solid var(--line-strong); border-radius: 18px;
  padding: 20px 24px; animation: none;
}
#education-settings-panel .panel-heading {
  position: sticky; top: -20px; z-index: 2; background: #071321;
  margin: -20px -24px 16px; padding: 16px 24px;
  border-bottom: 1px solid var(--line-strong);
}
#education-settings-panel .panel-kicker { display: none; }
#education-settings-panel h3 { font-size: 24px; }
#education-settings-panel .settings-step { margin: 10px 0; }
#education-settings-panel .settings-step > summary { min-height: 48px; }
#education-settings-panel [hidden] { display: none !important; }
#education-settings-panel .competition-embedded { width: 100%; }
#education-settings-panel .competition-dialog {
  width: auto; max-width: none; max-height: none; overflow: visible;
  padding: 12px 0; border: 0; box-shadow: none; background: transparent;
}
#education-settings-panel .competition-dialog > :is(.eyebrow, h2) { display: none; }
#education-settings-panel .competition-option { min-width: 0; }
#settings-game-content fieldset { border: 0; margin: 0; padding: 16px; min-width: 0; }
#settings-game-content label { display: flex; align-items: center; gap: 12px; margin-block: 14px; }
#settings-game-content .unified-game-fields label { display: grid; grid-template-columns: 1fr; gap: 8px; }
#settings-game-content output { float: right; font-variant-numeric: tabular-nums; }
#settings-game-content input[type=range] { width: 100%; }
#settings-game-content :is(button,select) { min-height: 44px; padding: 8px 16px; border: 1px solid #6d9dac; border-radius: 7px; background: #183747; color: #e9faff; font: inherit; }
#education-settings-panel .competition-embedded button {
  min-height: 44px; padding: 8px 24px; border-radius: 7px;
  background: #183747; color: #e9faff; border: 1px solid #6d9dac;
  font: inherit; cursor: pointer;
}

/* One readable web result surface replaces the duplicate Unity summary.
   Keep the iframe alive and sized so returning never reloads the game. */
.unity-stage:has(> .portal-result-panel:not([hidden])) { position: relative; display: flex; flex-direction: column; }
.unity-stage:has(> .portal-result-panel:not([hidden])) > .unity-viewport {
  position: absolute; inset: 0; visibility: hidden; pointer-events: none;
}
.unity-stage:has(> .portal-result-panel:not([hidden])) > .game-toolbar { order: 2; flex: 0 0 auto; padding: 10px 16px; }
.unity-stage:has(> .portal-result-panel:not([hidden])) :is(#portal-workflow-status, #keyboard-focus-status, #feature-access-status, .toolbar-guides, .toolbar-settings, #duel-open) { display: none; }
.unity-stage:has(> .portal-result-panel:not([hidden])) .game-toolbar-actions { justify-content: flex-end; }
.unity-stage > .portal-result-panel:not([hidden]) {
  order: 1; width: 100%; box-sizing: border-box; margin: 0; padding: 24px clamp(20px, 4vw, 64px);
  border: 0; border-radius: 0; background: #102331; max-height: none;
}
.unity-stage:is(:fullscreen, .is-fallback-fullscreen) > .portal-result-panel:not([hidden]) {
  flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto;
}
.unity-stage.is-fallback-fullscreen:has(> .portal-result-panel:not([hidden])) { position: fixed; inset: 0; }
.portal-result-panel .result-heading { margin: 0 0 16px; }
.portal-result-panel .result-heading h3 { font-size: 20px; color: #edf7fc; }
.portal-result-panel .result-hero { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 0 0 20px; }
.portal-result-panel .result-score-block { display: flex; align-items: baseline; gap: 8px; border: 0; padding: 0; }
.portal-result-panel #portal-result-score { font-size: 40px; line-height: 1.2; }
.portal-result-panel #portal-result-mode { margin: 0; font-size: 22px; }
.portal-result-panel .result-badges { margin-block: 8px 0; }
.portal-result-panel .result-stats { margin-bottom: 12px; }
.portal-result-panel .result-next { padding: 8px 0; border: 0; background: transparent; margin: 0; }
.portal-result-panel .result-details { margin-top: 12px; }
@media (max-width: 760px) {
  .site-footer .company-contact { display: grid; gap: 2px; }
  .site-footer .footer-scope { justify-self: start; }
  .site-footer .innocurie-brand-links a, .site-footer .footer-release a { min-height: 44px; }
}
