/* Platform theme tokens. Game and workflow state are owned by the existing components. */
.stadium-theme {
  --sv-paper: #f8f7f1;
  --sv-white: #fff;
  --sv-ink: #172f29;
  --sv-dark: #142e29;
  --sv-green: #075d49;
  --sv-green-hover: #064838;
  --sv-citron: #e4f57a;
  --sv-muted: #4f625b;
  --sv-line: #d8ded5;
  --sv-tint: #eaf2e8;
  --sv-gutter: clamp(16px, 4.5vw, 64px);
  --sv-radius: 12px;
  --sv-ease: cubic-bezier(.2,.8,.2,1);
  background: var(--sv-paper);
}

.stadium-theme .platform-shell {
  --ui-canvas: var(--sv-paper);
  --ui-surface: var(--sv-white);
  --ui-ink: var(--sv-ink);
  --ui-muted: var(--sv-muted);
  --ui-line: var(--sv-line);
  --ui-accent: var(--sv-green);
  --ui-accent-hover: var(--sv-green-hover);
  --ui-soft: var(--sv-tint);
  --ui-radius: var(--sv-radius);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

.stadium-theme .platform-shell .topbar {
  background: var(--sv-paper);
  border-color: var(--sv-line);
  box-shadow: none;
}

.stadium-theme .platform-shell .brand { font-weight: 850; letter-spacing: -.03em; }
.stadium-theme .platform-shell .brand-mark { color: var(--sv-green); }
.stadium-theme .platform-shell .button { border-radius: 9px; }
.stadium-theme .platform-shell .button.secondary { border-color: #bdcbbf; }
.stadium-theme .platform-shell :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--sv-green);
  outline-offset: 3px;
}
.stadium-theme .platform-shell .platform-main:focus-visible { outline: 3px solid var(--sv-green); outline-offset: -3px; }

.stadium-theme .platform-shell .panel,
.stadium-theme .platform-shell .teacher-section-disclosure { box-shadow: none; }
.stadium-theme .platform-shell .page-heading h1 {
  font-size: clamp(28px, 3.35vw, 44px);
  font-weight: 850;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.stadium-theme .platform-shell .page-heading p { color: var(--sv-muted); }
.stadium-theme .platform-shell .panel > :first-child:is(h1,h2) { text-wrap: balance; }

/* Public home */
.stadium-theme .platform-home-shell { background: var(--sv-paper); }
.stadium-theme .platform-home-shell > .page { max-width: none; padding: 0; }
.stadium-theme .platform-home-shell .topbar { padding-inline: max(var(--sv-gutter), calc((100% - 1232px) / 2)); }
.stadium-theme .platform-home-shell .topbar nav a {
  border: 1px solid #a1b2a8;
  border-radius: 9px;
  padding: 8px 13px;
}
.stadium-theme .platform-home-shell .topbar nav a:last-child { background: var(--sv-green); border-color: var(--sv-green); color: var(--sv-white); }
.stadium-theme .platform-home-shell .topbar nav a:last-child:hover { background: var(--sv-green-hover); }
.stadium-theme .platform-home-shell .topbar .brand { min-height: 44px; }
.stadium-theme .platform-home-shell .topbar .brand > span:not(.brand-mark) { display: none; }
.sv-home { color: var(--sv-ink); }
.sv-home h1, .sv-home h2, .sv-home h3, .sv-home p { margin: 0; }
.sv-wrap { width: min(1232px, calc(100% - var(--sv-gutter) * 2)); margin-inline: auto; min-width: 0; }
.sv-hero { min-height: calc(100svh - 72px); display: grid; align-items: center; padding-block: clamp(36px, 6.5vw, 104px); }
.sv-hero-layout { display: grid; grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr); align-items: center; gap: clamp(22px, 4vw, 64px); }
.sv-hero h1 { font-size: clamp(43px, 5.6vw, 86px); line-height: 1.08; letter-spacing: -.072em; font-weight: 900; color: var(--sv-ink); }
.sv-hero h1 span { color: var(--sv-green); }
.sv-hero h1::after, .sv-field-copy h2::after {
  content: ''; display: block; width: clamp(42px, 5vw, 72px); height: 6px; margin-top: 18px;
  background: var(--sv-citron); clip-path: polygon(0 100%, 12% 0, 100% 0, 88% 100%);
}
.sv-hero-copy > p { margin-top: 20px; max-width: 29em; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.75; color: var(--sv-muted); }
.sv-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.sv-home .sv-actions .button { min-height: 48px; min-width: 0; padding-inline: 16px; gap: 8px; white-space: nowrap; }
.sv-home .sv-actions .button.secondary { background: transparent; border-color: var(--sv-green); }
.sv-home .sv-actions .button.secondary:hover { background: var(--sv-tint); }
.sv-text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-block: 8px; margin-top: 6px; color: var(--sv-green); font-weight: 750; text-underline-offset: 4px; }

.sv-projection { border: 1px solid var(--sv-dark); border-radius: var(--sv-radius); min-width: 0; overflow: hidden; background: #102620; color: #f6f8e9; }
.sv-projection-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; border-bottom: 1px solid #dcecd237; font-weight: 750; }
.sv-preview-switch { display: flex; align-items: stretch; gap: 4px; }
.sv-preview-switch button { min-height: 44px; padding: 7px 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #edf3e3; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.sv-preview-switch button[aria-pressed="true"] { color: var(--sv-dark); background: var(--sv-citron); }
.sv-preview-switch button:not([aria-pressed="true"]):hover { border-color: #f4f6da60; }
.stadium-theme :is(.sv-projection,.teacher-sidebar,.sv-close) :focus-visible { outline-color: var(--sv-citron); }
.sv-arena, .sv-result-frame { width: 100%; min-width: 0; aspect-ratio: 1.48; min-height: 350px; }
.sv-arena { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(10px, 1.8vw, 22px); background-color: #17372f; background-size: cover; background-position: center; }
.sv-arena::before { position: absolute; inset: 0; z-index: -1; content: ''; background: linear-gradient(0deg, #061b17 0%, transparent 72%); }
.sv-arena-title { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: clamp(13px, 1.1vw, 16px); }
.sv-arena-title > * { padding: 4px 9px; border: 1px solid #d1edc36b; border-radius: 5px; background: #11352de8; }
.sv-arena-title strong { color: #edface; }
.sv-golem { position: absolute; inset: 7% 0 auto; width: min(57%, 340px); height: 76%; object-fit: contain; margin-inline: auto; filter: drop-shadow(0 12px 16px #031914b0); }
.sv-arena-ui { position: relative; z-index: 1; display: grid; gap: 7px; }
.sv-arena-health { display: grid; grid-template-columns: auto minmax(24px, 1fr) auto; align-items: center; gap: 8px; padding: 4px 7px; border-radius: 5px; background: #102721; color: #f5f9e5; font-size: clamp(11px, 1vw, 14px); font-variant-numeric: tabular-nums; }
.sv-meter { display: block; height: 8px; border-radius: 4px; background: #bdceaf55; overflow: hidden; }
.sv-meter i { display: block; width: 74%; height: 100%; background: var(--sv-citron); }
.sv-arena-question { padding: clamp(8px, 1.25vw, 15px); border: 1px solid #c0d4b879; border-radius: 7px; background: #102721ed; }
.sv-arena-question > strong { display: block; color: #fff; font-size: clamp(13px, 1.35vw, 18px); }
.sv-arena-question ul { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 8px 0 0; list-style: none; padding: 0; }
.sv-arena-question li { padding: 2px 7px; border: 1px solid #b8d5ad5e; border-radius: 4px; color: #f6f9e8; font-size: clamp(12px, 1vw, 14px); }
.sv-result-frame { display: grid; align-items: center; overflow: hidden; }
.sv-result-frame img { display: block; width: 100%; height: auto; clip-path: inset(9% 0 0); transform: translateY(-4.5%); }

.sv-workflow, .sv-faq { padding-block: clamp(48px, 8vw, 112px); border-top: 1px solid var(--sv-line); }
.sv-section-split { display: grid; grid-template-columns: minmax(0, .76fr) minmax(0, 1.24fr); gap: clamp(20px, 5vw, 82px); align-items: start; }
.sv-home h2 { font-size: clamp(29px, 4vw, 56px); line-height: 1.16; letter-spacing: -.052em; font-weight: 850; }
.sv-workflow { background: var(--sv-white); }
.sv-workflow ol { list-style: none; padding: 0; margin: 0; }
.sv-workflow li { display: grid; grid-template-columns: 42px minmax(6em, auto) minmax(0, 1fr); align-items: start; gap: 12px; border-top: 1px solid var(--sv-line); padding-block: 17px; }
.sv-workflow li:last-child { border-bottom: 1px solid var(--sv-line); }
.sv-step { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--sv-line); border-radius: 7px; background: var(--sv-tint); color: var(--sv-green); font-weight: 800; font-variant-numeric: tabular-nums; }
.sv-workflow h3 { font-size: clamp(18px, 2vw, 24px); line-height: 1.5; }
.sv-workflow p { color: var(--sv-muted); align-self: center; line-height: 1.7; }

.sv-field { background: var(--sv-dark); color: #f5f6e9; padding-block: clamp(44px, 7vw, 88px); }
.sv-field-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .96fr); align-items: center; gap: clamp(24px, 5vw, 76px); }
.sv-field-art { position: relative; overflow: hidden; aspect-ratio: 1.12; isolation: isolate; background-color: #25453a; background-size: cover; background-position: center; border-radius: var(--sv-radius); border: 1px solid #ccdca73d; }
.sv-field-art::before { position: absolute; inset: 0; z-index: -1; content: ''; background: linear-gradient(0deg, #0a221bf5, #0a221b10 55%); }
.sv-field-art img { position: absolute; object-fit: contain; }
.sv-field-boss { left: 13%; bottom: 5%; width: 78%; height: 90%; filter: drop-shadow(0 13px 22px #041a14b3); }
.sv-field-role { left: 2%; bottom: 0; width: 42%; height: 53%; filter: drop-shadow(4px 8px 10px #031b12); }
.sv-field-copy h2::after { margin-top: 12px; height: 4px; }
.sv-field-copy p { color: #d8e5db; line-height: 1.75; margin-top: 12px; }
.sv-roster, .sv-roles { display: flex; flex-wrap: wrap; list-style: none; padding: 0; gap: 6px 12px; }
.sv-roster { margin: 20px 0 8px; }
.sv-roles { margin: 0; padding-bottom: 16px; border-bottom: 1px solid #eef4e332; }
.sv-field-copy li { display: flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 700; }
.sv-field-copy li img { object-fit: contain; }
.sv-field-copy h3 { margin-top: 16px; color: var(--sv-citron); font-size: 22px; }
.sv-field-copy h3 + p { margin-top: 4px; }

.sv-faq details { border-bottom: 1px solid var(--sv-line); }
.sv-faq details:first-child { border-top: 1px solid var(--sv-line); }
.sv-faq summary { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 54px; padding-block: 12px; cursor: pointer; list-style: none; font-weight: 750; }
.sv-faq summary::-webkit-details-marker { display: none; }
.sv-faq summary > span { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; color: var(--sv-green); background: var(--sv-tint); font-weight: 600; }
.sv-faq details[open] summary > span { transform: rotate(45deg); }
.sv-faq details > p { padding: 0 24px 16px 0; line-height: 1.75; color: var(--sv-muted); }
.sv-close { padding-block: 20px clamp(38px, 7vw, 92px); }
.sv-close-line { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: clamp(20px, 4vw, 44px); background: var(--sv-dark); color: #fff; border-radius: var(--sv-radius); }
.sv-close-line h2 { font-size: clamp(26px, 3.3vw, 42px); }
.sv-close-line .sv-actions { margin-top: 0; }
.stadium-theme .sv-home .sv-close .button.primary { color: var(--sv-ink); background: var(--sv-citron); border-color: var(--sv-citron); }
.stadium-theme .sv-home .sv-close .button.secondary { color: #f6f8ed; border-color: #b2ccc0; }
.stadium-theme .sv-home .sv-close .button.secondary:hover { background: #2b4b40; }

/* Existing teacher tools, including inputs, setup flows and paginated panels. */
.stadium-theme .platform-shell.teacher-app-shell:has(.teacher-home-v2) { background: var(--sv-paper); }
.stadium-theme .platform-shell .teacher-sidebar.teacher-navigation-v2 { background: var(--sv-dark); }
.stadium-theme .teacher-navigation-v2 .teacher-nav-group-toggle { border-color: #e1f1df2c; }
.stadium-theme .platform-shell .teacher-navigation-v2 .teacher-nav-group-toggle[aria-expanded="true"] { color: var(--sv-citron); border-color: #e4f57a57; }
.stadium-theme .platform-shell .teacher-sidebar nav a.active { color: var(--sv-dark); background: var(--sv-citron); border-color: transparent; font-weight: 800; }
.stadium-theme .platform-shell .teacher-sidebar nav a.active .platform-icon { color: var(--sv-dark); opacity: 1; }
.stadium-theme .teacher-home-heading h1 { font-size: clamp(29px, 3.3vw, 44px); color: var(--sv-ink); }
.stadium-theme .teacher-home-phase { background: var(--sv-white); border-color: var(--sv-line); border-radius: var(--sv-radius); }
.stadium-theme .teacher-home-phase.after, .stadium-theme .teacher-home-phase.after.current { background: #f2f4ed; border-color: var(--sv-line); }
.stadium-theme .teacher-home-phase.current { background: var(--sv-tint); border-color: var(--sv-green); }
.stadium-theme .teacher-home-current, .stadium-theme .teacher-home-phase.after .teacher-home-current { background: var(--sv-green); }
.stadium-theme .teacher-home-tools, .stadium-theme .teacher-home-settings { border-color: var(--sv-line); border-radius: var(--sv-radius); background: var(--sv-white); }
.stadium-theme .teacher-home-tools a { border-color: var(--sv-line); }
.stadium-theme .teacher-todo-card { background: var(--sv-white); border-color: var(--sv-line); border-radius: var(--sv-radius); box-shadow: none; }
.stadium-theme .teacher-todo-card.attention { background: #fbf6e4; border-color: #d9c991; }
.stadium-theme .teacher-app-shell .daily-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stadium-theme #teacher-inventory { gap: 14px; }
.stadium-theme #teacher-inventory > :is(h3,p,ul) { margin-block: 0; }

/* Student destinations and the sign-in shells keep their original controls and game artwork. */
.stadium-theme .portal-v2 { --lobby-ink: var(--sv-ink); --lobby-muted: var(--sv-muted); --lobby-line: var(--sv-line); --lobby-teal: var(--sv-green); --lobby-mint: var(--sv-tint); --lobby-lilac: #f0f1e7; }
.stadium-theme .portal-v2 .lobby-welcome { padding: clamp(16px, 3vw, 32px); background: var(--sv-dark); color: #f5f7ed; border: 1px solid var(--sv-dark); border-radius: var(--sv-radius); box-shadow: none; }
.stadium-theme .portal-v2 .lobby-greeting h1, .stadium-theme .portal-v2 .lobby-student-class { color: #f8faef; }
.stadium-theme .portal-v2 .lobby-greeting p { color: #d5e2d8; }
.stadium-theme .portal-v2 .lobby-balance { background: #25473b; color: #f6f8e8; border-radius: 10px; }
.stadium-theme .portal-v2 .lobby-balance strong { color: var(--sv-citron); }
.stadium-theme .portal-v2 :is(.lobby-backpack,.lobby-destination,.lobby-learning-entry,.lobby-feedback) { border-radius: var(--sv-radius); border-color: var(--sv-line); }
.stadium-theme .portal-v2 :is(.lobby-learning-entry,.lobby-backpack,.lobby-feedback) { background: var(--sv-white); }
.stadium-theme .portal-v2 .lobby-destination:not(.lobby-unavailable) { background: var(--sv-tint); }
.stadium-theme .portal-v2 :is(.lobby-destination-shop,.lobby-destination-gacha):not(.lobby-unavailable) { background: var(--sv-green); color: var(--sv-white); }
.stadium-theme .portal-v2 :is(.lobby-destination-shop,.lobby-destination-gacha):not(.lobby-unavailable) :is(h3,p,.lobby-arrow) { color: var(--sv-white); }
.stadium-theme .platform-shell .platform-auth-layout .auth-panel, .stadium-theme .platform-shell .student-signin .panel { border-radius: var(--sv-radius); box-shadow: none; }
.stadium-theme .student-shell .roster-stack[aria-label="進入教室"] { gap: 12px; }
.stadium-theme .student-shell .roster-stack[aria-label="進入教室"] > p { margin-block: 0; }
.stadium-theme .shop-student-shell { --shop-ink: var(--sv-ink); --shop-muted: var(--sv-muted); }
.stadium-theme .shop-student-shell .button.primary { background: var(--sv-green); border-color: var(--sv-green); }

/* Projection and card-game controls use the same accent without moving stage elements. */
.stadium-theme .display-shell .battle-display-header { color: #f4f7e8; }
.stadium-theme .display-shell .pve-v7-hud .display-boss-hp-track > i { background: var(--sv-citron); }
.stadium-theme .display-shell :focus-visible, .stadium-theme .bt-shell :focus-visible { outline-color: var(--sv-citron); }
.stadium-theme .bt-shell { --bt-ink: var(--sv-dark); --bt-lime: var(--sv-citron); --bt-mint: var(--sv-paper); }
.stadium-theme .bt-shell :is(.bt-header,.bt-wallet,.bt-primary,.bt-secondary) { border-radius: var(--sv-radius); }

@media (max-width: 1000px) {
  .sv-hero h1 { font-size: clamp(40px, 6.2vw, 62px); }
  .sv-hero-layout { grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); }
  .sv-workflow li { grid-template-columns: 40px minmax(0, 1fr); }
  .sv-workflow li p { grid-column: 2; }
}
@media (max-width: 900px) {
  .sv-hero-layout, .sv-field-layout, .sv-section-split { grid-template-columns: minmax(0,1fr); }
  .sv-hero { min-height: auto; }
  .sv-wide-break, .sv-workflow h2 br { display: none; }
  .sv-field-art { aspect-ratio: 1.75; }
  .sv-close-line { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
  .stadium-theme .platform-home-shell .topbar nav { gap: 4px; }
  .stadium-theme .platform-home-shell .topbar nav a { padding-inline: 8px; }
  .sv-hero { padding-block: 28px 42px; }
  .sv-hero h1 { font-size: clamp(29px, 9.4vw, 47px); line-height: 1.15; }
  .sv-hero-copy > p { margin-top: 14px; }
  .sv-hero h1::after { margin-top: 12px; height: 4px; }
  .sv-actions { margin-top: 16px; display: grid; grid-template-columns: minmax(0,1fr); width: 100%; }
  .sv-text-link { margin-top: 2px; }
  .sv-projection-top { font-size: 13px; padding-inline: 8px; }
  .sv-preview-switch button { min-height: 44px; padding-inline: 7px; }
  .sv-arena, .sv-result-frame { min-height: 300px; }
  .sv-golem { width: 77%; height: 70%; }
  .sv-field-art { aspect-ratio: 1.35; }
  .sv-home h2 { font-size: 32px; }
  .sv-close-line h2 { font-size: 26px; }
  .stadium-theme .portal-v2 .lobby-welcome { gap: 12px; }
  .stadium-theme .platform-shell .task-bar { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: no-preference) {
  .sv-hero[data-enter] .sv-hero-copy { animation: sv-arrive 460ms var(--sv-ease) both; }
  .sv-hero[data-enter] .sv-projection { animation: sv-arrive 520ms var(--sv-ease) both; }
  .sv-result-frame, .sv-faq details[open] > p { animation: sv-answer 190ms var(--sv-ease) both; }
  .sv-faq summary > span { transition: transform 170ms var(--sv-ease); }
  .stadium-theme .platform-shell .button { transition: background-color 150ms var(--sv-ease), border-color 150ms var(--sv-ease), transform 120ms var(--sv-ease); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .stadium-theme .platform-shell .button:not(:disabled):hover { transform: translateY(-1px); }
  .stadium-theme .platform-shell .button:not(:disabled):active { transform: translateY(1px); }
}
@keyframes sv-arrive { from { opacity: .45; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sv-answer { from { opacity: .5; } to { opacity: 1; } }
