/* ══════════════════════════════════════════════════
   PRISON LIFE SIM — AAA Dark UI Stylesheet
   happystoner5420 Games © 2025
   ══════════════════════════════════════════════════ */

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

:root {
  --bg:         #0a0a0c;
  --bg2:        #111115;
  --bg3:        #18181f;
  --surface:    #1e1e28;
  --surface2:   #252530;
  --border:     #2e2e3d;
  --border2:    #3d3d52;
  --text:       #d8d8e8;
  --text-dim:   #7a7a9a;
  --text-muted: #4a4a6a;
  --accent:     #c8a84b;
  --accent2:    #e0c060;
  --red:        #c02020;
  --red2:       #e03030;
  --green:      #2a7a3a;
  --green2:     #3aaa4a;
  --blue:       #2a4aaa;
  --blue2:      #4a6acc;
  --hp-col:     #2ea84a;
  --rep-col:    #4a6acc;
  --heat-col:   #c05020;
  --shadow:     0 4px 24px rgba(0,0,0,0.7);
  --shadow2:    0 2px 8px rgba(0,0,0,0.5);
  --font:       'Segoe UI', 'Arial Narrow', Arial, sans-serif;
  --font-mono:  'Courier New', Courier, monospace;
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  user-select: none;
}

/* ── SCREENS ─────────────────────────────────────── */
.screen { position: fixed; inset: 0; display: none; z-index: 10; }
.screen.active { display: flex; }

/* ── MAIN MENU ────────────────────────────────────── */
#screen-mainmenu {
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.menu-bg {
  position: absolute; inset: 0;
  background: url('cell.jpg') center/cover no-repeat;
  filter: brightness(0.25) saturate(0.4) contrast(1.2);
}
.menu-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(10,10,12,0.5) 0%,
    rgba(10,10,12,0.85) 60%,
    rgba(10,10,12,0.98) 100%);
}
.menu-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; gap: 32px;
  width: 360px;
}
.title-block {
  text-align: center;
}
.title-bars {
  display: flex; gap: 6px; justify-content: center; margin: 8px 0;
}
.title-bars span {
  display: block; height: 2px;
  background: var(--accent);
}
.title-bars span:nth-child(1) { width: 40px; }
.title-bars span:nth-child(2) { width: 80px; }
.title-bars span:nth-child(3) { width: 40px; }

.game-title {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 8px;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text);
  text-shadow:
    0 0 40px rgba(200,168,75,0.3),
    0 2px 4px rgba(0,0,0,0.9);
}
.game-title span {
  font-size: 28px;
  letter-spacing: 16px;
  color: var(--accent);
  display: block;
  margin-top: 4px;
}
.subtitle {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 8px;
}
.main-nav {
  display: flex; flex-direction: column; gap: 10px; width: 100%;
}
.credits-tag {
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 2px; text-transform: uppercase;
}

/* ── BUTTONS ──────────────────────────────────────── */
.menu-btn {
  display: block; width: 100%; padding: 14px 24px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--border2);
  color: var(--text);
  font-family: var(--font); font-size: 13px;
  font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.menu-btn::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.15s ease;
}
.menu-btn:hover:not(:disabled) {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
  padding-left: 32px;
}
.menu-btn:hover:not(:disabled)::before { transform: scaleY(1); }
.menu-btn.primary {
  background: rgba(200,168,75,0.1);
  border-color: var(--accent);
  color: var(--accent);
}
.menu-btn.primary:hover:not(:disabled) {
  background: rgba(200,168,75,0.2);
  color: var(--accent2);
}
.menu-btn.danger {
  border-color: var(--red);
  color: var(--red2);
}
.menu-btn.danger:hover:not(:disabled) {
  background: rgba(192,32,32,0.1);
  border-color: var(--red2);
}
.menu-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── PANEL SCREENS ────────────────────────────────── */
.panel-screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  background: var(--bg);
  padding: 40px;
}
.panel-title {
  font-size: 28px; font-weight: 900;
  letter-spacing: 6px; text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--border2);
  padding-bottom: 12px;
  width: 100%; max-width: 600px; text-align: center;
}
.panel-title.red { color: var(--red2); }
.panel-sub {
  color: var(--text-dim);
  font-size: 13px; letter-spacing: 2px;
  text-transform: uppercase;
}

/* ── HOW TO PLAY ──────────────────────────────────── */
.htp-content {
  width: 100%; max-width: 620px;
  max-height: 60vh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px; line-height: 1.8;
  color: var(--text);
  font-size: 13px;
}
.htp-content h3 {
  color: var(--accent); font-size: 14px;
  letter-spacing: 2px; text-transform: uppercase;
  margin: 16px 0 6px;
}
.htp-content p { color: var(--text-dim); margin-bottom: 8px; }

/* ── INTAKE FORM ──────────────────────────────────── */
.intake-form {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; max-width: 400px;
}
.intake-form label {
  font-size: 11px; letter-spacing: 3px;
  text-transform: uppercase; color: var(--text-dim);
}
.intake-form input {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 18px; padding: 10px 14px;
  outline: none; letter-spacing: 2px;
  width: 100%;
}
.intake-form input:focus { border-color: var(--accent); }
.sentence-info {
  color: var(--red2); font-size: 12px;
  letter-spacing: 1px;
}

/* ══════════════════════════════════════════════════
   GAME SCREEN LAYOUT
   ══════════════════════════════════════════════════ */
#screen-game {
  flex-direction: column;
  background: var(--bg);
}

/* ── HUD ──────────────────────────────────────────── */
#hud {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  height: 54px; flex-shrink: 0; z-index: 20;
}
.hud-left {
  display: flex; flex-direction: column;
  gap: 2px; min-width: 120px;
}
.hud-name {
  font-size: 13px; font-weight: 700;
  letter-spacing: 2px; color: var(--accent);
  text-transform: uppercase;
}
.hud-tag {
  font-size: 10px; color: var(--text-muted);
  font-family: var(--font-mono);
}
.hud-center {
  display: flex; gap: 20px; align-items: center;
}
.hud-stat {
  display: flex; align-items: center; gap: 6px;
}
.hud-stat label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 2px; color: var(--text-muted);
  width: 30px;
}
.bar-wrap {
  width: 80px; height: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.bar {
  height: 100%; transition: width 0.4s ease;
  width: 100%;
}
.hp-bar   { background: var(--hp-col); box-shadow: 0 0 6px var(--hp-col); }
.rep-bar  { background: var(--rep-col); }
.heat-bar { background: var(--heat-col); width: 0%; }
.hud-stat span {
  font-size: 11px; color: var(--text-dim);
  font-family: var(--font-mono); min-width: 24px;
}
.hud-right {
  display: flex; gap: 16px; align-items: center;
}
.hud-info {
  display: flex; flex-direction: column; align-items: center;
}
.hud-label {
  font-size: 9px; color: var(--text-muted);
  letter-spacing: 2px; text-transform: uppercase;
}
.hud-info span:last-child {
  font-size: 14px; font-weight: 700;
  color: var(--text); font-family: var(--font-mono);
}

/* ── LOCATION BANNER ──────────────────────────────── */
#location-banner {
  display: flex; justify-content: space-between;
  align-items: center; padding: 4px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#location-name {
  font-size: 11px; font-weight: 700;
  letter-spacing: 4px; color: var(--accent);
  text-transform: uppercase;
}
#time-of-day {
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 3px; text-transform: uppercase;
}

/* ── MAIN LAYOUT ──────────────────────────────────── */
.game-body {
  display: flex; flex: 1; overflow: hidden;
  min-height: 0;
}
#game-main {
  flex: 1; position: relative;
  overflow: hidden; background: var(--bg);
}
#scene-container {
  position: absolute; inset: 0;
}
#scene-bg {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.4) saturate(0.6);
  transition: filter 0.5s ease;
}
#scene-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(10,10,12,0.2) 0%,
    rgba(10,10,12,0.6) 70%,
    rgba(10,10,12,0.9) 100%);
}
#npc-portraits {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: flex-end;
  padding: 0 40px; gap: 20px;
  align-items: flex-end;
}
.npc-portrait {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.npc-portrait:hover { transform: scale(1.05); }
.npc-portrait img {
  width: 80px; height: 110px;
  object-fit: cover; object-position: top;
  border: 2px solid var(--border2);
  filter: brightness(0.7) saturate(0.7);
  transition: all 0.2s ease;
}
.npc-portrait:hover img { filter: brightness(0.9) saturate(1); border-color: var(--accent); }
.npc-portrait-name {
  font-size: 9px; letter-spacing: 2px;
  color: var(--text-muted); text-transform: uppercase;
  margin-top: 4px;
}
.npc-portrait.ally img { border-color: var(--green2); filter: brightness(0.8) saturate(0.9); }
.npc-portrait.enemy img { border-color: var(--red2); }

/* ── DIALOGUE BOX ─────────────────────────────────── */
#dialogue-box {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(10,10,14,0.95);
  border-top: 2px solid var(--border2);
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 30;
}
#dialogue-box.hidden { display: none; }
#dialogue-speaker {
  font-size: 11px; font-weight: 700;
  letter-spacing: 3px; color: var(--accent);
  text-transform: uppercase;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}
/* Portrait + text sit side-by-side */
#dialogue-portrait-wrap {
  display: inline-block; vertical-align: top;
  float: left; margin-right: 14px; margin-bottom: 4px;
}
#dialogue-text {
  font-size: 14px; line-height: 1.7;
  color: var(--text);
  min-height: 40px;
  overflow: hidden; /* clear float */
  display: block;
}
#dialogue-portrait {
  width: 64px; height: 80px;
  object-fit: cover; object-position: top;
  border: 1px solid var(--border2);
  filter: brightness(0.85);
}
#dialogue-choices {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px;
}
.choice-btn {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text); font-family: var(--font);
  font-size: 12px; letter-spacing: 1px;
  cursor: pointer; transition: all 0.15s ease;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}
.choice-btn:hover {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
}
.choice-btn.aggressive { border-color: var(--red); color: var(--red2); }
.choice-btn.aggressive:hover { background: rgba(192,32,32,0.15); }
.choice-btn.friendly { border-color: var(--green2); color: var(--green2); }
.choice-btn.friendly:hover { background: rgba(42,170,74,0.15); }

/* ── COMBAT BOX ───────────────────────────────────── */
#combat-box {
  position: absolute; inset: 0;
  background: rgba(8,4,4,0.97);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; padding: 24px; z-index: 40;
}
#combat-box.hidden { display: none; }
#combat-header {
  text-align: center;
}
#combat-title {
  font-size: 32px; font-weight: 900;
  letter-spacing: 8px; color: var(--red2);
  text-transform: uppercase;
  text-shadow: 0 0 20px var(--red), 0 0 40px rgba(192,32,32,0.3);
  animation: pulse-red 0.8s ease-in-out infinite alternate;
}
@keyframes pulse-red {
  from { opacity: 0.8; }
  to { opacity: 1; text-shadow: 0 0 30px var(--red), 0 0 60px rgba(192,32,32,0.4); }
}
#combat-fighters {
  display: flex; align-items: center; gap: 40px;
}
.fighter {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  width: 140px;
}
.fighter img {
  width: 100px; height: 130px;
  object-fit: cover; object-position: top;
  border: 2px solid var(--border2);
}
.fighter-name {
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text);
}
.fighter-hp-wrap {
  width: 120px; height: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.fighter-hp {
  height: 100%; background: var(--hp-col);
  width: 100%; transition: width 0.4s ease;
  box-shadow: 0 0 6px var(--hp-col);
}
.fighter-hp.enemy { background: var(--red); box-shadow: 0 0 6px var(--red); }
.fighter span {
  font-size: 11px; color: var(--text-dim);
  font-family: var(--font-mono);
}
.vs-label {
  font-size: 28px; font-weight: 900;
  color: var(--accent); letter-spacing: 4px;
}
#combat-log {
  width: 100%; max-width: 520px;
  height: 80px; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 12px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-dim);
}
#combat-log p { margin-bottom: 4px; }
#combat-log p.hit { color: var(--red2); }
#combat-log p.defend { color: var(--blue2); }
#combat-log p.enemy-hit { color: var(--heat-col); }
#combat-log p.system { color: var(--accent); }
#combat-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: center;
}
.combat-btn {
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--font); font-size: 12px;
  font-weight: 700; letter-spacing: 2px;
  cursor: pointer; transition: all 0.15s ease;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}
.combat-btn:hover {
  background: rgba(200,168,75,0.15);
  border-color: var(--accent); color: var(--accent);
}
.combat-btn.defend-btn:hover { background: rgba(42,74,170,0.15); border-color: var(--blue2); color: var(--blue2); }
.combat-btn.flee-btn:hover { background: rgba(120,120,40,0.15); border-color: #888; color: #aaa; }
.combat-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── EVENT BOX ────────────────────────────────────── */
#event-box {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 90%; max-width: 620px;
  background: rgba(10,10,14,0.97);
  border: 1px solid var(--border2);
  border-top: 3px solid var(--accent);
  padding: 20px 24px; z-index: 35;
}
#event-box.hidden { display: none; }
#event-icon {
  font-size: 10px; letter-spacing: 3px;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 6px;
}
#event-title {
  font-size: 18px; font-weight: 700;
  color: var(--text); margin-bottom: 8px;
  letter-spacing: 2px;
}
#event-text {
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 14px; line-height: 1.7;
}
#event-choices {
  display: flex; flex-wrap: wrap; gap: 8px;
}

/* ── RIOT OVERLAY ─────────────────────────────────── */
#riot-overlay {
  position: absolute; inset: 0;
  background: rgba(40,4,4,0.92);
  z-index: 45; display: flex;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; padding: 24px;
}
#riot-overlay.hidden { display: none; }
.riot-banner {
  font-size: 36px; font-weight: 900;
  letter-spacing: 8px; color: var(--red2);
  text-transform: uppercase;
  animation: pulse-red 0.6s ease-in-out infinite alternate;
  text-shadow: 0 0 30px var(--red);
}
#riot-log {
  width: 100%; max-width: 560px;
  height: 160px; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-dim);
}
#riot-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ── SIDE PANEL ───────────────────────────────────── */
#side-panel {
  width: 200px; flex-shrink: 0;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.side-section {
  border-bottom: 1px solid var(--border);
  padding: 10px;
}
.side-title {
  font-size: 9px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex; justify-content: space-between;
}
#action-buttons {
  display: flex; flex-direction: column; gap: 4px;
}
.action-btn {
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font); font-size: 11px;
  font-weight: 700; letter-spacing: 1px;
  cursor: pointer; transition: all 0.15s ease;
  text-align: left; text-transform: uppercase;
}
.action-btn:hover:not(:disabled) {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
}
.action-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.action-btn.locked {
  color: var(--text-muted); border-color: var(--border);
}

/* Ally list */
#ally-list {
  display: flex; flex-direction: column; gap: 4px;
}
.ally-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-dim);
}
.ally-item img {
  width: 24px; height: 30px;
  object-fit: cover; object-position: top;
  border: 1px solid var(--green2);
}

/* Inventory */
#inventory-list {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.inv-item {
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 10px; color: var(--text-dim);
  letter-spacing: 1px; cursor: default;
  position: relative;
}
.inv-item .inv-qty {
  color: var(--accent); font-weight: 700;
  font-family: var(--font-mono);
}
.inv-use-btn {
  margin-left: 6px;
  padding: 1px 5px;
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red2);
  font-family: var(--font); font-size: 9px;
  font-weight: 700; letter-spacing: 1px;
  cursor: pointer; text-transform: uppercase;
}
.inv-use-btn:hover {
  background: var(--red);
  color: var(--bg);
}

/* ── FOOTER ───────────────────────────────────────── */
#game-footer {
  display: flex; align-items: center;
  padding: 8px 16px; gap: 10px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  height: 46px; flex-shrink: 0;
}
.foot-btn {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--font); font-size: 10px;
  font-weight: 700; letter-spacing: 2px;
  cursor: pointer; transition: all 0.15s ease;
  text-transform: uppercase;
}
.foot-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
#btn-sleep {
  margin-left: auto;
  border-color: var(--red);
  color: var(--red2);
}
#btn-sleep:hover {
  background: rgba(192,32,32,0.1);
  border-color: var(--red2);
}
#status-msg {
  flex: 1; text-align: center;
  font-size: 11px; color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

/* ── CANTEEN ──────────────────────────────────────── */
#screen-canteen .panel-screen {
  overflow-y: auto;
}
#canteen-money-display {
  font-size: 16px; color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700; letter-spacing: 2px;
}
#canteen-items {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; width: 100%; max-width: 680px;
  max-height: 50vh; overflow-y: auto;
}
.canteen-item {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.15s ease;
}
.canteen-item:hover { border-color: var(--accent); }
.canteen-item-name {
  font-size: 12px; font-weight: 700;
  letter-spacing: 1px; color: var(--text);
  text-transform: uppercase;
}
.canteen-item-price {
  font-size: 11px; color: var(--accent);
  font-family: var(--font-mono);
}
.canteen-item-desc {
  font-size: 10px; color: var(--text-muted);
}
.canteen-item-controls {
  display: flex; align-items: center; gap: 6px;
}
.qty-btn {
  width: 22px; height: 22px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text); font-size: 14px;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.item-qty {
  font-size: 13px; font-family: var(--font-mono);
  color: var(--accent); min-width: 20px; text-align: center;
}
#cart-total { color: var(--accent); font-family: var(--font-mono); font-weight: 700; }

/* ── THE HOLE ─────────────────────────────────────── */
.hole-bg {
  position: absolute; inset: 0;
  background: url('thehole.jpg') center/cover no-repeat;
  filter: brightness(0.15) saturate(0.2);
}
.hole-panel { background: transparent; }
.hole-img {
  width: 200px; height: 150px;
  object-fit: cover;
  border: 2px solid var(--red);
  filter: brightness(0.6) saturate(0.4);
}
#hole-msg {
  font-size: 14px; color: var(--text-dim);
  text-align: center; max-width: 400px;
  line-height: 1.7;
}
#hole-days {
  font-size: 28px; font-weight: 900;
  color: var(--red2); font-family: var(--font-mono);
  letter-spacing: 4px;
}

/* ── GAME OVER ────────────────────────────────────── */
.gameover-panel {
  background: rgba(8,4,4,0.98);
}
#gameover-icon {
  width: 80px; height: 80px;
  margin: 0 auto;
}
#gameover-title { color: var(--red2); }
#gameover-msg {
  font-size: 14px; color: var(--text-dim);
  text-align: center; max-width: 400px;
  line-height: 1.7;
}

/* ── TOAST ────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 60px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  color: var(--text); padding: 10px 20px;
  font-size: 12px; letter-spacing: 1px;
  opacity: 0; transition: all 0.3s ease;
  pointer-events: none; z-index: 100;
  max-width: 400px; text-align: center;
}
#toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
#toast.error { border-color: var(--red2); }
#toast.success { border-color: var(--green2); }

/* ── GAME LAYOUT FIX ──────────────────────────────── */
#screen-game {
  display: none; flex-direction: column;
}
#screen-game.active { display: flex; }
#screen-game .game-body {
  flex: 1; display: flex; overflow: hidden; min-height: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Hidden utility */
.hidden { display: none !important; }

/* ── WARDEN/GUARD dialogue tint ───────────────────── */
#dialogue-box.guard-mode { border-top-color: var(--blue2); }
#dialogue-box.guard-mode #dialogue-speaker { color: var(--blue2); border-left-color: var(--blue2); }
#dialogue-box.warden-mode { border-top-color: var(--red2); }
#dialogue-box.warden-mode #dialogue-speaker { color: var(--red2); border-left-color: var(--red2); }

/* ── FLASH ANIMATION ─────────────────────────────── */
@keyframes flash-red {
  0%,100% { background: rgba(8,4,4,0.97); }
  50% { background: rgba(60,0,0,0.97); }
}
.flash-hit { animation: flash-red 0.2s ease; }

/* ══════════════════════════════════════════════════
   PHONE / BURNER PHONE UI — Photorealistic iPhone style
   ══════════════════════════════════════════════════ */

/* ── PHONE SCREEN WRAPPER ─────────────────────────── */
#screen-phone {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: radial-gradient(ellipse at 30% 20%, #1a1a2e 0%, #0d0d0f 60%, #000 100%);
  gap: 18px;
  z-index: 200;
}

/* ── PHONE SHELL ──────────────────────────────────── */
#phone-shell {
  width: 375px;
  height: 780px;
  background:
    linear-gradient(160deg, #2c2c2e 0%, #1c1c1e 30%, #141416 100%);
  border-radius: 48px;
  border: 1.5px solid rgba(255,255,255,0.12);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.8),
    0 0 0 10px #1a1a1c,
    0 0 0 11px rgba(255,255,255,0.06),
    0 0 0 12px #141416,
    0 0 60px rgba(0,0,0,0.9),
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
}

/* ── DYNAMIC ISLAND / NOTCH ───────────────────────── */
#phone-notch {
  height: 48px;
  background: #1c1c1e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  flex-shrink: 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.07);
  position: relative;
}
#phone-notch::after {
  content: '';
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 28px;
  background: #000;
  border-radius: 20px;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.08);
}
#phone-notch-camera {
  width: 12px; height: 12px;
  background: radial-gradient(circle, #1a2a3a 0%, #0a0f14 70%);
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(30px, -50%);
  z-index: 1;
  box-shadow: 0 0 4px rgba(60,160,255,0.3);
}
#phone-time {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  z-index: 1;
}
#phone-status-icons {
  display: flex;
  gap: 5px;
  font-size: 10px;
  color: #fff;
  z-index: 1;
  align-items: center;
}

/* ── VIEWS ────────────────────────────────────────── */
.phone-view { display: none; flex-direction: column; flex: 1; min-height: 0; }
.phone-view.active { display: flex; }

/* ── CONTACTS LIST ────────────────────────────────── */
#phone-contacts { background: #000; }

#phone-contacts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 0.5px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
#phone-header-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}
#phone-header-left, #phone-header-right {
  font-size: 16px;
  color: #0a84ff;
  min-width: 40px;
}

#phone-contact-list {
  flex: 1;
  overflow-y: auto;
  background: #000;
}

.phone-contact-row {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  gap: 13px;
  cursor: pointer;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
  transition: background 0.1s;
}
.phone-contact-row:active,
.phone-contact-row:hover { background: rgba(255,255,255,0.04); }

.contact-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
#chat-avatar {
  width: 36px; height: 36px;
  border: 1.5px solid rgba(255,255,255,0.12);
}
.contact-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.contact-name {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
}
.contact-preview {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-time {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

/* ── CHAT VIEW ────────────────────────────────────── */
#phone-chat { background: #000; }

#phone-chat-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 10px;
  border-bottom: 0.5px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  background: rgba(28,28,30,0.95);
  backdrop-filter: blur(20px);
}
#phone-back-btn {
  background: none;
  border: none;
  color: #0a84ff;
  font-size: 28px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  font-weight: 300;
}
#phone-back-btn:hover { color: #38a8ff; }
#chat-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
#chat-contact-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
#chat-online-status {
  font-size: 11px;
  color: #30d158;
}

/* ── MESSAGE BUBBLES ──────────────────────────────── */
#phone-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #000;
}
#phone-messages::-webkit-scrollbar { width: 2px; }
#phone-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}
.msg-row.sent { align-self: flex-end; align-items: flex-end; }
.msg-row.received { align-self: flex-start; align-items: flex-start; }

.msg-bubble {
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
  position: relative;
}
.msg-row.sent .msg-bubble {
  background: #0a84ff;
  color: #fff;
  border-bottom-right-radius: 5px;
}
.msg-row.received .msg-bubble {
  background: #1c1c1e;
  color: #fff;
  border: 0.5px solid rgba(255,255,255,0.08);
  border-bottom-left-radius: 5px;
}
.msg-time {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
  padding: 0 4px;
}

/* Typing indicator */
.typing-bubble .msg-bubble {
  padding: 12px 16px;
}
.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}
.typing-dots span {
  width: 7px; height: 7px;
  background: rgba(255,255,255,0.45);
  border-radius: 50%;
  animation: typingPulse 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingPulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1.1); }
}

/* System notice in chat */
.msg-system {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  padding: 4px 0;
}

/* ── INPUT BAR ────────────────────────────────────── */
#phone-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(28,28,30,0.98);
  border-top: 0.5px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
#phone-text-input {
  flex: 1;
  background: #2c2c2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 15px;
  color: #fff;
  outline: none;
  font-family: inherit;
}
#phone-text-input::placeholder { color: rgba(255,255,255,0.3); }
#phone-text-input:focus { border-color: rgba(10,132,255,0.5); }
#phone-send-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #0a84ff;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
#phone-send-btn:hover { background: #38a8ff; }
#phone-send-btn:active { background: #006bd6; }

/* ── HOME BAR ─────────────────────────────────────── */
#phone-home-bar {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  flex-shrink: 0;
}
#phone-home-bar::after {
  content: '';
  width: 120px; height: 4px;
  background: rgba(255,255,255,0.22);
  border-radius: 3px;
}

/* ── EXIT BUTTON ──────────────────────────────────── */
#phone-exit-btn {
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  font-family: var(--font);
  letter-spacing: 2px;
  padding: 8px 20px;
  cursor: pointer;
  border-radius: 3px;
  text-transform: uppercase;
  transition: all 0.15s;
}
#phone-exit-btn:hover {
  border-color: var(--red);
  color: var(--red2);
}

/* ══════════════════════════════════════════════════
   NEWSPAPER OVERLAY — Photorealistic broadsheet
   ══════════════════════════════════════════════════ */

#newspaper-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.88);
  animation: npFadeIn 0.4s ease;
}
#newspaper-overlay.hidden { display: none !important; }

@keyframes npFadeIn {
  from { opacity: 0; transform: scale(0.94) rotate(-1deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

#newspaper-sheet {
  width: min(720px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  background:
    /* halftone dot texture */
    radial-gradient(circle, rgba(0,0,0,0.06) 1px, transparent 1px),
    /* paper base */
    linear-gradient(170deg, #f5f0e0 0%, #ede8d4 40%, #e8e2cc 100%);
  background-size: 4px 4px, 100% 100%;
  border: 1px solid #bfb89a;
  box-shadow:
    0 0 0 6px #e0d9c0,
    0 0 0 7px #c8c0a0,
    0 8px 40px rgba(0,0,0,0.7),
    inset 0 0 80px rgba(0,0,0,0.05);
  padding: 0;
  color: #1a1408;
  font-family: 'Times New Roman', 'Georgia', serif;
  position: relative;
}
/* Aged paper corner fold */
#newspaper-sheet::after {
  content: '';
  position: absolute; bottom: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 0 40px 40px;
  border-color: transparent transparent #c8c0a0 transparent;
  filter: drop-shadow(-2px -2px 3px rgba(0,0,0,0.2));
}

/* ── MASTHEAD ─────────────────────────────────────── */
#np-masthead {
  padding: 18px 28px 10px;
  border-bottom: 3px double #1a1408;
  text-align: center;
}
#np-flag-top {
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #555040;
  margin-bottom: 6px;
  font-family: 'Georgia', serif;
}
#np-title {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-family: 'Times New Roman', serif;
  line-height: 1;
  color: #0d0a04;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.15);
  margin: 4px 0;
}
#np-flag-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1px;
  color: #555040;
  margin-top: 6px;
  font-family: 'Georgia', serif;
  padding: 0 4px;
}

/* ── RULES ────────────────────────────────────────── */
#np-rule-thick {
  border-top: 4px solid #1a1408;
  border-bottom: 1px solid #1a1408;
  height: 5px;
  margin: 0;
}
.np-col-rule { width: 1px; background: #bfb89a; flex-shrink: 0; margin: 0 2px; }

/* ── COLUMNS ──────────────────────────────────────── */
#np-columns {
  display: flex;
  gap: 0;
  padding: 0;
}
#np-col-main {
  flex: 3;
  padding: 18px 22px 16px 28px;
  border-right: 1px solid #bfb89a;
}
#np-col-side {
  flex: 1;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 140px;
}

/* ── MAIN STORY ───────────────────────────────────── */
#np-kicker {
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #8a0000;
  font-family: 'Georgia', serif;
  margin-bottom: 6px;
  font-weight: 700;
}
#np-headline {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.1;
  font-family: 'Times New Roman', serif;
  color: #0d0a04;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}
#np-subhead {
  font-size: 14px;
  font-style: italic;
  color: #3a3020;
  margin-bottom: 8px;
  line-height: 1.4;
  font-family: 'Georgia', serif;
}
#np-byline {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #666050;
  margin-bottom: 4px;
}
#np-rule-thin {
  border-top: 1px solid #1a1408;
  margin: 6px 0 10px;
}
#np-body-text {
  font-size: 13.5px;
  line-height: 1.7;
  text-align: justify;
  hyphens: auto;
  font-family: 'Times New Roman', serif;
  column-count: 2;
  column-gap: 18px;
  column-rule: 1px solid #bfb89a;
}
#np-body-text p { margin: 0 0 8px; }
#np-body-text p:first-child::first-letter {
  font-size: 42px;
  font-weight: 900;
  float: left;
  line-height: 0.78;
  margin: 4px 5px 0 0;
  color: #0d0a04;
}

/* ── SIDE ADS ─────────────────────────────────────── */
.np-ad-box {
  border: 1px solid #bfb89a;
  padding: 10px 10px;
  background: rgba(255,255,255,0.25);
  text-align: center;
}
.np-ad-title {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 5px;
  border-bottom: 1px solid #bfb89a;
  padding-bottom: 4px;
  font-family: 'Georgia', serif;
}
.np-ad-body {
  font-size: 10px;
  line-height: 1.6;
  font-family: 'Georgia', serif;
  color: #3a3020;
}

/* ── FOOTER / CLOSE ───────────────────────────────── */
#np-footer {
  border-top: 3px double #1a1408;
  padding: 6px 28px;
  font-size: 9px;
  letter-spacing: 1px;
  color: #666050;
  text-align: center;
  font-family: 'Georgia', serif;
}
#np-close-btn {
  display: block;
  width: calc(100% - 56px);
  margin: 10px 28px 18px;
  padding: 10px;
  background: #1a1408;
  color: #e8e2cc;
  border: none;
  font-family: 'Georgia', serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
#np-close-btn:hover { background: #8a0000; }
