:root {
  --ink: #fbf6ff;
  --subdued: #c9bfd8;
  --shell: #100e1e;
  --purple: #cba4ff;
  --stroke: #d9bfff38;
  --glass: #19142bec;
  --paper: #faf4f9;
  --paper-ink: #281c3d;
  --hud-height: 4.5rem;
  --mint: #dab5ff;
  --cream: var(--ink);
}

html { scroll-behavior: auto; }
body { background: var(--shell); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 1rem; }
[hidden] { display: none !important; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible {
  outline: 3px solid #a765ef; outline-offset: 3px;
}
.game-hud {
  position: sticky; top: 0; height: auto; min-height: var(--hud-height);
  gap: clamp(.55rem, 2vw, 1.75rem); padding: .65rem clamp(.75rem, 3vw, 2.5rem);
  background: #121020f5; border-color: var(--stroke);
}
.game-wordmark { font-size: clamp(1rem, 2.1vw, 1.6rem); font-weight: 800; letter-spacing: -.07em; white-space: nowrap; line-height: 1.1; }
.game-wordmark > span { color: var(--purple); }
.game-wordmark small { display: block; font-size: .72rem; font-weight: 550; color: var(--subdued); letter-spacing: .03em; margin-top: .25rem; }
.game-progress { display: grid; gap: .28rem; width: min(14rem, 20vw); text-align: center; color: var(--subdued); font-size: .78rem; line-height: 1.2; }
.game-progress progress {
  width: 100%; height: .32rem; appearance: none; border: 0; border-radius: 1rem; background: #392b50; color: var(--purple);
}
.game-progress progress::-webkit-progress-bar { background: #392b50; border-radius: 1rem; }
.game-progress progress::-webkit-progress-value { background: linear-gradient(90deg, #8d63ec, #e0aafe); border-radius: 1rem; transition: width .45s ease; }
.game-progress progress::-moz-progress-bar { background: var(--purple); border-radius: 1rem; }
.game-hud .hud-right { gap: .55rem; }
.game-hud .quiet-btn, .game-footer .quiet-btn { font-size: .82rem; min-height: 2.5rem; padding: .42rem .78rem; white-space: nowrap; background: #251c38; border-color: var(--stroke); }
.game-hud .quiet-btn:hover, .game-footer .quiet-btn:hover { background: #403056; }
.game-hud .help-button { width: 2.5rem; padding: 0; font-size: 1.05rem; font-weight: 780; }
.demo-label { color: var(--subdued); border: 1px solid var(--stroke); border-radius: 1rem; padding: .2rem .5rem; font-size: .76rem; white-space: nowrap; }
.game-hud .audio-controls { margin-left: 0; border-color: var(--stroke); background: #251b38; box-shadow: none; }
.game-hud .sound-toggle { background: #d9b8ff20; color: var(--ink); }
.game-hud .sound-toggle.muted { background: #ffffff0c; color: var(--subdued); }
.game-footer { display: flex; justify-content: space-between; align-items: center; min-height: 3.25rem; padding: .3rem clamp(.75rem, 3vw, 2.5rem); color: var(--subdued); font-size: .8rem; border-top: 1px solid var(--stroke); }
.game-footer .quiet-btn { min-height: 2.15rem; }

.game-screen { position: relative; isolation: isolate; display: grid; min-height: calc(100svh - var(--hud-height) - 3.25rem); overflow: clip; background: #171124; }
.scene-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: -3; }
.game-screen::before {
  content: ''; position: absolute; z-index: -2; inset: 0;
  background: linear-gradient(90deg, #130f20ed, #1b1128bf 44%, #16112827 81%), linear-gradient(0deg, #130e23b8, transparent 70%);
}
.screen-content {
  width: min(100%, 92rem); min-width: 0; margin: auto; padding: clamp(1.25rem, 4vw, 3.5rem);
  animation: screen-in .44s both cubic-bezier(.2,.65,.3,1);
}
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.scene-panel { width: min(100%, 38rem); min-width: 0; }
.game-screen h1, .game-screen h2, .game-screen h3, .game-dialog h2 { font-family: inherit; letter-spacing: -.055em; font-weight: 750; }
.game-screen h1 { margin: .38rem 0 1rem; max-width: 18ch; font-size: clamp(2.15rem, 5.6vw, 5.15rem); line-height: .99; text-wrap: balance; }
.game-screen h1:focus { outline: none; }
.game-screen h2 { margin: 0 0 .65rem; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.14; }
.game-screen h3 { margin: 0 0 .65rem; font-size: 1.32rem; line-height: 1.22; }
.game-screen p, .game-dialog p { line-height: 1.55; }
.lead { font-size: clamp(1rem, 1.7vw, 1.3rem); color: #f6efff; max-width: 50ch; }
.kicker { margin: 0; font-size: .83rem; color: var(--purple); font-weight: 720; letter-spacing: .1em; text-transform: uppercase; }
.small-note { font-size: .86rem; line-height: 1.48; color: var(--subdued); }
.action-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.game-screen .button-main, .game-dialog .button-main, .maya-guide .button-main {
  min-height: 2.85rem; padding: .65rem 1.2rem; border-radius: .85rem;
  background: linear-gradient(135deg, #e2b4ff, #b58af8); color: #27143d; font-size: .94rem; font-weight: 760;
  box-shadow: 0 4px 18px #2110392b;
}
.game-screen .button-main:hover, .game-dialog .button-main:hover, .maya-guide .button-main:hover {
  background: linear-gradient(135deg, #f1d2ff, #c4a5fa);
}
.game-screen .button-secondary, .game-dialog .button-secondary {
  min-height: 2.85rem; border-radius: .85rem; font-size: .91rem; padding: .65rem 1rem;
}
.screen-home .screen-content { display: flex; justify-content: flex-end; }
.screen-home::before { background: linear-gradient(90deg, #20132d15, #1b102d65 39%, #120b20f7 97%), linear-gradient(0deg, #180e2b9d, transparent 58%); }
.screen-home .scene-art { object-position: 36% center; }
.screen-home .scene-panel { padding: clamp(1.2rem, 3.5vw, 2.5rem); width: min(100%, 40rem); background: linear-gradient(155deg,#271636c7,#161021f4); border: 1px solid var(--stroke); border-radius: 1.65rem; box-shadow: 0 24px 75px #09031378; }
.screen-home .scene-chapter { font-size: .85rem; }
.screen-home h1 { max-width: 12ch; }
.study-facts { display: flex; gap: .45rem; flex-wrap: wrap; margin: 1.25rem 0 1.6rem; }
.study-facts span { padding: .42rem .67rem; background: #ac81ed21; border: 1px solid var(--stroke); color: #efe1ff; border-radius: 1rem; font-size: .83rem; }

.screen-consent .scene-panel, .screen-scenario .scene-panel, .screen-reflection .scene-panel, .screen-review .scene-panel {
  padding: clamp(1.1rem, 3vw, 2rem); margin-inline: auto; border: 1px solid var(--stroke); border-radius: 1.4rem;
  background: var(--glass); box-shadow: 0 20px 70px #0906167a;
}
.screen-consent h1, .screen-scenario h1, .screen-reflection h1, .screen-review h1, .screen-workspace h1 { font-size: clamp(2rem, 4.1vw, 3.45rem); max-width: none; }
.screen-scenario .scene-panel { width: min(100%, 51rem); }
.screen-scenario .choice-card { background: #392451; padding: .65rem .85rem; }
.study-check {
  display: flex; gap: .7rem; align-items: flex-start; margin: .85rem 0; padding: .8rem;
  border: 1px solid var(--stroke); border-radius: .75rem; background: #ccb0eb12; font-size: .94rem; line-height: 1.44; cursor: pointer;
}
.study-check input { flex: 0 0 auto; width: 1.18rem; height: 1.18rem; margin: .08rem 0 0; accent-color: #8955c4; }
.protocol-card, .sample-answer { padding: .95rem; margin: .85rem 0; border: 1px solid var(--stroke); border-radius: .8rem; background: #ab89d317; }
.protocol-card p:last-child, .sample-answer p:last-child { margin-bottom: 0; }
.protocol-card .kicker, .sample-answer .kicker { margin-bottom: .35rem; }
.sample-reference { border-left: .2rem solid #ba88ee; padding-left: .65rem; overflow-wrap: anywhere; }
.assignment-lead { font-weight: 650; max-width: 68ch; }
.assignment-length { padding: .55rem .75rem; border-inline-start: 3px solid #7644a0; background: #e9dcf3; border-radius: .3rem; }
.screen-narrative .scene-panel { padding: clamp(.95rem, 3vw, 1.5rem); border-radius: 1.35rem; background: linear-gradient(145deg, #20162ee8, #191023e0); border: 1px solid var(--stroke); }
.screen-narrative .scene-art { object-position: 62% center; }
.character-bubble { display: flex; align-items: flex-start; gap: .75rem; max-width: 33rem; margin: .85rem 0; padding: .75rem; border-radius: 1rem 1rem 1rem .25rem; background: #f7ebff; color: #342344; }
.character-bubble p { margin: .12rem 0 0; line-height: 1.38; }
.character-bubble small, .player-bubble small { display: block; font-size: .76rem; font-weight: 800; }
.player-bubble { width: max-content; max-width: 100%; margin-left: auto; border-radius: .9rem .9rem .3rem .9rem; padding: .45rem .8rem; background: #6c37ae; font-weight: 750; }
.scene-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-top: 1rem; }
.single-choice { display: flex; }
.choice-card {
  display: flex; flex-direction: column; align-items: stretch; justify-content: center; min-height: 3rem;
  padding: 0; overflow: hidden; text-align: left; background: #302047; color: var(--ink);
  border-radius: .85rem; border: 1px solid var(--stroke); font-size: .98rem; font-weight: 700;
  transition: background .2s ease, border-color .2s ease;
}
.choice-card:hover { background: #4b3265; border-color: #c995ff; }
.choice-card img { width: 100%; height: clamp(4.5rem, 11vw, 9rem); object-fit: cover; display: block; }
.choice-card span { padding: .68rem .8rem; }
.screen-scenario .choice-card span { padding: .08rem; }

.screen-alarm .scene-panel, .screen-phone .scene-panel, .screen-bridge .scene-panel { margin-inline: auto; text-align: center; }
.screen-alarm h1, .screen-phone h1, .screen-bridge h1 { margin: .36rem auto .85rem; font-size: clamp(1.75rem, 4vw, 3.1rem); }
.screen-alarm::before, .screen-phone::before, .screen-bridge::before { background: radial-gradient(ellipse at center, #29194260, #100b1ce8 82%); }
.game-phone {
  display: flex; flex-direction: column; position: relative;
  width: min(100%, clamp(17rem, 43svh, 20.25rem)); aspect-ratio: 9 / 16; min-height: 0;
  margin-inline: auto; padding: .65rem; text-align: left; border: .46rem solid #15101f;
  outline: 1px solid #c9b3dc7d; border-radius: 2.1rem; overflow: hidden;
  background: linear-gradient(150deg,#39305f,#1e193a 53%,#18132c);
  box-shadow: 0 14px 60px #10051bba, inset 0 0 0 1px #e2c4ff33;
}
.phone-system { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: .05rem .43rem .6rem; font-size: .8rem; font-weight: 700; }
.phone-system span:last-child { text-align: right; }
.phone-system i { display: block; width: 4rem; height: .8rem; border-radius: 1rem; background: #100d17; }
.alarm-body { min-height: 0; flex: 1; display: grid; place-content: center; text-align: center; }
.alarm-body span { font-size: 2.4rem; color: #e2baff; }
.alarm-body time, .lock-phone > time { font-size: clamp(2.7rem, 12vw, 4.4rem); font-weight: 730; letter-spacing: -.09em; line-height: 1; }
.alarm-body p { color: var(--subdued); }
.alarm-phone .button-main, .lock-phone .button-main { margin: auto .3rem .5rem; }
.text-header, .phone-notification, .guide-heading { display: flex; gap: .6rem; align-items: center; }
.text-header { padding: .45rem .35rem .6rem; border-bottom: 1px solid #ffffff26; }
.text-header small { display: block; color: #dfc9f2; font-size: .76rem; }
.maya-avatar { display: grid; place-items: center; flex: 0 0 2.05rem; width: 2.05rem; height: 2.05rem; border-radius: 50%; color: #28183d; background: linear-gradient(145deg,#ffcfbf,#c7a4ff); font-weight: 820; }
.message-thread { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: .82rem .3rem; }
.message-bubble { max-width: 91%; margin: 0 0 .55rem; padding: .58rem .72rem; font-size: .95rem; }
.message-bubble.received { background: #faeffa; color: #302247; border-radius: .85rem .85rem .85rem .15rem; }
.message-bubble.sent { align-self: flex-end; color: white; background: #6943ab; border-radius: .85rem .85rem .15rem .85rem; }
.message-thread small { align-self: flex-end; margin: -.38rem 0 .6rem; color: var(--subdued); }
.phone-actions { display: grid; margin: 0 .3rem .5rem; gap: .45rem; }
.message-phone .maya-chat { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.message-phone .message-thread { min-height: 0; max-height: none; overflow-wrap: anywhere; }
.message-phone .maya-compose textarea { resize: none; }
.lock-phone { background: linear-gradient(160deg,#211b45b8,#201030e6), url('assets/campus.webp') center/cover; }
.lock-phone > time { text-align: center; margin-top: 1.25rem; }
.lock-phone > time + p { text-align: center; margin-top: .5rem; }
.phone-notification { margin: .75rem .2rem 1.5rem; background: #f8eff9; padding: .75rem; border-radius: .9rem; color: var(--paper-ink); }
.phone-notification p { margin: .1rem 0 0; }

.screen-workspace::before { background: linear-gradient(135deg, #140e2070, #1b1027a8); }
.screen-workspace .screen-content {
  display: flex; width: 100%; min-width: 0; margin: 0; padding: clamp(.5rem, 1.25vw, 1.45rem);
}
.screen-workspace .scene-panel { display: flex; width: 100%; min-width: 0; }
.laptop {
  width: 100%; min-width: 0; overflow: hidden; border: 1px solid #bda5df81; border-radius: .95rem;
  box-shadow: 0 18px 65px #090512aa, inset 0 1px #e0c9fa24; background: #211831;
}
.workspace-portal {
  --workspace-pad: clamp(.95rem, 2.5vw, 2.45rem);
  display: flex; flex-direction: column;
}
.workspace-portal .workspace-window-bar { cursor: default; touch-action: auto; }
.workspace-footer-actions { display: flex; align-items: center; gap: .6rem; }
.workspace-help-slot { flex: none; }
.workspace-help-slot .activity-chat-launcher {
  position: static; background: #3c2b50; border-color: #ad8bc66b; box-shadow: none;
}
.workspace-help-slot .activity-chat-launcher:hover { background: #513a6a; }
.workspace-portal .portal-address-bar { background: #292436; }
.laptop-body { display: grid; grid-template-columns: clamp(10rem, 13vw, 15rem) minmax(0, 1fr); flex: 1; }
.workspace-sidebar { min-width: 0; background: linear-gradient(160deg, #35204c, #21182f 60%); }
.workspace-sidebar .portal-university { padding: 1.1rem .95rem .85rem; }
.workspace-tabs { display: grid; gap: .28rem; padding: .4rem .65rem .8rem; }
.workspace-tabs button {
  display: flex; align-items: center; gap: .55rem; min-width: 0; text-align: left;
  padding: .56rem .65rem; font-size: .94rem; border: 1px solid transparent;
  min-height: 2.8rem; border-radius: .55rem; color: #f3e7ff; background: transparent;
}
.workspace-tabs button::before {
  content: ''; flex: none; width: .9rem; height: 1rem; border: 1.3px solid currentColor; border-radius: .2rem;
  background: linear-gradient(currentColor, currentColor) center .25rem / .46rem 1px no-repeat,
              linear-gradient(currentColor, currentColor) center .48rem / .46rem 1px no-repeat;
  opacity: .85;
}
.workspace-tabs [data-tab="chat"]::before {
  height: .8rem; border-radius: .32rem;
  background: radial-gradient(circle, currentColor 34%, transparent 48%) center / .22rem .22rem repeat-x;
}
.workspace-tabs [data-tab="resources"]::before { height: .8rem; border-radius: .12rem; }
.workspace-tabs button:hover, .workspace-tabs button[aria-selected="true"] { background: #4f3776; border-color: #c79aff80; }
.workspace-tabs button[aria-selected="true"] { font-weight: 750; }
.workspace-content {
  display: grid; min-width: 0; align-content: stretch; color: var(--paper-ink); background: #faf5fb;
  grid-template: "heading rail" auto "panel rail" minmax(0, 1fr) / minmax(0, 1fr) clamp(10.5rem, 15vw, 15rem);
}
.workspace-heading {
  grid-area: heading; min-width: 0; padding: var(--workspace-pad) var(--workspace-pad) .85rem;
  border-bottom: 1px solid #e7dcef;
}
.screen-workspace .workspace-heading .scene-chapter { color: #6b3caa; }
.screen-workspace .workspace-heading h1 { margin: .3rem 0 0; font-size: clamp(1.75rem, 3vw, 3.45rem); }
.workspace-rail { grid-area: rail; padding: var(--workspace-pad) clamp(.6rem, 1.3vw, 1.15rem); border-inline-start: 1px solid #e7dcef; background: #f3ebf8; }
.workspace-rail .story-side {
  position: static; z-index: auto; width: auto; grid-template-columns: minmax(0, 1fr);
  padding: 0; background: transparent;
}
.workspace-rail .clock-card {
  padding: .85rem; background: linear-gradient(145deg,#211831,#3a2356); color: #f8eeff;
  box-shadow: 0 5px 16px #39265627;
}
.workspace-rail .activity1-help-button {
  position: static; color: #382051; background: #eadcf8; border-color: #a886d372;
  border-radius: .6rem; box-shadow: none; font-size: .86rem;
}
.workspace-rail .activity1-help-button span { color: #7039a0; }
.workspace-rail .activity1-help-button:hover { background: #e1ccf4; }
.laptop-screen { grid-area: panel; min-width: 0; min-height: 0; color: var(--paper-ink); }
.laptop-screen > section { min-width: 0; padding: clamp(.85rem, 1.65vw, 1.45rem) var(--workspace-pad) var(--workspace-pad); }
.workspace-content .assignment-length {
  padding: .64rem .85rem; border-inline-start: 3px solid #8a54c5; border-radius: .45rem;
  color: #392050; background: #eee0fb;
}
.laptop-screen #panel-document textarea[id^="taskResponse"] { min-height: clamp(14rem, 36dvh, 30rem); }
.laptop-screen .small-note, .reflection-field .small-note { color: #554563; }
.laptop-screen .kicker { color: #633d93; }
.laptop-screen .status-line { color: #543274; margin: .35rem 0 0; }
.panel-title { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.document-status { font-size: .85rem; color: #57476d; white-space: nowrap; }
.field-label, .reflection-field label { display: block; margin: .45rem 0 .28rem; font-size: .96rem; font-weight: 700; }
.laptop textarea, .reflection-field textarea {
  display: block; min-height: 0; color: var(--paper-ink); background: #fffaff;
  border: 1px solid #8266a577; font-size: 1rem; border-radius: .62rem; padding: .67rem; resize: vertical;
}
.laptop details { padding: .65rem 0; border-bottom: 1px solid #b9a2ce; }
.laptop details summary { font-weight: 720; cursor: pointer; }
.laptop details > :not(summary) { margin-top: .65rem; }
.laptop .button-secondary, .screen-reflection .button-secondary, .screen-review .button-secondary { background: #e9dbf7; color: #332146; border-color: #8561a674; }
.laptop .chat-history { min-height: 8rem; height: clamp(13rem, 38dvh, 30rem); border-radius: .65rem; padding: .7rem; background: #eee5f4; scrollbar-color: #9270b9 transparent; }
.laptop .chat-turn { color: #312442; background: #fffcff; font-size: .94rem; }
.laptop .chat-turn.user { color: #fff; background: #604294; }
.laptop .chat-turn strong { font-size: .79rem; }
.laptop .chat-turn p { margin: .18rem 0 0; line-height: 1.5; }
.laptop .chat-compose { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; }
.laptop .chat-compose textarea { min-height: 2.75rem; }
.laptop-footer {
  display: flex; justify-content: flex-end; align-items: center; gap: .65rem;
  padding: .6rem 1rem; background: linear-gradient(100deg,#23192f,#342348); border-top: 1px solid var(--stroke);
}
.laptop-footer p { margin: 0 auto 0 0; color: #e4d3f3; font-size: .875rem; }
.laptop-footer .button-main { flex-shrink: 0; }
@media (max-width: 1120px) {
  .workspace-content { grid-template: "heading" auto "rail" auto "panel" minmax(0, 1fr) / minmax(0, 1fr); }
  .workspace-rail { padding: .65rem var(--workspace-pad); border-inline-start: 0; border-bottom: 1px solid #e7dcef; }
  .workspace-rail .story-side { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .workspace-rail .clock-card { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .62rem; padding: .45rem .65rem; }
  .workspace-rail .clock-card .kicker { font-size: .71rem; }
  .workspace-rail .clock-card > time { font-size: 1.2rem; }
  .workspace-rail .story-deadline { margin: 0; }
  .workspace-rail .story-deadline small { margin: 0; }
}

.screen-reflection .scene-panel, .screen-review .scene-panel {
  background: var(--paper); color: var(--paper-ink); border-color: #ecd8ff; width: min(100%, 49rem);
}
.screen-reflection .scene-chapter, .screen-review .scene-chapter { color: #633a8a; }
.screen-reflection .study-check, .screen-review .study-check { border-color: #a68caf8f; background: #eadff3; }
.reflection-field { display: grid; grid-template-columns: 1.95rem minmax(0,1fr); gap: .56rem; align-items: start; margin: .6rem 0; }
.reflection-field > span { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-top: .18rem; color: #fff; background: #7645ba; border-radius: 50%; font-weight: 700; font-size: .82rem; }
.screen-review .status-line { color: #542b7c; }
.screen-left .scene-panel { margin-left: auto; padding: clamp(1rem, 4vw, 2.2rem); background: #21172be8; border: 1px solid var(--stroke); border-radius: 1.5rem; }
.screen-left::before { background: linear-gradient(90deg,#1b10202b,#1b102aa8 60%,#120b20dc); }

.story-side.ending-side:not(:has(> .maya-guide:not([hidden]))) { display: none; }
.ending-scene .screen-content { width: min(100%, 84rem); padding: clamp(1.25rem, 3.8vw, 3.25rem); }
.ending-scene .scene-panel { width: 100%; min-width: 0; }
.ending-scene h1 { max-width: none; }
.screen-ending-library .screen-content, .screen-ending-success .screen-content {
  display: grid; align-self: stretch; margin-block: 0;
}
.screen-ending-library .scene-panel, .screen-ending-success .scene-panel { display: flex; flex-direction: column; }
.screen-ending-library .scene-art, .screen-ending-success .scene-art {
  object-position: center 44%; animation: ending-dolly 8s ease-out both;
}
@keyframes ending-dolly { from { transform: scale(1); } to { transform: scale(1.07); } }
.screen-ending-library::before, .screen-ending-success::before {
  background: linear-gradient(180deg, #15101fc9, transparent 33%, transparent 62%, #15101ff0 100%);
}
.ending-film-dialogue { margin-top: auto; padding-top: clamp(11rem, 35svh, 24rem); }
.ending-bubbles { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.ending-bubbles blockquote {
  max-width: min(24rem, 48%); margin: 0; padding: .85rem 1rem; border-radius: 1rem 1rem 1rem .25rem;
  border: 1px solid #dbc1ff73; background: #241b38ec; box-shadow: 0 8px 30px #10091980;
}
.ending-bubbles blockquote:last-child { background: #503470ec; border-radius: 1rem 1rem .25rem 1rem; }
.ending-bubbles strong { display: block; font-size: .8rem; color: #e1c0ff; }
.ending-bubbles p { margin: .18rem 0 0; }
.screen-ending-success h1 { color: #eeffdf; animation: ending-reveal .45s ease-out both; }
.screen-ending-success .ending-bubbles blockquote { animation: ending-reveal .45s .38s ease-out both; }
.screen-ending-success .ending-bubbles blockquote:last-child { animation-delay: .7s; }
@keyframes ending-reveal { from { opacity: 0; transform: translateY(.6rem); } to { opacity: 1; transform: none; } }

:is(.screen-ending-portal, .screen-complete)::before { background: linear-gradient(125deg, #14122514, #1310205e), linear-gradient(0deg, #11101d8c, transparent 45%); }
:is(.screen-ending-portal, .screen-complete) .screen-content { width: min(100%, 92rem); padding: clamp(.75rem, 2.6vw, 2.25rem); }
.campus-desktop { display: grid; gap: clamp(.75rem, 2vw, 1.4rem); }
.desktop-windows {
  display: grid; grid-template-columns: minmax(17rem, .59fr) minmax(0, 1fr);
  gap: clamp(.8rem, 1.5vw, 1.35rem); align-items: end; isolation: isolate;
}
.desktop-workspace { min-width: 0; }
#submissionGuideSlot:has(> .maya-guide:not([hidden])) { margin-block-end: .9rem; }
#submissionGuideSlot .maya-guide { max-width: 24rem; }
#submissionGuideSlot .maya-guide p { margin-block: .4rem .55rem; }
.desktop-window {
  position: relative; min-width: 0; overflow: hidden; border: 1px solid #af98d17d; border-radius: .7rem;
  box-shadow: 0 20px 56px #080612bf, 0 1px 1px #d8c8ff36 inset;
}
.desktop-window.window-active { z-index: 2; border-color: #cbb3f7; }
.desktop-window.window-minimized { visibility: hidden; }
.desktop-window.window-moving { box-shadow: 0 22px 66px #080612f0, 0 0 0 1px #d9b7ff; }
.desktop-window-bar {
  display: flex; align-items: end; padding: .48rem .58rem 0;
  background: #181721; border-bottom: 1px solid #d9c6f129; font-size: .88rem;
}
.desktop-minimize {
  display: none; place-items: center; align-self: center; width: 2.35rem; min-height: 2rem;
  margin: 0 0 .35rem auto; border: 1px solid transparent; border-radius: .4rem; color: #f1dfff; background: transparent;
}
.desktop-minimize::before { content: ''; width: .72rem; height: 2px; border-radius: 1px; background: currentColor; }
.desktop-minimize:hover { background: #413153; border-color: #e2c4ff45; }
.desktop-window-bar:focus-visible, .desktop-minimize:focus-visible { outline-offset: -3px; }
.desktop-window-tab {
  display: flex; align-items: center; gap: .6rem; min-height: 2.25rem; padding: .32rem .78rem;
  border: 1px solid #d9c6f12c; border-bottom: 0; border-radius: .49rem .49rem 0 0;
  background: #2b2837; font-weight: 660;
}
.desktop-window-bar h2 { margin: 0; font-size: .91rem; letter-spacing: 0; }
.workspace-report { background: linear-gradient(155deg, #1c1c27, #151520); }
.desktop-folder {
  position: relative; display: inline-block; width: 1.16rem; height: .76rem; flex: none; border-radius: .16rem;
  background: linear-gradient(#efd287, #c38c4c); margin-top: .2rem;
}
.desktop-folder::before {
  content: ''; position: absolute; left: 0; top: -.18rem; width: .55rem; height: .26rem;
  background: #efd287; border-radius: .13rem .15rem 0 0;
}
.desktop-file-path {
  margin: .58rem .65rem; padding: .4rem .62rem; border: 1px solid #d7c8ed2c; border-radius: .38rem;
  background: #13121b; color: #dfd5ed; font-size: .81rem;
}
.desktop-file-path span { margin: 0 .3rem; color: #a497b7; }
.desktop-file-browser { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid #e3d4fa22; }
.desktop-file-tree {
  display: none; padding: .7rem .44rem; border-inline-end: 1px solid #ded3ef22;
  background: #22212e; color: #dfd5ed; font-size: .82rem;
}
.desktop-file-tree strong { display: block; padding: .3rem .4rem; }
.desktop-file-tree [aria-current] {
  display: flex; align-items: center; gap: .35rem; padding: .42rem .4rem; border-radius: .3rem;
  background: #382d49; color: #f7edff;
}
.report-drawer { min-width: 0; min-height: 14rem; padding: .66rem .7rem .8rem; }
.desktop-file-list-label { margin: 0 0 .45rem; padding: 0 .25rem .3rem; border-bottom: 1px solid #ded3ef22; color: #dbcee8; font-size: .81rem; }
.report-file {
  width: 100%; display: flex; text-align: start; align-items: center; gap: .65rem; padding: .7rem;
  border: 1px solid #8f9fe778; border-radius: .42rem; color: var(--ink); background: #323857; cursor: grab;
}
.report-file:hover, .report-file[aria-pressed="true"] { border-color: #b8a5f2; background: #49446b; }
.report-file:active { cursor: grabbing; }
.report-file strong, .report-file small { display: block; overflow-wrap: anywhere; }
.report-file strong { font-size: .94rem; }
.report-file small { margin-top: .15rem; color: #e3d5f2; font-size: .82rem; }
.report-grip {
  flex: none; margin-inline-start: auto; width: .7rem; height: 1.06rem;
  background: radial-gradient(circle, #d4baf6 1px, transparent 1.5px) 0 0 / .35rem .35rem;
}
.report-symbol {
  position: relative; flex: none; width: 1.65rem; height: 2.1rem;
  border-radius: .23rem; clip-path: polygon(0 0, 70% 0, 100% 25%, 100% 100%, 0 100%);
  background: linear-gradient(145deg, #f6f0ff, #d2b8ff);
}
.report-symbol::before { content: ''; position: absolute; right: 0; top: 0; width: 30%; height: 25%; background: #9f7cde; }
.report-symbol::after {
  content: ''; position: absolute; width: 54%; height: 2px; left: 22%; bottom: 44%;
  color: #7453b0; background: currentColor; box-shadow: 0 .3rem, 0 .6rem;
}
.workspace-report details { margin-top: .6rem; color: #e6daef; font-size: .88rem; }
.workspace-report summary { cursor: pointer; }
.workspace-report summary { min-height: 2rem; padding-block: .34rem; }
.portal-report-preview {
  max-height: 10rem; overflow: auto; padding: .6rem; margin: .25rem 0 0; border-radius: .42rem;
  background: #151522; white-space: pre-wrap; overflow-wrap: anywhere;
}
.desktop-files-footer {
  border-top: 1px solid #e3d4fa26; background: #191826; padding: .58rem .9rem;
  color: #d8cde6; font-size: .8rem;
}
.desktop-files-footer span { color: #bce6cb; margin-inline-end: .25rem; }
.submission-portal { background: linear-gradient(155deg, #211534, #171121); }
.portal-window-bar { background: #1a1826; }
.portal-brand-mark {
  flex: none; display: grid; place-items: center; width: 1.65rem; aspect-ratio: 1; border-radius: .43rem;
  background: linear-gradient(145deg, #e3b9ff, #9362e6); color: #231139; font-weight: 850;
}
.desktop-window-tab .portal-brand-mark { width: 1.25rem; border-radius: .3rem; font-size: .77rem; }
.portal-address-bar {
  display: flex; align-items: center; gap: .6rem; padding: .45rem .65rem;
  border-bottom: 1px solid #d9c6f128; background: #2b2837;
}
.portal-address-bar .desktop-file-path { flex: 1; min-width: 0; margin: 0; }
.portal-simulation {
  flex: none; padding: .22rem .55rem; border: 1px solid #d8c4f042;
  border-radius: 2rem; color: #ebd9ff; text-align: center; font-size: .8rem;
}
.portal-window-content { display: grid; grid-template-columns: 8.6rem minmax(0, 1fr); }
.portal-navigation {
  display: flex; flex-direction: column; gap: .4rem; padding: .8rem .5rem;
  border-inline-end: 1px solid #d8c4f027; background: #231736;
}
.portal-university { display: flex; align-items: center; gap: .45rem; padding: .3rem .2rem .85rem; }
.portal-university strong, .portal-university small { display: block; }
.portal-university strong { letter-spacing: .08em; font-size: .93rem; }
.portal-university small { color: #e0ccec; font-size: .8rem; }
.portal-nav-current, .portal-navigation button {
  color: var(--ink); text-align: start; padding: .55rem .52rem; border-radius: .4rem; font-size: .83rem;
}
.portal-nav-current { background: #5b3185; font-weight: 670; }
.portal-navigation button { background: transparent; border: 1px solid transparent; }
.portal-navigation button:hover { background: #37244d; border-color: #b08ad55e; }
.portal-body { min-width: 0; padding: clamp(.9rem, 2.15vw, 1.55rem); }
:is(.screen-ending-portal, .screen-complete) .portal-body h1 {
  margin: 0 0 .85rem; font-size: clamp(1.6rem, 2.6vw, 2.5rem); text-wrap: initial;
}
.portal-course-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: .7rem; padding: .85rem; border: 1px solid #b59be442; border-radius: .72rem;
  background: linear-gradient(125deg, #3b2a55, #2c1d41);
}
.portal-course-card .report-symbol { margin-inline: .1rem; }
.portal-course-card h2 { margin: 0; font-size: 1.1rem; letter-spacing: -.02em; }
.portal-course-card p { margin: .15rem 0 0; color: #e0d1ee; font-size: .84rem; }
.portal-course-card .portal-due {
  margin: 0; padding: .35rem .55rem; border-radius: .45rem; background: #4c2855; color: #ffe1ef; text-align: center;
}
.portal-due time { display: block; font-weight: 700; white-space: nowrap; }
.portal-dropzone {
  width: 100%; margin-top: .85rem; padding: 1.05rem .75rem; min-height: 10.75rem;
  display: grid; align-content: center; justify-items: center; gap: .34rem;
  border: 2px dashed #bb95f4a8; border-radius: .78rem; color: var(--ink); font-size: 1rem;
  background: radial-gradient(ellipse at 50% 0, #7049b151, transparent 85%), #302347;
  text-align: center; transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.portal-upload-icon {
  position: relative; width: 2.5rem; height: 2.4rem; margin-bottom: .3rem; color: #debbff;
}
.portal-upload-icon::before {
  content: '\2191'; position: absolute; inset: -.75rem 0 0; font-size: 2.25rem; line-height: 1.4;
}
.portal-upload-icon::after {
  content: ''; position: absolute; inset: 1.45rem .05rem 0; border: 2px solid currentColor;
  border-top: 0; border-radius: 0 0 .45rem .45rem;
}
#dropzoneHint { color: #e4d4f2; font-size: .88rem; }
.portal-dropzone:hover, .portal-dropzone.drag-over { background-color: #4c3166; border-color: #e8bcff; }
.report-dragging .portal-dropzone:not([aria-pressed="true"]) { border-color: #e8bcff; box-shadow: inset 0 0 1.6rem #b47df049; }
.portal-dropzone[aria-pressed="true"] { border-style: solid; border-color: #a1debd; background: #263b3a; }
.portal-dropzone[aria-pressed="true"] .portal-upload-icon { color: #c2f2d5; }
.portal-dropzone[aria-pressed="true"] .portal-upload-icon::before { content: '\2713'; inset: -.25rem 0 0; }
.portal-dropzone[aria-pressed="true"] .portal-upload-icon::after { display: none; }
.submission-portal .portal-submit {
  width: 100%; margin-top: .85rem; color: #fff; background: linear-gradient(105deg, #7131b9, #8543cd);
  border: 1px solid #c796f769; box-shadow: 0 6px 16px #10091e7a;
}
.submission-portal .portal-submit:not(:disabled):hover { background: linear-gradient(105deg, #8140c8, #914bd7); }
.submission-portal .portal-submit:disabled { background: #352546; color: #c7b5d8; box-shadow: none; opacity: 1; cursor: default; }
.fictional-upload { margin-top: .8rem; }
.fictional-upload progress { display: block; width: 100%; height: .7rem; accent-color: #cb9df9; }
.portal-receipt {
  display: grid; place-items: center; align-content: center; gap: .5rem; min-height: 14.5rem; margin-top: .85rem;
  padding: 1rem; border: 1px solid #a1debd85; border-radius: .78rem; text-align: center;
  background: radial-gradient(ellipse at 50% 0, #46755848, transparent 85%), #202b32;
  animation: ending-reveal .36s ease-out both;
}
.portal-receipt-check {
  display: grid; place-items: center; width: 2.65rem; aspect-ratio: 1; border-radius: 50%;
  background: #b8eac8; color: #193726; font-size: 1.55rem; font-weight: 800;
}
.portal-receipt h2 { margin: 0; font-size: clamp(1.14rem, 2.5vw, 1.55rem); letter-spacing: -.035em; color: #ebfff1; }
.portal-receipt p { margin: 0 0 .2rem; color: #d0e6dc; font-size: .9rem; overflow-wrap: anywhere; }
.desktop-dock {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem; padding: .45rem .7rem;
  border: 1px solid #d3bcfc42; border-radius: .6rem; background: #181623ee;
  box-shadow: 0 8px 32px #080612a8;
}
.desktop-dock > button { justify-self: start; }
.desktop-dock .button-secondary { min-height: 2.5rem; padding: .4rem .7rem; border-radius: .42rem; background: #2b253b; }
.desktop-app-switcher { display: flex; grid-column: 2; gap: .38rem; }
.desktop-app-switcher button { display: flex; align-items: center; gap: .5rem; }
.desktop-app-switcher button[aria-expanded="false"] { background: #171420; border-style: dashed; }
.desktop-app-switcher .portal-brand-mark { width: 1.23rem; border-radius: .3rem; font-size: .75rem; }
.desktop-dock time {
  grid-column: 3; justify-self: end; color: var(--ink); font-weight: 720; white-space: nowrap; font-size: .88rem; font-variant-numeric: tabular-nums;
}

@media (min-width: 801px) {
  .desktop-windows { padding-block: 2rem; }
  .desktop-window-bar { cursor: grab; user-select: none; touch-action: none; }
  .window-moving .desktop-window-bar { cursor: grabbing; }
  .desktop-minimize { display: grid; }
}
@media (min-width: 1150px) {
  .desktop-file-browser { grid-template-columns: 7.65rem minmax(0, 1fr); }
  .desktop-file-tree { display: block; }
}
@media (max-width: 1020px) {
  .portal-window-content { grid-template-columns: minmax(0, 1fr); }
  .portal-navigation { flex-direction: row; align-items: center; border-inline-end: 0; border-bottom: 1px solid #d8c4f027; padding: .32rem .65rem; }
  .portal-university { display: none; }
  .portal-navigation button { margin-inline-start: auto; }
}
@media (max-width: 800px) {
  .desktop-windows { grid-template-columns: minmax(0, 1fr); }
  .report-drawer { min-height: 0; }
  .desktop-files-footer { display: none; }
  .portal-dropzone { min-height: 8rem; }
}
@media (max-width: 580px) {
  .desktop-dock { grid-template-columns: 1fr auto; }
  .desktop-app-switcher { display: none; }
  .desktop-dock time { grid-column: 2; }
}
@media (max-width: 420px) {
  .desktop-file-path { overflow-wrap: anywhere; }
  .portal-address-bar { gap: .4rem; padding-inline: .5rem; }
  .portal-address-bar .desktop-file-path { padding-inline: .38rem; }
  .portal-address-bar .desktop-file-path span { margin-inline: .16rem; }
  .portal-course-card { grid-template-columns: auto minmax(0, 1fr); }
  .portal-course-card .portal-due { grid-column: 1 / -1; padding: .22rem .4rem; text-align: start; }
  .portal-due time { display: inline; margin-inline-start: .2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-dropzone { transition: none; }
  .portal-receipt { animation: none; }
}

.result-confirmation {
  display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; padding: .7rem .85rem;
  border: 1px solid #67b287; border-radius: .66rem; background: linear-gradient(125deg, #224038, #222f35);
}
.screen-complete .screen-content { padding-block: .65rem; }
.results-desktop { gap: .55rem; }
.results-desktop .portal-body { padding: clamp(.85rem, 2vw, 1.3rem); }
.result-confirmation > div { flex: 1 1 14rem; min-width: 0; }
.result-confirmation h2 { margin: 0; color: #effff4; font-size: clamp(1.05rem, 1.6vw, 1.28rem); letter-spacing: -.025em; }
.result-confirmation p { margin: .19rem 0 0; color: #d4e9dc; font-size: .82rem; }
.result-confirmation .portal-receipt-check { flex: none; width: 2.32rem; font-size: 1.3rem; }
.result-badge {
  padding: .32rem .52rem; border: 1px solid #81d7a47a; border-radius: .36rem;
  background: #2b5846; color: #e0ffeb; font-size: .78rem; font-weight: 700;
}
.result-card {
  margin-top: .68rem; padding: .67rem .75rem; border: 1px solid #aa8bc349; border-radius: .66rem;
  background: linear-gradient(135deg, #32224b, #261a38);
}
.result-card h2 { margin: 0 0 .56rem; font-size: .97rem; letter-spacing: -.018em; }
.ending-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; margin: 0; }
.ending-stats > div {
  display: flex; flex-direction: column-reverse; gap: .18rem; min-width: 0; justify-content: center;
  padding: .72rem .8rem; background: #3b2b51; border: 1px solid #bd99da52; border-radius: .75rem;
}
.ending-stats dt { color: #decbea; font-size: .82rem; }
.ending-stats dd { margin: 0; font-size: clamp(1.25rem, 1.8vw, 1.65rem); font-weight: 800; line-height: 1.06; font-variant-numeric: tabular-nums; }
.ending-stats > div:last-child dd { color: #aff3c9; }
.result-details-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: .65rem; margin-top: .68rem; }
.ending-photo { position: relative; min-height: 9rem; overflow: hidden; margin: 0; border: 1px solid #aa8bc349; border-radius: .66rem; }
.ending-photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 43%; }
.result-details { margin: 0; }
.result-details dl { margin: 0; font-size: .79rem; }
.result-details dl > div { display: grid; grid-template-columns: minmax(4.8rem, .65fr) minmax(0, 1fr); gap: .45rem; padding: .31rem 0; border-top: 1px solid #d7b8ee27; }
.result-details dt { color: #ddccee; }
.result-details dd { margin: 0; overflow-wrap: anywhere; }
.receipt-file, .receipt-file:hover { cursor: default; background: #233c41; border-color: #91c9ab78; }
.receipt-file-check { margin-inline-start: auto; color: #b9f5ce; font-weight: 800; }
.desktop-dock-label { color: var(--subdued); font-size: .83rem; }
.ending-finish { display: flex; justify-content: flex-end; margin-top: .75rem; }
@media (min-width: 801px) {
  .results-desktop .desktop-windows { padding-block: .8rem .5rem; }
  .results-desktop .report-drawer { min-height: 17rem; }
}
@media (max-width: 1150px) {
  .results-desktop .ending-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .results-desktop .desktop-file-list-label { display: none; }
  .result-details-layout { grid-template-columns: minmax(0, 1fr); }
  .ending-photo { min-height: 10rem; aspect-ratio: 16 / 9; }
  .ending-finish .button-main { width: 100%; }
}
@media (max-width: 760px) {
  .screen-ending-library .screen-content, .screen-ending-success .screen-content { align-self: start; }
  .screen-ending-library .scene-art, .screen-ending-success .scene-art { height: max(14rem, 64vw); object-position: center 38%; }
  .screen-ending-library::before, .screen-ending-success::before {
    background: linear-gradient(180deg, #15101fad, transparent 26vw, #171124 65vw);
  }
  .ending-film-dialogue { margin-top: 0; padding-top: clamp(7rem, calc(62vw - 5rem), 22rem); }
  .ending-bubbles { align-items: stretch; flex-direction: column; gap: .6rem; }
  .ending-bubbles blockquote { max-width: 88%; }
  .ending-bubbles blockquote:last-child { align-self: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .ending-scene .scene-art, .screen-ending-success h1, .screen-ending-success .ending-bubbles blockquote { animation: none; }
}

.story-side { display: grid; gap: .5rem; align-items: start; }
.clock-card, .maya-guide { padding: .75rem; border: 1px solid var(--stroke); border-radius: .9rem; }
.clock-card { background: #1b152bf5; }
.clock-card[hidden] + .maya-guide { grid-column: 1 / -1; }
.clock-card > time { display: block; color: #f2e7ff; font-size: 1.85rem; line-height: 1.18; font-weight: 780; font-variant-numeric: tabular-nums; }
.story-deadline { margin-top: .35rem; font-size: .89rem; }
.story-deadline span, .story-deadline small { display: block; }
.story-deadline small { margin-top: .18rem; color: var(--subdued); font-size: .75rem; }
.maya-guide { color: #2f2042; background: #f5e8ff; border-color: #dcc1f5; box-shadow: 0 10px 30px #14062458; }
.maya-guide p { margin: .4rem 0 .55rem; line-height: 1.35; font-size: .95rem; }
.maya-guide .button-main { min-height: 2.2rem; padding: .35rem .75rem; }
.maya-guide .maya-avatar { flex-basis: 1.65rem; width: 1.65rem; height: 1.65rem; }
@media (min-width: 1060px) {
  .story-side { position: fixed; z-index: 31; top: calc(var(--hud-height) + 1rem); right: clamp(.75rem, 2vw, 1.8rem); width: 13rem; }
  .screen-content { padding-inline-end: calc(14rem + clamp(1.25rem, 4vw, 3.5rem)); }
}
@media (max-width: 1059px) {
  .story-side { grid-template-columns: auto minmax(0, 1fr); padding: .45rem .65rem; background: #151022; }
  .story-side > .maya-guide { display: flex; flex-wrap: wrap; align-items: center; gap: .32rem .55rem; box-shadow: none; }
  .maya-guide p { flex: 1 1 10rem; margin: 0; }
  .maya-guide .guide-heading { gap: .28rem; font-size: .85rem; }
  .maya-guide .button-main { flex: 0 0 auto; min-height: 2rem; font-size: .83rem; }
  .clock-card > time { font-size: 1.5rem; }
}
@media (max-width: 430px) {
  .story-side { grid-template-columns: minmax(6.1rem, .85fr) minmax(0, 1.5fr); }
  .clock-card, .maya-guide { padding: .48rem; }
  .maya-guide .maya-avatar { display: none; }
  .story-deadline { font-size: .8rem; }
  .story-deadline small { font-size: .72rem; }
}
.game-dialog {
  width: min(42rem, 94vw); max-height: 88dvh; overflow: auto; color: var(--ink); background: #241834;
  border: 1px solid var(--stroke); border-radius: 1.25rem; padding: clamp(1rem, 4vw, 2rem);
}
.game-dialog::backdrop { background: #0d081acc; backdrop-filter: blur(5px); }
.game-dialog h2 { font-size: clamp(1.6rem, 4vw, 2.35rem); margin: 0 0 .6rem; }
.final-consent { width: min(36rem, calc(100vw - 1.25rem)); }
.final-consent-heading { display: flex; align-items: start; justify-content: space-between; gap: .65rem; }
.final-consent-heading > button { flex: none; min-height: 2.3rem; padding: .32rem .7rem; }
.final-consent-checks { min-width: 0; margin: 0 0 .9rem; border: 0; padding: 0; }
.final-consent .status-line { margin: .65rem 0 0; color: #e6d6f4; font-size: .86rem; }
.final-consent .status-line:empty { display: none; }
@media (max-width: 480px) {
  .final-consent .action-row > button { width: 100%; }
}
.activity1-help-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 2.75rem; padding: .5rem 1rem; border: 1px solid #ceb0f36b; border-radius: 999px;
  color: var(--ink); background: #382750; box-shadow: 0 5px 20px #10081870; font-weight: 700;
}
.activity1-help-button span { color: #e6bdff; }
.activity1-help-button:hover { background: #51366d; }
.activity1-guide { width: min(38rem, calc(100vw - 1.25rem)); padding: 0; overflow: hidden; }
.activity1-guide[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.activity1-guide-copy { padding: clamp(1rem, 4vw, 2rem) clamp(1rem, 4vw, 2rem) .6rem; overflow-y: auto; scrollbar-color: #a880c8 transparent; }
.activity1-guide .kicker { margin-bottom: .4rem; }
.activity1-guide p { margin: .75rem 0; }
.activity1-guide-copy p:first-child { margin-top: 0; }
.activity1-guide h2:focus { outline: none; }
.activity1-guide-tabs { display: grid; gap: .65rem; margin: .85rem 0; line-height: 1.5; }
.activity1-guide-tabs dt, .activity1-guide-tabs dd { display: inline; margin: 0; }
.activity1-guide-tabs dt { font-weight: 750; color: #e6c8ff; }
.activity1-guide-rule { padding: .6rem .8rem; border-inline-start: 3px solid #c995f0; background: #ffffff0a; }
.activity1-guide form {
  display: flex; justify-content: flex-end; padding: .7rem clamp(1rem, 4vw, 2rem) 1rem;
  background: #1d152c; border-top: 1px solid var(--stroke);
}
.activity-chat-launcher {
  position: fixed; z-index: 32; inset-inline-end: clamp(.8rem, 2vw, 1.8rem);
  inset-block-end: max(.85rem, env(safe-area-inset-bottom)); display: grid; place-items: center;
  inline-size: 2.85rem; block-size: 2.85rem; padding: 0; border: 1px solid #e6c2ff; border-radius: 50%;
  background: #d8afff; color: #27143d; box-shadow: 0 5px 24px #10081880;
}
.activity-chat-launcher:hover { background: #edd1ff; }
.study-help-icon { font-size: 1.3rem; line-height: 1; }
.activity-chat-dialog {
  position: fixed; inset: auto clamp(.8rem, 2vw, 1.8rem) 1rem auto; margin: 0;
  width: min(28rem, calc(100vw - 1.6rem)); max-height: min(36rem, calc(100dvh - 2rem));
  padding: 1rem; background: #241834; box-shadow: 0 18px 70px #10081880;
}
.activity-chat-dialog[open] { display: flex; flex-direction: column; gap: .7rem; }
.activity-chat-dialog::backdrop { background: #0d081a75; backdrop-filter: none; }
.activity-chat-heading { display: flex; gap: .55rem; justify-content: space-between; align-items: start; }
.activity-chat-heading h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.035em; }
.activity-chat-heading h2:focus { outline: none; }
.activity-chat-heading .button-secondary { min-height: 2.25rem; padding: .4rem .7rem; }
.activity-chat-dialog p { margin: 0; }
.activity-chat-dialog .chat-history {
  flex: 1 1 16rem; min-height: 5rem; background: #191126; border-radius: .7rem; padding: .65rem;
  scrollbar-color: #9475bd transparent;
}
.activity-chat-dialog .chat-turn { background: #41334f; color: #fcf2ff; overflow-wrap: anywhere; white-space: normal; font-size: .9rem; }
.activity-chat-dialog .chat-turn.user { background: #604294; }
.activity-chat-dialog .chat-turn strong { font-size: .78rem; }
.activity-chat-dialog .chat-turn p { margin-top: .2rem; white-space: pre-wrap; }
.activity-chat-dialog .chat-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.activity-chat-dialog .chat-compose textarea { min-height: 3rem; background: #1b132a; border-color: #bb9cdb80; }
.activity-chat-dialog .status-line { color: #ead6ff; margin-top: .4rem; }
.activity-chat-dialog .status-line:empty { display: none; }
@media (min-width: 1060px) {
  .game-footer { padding-inline-end: calc(clamp(.8rem, 2vw, 1.8rem) + 3.65rem); }
}
@media (max-width: 1059px) {
  .activity1-help-button { position: fixed; right: .8rem; bottom: max(.75rem, env(safe-area-inset-bottom)); z-index: 31; }
  .activity-chat-launcher { inset-inline: .8rem auto; }
  #story { padding-block-end: max(3.6rem, calc(env(safe-area-inset-bottom) + 2.75rem)); }
}
@media (max-width: 580px) {
  .activity-chat-dialog { inset: auto .5rem max(.5rem, env(safe-area-inset-bottom)); width: auto; }
  .activity-chat-dialog .chat-compose { gap: .45rem; }
}
.study-rules { padding-left: 1.25rem; line-height: 1.5; }
.study-rules li + li { margin-top: .45rem; }
.toast { color: #2b1d40; background: #f1e3ff; z-index: 99; font-size: .93rem; }

@media (max-width: 870px) {
  .game-progress { display: none; }
  .game-hud { padding-inline: .75rem; }
  .demo-label { display: none; }
}
@media (max-width: 580px) {
  :root { --hud-height: 4rem; }
  .game-hud { gap: .35rem; padding: .45rem .58rem; }
  .game-wordmark { white-space: normal; min-width: 0; }
  .game-wordmark small { display: none; }
  .game-hud .hud-right { gap: .27rem; flex: 0 0 auto; }
  .game-hud .quiet-btn { font-size: .75rem; min-height: 2.25rem; padding-inline: .5rem; }
  .game-hud .help-button { width: 2.14rem; padding: 0; }
  .game-hud .audio-controls { gap: .16rem; padding-inline: .2rem; }
  .game-hud .sound-toggle { padding-inline: .45rem; }
  .volume-control input { width: 2.25rem; height: 1.6rem; margin-inline: .08rem; }
  .screen-content { padding: 1rem .8rem; }
  .screen-home .screen-content { align-self: end; padding-top: min(27svh, 10rem); margin-bottom: 0; }
  .screen-home::before { background: linear-gradient(0deg,#160e23eb 7%,#1a11288a 57%,#1c102b0a); }
  .screen-home .scene-panel { padding: 1.15rem; }
  .screen-narrative .screen-content { align-self: end; margin-bottom: 0; padding-top: min(29svh, 10rem); }
  .screen-narrative::before { background: linear-gradient(0deg, #130e23eb, #1b112842 68%, #1611281c); }
  .screen-narrative .scene-art { object-position: 57% top; }
  .laptop-body { grid-template-columns: minmax(0,1fr); }
  .workspace-tabs { grid-template-columns: repeat(4, minmax(0,1fr)); gap: .25rem; padding: .4rem; }
  .workspace-tabs button { justify-content: center; text-align: center; min-height: 2.75rem; font-size: .86rem; padding: .38rem; }
  .laptop .chat-history { height: clamp(8.75rem, 25dvh, 16rem); }
  .laptop-footer { flex-wrap: wrap; padding: .65rem; }
  .laptop-footer p:empty { display: none; }
  .laptop-footer .button-main { width: 100%; }
  .workspace-footer-actions { inline-size: 100%; }
  .workspace-footer-actions .button-main { flex: 1; width: auto; min-width: 0; }
}
@media (max-width: 580px) {
  .workspace-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 350px) {
  .game-hud { padding-inline: .4rem; }
  .game-hud .hud-right { gap: .2rem; }
  .game-hud .quiet-btn { padding-inline: .36rem; }
  .game-hud .help-button { width: 1.85rem; }
  .volume-control input { width: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .screen-content, .maya-guide { animation: none; }
}

/* Illustrated story beats keep the speech near the actors. */
.screen-dialogue .screen-content, .screen-thought .screen-content { align-self: end; margin-block-end: 0; padding-block-start: clamp(11rem, 32svh, 20rem); }
.screen-dialogue::before, .screen-thought::before { background: linear-gradient(0deg, #160d27f0, #17102568 45%, #160e251a 74%); }
.screen-dialogue .scene-chapter, .screen-thought .scene-chapter { margin-bottom: .85rem; color: #f2dfff; text-shadow: 0 1px 12px #130a19; }
.speech-bubble, .thought-bubble {
  position: relative; width: fit-content; max-width: min(100%, 29rem);
  margin: 1rem 0 .75rem; padding: .8rem 1.05rem; background: #f8efff; color: #332046;
  box-shadow: 0 9px 25px #190d2b36;
}
.speech-bubble { border-radius: .35rem 1rem 1rem 1rem; }
.speech-bubble::before {
  content: ''; position: absolute; inset: -.65rem auto auto 1.15rem;
  width: 1rem; height: .8rem; background: inherit; clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.thought-bubble { border-radius: 1.8rem; background: #ede1ff; }
.thought-bubble::before, .thought-bubble::after { content: ''; position: absolute; background: inherit; border-radius: 50%; }
.thought-bubble::before { width: .65rem; height: .65rem; right: 2.25rem; top: -.8rem; }
.thought-bubble::after { width: .36rem; height: .36rem; right: 1.85rem; top: -1.26rem; }
.thought-bubble small { font-size: .83rem; font-weight: 750; }
.thought-bubble p { margin: .25rem 0 0; font-size: clamp(1rem, 2.5vw, 1.25rem); }
#C00 .scene-panel { width: min(100%, 38rem); }
#C00 .speech-bubble { margin-inline-start: auto; border-radius: 1rem .35rem 1rem 1rem; }
#C00 .speech-bubble::before { inset-inline: auto 1.3rem; transform: scaleX(-1); }
#C00 .scene-art { object-position: 61% center; }
#M01 .scene-art { object-position: 31% center; }
#T01 .scene-art { object-position: 48% 32%; }
.message-thread { max-height: 15rem; overflow: auto; }
.maya-chat { min-width: 0; }
.maya-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; align-items: end; }
.maya-compose textarea { min-height: 2.85rem; padding: .55rem .65rem; resize: vertical; font-size: 1rem; background: #18122c; border-radius: .8rem; }
.maya-compose button { padding-inline: .78rem !important; }
.maya-note, .maya-status { margin: .35rem .27rem .55rem; color: #e1d3ed; font-size: .86rem; }
.maya-status:empty { display: none; }
.message-bubble { overflow-wrap: anywhere; }
.library-conversation { margin-top: .7rem; padding: .68rem; border: 1px solid var(--stroke); border-radius: .8rem; background: #261b3bed; }
.library-conversation .message-thread { max-height: clamp(7rem, 21svh, 13rem); }
.library-conversation .message-thread:empty { display: none; }
.library-conversation .maya-compose textarea { background: #65469e; color: #fff; border-radius: .85rem .85rem .2rem .85rem; }
.library-conversation .maya-compose textarea::placeholder { color: #f3e6ff; }
@media (max-width: 580px) {
  :is(.screen-alarm, .screen-phone, .screen-bridge) .screen-content { align-self: start; margin-block: 0; padding-block-start: 1.25rem; }
}

/* Activity 2 moves from the library scene into the draft, workspace and conversation. */
.activity2-screen {
  --a2-panel: #191329f5;
  --a2-surface: #2b2140;
  --a2-outline: #a98acd69;
  --a2-muted: #dfcee9;
  color: var(--ink);
}
.activity2-screen:not(.screen-bridge)::before {
  background: radial-gradient(ellipse at 70% 15%, #392452b8, #130e20f1 78%), linear-gradient(0deg, #120b1ed9, #1710286e);
}
.activity2-screen .scene-panel {
  width: min(100%, 53rem); margin-inline: auto; min-width: 0; color: var(--ink);
  background: var(--a2-panel); border: 1px solid var(--a2-outline); border-radius: 1.35rem;
  padding: clamp(1rem, 3vw, 2rem); box-shadow: 0 22px 70px #0b061975;
}
.activity2-screen .scene-chapter { color: #d8b6ff; }
.activity2-screen h1 { font-size: clamp(1.85rem, 4.4vw, 3.3rem); max-width: none; margin: .35rem 0 1.1rem; }
.activity2-screen .small-note { color: var(--a2-muted); }
.activity2-screen .activity2-actions { margin-top: 1.05rem; }
.activity2-screen .button-secondary { background: #2d2241; color: #faecff; border: 1px solid var(--a2-outline); }
.activity2-screen .button-secondary:hover { background: #483264; }
.activity2-screen .study-check { background: #2a203d; border-color: var(--a2-outline); }

#BRIDGE.activity2-screen::before {
  background: linear-gradient(90deg, #0c071513 27%, #160b2190 67%, #130c1fdd), linear-gradient(0deg, #160e26dd 0%, transparent 55%);
}
#BRIDGE.activity2-screen .scene-art { object-position: 42% 44%; }
#BRIDGE.activity2-screen .screen-content { align-self: end; margin-block: 0; padding-block: clamp(1rem, 8svh, 4rem) clamp(1rem, 3svh, 2.5rem); }
#BRIDGE.activity2-screen .scene-panel { width: min(100%, 33rem); margin-inline: auto 0; text-align: left; }
.activity2-opening-scene .button-main { display: block; margin: 1rem 0 0 auto; }

.activity2-speech { display: flex; align-items: flex-start; gap: .65rem; max-width: min(100%, 43rem); margin: .55rem 0; min-width: 0; }
.activity2-avatar {
  display: grid; place-content: center; flex: 0 0 clamp(2rem, 4vw, 2.7rem); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid #c6a8e6; background: #483069 url('assets/maya-library-table.webp') 34% 27% / auto 390%;
}
.activity2-speech > div {
  min-width: 0; padding: .6rem .82rem; background: linear-gradient(160deg,#36294a,#28203c);
  border: 1px solid #ab88d357; border-radius: .32rem .93rem .93rem .93rem;
}
.activity2-speech strong { display: block; color: #eacfff; font-size: .8rem; }
.activity2-speech p { margin: .18rem 0 0; line-height: 1.48; overflow-wrap: anywhere; }
.activity2-player { flex-direction: row-reverse; margin-inline-start: auto; }
.activity2-player .activity2-avatar { background: linear-gradient(150deg,#ad76e4,#4a286d); color: #fff; font-weight: 750; }
.activity2-player > div { background: #5e398c; border-radius: .93rem .32rem .93rem .93rem; }
.activity2-opening-scene .sample-answer { margin: .65rem 0 .65rem 3.35rem; padding: .7rem .8rem; background: #f0e5f9; color: #2a1c3e; border-color: #d8b9eb; }
.activity2-opening-scene .sample-answer h3 { margin: 0 0 .3rem; font-size: 1rem; letter-spacing: -.02em; }
.activity2-opening-scene .sample-answer p { margin: 0; }

#A2_WORK.activity2-screen .scene-panel { width: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; }
.activity2-laptop #panel-brief .sample-answer { margin: 0; padding: 0; border: 0; background: transparent; }
.activity2-assignment-brief { margin: .75rem 0 1rem; padding: .75rem 1rem; border-radius: .6rem; background: #ebe1f6; }
.activity2-assignment-brief h3, .activity2-laptop .sample-answer h4 { margin: 0 0 .28rem; }
.activity2-laptop .sample-answer h4 + p { margin: 0 0 .85rem; }
.activity2-laptop .sample-reference ul { margin: .4rem 0 0; padding-inline-start: 1.1rem; }
.activity2-laptop .sample-reference li + li { margin-top: .3rem; }
.activity2-laptop .laptop-screen .small-note { color: #514164; }
.activity2-conversation textarea {
  color: #fbf0ff; background: #211932; border: 1px solid #a989cc; border-radius: .65rem;
  min-height: 2.75rem; padding: .62rem .72rem; font-size: 1rem; resize: vertical;
}
.activity2-conversation textarea::placeholder { color: #dbc6e8; }
.activity2-laptop .laptop-footer > .button-secondary { margin-inline-end: auto; }
.activity2-laptop .laptop-footer p { margin: 0; }
.activity2-laptop .laptop-footer p:empty { display: none; }
.activity2-split .laptop-screen {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .94fr);
  align-content: start; gap: .85rem; padding: .9rem;
}
.activity2-split .laptop-screen > section { padding: clamp(.9rem, 1.4vw, 1.35rem); border: 1px solid #e0d0ed; border-radius: .75rem; background: #fffaff; }
.activity2-split .chat-history { height: clamp(10rem, 27dvh, 27rem); }
.activity2-split #panel-brief {
  max-height: clamp(22rem, 50dvh, 38rem); overflow: auto; background: #f2e9fa;
  scrollbar-width: thin; scrollbar-color: #9073b0 #f2e9fa;
}
.activity2-assistant-help { width: min(36rem, calc(100vw - 1.25rem)); }
.activity2-assistant-help .kicker { margin-bottom: .3rem; }
.activity2-assistant-help p { margin: .65rem 0; }
.activity2-assistant-help ul { margin: .55rem 0 .9rem; padding-inline-start: 1.3rem; line-height: 1.5; }
.activity2-assistant-help li + li { margin-top: .2rem; }
.activity2-assistant-help form { margin-top: .95rem; }
.activity2-assistant-help .button-main { width: 100%; }

.screen-a2-discuss .scene-panel { width: min(100%, 48rem); }
.activity2-thread { display: grid; align-content: start; max-height: min(54dvh, 28rem); overflow: auto; scrollbar-color: #9e75c2 transparent; padding: .25rem .25rem .35rem; }
.activity2-conversation .chat-compose { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .55rem; align-items: end; margin-top: .65rem; }
.activity2-conversation .status-line { margin: .35rem 0 0; color: #f0d6ff; }
.activity2-conversation .status-line:empty { display: none; }

.activity2-reflection-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(12rem,.36fr); align-items: start; gap: .85rem; }
.activity2-question-card, .activity2-reflection-progress { border: 1px solid var(--a2-outline); border-radius: .85rem; background: #28203a; padding: .75rem .85rem; }
.activity2-reflection-progress { display: grid; gap: .4rem; }
.activity2-reflection-progress progress { width: 100%; accent-color: #c18cf5; }
.activity2-reflection-progress p { margin: 0; }
.activity2-screen .reflection-field textarea { padding: .5rem .6rem; background: #1d162d; color: #fff1ff; border-color: #a989cb; }

@media (max-width: 1059px) {
  body > .story-side.activity2-side:has(> .maya-guide[hidden]) { display: block; }
  body > .activity2-side .clock-card:has(+ .maya-guide[hidden]) { display: flex; align-items: center; gap: .45rem; }
  body > .activity2-side .clock-card:has(+ .maya-guide[hidden]) .kicker { font-size: .72rem; }
  body > .activity2-side .clock-card:has(+ .maya-guide[hidden]) .story-deadline { margin: 0 0 0 auto; text-align: right; }
}
@media (max-width: 760px) {
  #BRIDGE.activity2-screen { min-height: calc(100svh - var(--hud-height) - 6rem); }
  #BRIDGE.activity2-screen .screen-content { align-self: end; padding-block-start: clamp(5rem, 16svh, 13rem); }
  #BRIDGE.activity2-screen .scene-art { object-position: 36% 38%; }
  #BRIDGE.activity2-screen::before { background: linear-gradient(0deg,#130c1ff2 10%,#180f2790 47%,#140d2233 78%); }
  .activity2-reflection-grid { grid-template-columns: 1fr; }
  .activity2-reflection-progress { grid-row: 1; }
}
@media (max-width: 480px) {
  .activity2-screen .screen-content { padding-inline: .6rem; }
  .activity2-screen .scene-panel { padding: .85rem; }
  .activity2-opening-scene .sample-answer { margin-inline-start: 2.65rem; }
  .activity2-screen .activity2-actions > * { flex: 1 1 100%; }
  .workspace-portal .portal-simulation { display: none; }
  .activity2-laptop .laptop-footer { gap: .48rem; }
  .activity2-laptop .laptop-footer > .button-secondary { order: 2; margin: 0; width: 100%; }
}
