:root {
  color-scheme: dark;
  --bg: #0e1716;
  --surface: #182322;
  --surface-hi: #21302d;
  --ink: #f7eedc;
  --muted: #c3c4b5;
  --gold: #e8c984;
  --stroke: #4a5447;
  --heading: Georgia, 'Times New Roman', serif;
  --ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max: 1170px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font: 1rem/1.53 var(--ui); color: var(--ink); background: var(--bg); }
button, input, select { font: inherit; }
button, .file-label { cursor: pointer; touch-action: manipulation; }
button:disabled, input:disabled { cursor: default; opacity: .58; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #ffdc84; outline-offset: 4px; }
main { flex: 1; min-width: 0; }
main:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--heading); line-height: 1.08; font-weight: 400; }
h1 { font-size: clamp(2.35rem, 5vw, 4.3rem); letter-spacing: -.037em; }
h2 { font-size: clamp(1.45rem, 2.5vw, 2.05rem); }
a { color: var(--gold); }
button { color: inherit; }
.skip { position: absolute; z-index: 20; left: 1rem; top: .65rem; background: var(--bg); padding: .5rem; transform: translateY(-180%); }
.skip:focus { transform: none; }
.topbar { background: #101a18; border-bottom: 1px solid #44493a; }
.top-inner, .wrap, .footer { width: min(var(--max), calc(100% - 72px)); margin-inline: auto; }
.top-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.brand { display: inline-flex; gap: .7rem; align-items: center; padding: 5px 0; border: 0; background: none; text-align: left; font: 1.36rem/1 var(--heading); }
.brand small { font: .78rem/1.1 var(--ui); margin-top: .32rem; display: block; color: var(--muted); }
.brand-mark { display: grid; place-items: center; color: var(--gold); width: 43px; height: 45px; font-size: 1.52rem; background: #202b25; border: 1px solid #7d6d49; border-radius: 12px 12px 17px 17px; }
.top-actions, .team-chip { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.team-chip { color: var(--muted); font-weight: 650; font-size: .88rem; }
.team-chip > span:last-child { max-width: 21ch; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-top: 1px solid #39433d; margin-top: 52px; min-height: 64px; color: var(--muted); font-size: .86rem; }
.teacher-link { padding: .65rem .15rem; min-height: 44px; background: transparent; color: var(--muted); border: 0; }
.teacher-link:hover { color: var(--gold); }
.storage-alert { position: fixed; z-index: 4; right: 12px; bottom: 12px; max-width: min(420px, 94vw); border: 1px solid #a4774d; border-radius: 8px; padding: 1rem; background: #422923; color: #ffe3c3; }
.eyebrow { color: var(--gold); font-size: .78rem; font-weight: 720; letter-spacing: .15em; text-transform: uppercase; margin-bottom: .75rem; }
.lede { color: var(--muted); max-width: 63ch; line-height: 1.55; }
.hero {
  min-height: min(470px, 63vw); display: grid; align-items: center; border-bottom: 1px solid #524b38;
  background: linear-gradient(90deg, #0d1717 0%, #0d1717eb 21%, #1119176c 51%, #11191710 78%), #172825 url('assets/castillo.jpg') center 53% / cover no-repeat;
}
.hero-copy { width: min(var(--max), calc(100% - 72px)); margin: 0 auto; padding: 56px 0 42px; }
.hero h1 { font-size: clamp(2.65rem, 5.35vw, 5.25rem); line-height: .99; text-shadow: 0 3px 20px #0008; }
.hero h1 em { font-style: normal; color: #f1d293; }
.hero .lede { max-width: 45ch; margin-top: 22px; color: #e7e3d6; }
.hero-mobile { display: none; }
.hero-rule { width: 135px; display: flex; gap: 8px; align-items: center; margin-top: 23px; color: #d7b777; }
.hero-rule::before, .hero-rule::after { content: ''; height: 1px; background: #d7b777; opacity: .61; }
.hero-rule::before { width: 30px; }
.hero-rule::after { flex: 1; opacity: .32; }
.setup { margin-top: 30px; }
.panel { background: var(--surface); border: 1px solid var(--stroke); border-radius: 14px; }
.setup-panel { padding: clamp(20px, 4vw, 33px); }
.setup-heading { margin-bottom: 20px; }
.setup-heading p { color: var(--muted); margin-top: .5rem; }
.setup-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
label, legend { color: var(--ink); font-size: .95rem; font-weight: 650; }
input, select { display: block; width: 100%; color: var(--ink); background: #101a19; border: 1px solid #62705f; padding: .62rem .75rem; min-height: 47px; border-radius: 7px; margin-top: .37rem; }
input::placeholder { color: #a9ae9e; }
select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, #dbbf81 50%), linear-gradient(135deg, #dbbf81 50%, transparent 50%); background-position: calc(100% - 18px) 51%, calc(100% - 13px) 51%; background-size: 5px 5px; background-repeat: no-repeat; }
.house-fieldset, .fraction-field { padding: 0; border: 0; min-width: 0; margin: 19px 0 0; }
.house-fieldset legend { margin-bottom: 10px; }
.house-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gryffindor { --house: #874246; --house-bg: #3a2328; --house-edge: #dbb78a; }
.slytherin { --house: #457861; --house-bg: #1c332d; --house-edge: #a6c8ad; }
.ravenclaw { --house: #476d8a; --house-bg: #23313e; --house-edge: #adc8e0; }
.hufflepuff { --house: #91723e; --house-bg: #372f22; --house-edge: #ead194; }
.house-tile { position: relative; cursor: pointer; }
.house-tile input { position: absolute; width: 1px; min-height: 1px; height: 1px; opacity: 0; pointer-events: none; }
.house-body, .order-shield { display: grid; justify-items: center; align-content: center; gap: 6px; background: linear-gradient(120deg, var(--house-bg), #1b2421); border-radius: 9px; border: 1px solid var(--house); padding: .65rem .25rem .52rem; min-height: 75px; font-size: .87rem; }
.house-tile input:checked + .house-body, .order-shield[aria-pressed=true] { border-color: var(--house-edge); box-shadow: inset 0 0 0 2px var(--house-edge); background: var(--house-bg); }
.house-tile input:focus-visible + .house-body { outline: 3px solid var(--gold); outline-offset: 3px; }
.shield { flex: none; display: grid; place-items: center; height: 31px; width: 29px; padding: 0 1px 3px; border: 1px solid var(--house-edge); border-radius: 5px 5px 12px 12px; background: linear-gradient(145deg, var(--house), var(--house-bg)); box-shadow: 0 1px 4px #0006; font-size: 15px; }
.shield > span { filter: grayscale(1) sepia(.35) brightness(1.2); }
.small-shield { width: 24px; height: 26px; font-size: 12px; }
.primary, .quiet, .danger, .file-label {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; gap: .38rem;
  padding: .67rem 1.05rem; border: 1px solid #697363; border-radius: 7px;
  background: #202c29; color: var(--ink); text-align: center; font-weight: 720; font-size: .94rem;
}
.primary { background: #e6c782; color: #201a10; border-color: #e6c782; box-shadow: 0 3px 12px #100f0a3b; }
.danger { background: #382727; border-color: #975f5c; }
@media (hover: hover) {
  .primary:hover { background: #f6db9d; }
  .quiet:hover, .file-label:hover { border-color: var(--gold); color: var(--gold); }
  .danger:hover { border-color: #e09b96; }
}
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.feedback { color: #dce6cc; margin-top: .65rem; font-size: .94rem; }
.feedback:empty { display: none; }
.feedback.bad { color: #ffcebd; }
.resume { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 24px; }
.resume p { margin-top: .22rem; color: var(--muted); }
.resume .shield { width: 46px; height: 52px; font-size: 23px; }
.narrow { max-width: 790px; }
.inner, .rules, .map { margin-top: 38px; }
.page-title { margin-bottom: 24px; }
.page-title .lede { margin-top: 12px; }
.scroll-panel { padding: clamp(20px, 4vw, 40px); border-color: #766445; background: radial-gradient(ellipse at top, #30342a, #1d2723); }
.decree { list-style: none; display: grid; gap: 17px; padding: 0; margin: 0 0 27px; color: var(--muted); }
.decree li { position: relative; padding-left: 24px; }
.decree li::before { content: '✦'; position: absolute; left: 0; color: var(--gold); }
.decree strong { color: var(--ink); font-weight: 680; }
.mission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.scene-1 { --scene: url('assets/mision-1.jpg'); --scene-accent: #bbd5a4; }
.scene-2 { --scene: url('assets/mision-2.jpg'); --scene-accent: #e8bb7e; }
.scene-3 { --scene: url('assets/mision-3.jpg'); --scene-accent: #aed9eb; }
.scene-4 { --scene: url('assets/mision-4.jpg'); --scene-accent: #edd4a3; }
.scene-5 { --scene: url('assets/mision-5.jpg'); --scene-accent: #d2e39d; }
.scene-6 { --scene: url('assets/mision-6.jpg'); --scene-accent: #e8bdf5; }
.mission-card { border: 1px solid #57624f; border-radius: 12px; overflow: hidden; text-align: left; padding: 0; background: var(--surface); }
.mission-card:hover { border-color: var(--scene-accent); }
.mission-img { min-height: clamp(104px, 12vw, 155px); display: flex; gap: .35rem; align-items: flex-start; justify-content: space-between; padding: 12px; background: linear-gradient(#07110fc2, #0b100f12 66%, #111917), var(--scene) center 52% / cover; }
.mission-number { display: flex; gap: 5px; align-items: center; color: var(--ink); font-size: .85rem; font-weight: 690; text-shadow: 0 1px 2px black; }
.mission-number span { color: var(--scene-accent); }
.state { display: inline-block; flex: none; align-self: start; border: 1px solid #6f7866; border-radius: 999px; padding: .18rem .49rem; color: #e1e3d6; background: #16211fee; font: 650 .77rem/1.2 var(--ui); white-space: nowrap; }
.state.started { background: #373121; color: #f6dd9c; border-color: #ad8e54; }
.state.done { background: #20362a; color: #d5efc3; border-color: #7aa580; }
.mission-copy { display: grid; gap: 5px; padding: 14px 15px; }
.mission-copy > strong { font: 400 clamp(1.1rem, 2vw, 1.45rem)/1.15 var(--heading); }
.mission-copy > span { color: var(--muted); font-size: .87rem; }
.mission-progress { display: flex; align-items: center; gap: 9px; margin-top: 6px; }
.pips { display: flex; gap: 4px; }
.pips i { display: inline-block; width: 15px; height: 4px; border-radius: 3px; background: #526055; }
.pips .lit { background: var(--scene-accent); }
.passport, .chamber-teaser { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 20px clamp(17px, 3vw, 27px); border: 1px solid #665b43; border-radius: 12px; background: #222820; margin-top: 18px; }
.passport .eyebrow, .chamber-teaser .eyebrow { margin-bottom: .35rem; }
.code-slots { display: grid; grid-template-columns: repeat(6, minmax(31px, 50px)); gap: 7px; }
.code-slot { display: grid; place-items: center; min-height: 52px; border: 1px solid #69705b; border-radius: 7px; padding: 4px; background: #171e1b; line-height: 1.1; color: var(--muted); }
.code-slot small { font-size: .72rem; }
.code-slot strong { font: 400 1.45rem var(--heading); }
.code-slot.found { color: var(--gold); border-color: #b39355; background: #392f1f; }
.chamber-teaser { background: linear-gradient(90deg, #111b19fd, #18201bdd 52%, #111b19a8), var(--scene, url('assets/mision-4.jpg')) right 45% / cover; }
.chamber-teaser p:last-child { color: var(--muted); margin-top: .4rem; }
.trail { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.trail .quiet { background: transparent; }
.mission-banner { display: flex; min-height: 250px; align-items: end; padding: clamp(20px, 4vw, 37px); border: 1px solid #6b6952; border-radius: 14px; background: linear-gradient(90deg, #111917fa 3%, #111917c9 33%, #11191728 85%), var(--scene) right 52% / cover; }
.mission-banner h1 { max-width: 20ch; }
.mission-banner p:last-child { color: #e6e0d1; max-width: 49ch; margin-top: 12px; }
.activity-list { display: grid; gap: 10px; margin-top: 20px; }
.activity-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--stroke); border-radius: 8px; text-align: left; min-height: 65px; background: var(--surface); }
.activity-link.selected { border-color: var(--scene-accent); }
.activity-link .state { align-self: center; }
.activity-link small, .activity-link strong { display: block; }
.activity-link small { color: var(--muted); font-size: .77rem; }
.activity-link strong { font-size: .95rem; line-height: 1.22; }
.activity-index { background: #26342c; color: var(--gold); border-radius: 50%; width: 31px; height: 31px; display: grid; place-items: center; }
.activity-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 32%); gap: 16px; align-items: start; }
.activity-panel { min-height: 350px; padding: clamp(17px, 3.2vw, 33px); }
.activity-panel h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
.activity-panel .eyebrow { color: var(--scene-accent); }
.prompt { margin-top: 15px; }
.prompt p { max-width: 64ch; }
.math-rows { margin-top: 17px; padding: 16px; background: #242a21; border-left: 2px solid #9a8050; border-radius: 0 8px 8px 0; display: grid; gap: 11px; }
.math-line { display: flex; flex-wrap: wrap; gap: .24em; align-items: center; color: #fff3d4; font: clamp(1.11rem, 2.7vw, 1.60rem)/1.3 var(--heading); white-space: pre-wrap; }
.fraction { display: inline-grid; grid-template-rows: auto auto; text-align: center; align-items: center; align-self: center; min-width: 1.1em; margin-inline: .04em; font-variant-numeric: lining-nums; }
.fraction > span { padding: 0 .19em; }
.fraction > span:first-child { border-bottom: 1px solid currentColor; }
.answer-fields { display: flex; flex-wrap: wrap; gap: 15px 20px; align-items: start; margin-top: 20px; }
.answer-integer { flex: 0 1 190px; }
.answer-integer input { max-width: 155px; }
.fraction-field { margin: 0; padding: 0; flex: 0 1 155px; }
.fraction-field legend { margin-bottom: 6px; }
.fraction-editor { display: grid; width: 96px; gap: 9px; position: relative; }
.fraction-editor::after { content: ''; background: var(--gold); height: 2px; position: absolute; top: calc(50% - 1px); inset-inline: -2px; }
.fraction-editor input { text-align: center; margin: 0; padding: .3rem; }
.crate-grid, .factor-toolbar, .order-grid { margin-top: 20px; }
.crate-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.crate { background: #342f23; border: 1px solid #9c7d52; border-radius: 7px; padding: 8px 3px; display: grid; gap: 1px; min-height: 65px; }
.crate span { color: var(--gold); font-size: 1.35rem; }
.crate[aria-pressed=true] { background: #665135; border-color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }
.factor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.factor-add, .factor-chip { border-radius: 6px; border: 1px solid #998556; background: #383323; color: #f4dda9; min-height: 45px; min-width: 45px; padding: 6px 9px; font-weight: 700; }
.factor-add span, .factor-chip span { color: var(--muted); }
.factor-tray { min-height: 62px; display: flex; align-items: center; gap: 11px; margin: 10px 0; padding: 8px 10px; background: #111b19; border: 1px dashed #7e795f; border-radius: 6px; }
.factor-product { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.empty-selection { color: var(--muted); font-size: .83rem; }
.order-shield { position: relative; min-height: 112px; }
.order-shield .position { position: absolute; top: 4px; left: 5px; background: var(--house-edge); color: #161a16; border-radius: 50%; width: 23px; height: 23px; display: grid; place-items: center; font-size: .78rem; font-weight: 800; }
.order-tray { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 11px 0; }
.order-tray li { display: flex; align-items: center; gap: 6px; min-width: 56px; padding: 5px 8px; background: #101a19; border: 1px solid #566557; border-radius: 5px; font-size: .78rem; }
.order-tray li span { color: var(--gold); }
.mission-side { background: #182321; border: 1px solid #495645; border-radius: 12px; overflow: hidden; }
.side-scene { min-height: 135px; background: linear-gradient(transparent, #1823214d), var(--scene) center 52% / cover; }
.mission-side > h2 { font-size: 1.3rem; margin: 16px 13px 10px; }
.side-activities { display: grid; gap: 7px; padding: 0 8px 8px; }
.mission-side .activity-link { grid-template-columns: auto 1fr; min-height: 52px; padding: 8px; }
.mission-side .activity-link .state { display: none; }
.success-box, .reward { border: 1px solid #748f63; background: #29392c; color: #e0f0d7; border-radius: 8px; padding: 14px; margin-top: 16px; }
.success-box { animation: success .48s ease-out both; }
@keyframes success { from { box-shadow: 0 0 24px #d4ef9977; } to { box-shadow: none; } }
.reward { display: flex; gap: 12px; align-items: center; border-color: #8d7449; background: #383024; color: #f7e5bd; }
.reward-digit { display: grid; place-items: center; border: 1px solid #ac9256; border-radius: 8px; min-width: 43px; height: 49px; color: var(--gold); font: 1.75rem var(--heading); }
.pitch { list-style: none; display: flex; margin: 12px 0 0; padding: 12px; gap: 6px; border-radius: 8px; background: repeating-linear-gradient(90deg, #213227 0 19%, #27382b 19% 34%); border: 1px solid #647759; }
.pitch li { display: grid; flex: 1; justify-items: center; color: #b3c2a8; font-size: .81rem; }
.pitch li span { font-size: 1.22rem; }
.pitch .cleared { color: #fde59c; font-weight: 700; }
.pitch-win { margin: 7px 12px; color: var(--gold); }
.mission-side .pitch { margin: 0 8px 10px; }
.chamber-wall { overflow: hidden; isolation: isolate; position: relative; display: grid; min-height: 510px; place-items: center; text-align: center; background: #17201c url('assets/mision-4.jpg') center / cover no-repeat; border: 1px solid #85734c; border-radius: 17px; padding: 22px; }
.chamber-copy { z-index: 2; border-radius: 13px; border: 1px solid #ad8e56; background: #13201ef2; padding: clamp(16px, 3vw, 32px); max-width: 550px; box-shadow: 0 10px 42px #0009; }
.chamber-copy h1 { font-size: clamp(1.95rem, 5.2vw, 3.5rem); margin-bottom: .65rem; }
.chamber-copy form { margin-top: 16px; display: grid; justify-items: center; gap: 8px; }
.chamber-copy input { width: min(250px, 100%); text-align: center; letter-spacing: .33em; font-size: 1.25rem; }
.chamber-doors { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; z-index: 0; }
.chamber-doors i { border-inline: 1px solid #a68d5760; background: repeating-linear-gradient(0deg,#211f1877 0 8%, #413b2b50 8% 8.5%); }
.chamber-wall.opened .chamber-doors i:first-child { animation: open-left .72s ease-out both; }
.chamber-wall.opened .chamber-doors i:last-child { animation: open-right .72s ease-out both; }
@keyframes open-left { to { transform: translateX(-99%); } }
@keyframes open-right { to { transform: translateX(99%); } }
.light-reveal { position: absolute; color: #fff1be; text-shadow: 0 0 44px #f5ca6d; font-size: clamp(220px, 54vw, 600px); line-height: .9; animation: shimmer .95s ease-out both; opacity: .6; }
@keyframes shimmer { 0% { opacity: 0; scale: .35; } 55% { opacity: .95; } 100% { opacity: .6; scale: 1; } }
.diploma { animation: diploma .55s .35s ease-out both; }
@keyframes diploma { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.diploma .shield { margin: 14px auto 10px; }
.diploma strong { color: var(--gold); }
.teacher-login, .teacher-empty, .teacher-settings, .report { padding: clamp(17px, 3vw, 26px); }
.teacher-login input, .teacher-settings input { max-width: 230px; }
.teacher-login button { margin-top: 12px; }
.teacher-settings { margin-top: 20px; }
.teacher-settings p { margin-top: 10px; color: var(--muted); }
.teacher-settings form { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.teacher-settings form .feedback { flex-basis: 100%; }
.teacher-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.file-label { position: relative; overflow: hidden; }
.file-label input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.file-label:focus-within { outline: 3px solid var(--gold); }
.reset-box { border-top: 1px solid var(--stroke); padding-top: 13px; margin-top: 15px; }
.reset-box button { margin-right: 6px; margin-top: 7px; }
.report-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding-bottom: 15px; border-bottom: 1px solid var(--stroke); }
.report-heading p:last-child { margin-top: 4px; }
.grade { color: var(--gold); font-size: clamp(1.35rem, 3vw, 2rem); }
.report-stats { display: flex; flex-wrap: wrap; gap: 10px 25px; }
.report-stats dt { color: var(--muted); font-size: .86rem; }
.report-stats dd { margin: 0; font-weight: 700; }
.report-mission { margin-top: 18px; }
.report-mission h3 { display: flex; gap: 8px; justify-content: space-between; padding: 8px; border-radius: 3px; background: #26342b; color: var(--gold); font-size: 1.12rem; }
.report-mission h3 span { white-space: nowrap; }
.report-row { padding: 8px; border-bottom: 1px solid var(--stroke); }
.report-row-head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto auto; gap: 7px 13px; align-items: start; font-size: .90rem; }
.report-row-head > span { color: var(--muted); }
.report-row details { margin-top: 5px; color: var(--muted); font-size: .87rem; }
.report-row details summary { cursor: pointer; }
.report-row details ol { margin: 5px 0; padding-left: 18px; }
@media (max-width: 860px) {
  .top-inner, .wrap, .hero-copy, .footer { width: calc(100% - 42px); }
  .mission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mission-img { min-height: 123px; }
}
@media (max-width: 740px) {
  .activity-layout { grid-template-columns: 1fr; }
  .side-scene { display: none; }
}
@media (max-width: 650px) {
  .top-inner, .wrap, .hero-copy, .footer { width: calc(100% - 28px); }
  .top-inner { min-height: 60px; }
  .brand { font-size: 1.15rem; gap: .48rem; }
  .brand small { font-size: .7rem; }
  .brand-mark { width: 33px; height: 37px; }
  .team-chip > span:last-child { max-width: 10ch; }
  .top-actions .quiet { padding-inline: .45rem; }
  .hero { min-height: 360px; background-position: center, 61% 53%; background-image: linear-gradient(90deg, #0a1617f0 1%, #101918a6 60%, #11191735), url('assets/castillo.jpg'); }
  .hero-copy { padding: 38px 0 30px; }
  .hero-mobile { display: initial; }
  .hero .lede { max-width: 32ch; margin-top: 13px; }
  .hero-rule { margin-top: 14px; }
  .setup { margin-top: 16px; }
  .setup-fields { grid-template-columns: 1fr; gap: 10px; }
  .house-grid { gap: 6px; }
  .house-body, .order-shield { font-size: .73rem; }
  .inner, .rules, .map { margin-top: 25px; }
  .mission-grid { gap: 9px; }
  .mission-img { min-height: 109px; padding: 6px; flex-direction: column; }
  .mission-number { font-size: .77rem; }
  .mission-copy { padding: 10px 8px; }
  .mission-copy > span { font-size: .77rem; }
  .mission-progress { flex-wrap: wrap; gap: 5px; }
  .mission-banner { min-height: 207px; }
  .activity-panel { min-height: 0; }
  .activity-list { margin-top: 14px; }
  .report-row-head { grid-template-columns: minmax(0, 1fr) auto; }
  .resume { padding: 14px; gap: 9px; }
  .resume .primary { grid-column: 1 / -1; }
  .footer { margin-top: 35px; }
}
@media (max-width: 360px) {
  .house-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 2.3rem; }
  .top-actions .team-chip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; }
}
@media print {
  :root { color-scheme: light; }
  body { display: block; color: #111; background: white; font-size: 10pt; }
  .topbar, .footer, .skip, .storage-alert, .teacher-page > :not(.report) { display: none !important; }
  .wrap { width: auto; margin: 0; }
  .report, .report-heading, .report-row { background: white; color: #111; border-color: #bbb; }
  .report { border: 0; padding: 0; }
  .report .eyebrow, .grade, .report-stats dt, .report-row-head > span, .report-row details { color: #222; }
  .report-mission h3 { background: #edf0ea; color: #141d17; break-after: avoid; }
  .report-row { break-inside: avoid; }
  .report-row-head { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto auto; }
  .report-row details summary { display: none; }
  .report-row details ol { margin-bottom: 0; }
  @page { margin: 15mm; }
}
