/* Don's Life Choices — mobile-first office-dread aesthetic */

:root {
  --beige: #e8e2d4;
  --beige-dark: #d4cdb8;
  --paper: #f5f3ed;
  --ink: #2a2a2a;
  --ink-soft: #4a4a4a;
  --tl-white: #f8f7f1;
  --accent: #c84a1e;      /* burnt orange */
  --sick-green: #8a9a3c;  /* secondary accent */
  --shadow: rgba(0, 0, 0, 0.15);
  --line: #b8b0a0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color: var(--ink);
  background: var(--beige);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Subtle TL-light gradient */
  background-image:
    radial-gradient(ellipse at top, var(--tl-white) 0%, var(--beige) 60%, var(--beige-dark) 100%);
  background-attachment: fixed;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---- CRT / TL flicker overlay ---- */
.crt::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.025) 0px,
      rgba(0, 0, 0, 0.025) 1px,
      transparent 1px,
      transparent 3px
    );
  z-index: 999;
  mix-blend-mode: multiply;
}

.crt::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 255, 230, 0.04);
  z-index: 998;
  animation: flicker 6s infinite steps(1, end);
}

@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.6; }
}

/* ---- Top bar ---- */
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
  border-bottom: 1px dashed var(--line);
  background: linear-gradient(180deg, var(--tl-white), transparent);
}

#hearts {
  display: flex;
  gap: 6px;
}

.heart {
  width: 22px;
  height: 22px;
  display: inline-block;
  transition: transform 0.4s ease;
}

.heart.lost {
  opacity: 0.35;
  transform: rotate(-8deg) scale(0.9);
}

.heart-break {
  animation: heartBreak 0.9s ease forwards;
}

/* ---- Compact heart counter for large MAX_LIVES ---- */
.heart-counter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.heart-big {
  width: 22px;
  height: 22px;
}

.heart-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.heart-count.low {
  animation: lowFlash 1.4s ease-in-out infinite;
}

@keyframes lowFlash {
  0%, 100% { color: var(--accent); }
  50%      { color: #ff8e54; }
}

.heart-max {
  color: var(--ink-soft);
  font-weight: 400;
  font-size: 11px;
}

.heart-bar {
  flex: 1;
  height: 5px;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 3px;
  overflow: hidden;
  max-width: 110px;
}

.heart-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff8e54);
  transition: width 0.6s ease;
}

/* ---- Random button ---- */
.random-btn {
  background: var(--accent);
  color: var(--paper);
  border: none;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 3px;
  text-align: left;
  white-space: nowrap;
}

.random-btn:active { transform: translateY(1px); }

@keyframes heartBreak {
  0%   { transform: scale(1); }
  20%  { transform: scale(1.3) rotate(-3deg); }
  40%  { transform: scale(0.9) rotate(6deg); }
  100% { transform: scale(0.9) rotate(-8deg); opacity: 0.35; }
}

#muteBtn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink-soft);
}

#muteBtn:active { transform: translateY(1px); }

/* ---- Footer ---- */
#footer {
  text-align: center;
  padding: 10px 16px 14px;
  color: var(--ink-soft);
  font-size: 11px;
  border-top: 1px dashed var(--line);
  letter-spacing: 0.05em;
}

/* ---- Scene ---- */
.scene {
  flex: 1;
  padding: 18px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scene.fading {
  animation: fadeOut 0.35s ease forwards;
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-6px); }
}

/* ---- Cards / panels ---- */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
  box-shadow: 2px 2px 0 var(--shadow);
}

.panel h1, .panel h2 {
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel h1 { font-size: 22px; }
.panel h2 { font-size: 17px; }

.panel p {
  margin: 0 0 10px;
  white-space: pre-wrap;
}

.panel p:last-child { margin-bottom: 0; }

/* ---- Character row ---- */
.character-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 4px;
  min-height: 130px;
}

.don-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--paper);
  overflow: hidden;
  flex-shrink: 0;
  align-self: flex-end;
  box-shadow: 1px 1px 0 var(--shadow);
}

.don-avatar img,
.don-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}

.boss-silhouette {
  flex: 1;
  max-width: 200px;
  height: 130px;
  position: relative;
}

.boss-silhouette svg {
  width: 100%;
  height: 100%;
}

.boss-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  margin-left: auto;
  align-self: flex-start;
  padding-top: 4px;
}

/* ---- Choices ---- */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.choice-btn {
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 13px 14px;
  font: inherit;
  font-size: 14px;
  text-align: left;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 2px 2px 0 var(--shadow);
  line-height: 1.4;
}

.choice-btn:hover { background: var(--beige); }
.choice-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--shadow);
}

.choice-btn::before {
  content: "▸ ";
  color: var(--accent);
  font-weight: 700;
}

/* ---- Desk / hub screen ---- */
.desk-screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.desk-don {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 0 4px;
}

.desk-don .don-avatar {
  width: 96px;
  height: 96px;
}

.desk-don .name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
}

.desk-don .subtitle {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.story-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.story-btn {
  background: var(--paper);
  border: 1px solid var(--ink);
  border-left: 4px solid var(--accent);
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  border-radius: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  box-shadow: 2px 2px 0 var(--shadow);
}

.story-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow); }

.story-btn.done {
  border-left-color: var(--sick-green);
  opacity: 0.55;
  text-decoration: line-through;
  cursor: not-allowed;
}

.story-title { font-weight: 500; font-size: 14px; }
.story-status { font-size: 11px; color: var(--ink-soft); }

/* ---- Death screen ---- */
.death-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 20px 0;
  animation: deathShake 0.6s ease;
}

@keyframes deathShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.don-dead {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  overflow: hidden;
  position: relative;
  filter: grayscale(0) sepia(0) contrast(1) brightness(1);
  animation: don-fade-to-dead 1.1s ease-out forwards;
}

@keyframes don-fade-to-dead {
  0%   { filter: grayscale(0) sepia(0) contrast(1) brightness(1); }
  60%  { filter: grayscale(0.5) sepia(0.2) contrast(1) brightness(0.95); }
  100% { filter: grayscale(1) sepia(0.4) contrast(1.05) brightness(0.85); }
}

.don-dead img,
.don-dead svg {
  width: 100%;
  height: 100%;
  display: block;
}

.don-dead::after {
  content: "OVERLEDEN";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg) scale(1);
  border: 3px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 4px 10px;
  font-size: 13px;
  background: rgba(245, 243, 237, 0.78);
  border-radius: 4px;
  opacity: 0;
  animation: stamp-slam 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) 0.55s forwards;
}

@keyframes stamp-slam {
  0%   { transform: translate(-50%, -50%) rotate(-40deg) scale(3.4); opacity: 0; }
  60%  { transform: translate(-50%, -50%) rotate(-8deg)  scale(0.92); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(-12deg) scale(1);    opacity: 1; }
}

/* ---- Cross-story cameo line ---- */
.cameo {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-soft);
  opacity: 0.85;
}

.cameo::before {
  content: "↳ ";
  color: var(--accent);
  font-style: normal;
}

/* ---- Achievement strip on desk ---- */
.achievement-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
}

.ach-pill {
  filter: grayscale(1) opacity(0.35);
  transition: filter 0.3s ease;
  user-select: none;
}

.ach-pill.got {
  filter: grayscale(0) opacity(1);
}

.ach-count {
  margin-left: auto;
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

/* ---- Desk actions row ---- */
.desk-actions {
  display: flex;
  gap: 8px;
}

.dagboek-btn {
  flex: 1;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 3px;
  text-align: left;
}

.dagboek-btn:active { transform: translateY(1px); }

/* ---- Hidden storyline (Sander) ---- */
.story-btn.hidden-story {
  border-left-color: #d4a017;
  background: linear-gradient(180deg, #f8efd6, var(--paper));
  position: relative;
}

.story-btn.hidden-story .story-status {
  color: #c2940f;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

/* ---- Dagboek screen ---- */
.dagboek {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 4px 18px;
}

.dagboek h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.dagboek h2 {
  margin: 14px 0 2px;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.dagboek-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 3px;
}

.dagboek-stats > div {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dagboek-stats dt {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.dagboek-stats dd {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
}

.dagboek-stats .fav {
  font-size: 11px;
  font-style: italic;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.3;
}

.dagboek-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 8px;
  border-radius: 3px;
}

.dagboek-entry {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.35;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}

.dagboek-entry:last-child { border-bottom: none; }

.dagboek-text { flex: 1; font-style: italic; color: var(--ink); }

.dagboek-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.dagboek-empty {
  font-style: italic;
  text-align: center;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.ach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ach-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  opacity: 0.45;
  filter: grayscale(0.8);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.ach-row.got {
  opacity: 1;
  filter: none;
  border-left: 3px solid var(--accent);
}

.ach-icon {
  font-size: 22px;
  width: 28px;
  text-align: center;
}

.ach-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.ach-name {
  font-weight: 700;
  font-size: 13px;
}

.ach-desc {
  font-size: 11px;
  color: var(--ink-soft);
}

.dagboek-back {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--ink);
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
  margin-top: 10px;
}

.dagboek-back:active { transform: translateY(1px); }

/* ==========================================================
 *  OFFICE SIMULATOR X — isometric Habbo-meets-South-Park view
 * ========================================================== */

.sim-launch-btn {
  background: linear-gradient(180deg, #c84a1e 0%, #a73b14 100%);
  color: var(--paper);
  border: 2px solid #1a1a1a;
  padding: 14px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--shadow), inset 0 -3px 0 rgba(0,0,0,0.15);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sim-launch-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow), inset 0 -3px 0 rgba(0,0,0,0.15);
}

.office-sim {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: -18px -18px -24px;
  height: calc(100dvh - 60px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  background: #1a1a1a;
  color: var(--paper);
  position: relative;
  overflow: hidden;
}

.sim-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0,0,0,0.5);
  border-bottom: 1px solid #3a2a14;
  color: var(--paper);
  z-index: 10;
}

.sim-exit {
  background: var(--paper);
  border: 1px solid #1a1a1a;
  color: var(--ink);
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
}

.sim-title {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #d4a017;
}

.sim-prompt {
  font-size: 11px;
  font-style: italic;
  color: #aaa;
}

.sim-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at top, #4a3a24 0%, #1a1209 70%, #0a0707 100%);
}

.sim-camera {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: 0 0;
  will-change: transform;
}

.sim-floor {
  display: block;
  pointer-events: none;
}

.sim-furniture-svg {
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,0.6));
}

.sim-entities {
  position: absolute;
  top: 0;
  left: 0;
}

/* ---- Mini-sprites (Habbo × South Park) ---- */
.sim-sprite {
  position: absolute;
  width: 50px;
  height: 84px;
  margin-left: -25px;
  margin-top: -68px;   /* anchor at feet */
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(2px 5px 0 rgba(0,0,0,0.32));
  transition: filter 0.2s ease;
}

.sim-sprite-inner {
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  will-change: transform;
}

.sim-sprite-inner svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sim-sprite svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* The stage should treat horizontal pinches as gestures, not page-pans. */
.sim-stage { touch-action: none; }

.sim-sprite.npc.near {
  animation: simBob 1.1s ease-in-out infinite;
  filter: drop-shadow(0 0 12px #d4a017) drop-shadow(2px 5px 0 rgba(0,0,0,0.32));
}

.sim-sprite.moving {
  animation: simWalk 0.4s linear infinite;
}

@keyframes simBob {
  0%, 100% { margin-top: -68px; }
  50%      { margin-top: -71px; }
}

@keyframes simWalk {
  0%, 100% { margin-top: -68px; }
  50%      { margin-top: -70px; }
}

.sim-name-tag {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #d4a017;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
  margin-bottom: -8px;
  z-index: 1;
}

/* Hide name tag for Stan — he's a fishbowl, the plate is on the sprite. */
.sim-sprite#sim-sprite-stan .sim-name-tag { display: none; }

.sim-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 14px 14px;
  background: rgba(0,0,0,0.6);
  border-top: 1px solid #3a2a14;
  z-index: 10;
}

.sim-dpad {
  display: grid;
  grid-template-columns: 44px 44px 44px;
  grid-template-rows: 44px 44px 44px;
  gap: 4px;
  justify-self: start;
}

.sim-dpad button {
  background: rgba(245, 243, 237, 0.92);
  border: 2px solid #1a1a1a;
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 900;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 0 rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: none;
}

.sim-dpad button:active,
.sim-dpad button.pressed {
  transform: translateY(2px);
  box-shadow: 0 0 0 rgba(0,0,0,0.4);
  background: #d4a017;
}

.sim-dpad .pad-up    { grid-area: 1 / 2; }
.sim-dpad .pad-left  { grid-area: 2 / 1; }
.sim-dpad .pad-right { grid-area: 2 / 3; }
.sim-dpad .pad-down  { grid-area: 3 / 2; }
.sim-dpad .pad-mid {
  grid-area: 2 / 2;
  background: transparent;
  border: none;
  box-shadow: none;
  pointer-events: none;
}

.sim-action {
  align-self: end;
  justify-self: end;
  background: #c84a1e;
  border: 2px solid #1a1a1a;
  color: var(--paper);
  padding: 14px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.4);
  min-width: 120px;
  text-align: center;
}

.sim-action:disabled {
  background: #3a3a3a;
  color: #888;
  cursor: not-allowed;
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

.sim-action.ready {
  animation: simActionPulse 1s ease-in-out infinite;
}

@keyframes simActionPulse {
  0%, 100% { box-shadow: 0 3px 0 rgba(0,0,0,0.4), 0 0 0 0 rgba(212, 160, 23, 0.6); }
  50%      { box-shadow: 0 3px 0 rgba(0,0,0,0.4), 0 0 0 8px rgba(212, 160, 23, 0); }
}

.sim-overlay-info {
  position: absolute;
  top: 50px;
  left: 12px;
  right: 12px;
  background: rgba(0,0,0,0.75);
  color: var(--paper);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.4;
  z-index: 9;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-left: 3px solid #d4a017;
}

.sim-overlay-info.show { opacity: 1; }

/* ---- Dialog modal (NPC choice menu) ---- */
.sim-dialog {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 130px;
  z-index: 30;
  background: var(--paper);
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
  animation: simDialogIn 0.25s ease;
}

@keyframes simDialogIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.sim-dialog-title {
  font-size: 13px;
  font-style: italic;
  margin-bottom: 10px;
  color: var(--ink);
  line-height: 1.4;
}

.sim-dialog button {
  display: block;
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 11px 14px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  margin: 6px 0;
  cursor: pointer;
  border-radius: 3px;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--shadow);
}

.sim-dialog button:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--shadow);
}

.sim-dialog button::before {
  content: "▸ ";
  color: var(--accent);
  font-weight: 700;
}

.sim-dialog .sim-dialog-cancel {
  margin-top: 10px;
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
  font-style: italic;
}

.sim-dialog .sim-dialog-cancel::before { content: "✕ "; color: var(--ink-soft); }

/* ==========================================================
 *   CUTSCENE — Animated Peptide Injection
 * ========================================================== */

.cutscene {
  position: relative;
  height: calc(100dvh - 60px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  background: #060403;
  color: var(--paper);
  overflow: hidden;
  margin: -18px -18px -24px;
}

.cs-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 60% 40%, #4a3a24 0%, #1a1209 60%, #060403 100%),
    repeating-linear-gradient(180deg, rgba(0,0,0,0.06) 0 2px, transparent 2px 4px);
  background-blend-mode: multiply;
}

.cs-stage {
  position: absolute;
  inset: 0;
}

.cs-tufan {
  position: absolute;
  right: 12%;
  bottom: 18%;
  width: 200px;
  height: 280px;
  transform-origin: bottom center;
  transition: transform 2.6s cubic-bezier(0.3, 0, 0.2, 1);
  filter: drop-shadow(4px 8px 0 rgba(0,0,0,0.55));
}

.cs-tufan svg { width: 100%; height: 100%; display: block; }

.cs-don {
  position: absolute;
  left: 9%;
  bottom: 18%;
  width: 110px;
  height: 150px;
  transform-origin: bottom center;
  filter: drop-shadow(2px 6px 0 rgba(0,0,0,0.5));
  animation: csDonShiver 0.18s linear infinite;
}

.cs-don svg { width: 100%; height: 100%; display: block; }

@keyframes csDonShiver {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(0.6px); }
}

.cs-syringe {
  position: absolute;
  right: 28%;
  bottom: 48%;
  width: 180px;
  height: 50px;
  transform: translateX(220%) rotate(-12deg);
  transition: transform 1.4s cubic-bezier(0.5, 0, 0.2, 1);
  filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.4));
}

.cs-syringe svg { width: 100%; height: 100%; display: block; }

.cs-stage.prep .cs-syringe {
  transform: translateX(80%) rotate(-8deg);
}

.cs-stage.inject-prep .cs-syringe {
  transform: translateX(0) rotate(-2deg);
}

.cs-stage.inject-go .cs-syringe {
  transform: translateX(-10%) rotate(2deg);
  animation: csNeedleJab 0.18s ease 3;
}

@keyframes csNeedleJab {
  0%, 100% { translate: 0 0; }
  50%      { translate: 4px 0; }
}

.cs-flash {
  position: absolute;
  inset: 0;
  background: rgba(255, 240, 200, 0.92);
  opacity: 0;
  pointer-events: none;
}

.cs-stage.inject-go .cs-flash {
  animation: csFlash 0.5s ease;
}

@keyframes csFlash {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0; }
}

.cs-stage.tufan-grow .cs-tufan {
  transform: scale(1.55) translateY(2%);
}

.cs-stage.tufan-grow .cs-don {
  animation: csDonShiverBig 0.12s linear infinite;
}

@keyframes csDonShiverBig {
  0%, 100% { transform: translateX(0) translateY(0); }
  25%      { transform: translateX(-2px) translateY(0.5px); }
  50%      { transform: translateX(2px) translateY(-0.5px); }
  75%      { transform: translateX(-1px) translateY(0.3px); }
}

.cs-redhaze {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(0deg, rgba(180, 30, 30, 0.85) 0%, rgba(180, 30, 30, 0.4) 40%, transparent 70%),
    radial-gradient(ellipse at 50% 70%, rgba(255, 90, 90, 0.4) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 2.4s ease;
}

.cs-stage.red-haze .cs-redhaze { opacity: 1; }

.cs-grow-particles {
  position: absolute;
  right: 16%;
  bottom: 26%;
  width: 220px;
  height: 320px;
  pointer-events: none;
  opacity: 0;
}

.cs-stage.tufan-grow .cs-grow-particles {
  opacity: 1;
}

.cs-grow-particles span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ad84a;
  filter: blur(0.5px);
  animation: csParticleRise 1.6s ease-out infinite;
}

.cs-grow-particles span:nth-child(1) { left: 20%; bottom: 0;  animation-delay: 0s;    }
.cs-grow-particles span:nth-child(2) { left: 50%; bottom: 10%; animation-delay: 0.3s; }
.cs-grow-particles span:nth-child(3) { left: 35%; bottom: 5%;  animation-delay: 0.6s; }
.cs-grow-particles span:nth-child(4) { left: 65%; bottom: 15%; animation-delay: 0.9s; }

@keyframes csParticleRise {
  0%   { transform: translateY(0)    scale(1);   opacity: 0.95; }
  100% { transform: translateY(-220px) scale(0.4); opacity: 0;   }
}

.cs-caption {
  position: absolute;
  bottom: 24px;
  left: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.82);
  color: var(--paper);
  padding: 12px 14px;
  border-radius: 4px;
  border-left: 3px solid var(--accent);
  font-size: 13.5px;
  line-height: 1.45;
  z-index: 10;
  font-style: italic;
}

.cs-skip {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--paper);
  border: 1px solid var(--paper);
  padding: 6px 12px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
  z-index: 11;
  letter-spacing: 0.05em;
}

.death-text {
  font-size: 14px;
  background: var(--paper);
  border: 1px dashed var(--ink);
  padding: 12px 14px;
  white-space: pre-wrap;
  text-align: left;
}

.epitaph {
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 4px;
}

.death-continue {
  margin-top: 6px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 10px 18px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
}

.death-continue:active { transform: translateY(1px); }

/* ---- Game over ---- */
.gameover {
  text-align: center;
  padding: 30px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.gameover h1 {
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.gameover .stats {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 14px;
  text-align: left;
  font-size: 13px;
  width: 100%;
  max-width: 320px;
}

.gameover .stats dt {
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 6px;
}

.gameover .stats dt:first-child { margin-top: 0; }
.gameover .stats dd { margin: 0 0 4px; }

.reset-btn {
  background: var(--accent);
  color: var(--paper);
  border: none;
  padding: 14px 22px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  font-weight: 700;
}

/* ---- Intro screen ---- */
.intro {
  text-align: center;
  padding: 14px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.intro h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.02em;
}

.intro .blurb {
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-soft);
  max-width: 320px;
  margin: 0;
}

.intro .blurb strong {
  color: var(--ink);
  font-weight: 600;
}

.intro .start-btn {
  margin-top: 2px;
}

.game-logo {
  width: 42%;
  max-width: 150px;
  margin: 0 auto;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.15));
}

.game-logo svg,
.logo-svg,
.game-logo img.logo-img {
  width: 100%;
  height: auto;
  display: block;
}

.tufan-tag {
  width: 38%;
  max-width: 140px;
  margin: 14px auto 0;
  opacity: 0.92;
  transform: rotate(-5deg);
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.2));
}

.tufan-tag img,
.tufan-tag svg,
.tufan-tag .tag-img,
.tufan-tag-svg {
  width: 100%;
  height: auto;
  display: block;
}

.don-quote {
  margin: 0;
  padding: 8px 12px;
  max-width: 320px;
  background: var(--paper);
  border-left: 3px solid var(--accent);
  font-style: italic;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink);
  position: relative;
  text-align: left;
}

.don-quote cite {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.intro .start-btn {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 11px 22px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  margin-top: 2px;
}

/* ---- Inner thought (Don's internal monologue) ---- */
.thought {
  font-style: italic;
  color: var(--ink-soft);
  background: rgba(200, 74, 30, 0.06);
  border-left: 2px solid var(--accent);
  padding: 6px 10px;
  margin: 8px 0;
  font-size: 13px;
}

.thought::before { content: "( "; }
.thought::after  { content: " )"; }

/* ---- Boss tag in scene ---- */
.boss-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 2px 6px;
  border-radius: 2px;
  margin-bottom: 6px;
}
