:root { --ink:#17221f; --paper:#f3e8c8; --green:#285943; --brick:#a84632; --gold:#efb94d; --stress:#b7353e; --focus:#237aa3; }
* { box-sizing:border-box; }
body { margin:0; color:var(--ink); background:var(--paper); font:16px/1.5 ui-monospace,Consolas,monospace; }
header { display:flex; justify-content:space-between; gap:1rem; padding:1rem; color:white; background:var(--green); border-bottom:4px solid var(--ink); }
#resource-bar { display:flex; flex-wrap:wrap; gap:.4rem 1rem; }
.resource { white-space:nowrap; }
.wordmark { color:white; font-weight:900; text-decoration:none; }
.brand-lockup { display:flex; flex-wrap:wrap; align-items:baseline; gap:.4rem .75rem; }
.release-version { color:#d8eadf; font-size:.78rem; font-weight:800; }
.game-layout { display:grid; grid-template-columns:minmax(16rem, 22rem) 1fr; gap:1rem; padding:1rem; }
.game-layout > * { min-width:0; }
section, #campus-map, #game-stage { border:3px solid var(--ink); padding:1rem; background:#fff8df; box-shadow:4px 4px 0 var(--ink); }
#degree-audit { display:grid; gap:.75rem; }
.audit-card { padding:.75rem; border:2px solid var(--ink); background:#fffdf3; }
.audit-card h2, .audit-card p { margin:.25rem 0; }
.audit-status, .audit-summary { font-weight:900; color:var(--brick); }
#campus-map { min-height:16rem; display:grid; gap:1rem; }
.destination { width:100%; text-align:left; align-self:center; }
#reward-panel:empty { display:none; }
#reward-panel button { display:block; width:100%; margin:.65rem 0; text-align:left; }
#game-stage { min-height:20rem; margin-top:1rem; padding:0; overflow:hidden; image-rendering:pixelated; }
#game-stage canvas { display:block; width:100%; height:clamp(20rem,60vh,36rem); }
#activity-instructions { margin-top:1rem; }
#activity-instructions button { margin:.5rem .75rem .25rem 0; }
#activity-prompt:not([hidden]) { margin-top:.75rem; padding:.6rem .8rem; border:2px dashed var(--gold); background:#172b45; color:white; font-weight:900; }
.score-breakdown { display:grid; grid-template-columns:repeat(auto-fit,minmax(9rem,1fr)); gap:.4rem; }
.score-breakdown div { padding:.5rem; border:2px solid var(--ink); background:#fffdf3; }
.score-breakdown dt { text-transform:capitalize; font-weight:900; }
.score-breakdown dd { margin:0; font-size:1.2rem; }
.registration-objective { padding:.65rem .8rem; border:2px dashed var(--gold); background:#fffdf3; font-weight:800; }
.registration-status { min-height:1.5em; color:var(--brick); font-weight:900; }
#game-stage canvas { touch-action:none; }
.scoreboard-destination { background:var(--focus); color:white; }
#scoreboard-panel { margin-top:1rem; padding:0; overflow:hidden; color:#f8f1d7; background:#101d35; border-color:#07101f; box-shadow:4px 4px 0 #07101f; }
#scoreboard-panel[hidden] { display:none; }
.scoreboard-masthead { align-items:flex-start; padding:1rem; color:#101d35; background:var(--gold); border-bottom:3px solid #07101f; }
.scoreboard-masthead h2, .scoreboard-masthead p { margin:.1rem 0; }
.scoreboard-masthead h2 { font-size:clamp(1.5rem,4vw,2.5rem); line-height:1; letter-spacing:-.04em; }
.scoreboard-close { flex:0 0 auto; background:#fff8df; }
.scoreboard-controls { display:grid; grid-template-columns:repeat(3,minmax(8rem,1fr)) auto; align-items:end; gap:.75rem; padding:1rem; border-bottom:1px solid #6b8190; }
.scoreboard-controls label { display:grid; gap:.3rem; color:#f3e8c8; font-weight:800; }
.scoreboard-controls label[hidden] { display:none; }
.scoreboard-controls select { width:100%; min-height:3rem; padding:.55rem; border:2px solid #f3e8c8; color:#f3e8c8; background:#172b45; font:inherit; }
.scoreboard-controls button { min-height:3rem; box-shadow:none; }
#scoreboard-status { min-height:3.25rem; padding:.85rem 1rem; color:#f3e8c8; }
#scoreboard-status .scoreboard-retry { margin-left:.5rem; padding:.4rem .7rem; box-shadow:none; }
.scoreboard-table-scroll { max-width:100%; overflow-x:auto; outline-offset:-4px; scrollbar-color:var(--gold) #172b45; }
#scoreboard-table { width:100%; min-width:44rem; border-collapse:collapse; color:#f8f1d7; font-variant-numeric:tabular-nums; }
#scoreboard-table caption { padding:.75rem 1rem; color:#101d35; background:#f3e8c8; text-align:left; font-size:1.1rem; font-weight:900; }
#scoreboard-table th, #scoreboard-table td { padding:.7rem .8rem; border:1px solid #6b8190; text-align:left; white-space:nowrap; }
#scoreboard-table thead { color:#101d35; background:#8fc4bb; }
#scoreboard-table tbody tr:nth-child(even) { background:#172b45; }
#scoreboard-table .current-player { color:#101d35; background:var(--gold); }
#scoreboard-table .current-player:nth-child(even) { background:var(--gold); }
::selection { color:#101d35; background:var(--gold); }
.button, button { display:inline-block; padding:.7rem 1rem; border:3px solid var(--ink); background:var(--gold); color:var(--ink); font:inherit; font-weight:800; text-decoration:none; box-shadow:3px 3px 0 var(--ink); cursor:pointer; }
:focus-visible { outline:4px solid var(--focus); outline-offset:3px; }
.landing main { width:min(44rem,calc(100% - 2rem)); margin:10vh auto; }
.landing h1 { font-size:clamp(2.5rem,10vw,6rem); line-height:.9; margin:.2em 0; }
.tagline { font-weight:800; color:var(--brick); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media (max-width:760px) { .game-layout { grid-template-columns:1fr; padding:.65rem; } header { display:block; } .scoreboard-masthead { display:grid; gap:.75rem; } .scoreboard-controls { grid-template-columns:1fr; } .scoreboard-controls button { width:100%; } }
@media (max-width:480px) {
  body { font-size:14px; }
  header { flex-direction:column; align-items:flex-start; gap:.5rem; padding:.65rem; }
  .brand-lockup { gap:.25rem .5rem; }
  .release-version { font-size:.7rem; }
  #resource-bar { gap:.3rem .75rem; }
  .game-layout { padding:.5rem; gap:.5rem; }
  section, #campus-map, #game-stage { padding:.65rem; box-shadow:2px 2px 0 var(--ink); }
  #game-stage canvas { height:clamp(14rem, 45vh, 24rem); }
  #activity-instructions { font-size:.92rem; }
  #activity-prompt:not([hidden]) { font-size:.86rem; }
  .audit-card { padding:.5rem; }
  .registration-objective { padding:.5rem; font-size:.9rem; }
  .button, button { padding:.55rem .75rem; box-shadow:2px 2px 0 var(--ink); }
  .scoreboard-masthead { padding:.75rem; }
  .scoreboard-masthead h2 { font-size:clamp(1.2rem, 6vw, 1.8rem); }
  .scoreboard-controls { padding:.75rem; gap:.5rem; }
  .scoreboard-controls select { min-height:2.4rem; }
  #scoreboard-status { padding:.65rem .75rem; }
  #scoreboard-table th, #scoreboard-table td { padding:.5rem .45rem; font-size:.85rem; }
}
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior:auto !important; transition:none !important; animation:none !important; } #activity-prompt:not([hidden]) { border-style:solid; outline:3px solid white; outline-offset:-6px; } }

/* Residence Hall Run — modern indie activity shell. */
body[data-active-activity="residence_hall_run"] {
  --res-navy:#101d35;
  --res-navy-2:#172b45;
  --res-cream:#f6edcf;
  --res-mint:#8fc4bb;
  --res-amber:#efb94d;
  --res-coral:#e66a55;
  min-width:0;
  color:var(--res-cream);
  background:#0b1629;
  font-family:Inter,"Avenir Next","Segoe UI",sans-serif;
  font-size:16px;
}
body[data-active-activity="residence_hall_run"] > header {
  padding:.75rem clamp(1rem,3vw,2.5rem);
  color:var(--res-cream);
  background:var(--res-navy);
  border-bottom:1px solid #314969;
  box-shadow:0 8px 24px rgba(3,10,22,.28);
}
body[data-active-activity="residence_hall_run"] .game-layout {
  grid-template-columns:minmax(12rem,17rem) minmax(0,1fr);
  width:min(96rem,100%);
  margin:0 auto;
  gap:clamp(.75rem,2vw,1.5rem);
  padding:clamp(.75rem,2vw,1.5rem);
}
body[data-active-activity="residence_hall_run"] aside { opacity:.72; }
body[data-active-activity="residence_hall_run"] aside section,
body[data-active-activity="residence_hall_run"] .campus-surface,
body[data-active-activity="residence_hall_run"] #game-stage {
  border:1px solid #314969;
  border-radius:12px;
  background:var(--res-navy);
  box-shadow:0 12px 32px rgba(3,10,22,.32);
}
body[data-active-activity="residence_hall_run"] .campus-surface {
  min-width:0;
  padding:clamp(.65rem,1.6vw,1.25rem);
}
body[data-active-activity="residence_hall_run"] #campus-map { display:none; }
body[data-active-activity="residence_hall_run"] #activity-instructions {
  margin:.1rem 0 .8rem;
  color:#c9d9dc;
  font-size:1rem;
}
body[data-active-activity="residence_hall_run"] #activity-instructions button,
body[data-active-activity="residence_hall_run"] .retry-stage,
body[data-active-activity="residence_hall_run"] .return-campus {
  min-height:44px;
  border:1px solid #0b1629;
  border-radius:8px;
  box-shadow:0 5px 14px rgba(3,10,22,.28);
}
body[data-active-activity="residence_hall_run"] #activity-instructions button:hover,
body[data-active-activity="residence_hall_run"] .retry-stage:hover,
body[data-active-activity="residence_hall_run"] .return-campus:hover { background:#ffd277; }
body[data-active-activity="residence_hall_run"] #activity-prompt:not([hidden]) {
  width:100%;
  margin:.5rem 0;
  padding:.75rem 1rem;
  border:1px solid var(--res-amber);
  border-radius:8px;
  color:var(--res-cream);
  background:var(--res-navy-2);
  font-size:1rem;
}
body[data-active-activity="residence_hall_run"] #game-stage {
  width:100%;
  min-height:clamp(24rem,68vh,46rem);
  margin:0;
  padding:0;
  overflow:hidden;
}
body[data-active-activity="residence_hall_run"] #game-stage canvas {
  width:100%;
  height:clamp(24rem,68vh,46rem);
  background:var(--res-navy);
}
body[data-active-activity="residence_hall_run"] :focus-visible { outline:3px solid var(--res-mint); outline-offset:3px; }
body[data-active-activity="residence_hall_run"] ::selection { color:var(--res-navy); background:var(--res-mint); }
body[data-active-activity="residence_hall_run"] { scrollbar-color:var(--res-mint) var(--res-navy); }

@media (max-width:760px) {
  body[data-active-activity="residence_hall_run"] .game-layout { display:flex; flex-direction:column; padding:.5rem; }
  body[data-active-activity="residence_hall_run"] .campus-surface { order:1; width:100%; padding:.5rem; }
  body[data-active-activity="residence_hall_run"] aside { order:2; opacity:.58; }
  body[data-active-activity="residence_hall_run"] #game-stage,
  body[data-active-activity="residence_hall_run"] #game-stage canvas { min-height:18rem; height:min(58vh,30rem); }
  body[data-active-activity="residence_hall_run"] #activity-prompt:not([hidden]) { font-size:1rem; overflow-wrap:anywhere; }
  body[data-active-activity="residence_hall_run"] .retry-stage,
  body[data-active-activity="residence_hall_run"] .return-campus { display:block; width:100%; margin:.5rem 0 0; }
}
