/* =========================================================
   OFFICE HOURS — pixel study simulator
   ========================================================= */

:root {
  --site-bg: #150f1c;
  --site-fg: #f3e7cf;
  --site-accent: #ffc861;
  --site-on-accent: #171120;
  --site-surface: #241a2e;
  --site-muted: #b8a88c;
  --site-border: #0c0812;
  --site-font: "VT323", "Courier New", ui-monospace, monospace;
  --site-radius: 0px;
  --site-space: 1;
  --site-type: 1;
  --site-motion: 1;

  --ink: #171120;
  --line: var(--site-border);
  --wall: #33263f;
  --wall-2: #2a1f35;
  --floor: #573d2b;
  --floor-2: #3d2a1e;
  --panel: var(--site-surface);
  --panel-2: #2e2139;
  --cream: var(--site-fg);
  --cream-dim: var(--site-muted);
  --amber: var(--site-accent);
  --amber-d: #d99a37;
  --teal: #5fd3c4;
  --rose: #ff7a8a;
  --wood: #8a5a37;
  --wood-l: #a9713f;
  --wood-d: #5f3c24;
  --font-pixel: "Press Start 2P", "Courier New", monospace;
  --font-body: var(--site-font);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--site-bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: calc(21px * var(--site-type));
  line-height: 1.15;
  -webkit-font-smoothing: none;
  overflow: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.16) 0px,
    rgba(0, 0, 0, 0.16) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.45;
}

#app {
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.screen { flex: 1; min-height: 0; }

h1, h2, h3, .mono-label, .btn, .m-label, .board-sub, .name-tag, .hud-course,
.field > span, .ctrl-label, .speaker, .cost-note, .ghost, .grade-stamp {
  font-family: var(--font-pixel);
  text-transform: uppercase;
}

/* ---------------------------------------------------------
   BUTTONS / INPUTS
   --------------------------------------------------------- */
.btn {
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 11px 15px;
  color: var(--site-on-accent);
  background: var(--amber);
  border: 3px solid var(--line);
  border-radius: var(--site-radius);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition: transform calc(40ms * var(--site-motion)) steps(1), box-shadow calc(40ms * var(--site-motion)) steps(1), filter calc(100ms * var(--site-motion));
  line-height: 1;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55); }
.btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.btn.ghost { background: var(--panel-2); color: var(--cream); }
.btn.danger { background: #8f3646; color: #ffe6ea; }
.btn.tiny { font-size: 8px; padding: 8px 9px; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55); }
.btn.big { font-size: 13px; padding: 16px 26px; }
.btn.ask { font-size: 11px; padding: 0 18px; align-self: stretch; }

input, select, textarea {
  font-family: var(--font-body);
  font-size: 20px;
  color: var(--cream);
  background: #1a1322;
  border: 3px solid var(--line);
  border-radius: var(--site-radius);
  padding: 7px 10px;
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--amber); }
input::placeholder, textarea::placeholder { color: #6f6280; }
select { cursor: pointer; }
textarea { resize: vertical; line-height: 1.1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 8px; color: var(--cream-dim); letter-spacing: 1px; }

/* ---------------------------------------------------------
   SETUP SCREEN
   --------------------------------------------------------- */
.setup {
  overflow-y: auto;
  padding: calc(26px * var(--site-space)) clamp(14px, 4vw, 56px) calc(34px * var(--site-space));
  display: flex;
  flex-direction: column;
  gap: calc(20px * var(--site-space));
  background:
    radial-gradient(1000px 500px at 50% -10%, rgba(255, 200, 97, 0.12), transparent 70%),
    radial-gradient(800px 400px at 100% 110%, rgba(95, 211, 196, 0.08), transparent 70%),
    var(--site-bg);
}

.setup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.setup-head h1 {
  margin: 0;
  font-size: calc(clamp(18px, 3.4vw, 34px) * var(--site-type));
  line-height: 1.35;
  color: var(--cream);
  text-shadow: 4px 4px 0 var(--line);
  letter-spacing: 1px;
}
.setup-head h1 .accent { color: var(--amber); margin-left: 8px; }
.sub { margin: 10px 0 0; font-size: 22px; color: var(--cream-dim); letter-spacing: 2px; }

.setup-meta {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.7fr 1.6fr;
  gap: 12px;
  padding: 16px;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.45);
}

.setup-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: var(--site-radius);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.45);
  padding: calc(14px * var(--site-space)) calc(16px * var(--site-space)) calc(18px * var(--site-space));
  display: flex;
  flex-direction: column;
  gap: calc(12px * var(--site-space));
}

.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { margin: 0; font-size: 12px; color: var(--amber); letter-spacing: 2px; }

.preview {
  position: relative;
  height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #1c1426, #241a30);
  border: 3px solid var(--line);
  overflow: hidden;
}
.preview-glow {
  position: absolute;
  inset: auto 0 0 0;
  height: 65%;
  background: radial-gradient(closest-side at 50% 100%, rgba(255, 200, 97, 0.22), transparent);
}
.preview .avatar { position: relative; z-index: 2; height: 165px; width: auto; margin-bottom: 8px; }
.preview-shadow {
  position: absolute;
  bottom: 6px; left: 50%;
  width: 110px; height: 12px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.42);
  z-index: 1;
}

.avatar { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

.controls { display: flex; flex-direction: column; gap: 9px; }
.ctrl-row { display: grid; grid-template-columns: 84px 1fr; gap: 8px; align-items: center; }
.ctrl-label { font-size: 7.5px; color: var(--cream-dim); letter-spacing: 0.6px; line-height: 1.5; }
.ctrl-opts { display: flex; flex-wrap: wrap; gap: 6px; }

.sw {
  width: 21px; height: 21px;
  border: 3px solid var(--line);
  cursor: pointer;
  padding: 0;
  background-clip: padding-box;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}
.sw:hover { transform: translateY(-1px); }
.sw.on { outline: 2px solid var(--amber); outline-offset: 1px; }

.segbtn {
  font-family: var(--font-pixel);
  font-size: 7.5px;
  letter-spacing: 0.4px;
  padding: 7px 8px;
  color: var(--cream-dim);
  background: #1a1322;
  border: 2px solid var(--line);
  border-radius: var(--site-radius);
  cursor: pointer;
  text-transform: uppercase;
  line-height: 1;
}
.segbtn:hover { color: var(--cream); }
.segbtn.on { background: var(--teal); color: var(--ink); border-color: var(--line); }
.segbtn:focus-visible, .sw:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.setup-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 6px;
}
.hintline { margin: 0; color: var(--cream-dim); font-size: 20px; max-width: 60ch; }
.credit {
  margin: 14px 0 0;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 7px;
  letter-spacing: 1.5px;
  color: var(--cream-dim);
  text-transform: uppercase;
}
.credit b { color: var(--amber); font-weight: normal; }
.game-credit { margin: 0; font-size: 6px; letter-spacing: 1px; opacity: 0.8; }

/* ---------------------------------------------------------
   GAME LAYOUT
   --------------------------------------------------------- */
.game {
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(190px, 1fr) auto;
  background: #120c19;
  overflow: hidden;
}
.game > * { min-width: 0; }

/* ---- HUD ---- */
.hud {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px clamp(10px, 2vw, 22px);
  background: var(--panel);
  border-bottom: 3px solid var(--line);
  z-index: 6;
  flex-wrap: wrap;
}
.hud-id { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hud-course {
  font-size: 9px;
  color: var(--amber);
  letter-spacing: 1px;
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hud-topics { font-family: var(--font-pixel); font-size: 7px; color: var(--cream-dim); letter-spacing: 1px; }

.meters { display: flex; gap: 14px; flex: 1; min-width: 0; }
.meter { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 64px; }
.m-label { font-size: 7px; color: var(--cream-dim); letter-spacing: 1px; }
.bar {
  height: 14px;
  background: #140e1c;
  border: 3px solid var(--line);
  padding: 1px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0%;
  transition: width 0.35s steps(6), background 0.2s;
  background: var(--amber);
}
.m-learn .bar > i { background: var(--teal); }
.m-patience .bar > i { background: var(--rose); }
.m-comms .bar > i { background: #b48cf2; }
.m-label b { font-weight: normal; color: var(--cream); }
.bar.low > i { background: #ff4d63; }
.bar.maxed { box-shadow: 0 0 10px rgba(95, 211, 196, 0.8), 0 0 0 3px rgba(95, 211, 196, 0.2); }

.hud-actions { display: flex; gap: 7px; }

/* ---- SCENE ---- */
.scene {
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--line);
  background: #251a30;
  min-height: 0;
}
.scene.shake { animation: shake 0.32s steps(2, end) 1; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-5px, 1px); }
  50% { transform: translate(4px, -1px); }
  75% { transform: translate(-2px, 1px); }
}

.wall {
  position: absolute;
  inset: 0 0 26% 0;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 78px),
    linear-gradient(180deg, #3a2b48, var(--wall-2) 78%);
}
.wall-trim {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 14px;
  background: #1e1728;
  border-top: 3px solid var(--line);
}

/* window */
.window {
  position: absolute;
  left: 5.5%; top: 8%;
  width: 23%; height: 47%;
  background: #0d1330;
  border: 7px solid #6a4a33;
  box-shadow: inset 0 0 0 2px #2a1c14, 5px 5px 0 rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 55% at 68% 28%, rgba(255, 232, 170, 0.20), transparent 70%),
    linear-gradient(180deg, #101a3e, #1d2b52 60%, #2b3a63);
}
.moon {
  position: absolute;
  right: 16%; top: 14%;
  width: 15%; aspect-ratio: 1;
  background: #f7ecc8;
  box-shadow: inset -5px 5px 0 #d8c99b, 0 0 16px rgba(247, 236, 200, 0.35);
}
.star { position: absolute; background: #dfe8ff; }
.star.s1 { width: 4px; height: 4px; left: 18%; top: 22%; }
.star.s2 { width: 3px; height: 3px; left: 36%; top: 58%; opacity: 0.7; }
.star.s3 { width: 3px; height: 3px; left: 22%; top: 72%; opacity: 0.55; }
.mullion-v { position: absolute; left: 50%; top: 0; bottom: 0; width: 5px; margin-left: -2px; background: #5a3d2a; }
.mullion-h { position: absolute; top: 52%; left: 0; right: 0; height: 5px; margin-top: -2px; background: #5a3d2a; }

/* whiteboard */
.board {
  position: absolute;
  right: 4.5%; top: 9%;
  width: 37%; height: 40%;
  background: #eef2e4;
  border: 7px solid #7d5335;
  box-shadow: inset 0 0 0 2px #ccd4bd, 6px 6px 0 rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-start;
}
.board-inner {
  flex: 1;
  padding: 4% 6% 0;
  display: flex;
  flex-direction: column;
  gap: 5%;
  min-width: 0;
}
.board-course {
  font-family: var(--font-pixel);
  font-size: clamp(7px, 1.18vmin + 4px, 15px);
  line-height: 1.6;
  color: #2f3e66;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.board-sub {
  font-size: clamp(5px, 0.85vmin + 3px, 10px);
  color: #a33a43;
  letter-spacing: 2px;
}
.board-scribble {
  font-family: var(--font-body);
  font-size: clamp(9px, 1.4vmin + 3px, 18px);
  color: #62739b;
  font-style: italic;
  transform: rotate(-1.5deg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-tray {
  position: absolute;
  left: 6%; bottom: -15px;
  width: 55%; height: 9px;
  background: #aab3a0;
  border: 3px solid #454f3f;
  border-top: none;
}

/* clock */
.clock {
  position: absolute;
  left: 43%; top: 8%;
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 8px 10px;
  background: #120d1c;
  border: 3px solid var(--line);
  box-shadow: inset 0 0 0 2px #221a30, 4px 4px 0 rgba(0, 0, 0, 0.35);
}
.clock span { font-family: var(--font-pixel); font-size: clamp(8px, 1.1vmin + 4px, 13px); color: var(--amber); letter-spacing: 1px; }
.clock em { font-family: var(--font-pixel); font-size: 7px; font-style: normal; color: #8a7a52; }

/* plant */
.plant {
  position: absolute;
  left: 2%; bottom: 24%;
  width: 8%; height: 22%;
  z-index: 1;
}
.plant .pot {
  position: absolute;
  left: 18%; bottom: 0;
  width: 64%; height: 34%;
  background: #a3563a;
  border: 3px solid var(--line);
  box-shadow: inset 0 4px 0 #c3704d;
}
.plant .leaf { position: absolute; bottom: 30%; background: #3d7a52; border: 3px solid var(--line); }
.plant .l1 { left: 10%; width: 34%; height: 34%; bottom: 34%; }
.plant .l2 { left: 40%; width: 30%; height: 52%; bottom: 40%; background: #4a8f5f; }
.plant .l3 { left: 26%; width: 46%; height: 26%; bottom: 62%; background: #356a47; }

/* avatars */
.slot {
  position: absolute;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2;
  height: 54%;
}
.you-slot { left: 9%; bottom: 11%; }
.prof-slot { left: 55%; bottom: 15%; height: 56%; }
.slot .avatar { height: 100%; width: auto; filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, 0.28)); }
.slot::after {
  content: "";
  position: absolute;
  bottom: -6px; left: 50%;
  width: 72%; height: 10px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.32);
  z-index: -1;
}
.slot.talking .avatar { animation: bob 0.36s steps(2, end) infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.name-tag {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  letter-spacing: 1px;
  white-space: nowrap;
  padding: 6px 8px;
  background: var(--teal);
  color: var(--ink);
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* desk */
.desk {
  position: absolute;
  left: 40%; right: 1.5%;
  bottom: 6%;
  height: 24%;
  z-index: 3;
}
.desk-surface {
  position: absolute;
  left: -2%; right: -2%; top: 0;
  height: 17px;
  background: var(--wood-l);
  border: 3px solid var(--line);
  box-shadow: inset 0 3px 0 #c2854d, 0 4px 0 var(--wood-d), 5px 7px 0 rgba(0, 0, 0, 0.32);
}
.desk-front {
  position: absolute;
  left: 0; right: 0; top: 14px; bottom: 0;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.10) 0 2px, transparent 2px 40px),
    linear-gradient(180deg, #7f5132, #5e3b24);
  border: 3px solid var(--line);
  border-top: none;
}
.drawer {
  position: absolute;
  left: 10%; top: 16%;
  width: 30%; height: 62%;
  background: #6b4529;
  border: 3px solid #3a2416;
  box-shadow: inset 0 3px 0 #8a5d39;
}
.drawer .knob {
  position: absolute;
  left: 50%; top: 40%;
  width: 16%; height: 20%;
  min-width: 8px; min-height: 8px;
  transform: translateX(-50%);
  background: #c9a24a;
  border: 2px solid #3a2416;
}
.placard {
  position: absolute;
  left: 46%; top: 26%;
  transform: translateX(-50%);
  max-width: 44%;
  padding: 4px 8px;
  background: linear-gradient(180deg, #e2c06a, #b48d38);
  color: #2a1c0d;
  border: 3px solid #3a2416;
  box-shadow: inset 0 2px 0 #f4dc92, 2px 2px 0 rgba(0, 0, 0, 0.35);
  font-family: var(--font-pixel), monospace;
  font-size: 7px;
  letter-spacing: 0.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.desk-items { position: absolute; inset: 0 0 auto 0; height: 0; }
.desk-items > * { position: absolute; bottom: 0; }

.monitor {
  right: 11%;
  width: clamp(44px, 8.5vmin, 96px);
  height: clamp(36px, 6.6vmin, 74px);
  background: #262232;
  border: 4px solid #121018;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}
.monitor .m-screen {
  position: absolute;
  inset: 5px 5px 12px;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 4px),
    linear-gradient(160deg, #6fe0cd, #2f7d7a 65%);
  opacity: 0.9;
  animation: screen-flicker 6s steps(2, end) infinite;
}
@keyframes screen-flicker {
  0%, 96%, 100% { filter: brightness(1); }
  97% { filter: brightness(1.25); }
  98% { filter: brightness(0.85); }
}
.monitor .m-neck { position: absolute; left: 40%; bottom: -8px; width: 20%; height: 8px; background: #3a3348; border: 2px solid #121018; }
.monitor .m-base { position: absolute; left: 20%; bottom: -14px; width: 60%; height: 7px; background: #3a3348; border: 2px solid #121018; }

.mug {
  left: 15%;
  width: clamp(16px, 2.6vmin, 30px);
  height: clamp(17px, 2.8vmin, 32px);
  background: #e9ddc0;
  border: 3px solid var(--line);
  box-shadow: inset 0 3px 0 #fff6e2;
}
.mug::after {
  content: "";
  position: absolute;
  right: -9px; top: 24%;
  width: 8px; height: 42%;
  border: 3px solid var(--line);
  border-left: none;
  background: transparent;
}
.steam {
  position: absolute;
  width: 3px; height: 7px;
  background: rgba(255, 255, 255, 0.55);
  bottom: 100%;
  animation: steam 2.4s linear infinite;
}
.steam.s-a { left: 28%; animation-delay: 0s; }
.steam.s-b { left: 58%; height: 9px; animation-delay: 1.1s; }
@keyframes steam {
  0% { transform: translateY(4px); opacity: 0; }
  30% { opacity: 0.7; }
  100% { transform: translateY(-18px); opacity: 0; }
}

.papers {
  left: 34%;
  width: clamp(26px, 4.2vmin, 52px);
  height: clamp(9px, 1.5vmin, 15px);
  background:
    repeating-linear-gradient(180deg, #cfd6c5 0 2px, #e7ebdd 2px 5px);
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.32);
}
.papers i { display: none; }

.pencup {
  left: 58%;
  width: clamp(13px, 2vmin, 22px);
  height: clamp(14px, 2.2vmin, 24px);
  background: #2f3e66;
  border: 3px solid var(--line);
}
.pencup i {
  position: absolute;
  bottom: 100%;
  width: 3px;
  background: #ffc861;
}
.pencup i:first-child { left: 30%; height: 14px; background: #ff7a8a; }
.pencup i:last-child { left: 58%; height: 18px; }

/* floating xp */
.float {
  position: absolute;
  bottom: 42%;
  z-index: 5;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--teal);
  text-shadow: 2px 2px 0 var(--line);
  pointer-events: none;
  white-space: nowrap;
  animation: floatUp 1.2s steps(8, end) forwards;
}
.float.bad { color: var(--rose); }
@keyframes floatUp {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-52px); opacity: 0; }
}

/* ---- DIALOGUE ---- */
.dialogue {
  background: var(--panel);
  padding: 12px clamp(10px, 2.6vw, 26px) 14px;
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--site-space));
  box-shadow: inset 0 5px 0 rgba(0, 0, 0, 0.35);
  z-index: 5;
}
.dlg-head { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.speaker {
  font-size: 9px;
  color: var(--ink);
  background: var(--amber);
  padding: 7px 10px;
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.you-said {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 60%;
  font-size: 18px;
  color: #8f80a4;
}
.echo-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qbars { font-family: var(--font-body); font-weight: normal; font-size: 20px; letter-spacing: -1px; flex: none; color: var(--teal); }
.qbars.mid { color: #e0b950; }
.qbars.poor { color: var(--rose); }
.qscore { font-family: var(--font-pixel); font-size: 7px; font-weight: normal; flex: none; color: var(--teal); }
.qscore.mid { color: #e0b950; }
.qscore.poor { color: var(--rose); }
.rdims { display: inline-flex; gap: 3px; flex: none; }
.rdims i {
  font-style: normal;
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1;
  padding: 3px 3px 2px;
  border: 1px solid currentColor;
  color: var(--teal);
  opacity: 0.9;
  cursor: help;
}
.rdims i.mid { color: #e0b950; }
.rdims i.poor { color: var(--rose); opacity: 0.8; }

.line {
  min-height: 62px;
  max-height: 108px;
  overflow-y: auto;
  font-size: clamp(19px, 1.1vw + 8px, 23px);
  line-height: 1.14;
  color: var(--cream);
  padding: 10px 12px;
  background: #140e1c;
  border: 3px solid var(--line);
  box-shadow: inset 0 0 0 2px #221a30;
  cursor: pointer;
  scrollbar-width: thin;
}
.line.typing::after {
  content: "▮";
  color: var(--amber);
  animation: blink 0.8s steps(1) infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.quiz-options { display: flex; flex-wrap: wrap; gap: 7px; }
.suggestions {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.suggestions::-webkit-scrollbar { display: none; }
.suggestions:empty { display: none; }

.chip {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--teal);
  background: #1a1322;
  border: 2px dashed #3f6c67;
  border-radius: var(--site-radius);
  padding: 4px 10px;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip:hover { background: #1f3b3a; color: #d7fff9; }
.chip:disabled { opacity: 0.5; cursor: default; }

.opt {
  font-family: var(--font-body);
  font-size: 19px;
  color: var(--cream);
  background: #221a30;
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
  padding: 8px 14px;
  cursor: pointer;
  text-align: left;
}
.opt:hover:not(:disabled) { background: #33263f; }
.opt:disabled { cursor: default; }
.opt.correct { background: #1f5c4e; color: #d9fff6; }
.opt.wrong { background: #6a2434; color: #ffd9df; }

.askbar { display: flex; gap: 8px; }
.askbar input { font-size: 21px; padding: 9px 12px; }
.askbar input:disabled { opacity: 0.55; }

.quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ghost {
  font-size: 7.5px;
  letter-spacing: 0.6px;
  color: var(--cream-dim);
  background: none;
  border: 2px solid #4a3a5c;
  padding: 6px 9px;
  cursor: pointer;
}
.ghost:hover { color: var(--cream); border-color: var(--cream-dim); }
.cost-note { font-family: var(--font-body); font-size: 16px; color: #6f6280; letter-spacing: 0; margin-left: auto; }
.cost-note.good { color: #8fd9c9; }
.cost-note.poor { color: #d98a96; }

/* ---------------------------------------------------------
   OVERLAYS
   --------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(9, 6, 13, 0.82);
  backdrop-filter: blur(2px);
  overflow-y: auto;
}
.modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: var(--site-radius);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.6), inset 0 0 0 3px #33263f;
  padding: calc(26px * var(--site-space)) clamp(16px, 3vw, 34px);
  animation: popIn calc(180ms * var(--site-motion)) steps(3, end);
}
@keyframes popIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-card h2 { margin: 0 0 4px; font-size: 14px; letter-spacing: 1.5px; color: var(--amber); line-height: 1.6; }
.modal-x {
  position: absolute;
  right: 10px; top: 8px;
  width: 34px; height: 34px;
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1;
  color: var(--cream);
  background: #2e2139;
  border: 3px solid var(--line);
  cursor: pointer;
  z-index: 2;
}
.modal-x:hover { background: #8f3646; }

/* report */
.report { text-align: center; }
.grade-stamp {
  width: 96px; height: 96px;
  margin: 4px auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #ffdf9a;
  border: 5px solid #ffdf9a;
  border-radius: 50%;
  transform: rotate(-8deg);
  box-shadow: 0 0 0 4px rgba(255, 223, 154, 0.12), 0 0 26px rgba(255, 200, 97, 0.25);
  text-shadow: 0 0 12px rgba(255, 200, 97, 0.6);
}
.grade-stamp.grade-b { color: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 4px rgba(95, 211, 196, 0.12); }
.grade-stamp.grade-c { color: #d5c7ff; border-color: #d5c7ff; box-shadow: none; }
.grade-stamp.grade-d { color: var(--rose); border-color: var(--rose); box-shadow: none; }
.report-reason { margin: 6px auto 20px; max-width: 52ch; color: var(--cream-dim); font-size: 21px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
  text-align: left;
}
.stat {
  background: #1a1322;
  border: 2px solid var(--line);
  padding: 10px 12px;
}
.stat b { display: block; font-family: var(--font-pixel); font-size: 7px; color: var(--cream-dim); letter-spacing: 0.8px; margin-bottom: 6px; }
.stat span { font-size: 22px; color: var(--cream); }

.comms {
  text-align: left;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: #1a1322;
  border: 2px solid var(--line);
}
.comms h3 {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--cream-dim);
  letter-spacing: 1px;
  margin: 0 0 10px;
}
.comms-head { display: flex; align-items: center; gap: 14px; }
.comms-score { font-family: var(--font-pixel); font-size: 26px; color: var(--cream); }
.qbars.big { display: block; font-size: 26px; }
.comms-sub { margin: 2px 0 0; color: var(--cream-dim); font-size: 17px; }
.rubric {
  display: grid;
  gap: 6px;
  margin: 12px 0 4px;
  padding-top: 10px;
  border-top: 1px solid #3a2b48;
}
.r-row {
  display: grid;
  grid-template-columns: 62px 76px 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.r-name { font-family: var(--font-pixel); font-size: 7px; color: var(--cream-dim); letter-spacing: 0.8px; }
.r-row .qbars { font-size: 18px; }
.r-val { font-family: var(--font-pixel); font-size: 7px; font-weight: normal; color: var(--cream); }
.r-sub { color: #8f80a4; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.best-q { margin: 10px 0 0; font-size: 18px; color: var(--cream); }
.habit { margin: 6px 0 0; font-size: 18px; color: #b8a8cc; }
.t-q { font-family: var(--font-body); color: var(--teal); margin-right: 8px; }

.review { text-align: left; margin-bottom: 18px; }
.review h3, .transcript summary {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--cream-dim);
  letter-spacing: 1px;
  margin: 0 0 10px;
}
.review ul { margin: 0; padding-left: 20px; color: var(--cream); font-size: 19px; }
.review li { margin-bottom: 4px; }
.review li::marker { color: var(--rose); content: "› "; }

.transcript {
  text-align: left;
  border-top: 2px solid #3a2b48;
  padding-top: 14px;
  margin-bottom: 20px;
}
.transcript summary { cursor: pointer; margin: 0; }
.transcript-body { max-height: 180px; overflow-y: auto; margin-top: 12px; font-size: 18px; display: flex; flex-direction: column; gap: 8px; }
.t-line { padding-left: 12px; border-left: 3px solid #3a2b48; color: var(--cream-dim); }
.t-line b { font-family: var(--font-pixel); font-size: 7px; color: var(--amber); display: block; margin-bottom: 4px; }
.t-line.you b { color: var(--teal); }

.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* info */
.info-body { color: var(--cream); font-size: 20px; }
.info-body .lead { color: var(--amber); font-size: 22px; margin: 10px 0 14px; }
.rules { margin: 0 0 18px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.rules li::marker { color: var(--teal); }
.mono-label { font-family: var(--font-pixel); font-size: 8px; color: var(--cream-dim); letter-spacing: 1px; margin: 18px 0 8px; }
.code-sample {
  background: #120d1a;
  border: 2px solid #3a2b48;
  padding: 12px 14px;
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #a8e6b8;
  overflow-x: auto;
  white-space: pre;
}
code { font-family: ui-monospace, "Courier New", monospace; font-size: 0.88em; background: #1a1322; padding: 1px 5px; color: var(--amber); }

/* deck */
.deck { width: min(760px, 100%); }
.muted { color: var(--cream-dim); font-size: 18px; margin: 4px 0 16px; }

.deck-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 30vh;
  overflow-y: auto;
  margin-bottom: 20px;
  padding-right: 4px;
}
.deck-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #1a1322;
  border: 2px solid #33263f;
}
.deck-item .d-title { flex: 1; min-width: 0; }
.deck-item .d-title strong { display: block; font-family: var(--font-body); font-weight: normal; font-size: 19px; color: var(--cream); }
.deck-item .d-title small { display: block; font-size: 15px; color: #7d6f8f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag {
  font-family: var(--font-pixel);
  font-size: 6.5px;
  letter-spacing: 0.5px;
  padding: 4px 6px;
  border: 2px solid #4a3a5c;
  color: #9385a8;
  flex: none;
}
.tag.custom { color: var(--teal); border-color: #3f6c67; }
.d-act { display: flex; gap: 5px; flex: none; }
.d-act button {
  font-family: var(--font-pixel);
  font-size: 6.5px;
  padding: 5px 7px;
  color: var(--cream);
  background: #2e2139;
  border: 2px solid var(--line);
  cursor: pointer;
}
.d-act button:hover { background: #3d2d4d; }
.d-act button.del:hover { background: #7a2434; }

.topic-form { border-top: 2px solid #3a2b48; padding-top: 16px; }
.tf-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; margin-bottom: 12px; }
.topic-form .field { margin-bottom: 12px; }
.topic-form .row { justify-content: flex-start; align-items: center; }
.form-note { font-size: 17px; color: var(--teal); }
.form-note.err { color: var(--rose); }

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .setup-meta { grid-template-columns: 1fr 1fr; }
  .setup-meta .field:last-child { grid-column: 1 / -1; }
  .hud { gap: 10px; }
  .meters { order: 3; flex-basis: 100%; }
  .hud-actions { margin-left: auto; }
  .board { width: 34%; }
  .clock { left: 38%; }
}

@media (max-width: 700px) {
  body { font-size: 19px; }
  .setup-panels { grid-template-columns: 1fr; }
  .setup { padding: 16px 12px 24px; }
  .preview { height: 160px; }
  .preview .avatar { height: 138px; }
  .setup-head h1 { font-size: 20px; }
  .setup-foot { flex-direction: column; align-items: stretch; }
  .btn.big { width: 100%; }
  .hud-actions { width: 100%; justify-content: flex-end; }
  .game { grid-template-rows: auto minmax(132px, 1fr) auto; }
  .scene { min-height: 132px; }
  .you-slot { left: 3%; height: 52%; bottom: 10%; }
  .prof-slot { left: 53%; height: 52%; bottom: 14%; }
  .desk { left: 38%; }
  .board { width: 39%; right: 2.5%; top: 5%; height: 44%; }
  .board-scribble { display: none; }
  .board-course { font-size: clamp(6.5px, 1.1vmin + 3px, 10px); }
  .plant { display: none; }
  .window { left: 3%; width: 21%; }
  .clock { left: 30%; top: 4%; }
  .name-tag { display: none; }
  .placard { display: none; }
  .dialogue { padding: 9px 10px 10px; gap: 7px; }
  .line { min-height: 50px; max-height: 88px; font-size: 19px; }
  .chip { font-size: 16px; }
  .cost-note { display: block; flex-basis: 100%; margin-left: 0; font-size: 15px; line-height: 1.3; }
  .r-row { grid-template-columns: 58px 70px 28px; }
  .r-sub { display: none; }
  .you-said { max-width: 68%; }
  .tf-row { grid-template-columns: 1fr; gap: 0; }
  .deck-list { max-height: 24vh; }
  .grade-stamp { width: 78px; height: 78px; font-size: 28px; }
}

@media (max-width: 460px) {
  .setup-meta { grid-template-columns: 1fr; }
  .ctrl-row { grid-template-columns: 64px 1fr; }
  .plant { display: none; }
  .board-scribble { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
