/* ─── REGHU.EXE — shell, HUD, dialog, controls ─────────────────────────── */

:root {
  --t-bg: #0d1117;
  --t-surface: #161b22;
  --t-border: #30363d;
  --t-button: #21262d;
  --t-text: #c9d1d9;
  --t-dim: #8b949e;
  --t-green: #3fb950;
  --t-blue: #58a6ff;
  --t-purple: #a371f7;
  --t-yellow: #e3b341;
  --t-red: #f85149;
  --px-font: "Press Start 2P", monospace;
  --mono-font: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--t-bg);
  color: var(--t-text);
  font-family: var(--mono-font);
  overflow: hidden;
  /* it's a game, not a document — never let clicks select dialogue/UI text or
     show the I-beam text caret. Form fields re-enable selection below. */
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

/* the only places text selection makes sense: the name/feedback inputs */
input, textarea {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.hidden { display: none !important; }

/* ── CRT cabinet frame ─────────────────────────────────────────────────── */
#crt {
  position: relative;
  width: min(100%, 1100px);
  height: min(100%, 780px);
  display: flex;
  flex-direction: column;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: 10px;
  box-shadow:
    0 0 0 4px #0a0d12,
    0 24px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

/* ── HUD top bar ───────────────────────────────────────────────────────── */
#hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--t-border);
  background: var(--t-surface);
  flex: none;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dots { display: flex; gap: 5px; }
.dots span { width: 10px; height: 10px; border-radius: 50%; display: block; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

#hud-path {
  font-family: var(--px-font);
  font-size: 9px;
  color: var(--t-green);
  text-shadow: 0 0 6px rgba(63, 185, 80, 0.5);
  white-space: nowrap;
}

#hud-quest {
  font-family: var(--px-font);
  font-size: 8px;
  color: var(--t-yellow);
  white-space: nowrap;
}
#hud-quest.quest-done { color: var(--t-green); text-shadow: 0 0 8px rgba(63, 185, 80, 0.7); }


#hud-sound {
  background: var(--t-button);
  color: var(--t-dim);
  border: 1px solid var(--t-border);
  font-family: var(--mono-font);
  font-size: 12px;
  width: 26px;
  height: 24px;
  cursor: pointer;
}
#hud-sound:hover { color: var(--t-text); background: var(--t-border); }

/* ── stage / canvas ────────────────────────────────────────────────────── */
#stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05070a;
}

#game {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #05070a;
}

/* faint scanlines over the play area only */
#stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.14) 0px,
    rgba(0, 0, 0, 0.14) 1px,
    transparent 1px,
    transparent 4px
  );
}

/* ── hint bar ──────────────────────────────────────────────────────────── */
#hint {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--t-dim);
  border-top: 1px solid var(--t-border);
  background: var(--t-surface);
  flex: none;
  padding: 0 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── boot overlay ──────────────────────────────────────────────────────── */
#boot {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: #05070a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  cursor: pointer;
  padding: 20px;
}

#boot h1 {
  font-family: var(--px-font);
  font-size: clamp(16px, 3.4vw, 30px);
  color: var(--t-green);
  text-shadow: 0 0 14px rgba(63, 185, 80, 0.55);
  text-align: center;
  line-height: 1.5;
}
#boot h1 span { color: var(--t-purple); text-shadow: 0 0 14px rgba(163, 113, 247, 0.55); }

#boot-sub {
  font-family: var(--px-font);
  font-size: 9px;
  color: var(--t-dim);
  letter-spacing: 1px;
}

#boot-text {
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--t-text);
  white-space: pre;
  min-height: 10em;
  text-align: left;
}
#boot-text::after {
  content: "▮";
  color: var(--t-green);
  animation: blink 1s step-end infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── crash screen (server-unplug easter egg) ──────────────────────────────
   a fake kernel panic: full-bleed black terminal over the whole play area,
   above every other overlay (boot/dialog), ending in a [ RESET SERVER ] key */
#crash {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #05070a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}
#crash.hidden { display: none; }
#crash-inner {
  max-width: 520px;
  width: 100%;
  font-family: var(--mono-font);
}
#crash-title {
  font-family: var(--px-font);
  font-size: clamp(11px, 2.6vw, 16px);
  color: var(--t-red);
  text-shadow: 0 0 12px rgba(248, 81, 73, 0.6);
  letter-spacing: 1px;
  margin-bottom: 18px;
  animation: blink 1.1s step-end infinite;
}
#crash-text {
  font-family: var(--mono-font);
  font-size: 13px;
  line-height: 1.6;
  color: var(--t-green);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 22px;
}
#crash-text .crash-hl { color: var(--t-yellow); }
#crash-text .crash-dim { color: var(--t-dim); }
#crash-reset {
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--t-bg);
  background: var(--t-green);
  border: none;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(63, 185, 80, 0.45);
}
#crash-reset:hover { background: #56d364; }
#crash-reset:focus-visible { outline: 2px solid var(--t-text); outline-offset: 2px; }

/* ── dialog window ─────────────────────────────────────────────────────── */
#dialog {
  position: absolute;
  inset: 0;
  z-index: 20;
  outline: none; /* focused as a whole on open; no visible ring */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 4, 8, 0.55);
}

/* cream RPG message box: dark frame, gold inner ring, red nameplate title */
.dlg-window {
  position: relative;
  width: min(680px, 100%);
  max-height: 78%;
  display: flex;
  flex-direction: column;
  background: #fff8e6;
  border: 3px solid #454552;
  border-radius: 8px;
  box-shadow: inset 0 0 0 3px #e8c46a, 0 12px 36px rgba(0, 0, 0, 0.5);
}
.dlg-window::after {
  content: "▼";
  position: absolute;
  bottom: 6px;
  right: 12px;
  font-size: 11px;
  color: #d84848;
  animation: blink 1s step-end infinite;
}

.dlg-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  border-bottom: 2px solid #e8c46a;
  flex: none;
}

#dialog-path {
  flex: 1;
  font-size: 11px;
  color: #8a7a56;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#dialog-close {
  background: #454552;
  border: none;
  border-radius: 5px;
  color: #fff8e6;
  font-family: var(--mono-font);
  font-size: 12px;
  padding: 2px 8px;
  cursor: pointer;
}
#dialog-close:hover { background: #d84848; }

#dialog-body {
  padding: 14px 16px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbb271 #fff8e6;
}

#dialog-body h2 {
  display: inline-block;
  font-family: var(--px-font);
  font-size: 12px;
  line-height: 1.7;
  background: #d84848;
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  margin-bottom: 8px;
}

#dialog-body .dlg-sub {
  color: #8a7a56;
  font-size: 12px;
  margin-bottom: 8px;
}

#dialog-body .dlg-badge {
  color: #b06a10;
  font-size: 12px;
  margin-bottom: 8px;
}

#dialog-body p {
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 8px;
  color: #3c3c46;
}

#dialog-body ul { list-style: none; margin-bottom: 8px; }
#dialog-body li {
  font-size: 13px;
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
  margin-bottom: 6px;
  color: #3c3c46;
}
#dialog-body li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #d84848;
}

/* chips, link pills and input rows stay invisible (space reserved) while
   the dialog text is still typewriting — no empty boxes on screen */
.dlg-streaming { visibility: hidden; }

.dlg-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.dlg-tags span {
  font-size: 11px;
  color: #6d5c34;
  border: 1px solid #cbb271;
  padding: 2px 6px;
  background: #f3e6c4;
}

.dlg-input { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dlg-input input {
  flex: 1 1 100%;
  min-width: 150px;
  background: #fff;
  border: 2px solid #cbb271;
  border-radius: 5px;
  color: #3c3c46;
  font-family: var(--mono-font);
  font-size: 13px;
  padding: 6px 10px;
  caret-color: #d84848;
}
.dlg-input input::placeholder { color: #8a7a56; }
.dlg-input input:focus {
  outline: 2px solid #d84848;
  outline-offset: 1px;
}
.dlg-input button {
  font-family: var(--mono-font);
  font-size: 12px;
  color: #fff;
  background: #3a5aa8;
  border: 2px solid #2a4079;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
}
.dlg-input button:hover { background: #4a6cc0; }
.dlg-input button:disabled { background: #8a8f9c; border-color: #6b7080; opacity: 0.55; cursor: default; }

/* feedback prompt: 5-star rating + optional comment (the receptionist's
   end-of-visit ask). Stars are gold when filled, muted gold when empty. */
.dlg-rating { display: flex; align-items: center; gap: 3px; margin-top: 12px; }
.dlg-star {
  font-size: 22px;
  line-height: 1;
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  color: #cbb271;
  transition: color 0.08s, transform 0.08s;
}
.dlg-star.on { color: #e3b341; text-shadow: 0 0 6px rgba(227, 179, 65, 0.6); }
.dlg-star:hover { transform: scale(1.18); }
.dlg-rating-label {
  font-family: var(--mono-font);
  font-size: 12px;
  color: #8a7a56;
  margin-left: 8px;
}
.dlg-comment {
  width: 100%;
  margin-top: 10px;
  background: #fff;
  border: 2px solid #cbb271;
  border-radius: 5px;
  color: #3c3c46;
  font-family: var(--mono-font);
  font-size: 13px;
  line-height: 1.5;
  padding: 6px 10px;
  resize: vertical;
  min-height: 46px;
  caret-color: #d84848;
}
.dlg-comment::placeholder { color: #8a7a56; }
.dlg-comment:focus { outline: 2px solid #d84848; outline-offset: 1px; }

.dlg-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dlg-links a, .dlg-links button {
  font-family: var(--mono-font);
  font-size: 12px;
  color: #fff;
  background: #3a5aa8;
  border: 2px solid #2a4079;
  border-radius: 5px;
  padding: 5px 10px;
  text-decoration: none;
  cursor: pointer;
}
.dlg-links a:hover, .dlg-links button:hover {
  background: #4a6cc0;
}
.dlg-links button.dlg-danger {
  background: #8f2b26;
  border-color: #6e211d;
}
.dlg-links button.dlg-danger:hover { background: #b3352e; }

.dlg-contacts { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.dlg-contact { display: flex; align-items: center; gap: 8px; }
.dlg-contact-val {
  flex: 1;
  font-family: var(--mono-font);
  font-size: 13px;
  line-height: 1.65;
  color: #3c3c46;
  word-break: break-all;
}
.dlg-copy {
  flex: none;
  font-family: var(--mono-font);
  font-size: 14px;
  line-height: 1;
  color: #fff;
  background: #3a5aa8;
  border: 2px solid #2a4079;
  border-radius: 5px;
  padding: 5px 9px;
  cursor: pointer;
}
.dlg-copy:hover { background: #4a6cc0; }
.dlg-copy.copied { background: #3fb950; border-color: #2ea043; }

/* ── terminal-mode dialog (project computers) ──────────────────────────────
   full-screen black & green terminal covering the whole game window,
   mirroring the main site's macOS-terminal chrome + phosphor green */
#dialog.terminal { padding: 0; background: none; }
#dialog.terminal .dlg-window {
  width: 100%;
  height: 100%;
  max-height: 100%;
  background: #0d1117;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
/* CRT scanlines */
#dialog.terminal .dlg-window::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(63, 185, 80, 0.045) 0 1px,
    transparent 1px 3px
  );
}
#dialog.terminal .dlg-window::after {
  content: "█";
  color: #3fb950;
}
/* the shell already draws the terminal chrome (traffic dots + path) — no
   inner titlebar, just a floating ✕ in the terminal's top-right corner */
#dialog.terminal .dlg-titlebar {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  height: auto;
  padding: 0;
  border: none;
  background: none;
}
#dialog.terminal #dialog-path { display: none; }
#dialog.terminal #dialog-close {
  background: #21262d;
  color: #3fb950;
  border: 1px solid #2ea043;
  border-radius: 3px;
}
#dialog.terminal #dialog-close:hover { background: #d84848; color: #fff; }
#dialog.terminal #dialog-body {
  scrollbar-color: #2ea043 #0d1117;
  text-shadow: 0 0 6px rgba(63, 185, 80, 0.3); /* phosphor glow */
}
#dialog.terminal #dialog-body h2 {
  font-family: var(--mono-font);
  font-size: 15px;
  background: none;
  color: #3fb950;
  padding: 0;
  border-radius: 0;
  margin-bottom: 6px;
}
#dialog.terminal #dialog-body h2::before {
  content: "$ ";
  color: #8b949e;
}
#dialog.terminal #dialog-body .dlg-sub { color: #2ea043; }
#dialog.terminal #dialog-body .dlg-badge { color: #e3b341; }
#dialog.terminal #dialog-body p,
#dialog.terminal #dialog-body li { color: #56d364; }
#dialog.terminal #dialog-body li::before { color: #3fb950; }
#dialog.terminal .dlg-tags span {
  color: #3fb950;
  border-color: #2ea043;
  background: rgba(63, 185, 80, 0.08);
}
#dialog.terminal .dlg-links a,
#dialog.terminal .dlg-links button {
  color: #3fb950;
  background: #0d1117;
  border: 2px solid #2ea043;
  border-radius: 3px;
}
#dialog.terminal .dlg-links a:hover,
#dialog.terminal .dlg-links button:hover {
  background: #3fb950;
  color: #0d1117;
}
#dialog.terminal #dialog-body .dlg-quit {
  color: #8b949e;
  margin-top: 20px;
  text-shadow: none;
}

/* ── diploma-mode dialog (university diplomas) ─────────────────────────────
   parchment certificate centered over the dimmed (translucent) game screen:
   double gold frame, engraved serif type, GPA rendered as a gold seal */
#dialog.diploma {
  align-items: center;
  background: rgba(2, 4, 8, 0.62);
  padding: 0;
}
/* as tall as the game window itself */
#dialog.diploma .dlg-window {
  width: min(540px, 94%);
  height: 100%;
  max-height: 100%;
  background: radial-gradient(ellipse at center, #fdf6e0 55%, #f1e3bd 100%);
  border: 3px solid #454552;
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 4px #fdf6e0,
    inset 0 0 0 6px #c9a24d,
    inset 0 0 0 8px #fdf6e0,
    inset 0 0 0 9px #e2d0a2,
    0 14px 40px rgba(0, 0, 0, 0.55);
}
#dialog.diploma .dlg-window::after { content: none; }
/* no titlebar chrome on parchment — just a floating ✕ inside the frame */
#dialog.diploma .dlg-titlebar {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  height: auto;
  padding: 0;
  border: none;
}
#dialog.diploma #dialog-path { display: none; }
#dialog.diploma #dialog-close {
  background: none;
  border: 1px solid #c9a24d;
  border-radius: 3px;
  color: #8a7a56;
}
#dialog.diploma #dialog-close:hover { background: #d84848; color: #fff8e6; }
#dialog.diploma #dialog-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* content sits mid-parchment at full height */
  flex: 1;
  padding: 30px 34px 26px;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
}
/* monogram crest seal in school colors (no image assets in the game) */
#dialog.diploma .dlg-crest {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #c93c35;
  color: #fdf6e0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: bold;
  font-size: 20px;
  letter-spacing: 1px;
  box-shadow: 0 0 0 2px #fdf6e0, 0 0 0 4px #c9a24d;
  margin-bottom: 16px;
}
#dialog.diploma #dialog-body h2 {
  display: block;
  background: none;
  color: #4a3f28;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: 1px;
  padding: 0;
  margin-bottom: 10px;
}
#dialog.diploma #dialog-body h2::before {
  content: "✦ " attr(data-degree) " ✦";
  display: block;
  font-size: 10px;
  letter-spacing: 4px;
  color: #b28a2e;
  margin-bottom: 10px;
}
#dialog.diploma #dialog-body .dlg-sub {
  color: #6d5c34;
  font-style: italic;
  font-size: 13px;
  margin-bottom: 12px;
}
#dialog.diploma #dialog-body p {
  color: #55482c;
  font-size: 13px;
}
/* the GPA badge becomes the wax/gold seal, pinned below the citation text */
#dialog.diploma #dialog-body .dlg-badge {
  order: 9;
  background: radial-gradient(circle at 35% 30%, #f4d789, #d9ab3c 70%, #b8892a);
  border: 2px solid #a87f24;
  box-shadow: inset 0 0 0 2px #f4d789;
  border-radius: 999px;
  color: #5c4308;
  font-size: 11px;
  padding: 8px 14px;
  margin: 8px 0 2px;
}

/* ── scroll-mode dialog (the research paper) ───────────────────────────────
   rolled parchment manuscript over the dimmed game screen: a vertical
   parchment sheet with rolled rod ends sticking out top and bottom */
#dialog.scroll { align-items: center; background: rgba(2, 4, 8, 0.62); }
#dialog.scroll .dlg-window {
  width: min(560px, 92%);
  background: linear-gradient(#f3e6c4, #fdf6e0 8%, #fdf6e0 92%, #f1e3bd);
  border: none;
  border-radius: 2px;
  box-shadow:
    inset 14px 0 18px -12px rgba(90, 70, 30, 0.4),
    inset -14px 0 18px -12px rgba(90, 70, 30, 0.4),
    0 14px 40px rgba(0, 0, 0, 0.55);
}
/* the rolled rods — ::after replaces the blinking ▼ */
#dialog.scroll .dlg-window::before,
#dialog.scroll .dlg-window::after {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  height: 20px;
  background: linear-gradient(#efdcae, #cbb271 45%, #937f4e);
  border: 2px solid #5c4a2a;
  border-radius: 10px;
  pointer-events: none;
  animation: none;
}
#dialog.scroll .dlg-window::before { top: -10px; }
#dialog.scroll .dlg-window::after { bottom: -10px; }
/* no titlebar chrome on parchment — floating ✕ below the top rod */
#dialog.scroll .dlg-titlebar {
  position: absolute;
  top: 18px;
  right: 14px;
  z-index: 2;
  height: auto;
  padding: 0;
  border: none;
}
#dialog.scroll #dialog-path { display: none; }
#dialog.scroll #dialog-close {
  background: none;
  border: 1px solid #c9a24d;
  border-radius: 3px;
  color: #8a7a56;
}
#dialog.scroll #dialog-close:hover { background: #d84848; color: #fff8e6; }
#dialog.scroll #dialog-body {
  padding: 30px 34px 28px;
  font-family: Georgia, "Times New Roman", serif;
}
#dialog.scroll #dialog-body h2 {
  display: block;
  background: none;
  color: #4a3f28;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.45;
  padding: 0;
  margin-bottom: 8px;
  text-align: center;
}
#dialog.scroll #dialog-body h2::before {
  content: "✦ PUBLISHED RESEARCH ✦";
  display: block;
  font-size: 10px;
  letter-spacing: 4px;
  color: #b28a2e;
  margin-bottom: 10px;
}
#dialog.scroll #dialog-body .dlg-sub {
  color: #6d5c34;
  font-style: italic;
  text-align: center;
  margin-bottom: 10px;
}
#dialog.scroll #dialog-body .dlg-badge {
  display: block;
  text-align: center;
  color: #b06a10;
}
#dialog.scroll #dialog-body p {
  color: #55482c;
  line-height: 1.7;
}
#dialog.scroll .dlg-tags { justify-content: center; }
#dialog.scroll .dlg-links { justify-content: center; }
#dialog.scroll .dlg-links a,
#dialog.scroll .dlg-links button {
  color: #6d5c34;
  border-color: #c9a24d;
  background: none;
}
#dialog.scroll .dlg-links a:hover,
#dialog.scroll .dlg-links button:hover {
  background: #c9a24d;
  color: #fff8e6;
}

/* ── resume-mode dialog (lobby copier) ─────────────────────────────────────
   the resume as a sheet of printed paper centered over the blurred game:
   white page, dark ink, regular document type (not the game fonts), with
   the download links pinned to a footer strip below the page */
#dialog.resume {
  align-items: center;
  background: rgba(2, 4, 8, 0.62);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
#dialog.resume .dlg-window {
  width: min(720px, 100%);
  height: min(92%, 960px);
  max-height: 92%;
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf5 65%, #f3efe4 100%);
  border: 1px solid #b9b4a3;
  border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 22px 48px rgba(0, 0, 0, 0.6);
}
/* not a message box — drop the blinking ▼ prompt */
#dialog.resume .dlg-window::after { content: none; }
/* plain page — no RPG titlebar, just a floating ✕ on the paper corner */
#dialog.resume .dlg-titlebar {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  height: auto;
  padding: 0;
  border: none;
  background: none;
}
#dialog.resume #dialog-path { display: none; }
#dialog.resume #dialog-close {
  background: none;
  border: 1px solid #c6c0ae;
  border-radius: 3px;
  color: #8a8572;
}
#dialog.resume #dialog-close:hover { background: #d84848; color: #fff; }
#dialog.resume #dialog-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 0;
}
/* the printed page — regular document type, dark ink on white */
#dialog.resume .dlg-paper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 30px 38px 26px;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #22242a;
  scrollbar-width: thin;
  scrollbar-color: #b9b4a3 #f3efe4;
}
#dialog.resume .rp-name {
  font-size: 21px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.2px;
}
#dialog.resume .rp-contact {
  font-size: 11.5px;
  color: #55575e;
  text-align: center;
  margin: 3px 0 4px;
}
#dialog.resume .rp-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid #9a9481;
  padding-bottom: 2px;
  margin: 14px 0 7px;
}
#dialog.resume .rp-entry { margin-bottom: 9px; }
#dialog.resume .rp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
#dialog.resume .rp-title { font-size: 12.5px; font-weight: 700; }
#dialog.resume .rp-title.rp-role { font-weight: 400; font-style: italic; }
#dialog.resume .rp-note { font-weight: 400; color: #45474e; }
#dialog.resume .rp-date {
  font-size: 11.5px;
  color: #55575e;
  white-space: nowrap;
}
#dialog.resume .rp-subline {
  font-size: 12px;
  font-style: italic;
  color: #45474e;
  margin: 1px 0 2px;
}
#dialog.resume .rp-para { font-size: 12px; line-height: 1.5; margin-top: 2px; }
#dialog.resume .rp-bullets {
  margin: 2px 0 0;
  padding-left: 16px;
  list-style: disc;
}
#dialog.resume .rp-bullets li {
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 2px;
  padding-left: 2px;
  color: #22242a;
}
#dialog.resume .rp-bullets li::before { content: none; }
#dialog.resume .rp-pair { font-size: 12px; line-height: 1.55; }
#dialog.resume .rp-pair strong { font-weight: 600; }
#dialog.resume .dlg-links {
  flex: none;
  justify-content: center;
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid #ded8c6;
  background: #f0ecdf;
}
@media (max-width: 700px) {
  #dialog.resume .dlg-paper { padding: 20px 16px 18px; }
}

/* ── toast ─────────────────────────────────────────────────────────────── */
#toast {
  position: absolute;
  left: 50%;
  bottom: 44px;
  transform: translate(-50%, 16px);
  z-index: 25;
  background: var(--t-surface);
  border: 1px solid var(--t-green);
  color: var(--t-green);
  font-family: var(--px-font);
  font-size: 8px;
  line-height: 1.6;
  padding: 8px 14px;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── confetti ──────────────────────────────────────────────────────────── */
#confetti {
  position: absolute;
  inset: 0;
  z-index: 28;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ── touch controls ────────────────────────────────────────────────────── */
#touch-ui { display: none; }

@media (pointer: coarse), (max-width: 700px) {
  #touch-ui { display: block; }

  /* Hide the D-pad + A button while a plain dialogue (message box) is open —
     it sits low over the controls on a phone. Only the default dialogue mode:
     the terminal/diploma/scroll/resume modes are full-screen/centered overlays
     with their own close button, so leave the controls for those. */
  #dialog:not(.hidden):not(.terminal):not(.diploma):not(.scroll):not(.resume) ~ #touch-ui {
    display: none;
  }
}

#dpad {
  position: absolute;
  left: 14px;
  bottom: 44px;
  z-index: 22;
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
}
#dpad button, #btn-a {
  background: rgba(33, 38, 45, 0.85);
  border: 1px solid var(--t-border);
  color: var(--t-dim);
  font-family: var(--px-font);
  font-size: 12px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#dpad button:active, #btn-a:active { background: var(--t-border); color: var(--t-green); }
#dp-up { grid-column: 2; grid-row: 1; }
#dp-left { grid-column: 1; grid-row: 2; }
#dp-right { grid-column: 3; grid-row: 2; }
#dp-down { grid-column: 2; grid-row: 3; }

#btn-a {
  position: absolute;
  right: 18px;
  bottom: 58px;
  z-index: 22;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-size: 14px;
  color: var(--t-green);
}

/* ── focus visibility ──────────────────────────────────────────────────── */
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--t-green);
  outline-offset: 1px;
}

/* ── reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #boot-text::after { animation: none; }
  .dlg-window::after { animation: none; }
  #toast { transition: none; }
}

/* ── small screens ─────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  body { padding: 6px; }
  #hud { padding: 0 8px; gap: 6px; }
  #hud-path { font-size: 8px; }
  #hud-quest { font-size: 7px; }
  #hint { font-size: 10px; }
  .dlg-window { max-height: 88%; }
  #dialog { padding: 8px; }
}

