/* ============================================================
   UNTITLED — Game Styles
   Dark, gritty, mobile-first responsive
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0a0a12;
  --bg-card: #12121e;
  --bg-panel: #161625;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(0,255,136,0.3);
  --green: #00ff88;
  --blue: #00d4ff;
  --purple: #7b2ff7;
  --red: #ff3366;
  --orange: #ff8800;
  --yellow: #ffcc00;
  --text: #e8e8f0;
  --text-muted: #6a6a8a;
  --text-dim: #44445a;
  --font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

#game-root {
  width: 100%;
  height: 100%;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 1rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--text);
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--green);
  color: #000;
  border-color: var(--green);
}
.btn-primary:hover { background: #00cc6e; }

.btn-secondary {
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--green); color: var(--green); }

.btn-danger {
  color: var(--red);
  border-color: rgba(255,51,102,0.3);
}
.btn-danger:hover { background: rgba(255,51,102,0.1); }

.btn-ghost {
  border: none;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }

.btn-lg { padding: 1rem 2.5rem; font-size: 0.95rem; }

.btn-icon {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.btn-back {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
}
.btn-back:hover { color: var(--green); }

/* ============================================================
   INPUTS
   ============================================================ */
.input-group {
  margin-bottom: 1rem;
}

input[type="text"] {
  width: 100%;
  font-family: var(--mono);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
input[type="text"]:focus { border-color: var(--green); }
input[type="text"]::placeholder { color: var(--text-dim); }

.input-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
  padding-left: 0.25rem;
}

.error-msg {
  font-size: 0.8rem;
  color: var(--orange);
  min-height: 1.2rem;
  margin-bottom: 0.5rem;
  font-family: var(--mono);
}

/* ============================================================
   TITLE SCREEN
   ============================================================ */
.title-screen {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(123,47,247,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(0,255,136,0.06) 0%, transparent 50%),
    var(--bg);
}

.title-content {
  text-align: center;
}

.game-logo { margin-bottom: 3rem; }

.logo-glitch {
  font-family: var(--mono);
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
  position: relative;
  text-shadow: 2px 0 var(--purple), -2px 0 var(--green);
  animation: glitch 3s infinite;
}

@keyframes glitch {
  0%, 95%, 100% { text-shadow: 2px 0 var(--purple), -2px 0 var(--green); }
  96% { text-shadow: -4px 0 var(--red), 4px 0 var(--blue); }
  97% { text-shadow: 4px 0 var(--green), -4px 0 var(--purple); }
}

.logo-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.title-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.title-actions .btn { min-width: 240px; }

.title-footer {
  margin-top: 3rem;
  display: flex;
  gap: 2rem;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
  position: relative;
}

.login-card {
  max-width: 400px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
}

.login-card h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.login-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ============================================================
   CHARACTER CREATION
   ============================================================ */
.create-screen {
  position: relative;
}

.create-card {
  max-width: 440px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
}

.create-card h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.create-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* ============================================================
   ROLLING SCREEN
   ============================================================ */
.rolling-screen {
  align-items: stretch;
  padding: 1rem;
}

.roll-card {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  overflow-y: auto;
  padding: 1rem 0;
}

.roll-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.roll-header h2 { font-size: 1.5rem; }

.roll-seed {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.roll-seed code {
  color: var(--green);
  background: rgba(0,255,136,0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.roll-total {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.stat-icon { font-size: 1.2rem; }
.stat-label {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  flex: 1;
}
.stat-value {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
}
.stat-mod {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.dice-rolls {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.stat-tier {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.roll-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding: 1rem 0;
}

/* ============================================================
   BIOGRAPHY SCREEN
   ============================================================ */
.bio-screen {
  overflow-y: auto;
}

.bio-card {
  max-width: 520px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

.bio-card h2 {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.bio-name {
  text-align: center;
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 1.5rem;
}

.bio-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border-left: 3px solid var(--purple);
}

.bio-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
  font-family: var(--mono);
}

.bio-value {
  font-size: 0.95rem;
  line-height: 1.5;
}

.bio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.bio-item {
  padding: 0.75rem;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.bio-item-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
  font-family: var(--mono);
}

.bio-item-value {
  font-size: 0.85rem;
  font-weight: 500;
}

.bio-stats-mini {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 44px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.bio-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ============================================================
   GAME SCREEN
   ============================================================ */
.game-screen {
  padding: 0;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 5;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.char-name {
  font-weight: 700;
  font-size: 1rem;
}

.char-age, .char-day {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.char-cash {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--green);
  font-size: 0.9rem;
}

.game-content {
  display: grid;
  grid-template-columns: 200px 1fr 220px;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

.game-panel {
  padding: 1rem;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.game-panel:last-child { border-right: none; }

.game-panel h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-family: var(--mono);
}

/* Stats panel */
.game-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.game-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
}

.gs-icon { font-size: 1rem; }
.gs-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  flex: 1;
  color: var(--text-muted);
}
.gs-value {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
}

/* Main narrative panel */
.panel-main {
  background: rgba(255,255,255,0.01);
}

.game-narrative h3 {
  font-size: 1.1rem;
  color: var(--text);
  text-transform: none;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.game-narrative p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.narrative-hint {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(123,47,247,0.06);
  border: 1px solid rgba(123,47,247,0.15);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Heat bars */
.heat-bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.heat-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.heat-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  width: 40px;
  letter-spacing: 0.05em;
}

.heat-bar-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.heat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

.heat-value {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  width: 20px;
  text-align: right;
}

/* Info rows */
.info-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 0.2rem 0;
}

.info-row span:first-child { color: var(--text-dim); }
.info-row span:last-child { color: var(--text-muted); font-family: var(--mono); font-size: 0.75rem; }

/* Save indicator */
.save-indicator {
  position: fixed;
  top: 0.75rem;
  right: 50%;
  transform: translateX(50%);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--green);
  background: rgba(0,255,136,0.1);
  border: 1px solid rgba(0,255,136,0.2);
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 100;
  pointer-events: none;
}
.save-indicator.visible { opacity: 1; }

/* Menu overlay */
.game-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.game-menu.hidden { display: none; }

.menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.menu-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.menu-panel h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.menu-btn { width: 100%; text-align: left; }

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .game-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .panel-stats {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
  }

  .game-stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .game-stat {
    min-width: calc(33% - 0.25rem);
    padding: 0.25rem 0.5rem;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
  }

  .panel-info {
    border-top: 1px solid var(--border);
    border-right: none;
  }

  .game-panel { border-right: none; }

  .bio-grid { grid-template-columns: 1fr; }

  .roll-actions { flex-direction: column; align-items: center; }
  .roll-actions .btn { width: 100%; max-width: 300px; }

  .bio-actions { flex-direction: column; align-items: center; }
  .bio-actions .btn { width: 100%; max-width: 300px; }

  .menu-panel { width: 100%; }

  .header-left { gap: 0.5rem; }
  .char-name { font-size: 0.9rem; }

  .title-actions .btn { min-width: 200px; }
}

@media (max-width: 380px) {
  .game-stat { min-width: calc(50% - 0.25rem); }
  .mini-stat { min-width: 38px; padding: 0.35rem; }
  .logo-glitch { font-size: 2.5rem; }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-row { animation: fadeIn 0.4s ease-out both; }
.stat-row:nth-child(1) { animation-delay: 0.05s; }
.stat-row:nth-child(2) { animation-delay: 0.1s; }
.stat-row:nth-child(3) { animation-delay: 0.15s; }
.stat-row:nth-child(4) { animation-delay: 0.2s; }
.stat-row:nth-child(5) { animation-delay: 0.25s; }
.stat-row:nth-child(6) { animation-delay: 0.3s; }

/* ============================================================
   GAME STAT MODIFIER
   ============================================================ */
.gs-mod {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-left: 0.15rem;
}

/* ============================================================
   UTILITY COLORS
   ============================================================ */
.text-red   { color: var(--red) !important; }
.text-green { color: var(--green) !important; }
.text-orange{ color: var(--orange) !important; }
.text-yellow{ color: var(--yellow) !important; }
.debt-warning { color: var(--red); }

/* ============================================================
   HEADER BUTTONS (44px touch targets)
   ============================================================ */
.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
}
.header-btn:hover { background: rgba(255,255,255,0.08); border-color: var(--green); }
.header-btn:active { transform: scale(0.95); }
.btn-icon-inner { font-size: 1.1rem; line-height: 1; }

.narrative-tap-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,18,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.loading-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0,255,136,0.15);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-msg {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.loading-ad-container {
  margin-top: 1.5rem;
  display: none;
}

/* ============================================================
   DEATH SCREEN
   ============================================================ */
.death-screen {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255,51,102,0.08) 0%, transparent 60%),
    var(--bg);
  justify-content: flex-start;
  overflow-y: auto;
}

.death-content {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.death-header { text-align: center; }
.death-icon { font-size: 3rem; margin-bottom: 0.5rem; }

.death-title {
  font-family: var(--mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.2em;
  text-shadow: 0 0 30px rgba(255,51,102,0.5);
  animation: pulse-red 2s ease-in-out infinite;
}
@keyframes pulse-red {
  0%,100% { text-shadow: 0 0 30px rgba(255,51,102,0.4); }
  50%      { text-shadow: 0 0 60px rgba(255,51,102,0.8); }
}

.death-name {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.5rem;
}

.death-cause {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.death-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

.death-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  text-align: center;
}

.ds-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--mono);
  margin-bottom: 0.25rem;
}

.ds-value {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.death-ad-zone {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
}

.death-ad-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.death-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
}
.death-actions .btn { min-width: 240px; }

.death-debt-note {
  font-size: 0.8rem;
  text-align: center;
  padding: 0.5rem;
}

/* ============================================================
   CHARACTER SHEET OVERLAY (Portal — appended to body)
   ============================================================ */
.char-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}
.char-sheet-overlay.visible {
  pointer-events: all;
}

.cs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.32s;
}
.char-sheet-overlay.visible .cs-backdrop {
  background: rgba(0,0,0,0.5);
}

.cs-panel {
  position: relative;
  width: 480px;
  max-width: 100%;
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  z-index: 1;
}
.char-sheet-overlay.visible .cs-panel {
  transform: translateX(0);
}

.cs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cs-title-block {}
.cs-char-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.cs-char-sub {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.cs-close-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.cs-close-btn:hover { border-color: var(--red); color: var(--red); }

/* Tabs (mobile) */
.cs-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.cs-tabs::-webkit-scrollbar { display: none; }

.cs-tab {
  flex: 1;
  min-width: 80px;
  padding: 0.65rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  min-height: 44px;
}
.cs-tab:hover { color: var(--text-muted); }
.cs-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.cs-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.cs-section { }
.cs-section.hidden { display: none; }

.cs-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.cs-col { }

.cs-section-header {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

/* --- CS Stats --- */
.cs-stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cs-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cs-stat-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.cs-stat-icon { font-size: 1.1rem; flex-shrink: 0; }

.cs-stat-info { flex: 1; min-width: 0; }

.cs-stat-name {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.05em;
}

.cs-stat-desc {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-stat-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
}

.cs-stat-nums {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.cs-stat-value {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
}

.cs-stat-mod {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.cs-stat-bar-track {
  width: 80px;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.cs-stat-bar-fill {
  height: 100%;
  border-radius: 2px;
}

.cs-stat-tier {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- CS Heat --- */
.cs-heat-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.cs-heat-row {
  padding: 0.6rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cs-heat-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.cs-heat-icon { font-size: 1rem; flex-shrink: 0; }

.cs-heat-info { flex: 1; min-width: 0; }

.cs-heat-name {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.cs-heat-agency-desc {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 0.05rem;
}

.cs-heat-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cs-heat-badge {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid;
}

.cs-heat-value {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}

.cs-heat-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.cs-heat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s;
}

/* --- CS Debt --- */
.cs-debt-section {
  padding: 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cs-debt-title {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.cs-debt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.cs-debt-item { }

.cs-debt-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--mono);
  margin-bottom: 0.15rem;
}

.cs-debt-value {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* --- CS Factions --- */
.cs-factions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cs-faction-row {
  padding: 0.6rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cs-faction-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.cs-faction-icon { font-size: 1rem; flex-shrink: 0; }

.cs-faction-info { flex: 1; min-width: 0; }

.cs-faction-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-faction-type {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.1rem;
}

.cs-faction-standing {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}

.cs-faction-stats {
  display: flex;
  gap: 0.75rem;
}

.cs-fs {
  flex: 1;
  text-align: center;
}

.cs-fs-label {
  font-size: 0.55rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--mono);
  margin-bottom: 0.1rem;
}

.cs-fs-value {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
}

/* --- CS Career & Feats --- */
.cs-career-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cs-career-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.cs-career-item {
  padding: 0.5rem 0.6rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cs-career-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--mono);
  margin-bottom: 0.15rem;
}

.cs-career-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.cs-section-sublabel {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.cs-rank-ladder {
  padding: 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cs-ranks {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cs-rank {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0.2rem 0;
}

.cs-rank.past  { color: var(--green); }
.cs-rank.current {
  color: var(--text);
  font-weight: 700;
}

.cs-feats-section {
  padding: 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 80px;
}

.cs-feats-empty {
  text-align: center;
  padding: 0.5rem;
}

.cs-feats-empty-icon { font-size: 1.5rem; margin-bottom: 0.3rem; opacity: 0.4; }

.cs-feats-empty-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.cs-feats-empty-hint {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.cs-feat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.cs-feat:last-child { border-bottom: none; }
.cs-feat-icon { font-size: 0.9rem; }
.cs-feat-name { font-size: 0.8rem; color: var(--text-muted); }

/* ============================================================
   VIRTUAL D-PAD
   ============================================================ */
.dpad-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 20;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.dpad-cross {
  position: relative;
  width: 132px;
  height: 132px;
}

.dpad-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, border-color 0.1s, transform 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dpad-btn:active,
.dpad-btn.pressed {
  background: rgba(0,255,136,0.15);
  border-color: rgba(0,255,136,0.4);
  color: var(--green);
  transform: scale(0.93);
}

.dpad-up     { top: 0;    left: 44px; }
.dpad-left   { top: 44px; left: 0;    }
.dpad-center { top: 44px; left: 44px; border-radius: 50%; font-size: 0.6rem; }
.dpad-right  { top: 44px; left: 88px; }
.dpad-down   { top: 88px; left: 44px; }

/* ============================================================
   AD SYSTEM STYLES
   ============================================================ */

/* Interstitial overlay */
.ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.ad-overlay.visible { opacity: 1; }

.ad-overlay-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}

.ad-interstitial-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.ad-label {
  width: 100%;
  padding: 0.5rem 1rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.ad-controls {
  width: 100%;
  padding: 0.5rem 1rem;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.ad-skip-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ad-skip-timer {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.ad-skip-btn {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--green);
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 5px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  min-height: 32px;
  transition: background 0.15s;
}
.ad-skip-btn:hover { background: rgba(0,255,136,0.15); }
.ad-skip-btn.hidden { display: none; }

/* Placeholder ad unit */
.ad-unit-placeholder {
  background: var(--bg);
  border: 1px dashed rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-ph-inner {
  text-align: center;
  padding: 1rem;
}

.ad-ph-icon { font-size: 1.5rem; margin-bottom: 0.25rem; opacity: 0.4; }

.ad-ph-text {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ad-ph-size {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  opacity: 0.5;
  margin-top: 0.15rem;
}

.ad-ph-hint {
  font-size: 0.55rem;
  color: var(--text-dim);
  opacity: 0.4;
  margin-top: 0.1rem;
  font-style: italic;
}

/* ============================================================
   ADDITIONAL MOBILE RESPONSIVE IMPROVEMENTS
   ============================================================ */
@media (max-width: 768px) {
  /* Character sheet on mobile: full width */
  .cs-panel { width: 100%; border-left: none; }

  /* Faster slide for mobile */
  .cs-panel { transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1); }

  /* Death screen on mobile */
  .death-stats { grid-template-columns: 1fr 1fr; }
  .death-title { font-size: 2.5rem; }
  .death-actions .btn { min-width: 200px; width: 100%; max-width: 300px; }

  /* D-pad only on mobile */
  .dpad-container { bottom: 1rem; left: 1rem; }
}

@media (max-width: 480px) {
  /* Smaller two-column for very small phones */
  .cs-career-row { grid-template-columns: 1fr; }
  .cs-debt-grid { grid-template-columns: 1fr; }
  .death-stats { grid-template-columns: 1fr; }
}

/* Portrait vs landscape */
@media (orientation: landscape) and (max-width: 900px) {
  .death-content { padding: 1rem; gap: 1rem; }
  .death-header .death-title { font-size: 2rem; }
  .death-icon { font-size: 2rem; }
  .cs-panel { max-width: 60vw; }
}

/* Minimum 375px viewport (iPhone SE) */
@media (max-width: 375px) {
  .cs-stat-bar-track { width: 60px; }
  .cs-faction-name { font-size: 0.7rem; }
  .dpad-container { bottom: 0.75rem; left: 0.75rem; }
  .dpad-btn { width: 40px; height: 40px; font-size: 0.75rem; }
  .dpad-cross { width: 120px; height: 120px; }
  .dpad-left  { top: 40px; left: 0; }
  .dpad-center{ top: 40px; left: 40px; }
  .dpad-right { top: 40px; left: 80px; }
  .dpad-down  { top: 80px; left: 40px; }
}

/* ============================================================
   PHASE 1C: ACTION PANEL
   ============================================================ */
.action-panel {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 0.75rem;
}

.action-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.action-panel-header h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.75rem;
}

.action-categories {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-category { }

.category-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.action-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font);
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-height: 80px;
  justify-content: center;
}

.action-btn:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: rgba(0,255,136,0.06);
  transform: translateY(-1px);
}

.action-btn:active:not(:disabled) { transform: scale(0.97); }

.action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.action-btn.action-risky {
  border-color: rgba(255,51,102,0.3);
}

.action-btn.action-risky:hover:not(:disabled) {
  border-color: var(--red);
  background: rgba(255,51,102,0.08);
}

.action-icon  { font-size: 1.4rem; }
.action-name  { font-size: 0.65rem; font-weight: 600; text-align: center; }
.action-reward{ font-size: 0.6rem; color: var(--green); font-family: var(--mono); }
.action-stat  { font-size: 0.58rem; color: var(--text-muted); font-family: var(--mono); }

/* ============================================================
   PHASE 1C: ACTION LOG
   ============================================================ */
.action-log {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.5rem 0 0.75rem;
}

.action-log-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid transparent;
}

.action-log-entry.success { border-left-color: var(--green); }
.action-log-entry.failure { border-left-color: var(--red); }

.log-icon { font-size: 0.9rem; flex-shrink: 0; }
.log-text  { color: var(--text-muted); line-height: 1.3; }

/* ============================================================
   PHASE 1C: NOTIFICATION BANNER
   ============================================================ */
.notification-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
  font-size: 0.82rem;
  animation: slideDown 0.3s ease;
}

.notification-banner.warning {
  background: rgba(255,204,0,0.12);
  border: 1px solid rgba(255,204,0,0.3);
  color: var(--yellow);
}

.notification-banner.danger {
  background: rgba(255,51,102,0.12);
  border: 1px solid rgba(255,51,102,0.3);
  color: var(--red);
}

.notification-banner.info {
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  color: var(--blue);
}

.notif-text { flex: 1; line-height: 1.4; }

.notif-dismiss {
  background: none;
  border: none;
  color: currentColor;
  opacity: 0.6;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.1rem 0.3rem;
  flex-shrink: 0;
}

.notif-dismiss:hover { opacity: 1; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   PHASE 1C: POLICE ENCOUNTER OVERLAY
   ============================================================ */
.encounter-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.encounter-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.encounter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
}

.encounter-panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(255,51,102,0.4);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 60px rgba(255,51,102,0.15), 0 20px 60px rgba(0,0,0,0.5);
  animation: encounterIn 0.3s ease;
}

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

.encounter-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.encounter-level-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  background: rgba(255,51,102,0.1);
  border: 1px solid rgba(255,51,102,0.3);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.encounter-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.encounter-flavor {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

.encounter-divider {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.75rem;
  position: relative;
}

.encounter-divider::before,
.encounter-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--border);
}

.encounter-divider::before { left: 0; }
.encounter-divider::after  { right: 0; }

.encounter-choices {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.encounter-choice-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font);
  text-align: left;
  width: 100%;
  transition: all 0.15s;
}

.encounter-choice-btn:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: rgba(0,255,136,0.05);
}

.encounter-choice-btn:active:not(:disabled) { transform: scale(0.99); }

.encounter-choice-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ec-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ec-label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.ec-success-bar-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.ec-success-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s;
}

.ec-success-pct {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.ec-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.ec-outcomes {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.4rem;
}

.ec-outcome {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.ec-best  { color: rgba(0,255,136,0.8); }
.ec-worst { color: rgba(255,51,102,0.8); }

.ec-heat-impact,
.ec-stat-check {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-top: 0.2rem;
}

.ec-heat-impact { color: var(--orange); }

/* Encounter result */
.encounter-result {
  text-align: center;
  padding: 1.5rem 0;
}

.er-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.er-title {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.result-success .er-title { color: var(--green); }
.result-failure .er-title { color: var(--red); }

.er-skill-check {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.er-text {
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 380px;
  margin: 0 auto 0.75rem;
}

.er-arrested {
  color: var(--orange);
  font-size: 0.85rem;
  font-weight: 600;
}

.er-died {
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 700;
  animation: pulse 0.5s ease infinite alternate;
}

/* ============================================================
   PHASE 1C: DEBT ESCALATION IN CHARACTER SHEET
   ============================================================ */
.cs-debt-item-wide {
  grid-column: span 2;
}

.cs-debt-warning {
  background: rgba(255,51,102,0.1);
  border: 1px solid rgba(255,51,102,0.3);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* ============================================================
   PHASE 1C: RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .action-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .encounter-panel {
    padding: 1rem;
    border-radius: 12px;
  }

  .encounter-choice-btn {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .action-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .action-btn {
    min-height: 70px;
    padding: 0.4rem;
  }

  .action-icon { font-size: 1.2rem; }
  .action-name { font-size: 0.6rem; }

  .ec-outcomes { display: none; } /* hide verbose outcomes on very small screens */
}
