/* ═══════════════════════════════════════════════════════════════
   BAD DOCTOR — styles.css
   Photo-real AAA dark hospital UI
═══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:            #0a0c0f;
  --bg2:           #0f1318;
  --bg3:           #141920;
  --surface:       #1a2030;
  --surface2:      #1f2840;
  --border:        #2a3550;
  --border2:       #3a4870;
  --text:          #d8e4f0;
  --text2:         #8fa8c8;
  --muted:         #4a6080;
  --accent:        #00b4d8;
  --accent2:       #0077a8;
  --green:         #22c55e;
  --green2:        #16a34a;
  --red:           #ef4444;
  --red2:          #b91c1c;
  --orange:        #f97316;
  --yellow:        #eab308;
  --purple:        #a855f7;
  --hospital-red:  #c0392b;
  --rx-green:      #0d9e6e;
  --font-main:     'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:     'Courier New', monospace;
  --shadow-card:   0 4px 24px rgba(0,0,0,0.7), 0 1px 4px rgba(0,180,216,0.08);
  --shadow-modal:  0 8px 64px rgba(0,0,0,0.95), 0 0 0 1px rgba(0,180,216,0.15);
  --glow-accent:   0 0 20px rgba(0,180,216,0.3);
  --glow-red:      0 0 20px rgba(239,68,68,0.4);
  --glow-green:    0 0 20px rgba(34,197,94,0.3);
  --radius:        8px;
  --radius-lg:     14px;
  --radius-xl:     20px;
}

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

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

/* ── Menu Background ──────────────────────────────────────── */
.menu-bg-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,100,160,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(192,57,43,0.12) 0%, transparent 60%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 59px,
      rgba(0,180,216,0.03) 59px,
      rgba(0,180,216,0.03) 60px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 59px,
      rgba(0,180,216,0.03) 59px,
      rgba(0,180,216,0.03) 60px
    ),
    linear-gradient(180deg, #060810 0%, #0a0f1a 50%, #080b14 100%);
  z-index: 0;
}

/* ── Main Menu ────────────────────────────────────────────── */
#screen-mainmenu {
  align-items: center;
  justify-content: center;
}
.menu-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 32px;
  padding: 40px 20px;
}
.menu-logo-area { text-align: center; }
.logo-cross {
  font-size: 72px;
  color: var(--hospital-red);
  text-shadow: 0 0 40px rgba(192,57,43,0.8), 0 0 80px rgba(192,57,43,0.4);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
  animation: pulse-cross 2.5s ease-in-out infinite;
}
@keyframes pulse-cross {
  0%,100% { text-shadow: 0 0 40px rgba(192,57,43,0.8), 0 0 80px rgba(192,57,43,0.4); }
  50%      { text-shadow: 0 0 60px rgba(192,57,43,1.0), 0 0 120px rgba(192,57,43,0.6); }
}
.game-title {
  font-size: 72px;
  font-weight: 900;
  letter-spacing: 12px;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 40px rgba(0,180,216,0.6),
    0 2px 0 rgba(0,0,0,0.8),
    0 4px 20px rgba(0,0,0,0.9);
  line-height: 1;
}
.game-subtitle {
  font-size: 16px;
  letter-spacing: 6px;
  color: var(--accent);
  text-transform: uppercase;
  margin-top: 6px;
  opacity: 0.85;
}
.game-tagline {
  font-size: 13px;
  color: var(--text2);
  margin-top: 14px;
  font-style: italic;
}
.game-rating {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 14px;
  border: 1px solid var(--red);
  border-radius: 4px;
  font-size: 11px;
  color: var(--red);
  letter-spacing: 1px;
}
.main-menu-nav {
  display: flex; flex-direction: column; gap: 10px;
  width: 360px;
}
.menu-footer {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 12px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.menu-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
  flex-direction: row;
  text-align: left;
}
.menu-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.menu-btn:hover {
  background: var(--surface2);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--glow-accent);
  transform: translateX(4px);
}
.menu-btn.primary {
  background: linear-gradient(135deg, var(--accent2), #005580);
  border-color: var(--accent);
  color: #fff;
}
.menu-btn.primary:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: var(--glow-accent);
}
.menu-btn.danger {
  border-color: var(--red2);
  color: var(--red);
}
.menu-btn.danger:hover {
  background: rgba(239,68,68,0.15);
  border-color: var(--red);
  box-shadow: var(--glow-red);
  color: #fff;
}
.btn-icon { font-size: 20px; flex-shrink: 0; }
.btn-sub {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--text2);
  display: block;
  text-transform: none;
  margin-top: 1px;
}
.menu-btn:hover .btn-sub { color: var(--accent); }

/* ── Modal Box ────────────────────────────────────────────── */
#screen-howtoplay,
#screen-credits {
  align-items: center;
  justify-content: center;
}
.modal-box {
  position: relative; z-index: 1;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-modal);
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.modal-box h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

/* ── How To Play ──────────────────────────────────────────── */
.how-to-play-box { width: 700px; }
.how-to-sections { display: flex; flex-direction: column; gap: 20px; margin-bottom: 28px; }
.htp-section h3 { font-size: 14px; font-weight: 700; color: var(--yellow); margin-bottom: 6px; letter-spacing: 1px; }
.htp-section p, .htp-section li { font-size: 13px; color: var(--text2); line-height: 1.7; }
.htp-section ul { padding-left: 20px; }
.htp-section li { margin-bottom: 4px; }
.htp-section strong { color: var(--text); }

/* ── Credits ──────────────────────────────────────────────── */
.credits-box { width: 560px; }
.credits-studio { font-size: 26px; font-weight: 900; color: var(--accent); text-align: center; letter-spacing: 3px; }
.credits-tagline { font-size: 12px; color: var(--muted); text-align: center; font-style: italic; margin-bottom: 24px; }
.credits-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.credit-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.credit-role { font-size: 12px; color: var(--muted); }
.credit-name { font-size: 13px; color: var(--text); font-weight: 600; }
.credits-disclaimer { font-size: 11px; color: var(--red); border: 1px solid var(--red2); border-radius: 6px; padding: 10px; margin-bottom: 20px; line-height: 1.6; }

/* ── Game HUD ─────────────────────────────────────────────── */
#screen-game {
  flex-direction: column;
  background: var(--bg);
}
#game-hud {
  height: 52px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
  position: relative; z-index: 5;
}
.hud-left { display: flex; align-items: center; gap: 20px; }
.hud-logo {
  font-size: 18px; font-weight: 900; letter-spacing: 4px;
  color: var(--hospital-red);
  text-shadow: 0 0 20px rgba(192,57,43,0.6);
}
.hud-day { font-size: 12px; color: var(--accent); letter-spacing: 2px; text-transform: uppercase; }
.hud-center { display: flex; gap: 28px; }
.hud-stat {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
}
.stat-icon { font-size: 14px; }
.hud-stat span:nth-child(2) { font-size: 18px; font-weight: 800; color: #fff; }
.stat-label { font-size: 10px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.hud-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.hud-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Game Layout ──────────────────────────────────────────── */
#game-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  gap: 0;
  overflow: hidden;
  min-height: 0;
}
.panel-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

/* ── Patient Ward Panel ───────────────────────────────────── */
#panel-ward {
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg2);
}
#patient-grid {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.patient-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.patient-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--border2);
  transition: background 0.15s;
}
.patient-card:hover {
  background: var(--surface2);
  border-color: var(--accent);
  transform: translateX(2px);
}
.patient-card:hover::before { background: var(--accent); }
.patient-card.active { background: var(--surface2); border-color: var(--accent); }
.patient-card.active::before { background: var(--accent); box-shadow: var(--glow-accent); }
.patient-card.dead { opacity: 0.4; cursor: pointer; border-color: var(--red2); }
.patient-card.dead::before { background: var(--red); }
.patient-card.cured { opacity: 0.6; border-color: var(--green2); }
.patient-card.cured::before { background: var(--green); }
.patient-card.critical::before { background: var(--red); animation: blink-border 1s infinite; }
@keyframes blink-border {
  0%,100% { opacity: 1; } 50% { opacity: 0.2; }
}
.patient-thumb {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover; object-position: top center;
  border: 2px solid var(--border2);
  flex-shrink: 0;
  background: var(--surface2);
}
.patient-card-info { flex: 1; min-width: 0; }
.patient-card-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.patient-card-cond {
  font-size: 11px; color: var(--text2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.patient-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-alive   { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-critical{ background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink-border 0.8s infinite; }
.status-dead    { background: var(--muted); }
.status-cured   { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.status-surgery { background: var(--orange); box-shadow: 0 0 6px var(--orange); }

/* ── Center Panel / Chart ─────────────────────────────────── */
#panel-center {
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg3);
}
#no-patient-selected {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--muted);
  gap: 12px;
}
.no-patient-icon { font-size: 64px; opacity: 0.2; }
#no-patient-selected p { font-size: 14px; }
#no-patient-selected .muted { font-size: 12px; color: var(--border2); font-style: italic; }

#patient-chart {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden;
}
#chart-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#chart-patient-img {
  width: 72px; height: 72px;
  border-radius: var(--radius);
  object-fit: cover; object-position: top center;
  border: 2px solid var(--border2);
  background: var(--surface2);
}
#chart-patient-info { flex: 1; }
#chart-name { font-size: 20px; font-weight: 800; color: #fff; }
#chart-age-gender { font-size: 12px; color: var(--text2); margin-top: 2px; }
.condition-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(168,85,247,0.2);
  border: 1px solid var(--purple);
  color: var(--purple);
}
#chart-status { font-size: 12px; margin-top: 4px; color: var(--text2); }

#chart-vitals {
  display: flex; gap: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.vital {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 4px;
  border-right: 1px solid var(--border);
  font-size: 11px;
}
.vital:last-child { border-right: none; }
.vital span:first-child { color: var(--muted); letter-spacing: 1px; font-size: 10px; text-transform: uppercase; }
.vital span:last-child { color: var(--green); font-size: 14px; font-weight: 700; font-family: var(--font-mono); margin-top: 2px; }

/* ── Chat Area ────────────────────────────────────────────── */
#chat-area {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  background: var(--bg);
}
.chat-msg {
  display: flex; gap: 8px;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
.chat-msg.doctor { flex-direction: row-reverse; }
.chat-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.chat-msg.doctor .chat-bubble {
  background: var(--accent2);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.chat-msg.patient .chat-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 3px;
}
.chat-msg.system .chat-bubble {
  background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.3);
  color: var(--yellow);
  font-size: 12px;
  font-style: italic;
  max-width: 100%;
}
.chat-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
#chat-input-row {
  display: flex; gap: 8px;
  padding: 10px 12px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
#chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--font-main);
}
#chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,180,216,0.1); }
#chat-input::placeholder { color: var(--muted); }
#btn-chat-send {
  background: var(--accent2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s;
}
#btn-chat-send:hover { background: var(--accent); }

/* ── Chart Actions ────────────────────────────────────────── */
#chart-actions {
  display: flex; gap: 8px;
  padding: 10px 12px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.action-btn {
  flex: 1;
  padding: 9px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.action-btn.prescribe { background: rgba(13,158,110,0.2); border-color: var(--rx-green); color: var(--rx-green); }
.action-btn.prescribe:hover { background: var(--rx-green); color: #fff; }
.action-btn.surgery { background: rgba(239,68,68,0.15); border-color: var(--red2); color: var(--red); }
.action-btn.surgery:hover { background: var(--red2); color: #fff; }
.action-btn.discharge { background: rgba(0,180,216,0.12); border-color: var(--accent2); color: var(--accent); }
.action-btn.discharge:hover { background: var(--accent2); color: #fff; }
.action-btn.observe { background: rgba(168,85,247,0.12); border-color: var(--purple); color: var(--purple); }
.action-btn.observe:hover { background: rgba(168,85,247,0.3); color: #fff; }
.action-btn.fastfwd {
  background: rgba(234,179,8,0.12);
  border-color: var(--yellow);
  color: var(--yellow);
  flex: 1.4;
}
.action-btn.fastfwd:hover { background: rgba(234,179,8,0.28); color: #fff; }
.action-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Weekly Report Modal ──────────────────────────────────────── */
.weekly-modal {
  width: 660px;
  max-height: 88vh;
  padding: 28px;
  position: relative;
  overflow-y: auto;
}
.weekly-patient-name { font-size: 13px; color: var(--text2); margin-top: 4px; }

#weekly-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 20px 0 16px;
}

.week-day {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  animation: fade-in 0.2s ease;
}
.week-day-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
}
.week-day-event {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
}
.week-day-health {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.week-day.day-good    { border-color: var(--green2); background: rgba(34,197,94,0.07); }
.week-day.day-bad     { border-color: var(--red2);   background: rgba(239,68,68,0.08); }
.week-day.day-warn    { border-color: var(--orange);  background: rgba(249,115,22,0.07); }
.week-day.day-neutral { border-color: var(--border);  }

#weekly-verdict {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  border: 1px solid var(--border2);
  background: var(--surface2);
  margin-bottom: 8px;
}

#weekly-readmit-banner {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(239,68,68,0.12);
  border: 2px solid var(--red);
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  animation: blink-border 1.2s ease infinite;
}

/* ── Current Meds ─────────────────────────────────────────── */
#current-meds {
  padding: 10px 12px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  max-height: 130px;
  overflow-y: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
}
.current-meds-title {
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  color: var(--muted); text-transform: uppercase;
  margin-bottom: 6px;
}
#meds-list { display: flex; flex-direction: column; gap: 4px; }
.med-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 12px;
}
.med-item-name { font-weight: 600; color: var(--rx-green); }
.med-item-dose { color: var(--text2); font-size: 11px; }
.med-item-remove {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 0 4px;
  transition: color 0.15s;
}
.med-item-remove:hover { color: var(--red); }

/* ── Log Panel ────────────────────────────────────────────── */
#panel-log {
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg2);
}
#event-log {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.log-entry {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 5px;
  border-left: 3px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  line-height: 1.5;
  animation: fade-in 0.25s ease;
}
.log-entry.log-info    { border-color: var(--accent); }
.log-entry.log-good    { border-color: var(--green); color: var(--green); }
.log-entry.log-bad     { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.08); }
.log-entry.log-warn    { border-color: var(--orange); color: var(--orange); }
.log-entry.log-death   { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.15); font-weight: 700; }
.log-entry.log-funny   { border-color: var(--yellow); color: var(--yellow); font-style: italic; }
.log-time { color: var(--muted); font-size: 10px; margin-right: 6px; font-family: var(--font-mono); }

/* ── Modal Overlay ────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal-header { margin-bottom: 20px; }
.modal-header h2 { font-size: 20px; font-weight: 800; letter-spacing: 2px; color: var(--accent); }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text2);
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  padding: 6px 12px; cursor: pointer;
  transition: all 0.15s;
}
.modal-close:hover { border-color: var(--red); color: var(--red); }

/* ── Prescription Modal ───────────────────────────────────── */
.rx-modal {
  width: 820px; max-height: 86vh;
  padding: 24px;
  position: relative;
  display: flex; flex-direction: column;
}
.rx-patient-name { font-size: 13px; color: var(--text2); margin-top: 4px; }
.rx-layout {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; flex: 1; overflow: hidden;
  min-height: 0;
}
.rx-left { display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.rx-search-bar input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  font-family: var(--font-main);
}
.rx-search-bar input:focus { border-color: var(--accent); }
.rx-categories {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.rx-cat-btn {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  transition: all 0.12s;
}
.rx-cat-btn:hover, .rx-cat-btn.active { background: var(--accent2); border-color: var(--accent); color: #fff; }
.rx-drug-list {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.rx-drug-item {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s;
  display: flex; flex-direction: column; gap: 2px;
}
.rx-drug-item:hover { border-color: var(--rx-green); background: var(--surface2); }
.rx-drug-item.selected { border-color: var(--rx-green); background: rgba(13,158,110,0.1); }
.rx-drug-name { font-size: 13px; font-weight: 700; color: var(--text); }
.rx-drug-class { font-size: 10px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.rx-right { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; scrollbar-width: thin; }
.rx-detail-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-style: italic; }
.rx-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.rx-detail-name { font-size: 18px; font-weight: 800; color: var(--rx-green); margin-bottom: 4px; }
.rx-detail-class { font-size: 11px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin-bottom: 10px; }
.rx-detail-section { margin-bottom: 10px; }
.rx-detail-section h4 { font-size: 11px; font-weight: 700; color: var(--yellow); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.rx-detail-section p, .rx-detail-section li { font-size: 12px; color: var(--text2); line-height: 1.5; }
.rx-detail-section ul { padding-left: 16px; }
.rx-detail-warn { background: rgba(239,68,68,0.1); border: 1px solid var(--red2); border-radius: 5px; padding: 8px 10px; }
.rx-detail-warn p { color: var(--red) !important; font-size: 12px; }
.rx-form { display: flex; flex-direction: column; gap: 12px; }
.rx-form-field { display: flex; flex-direction: column; gap: 4px; }
.rx-form-field label { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.rx-form-field select, .rx-form-field input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  font-family: var(--font-main);
  cursor: pointer;
}
.rx-form-field select:focus, .rx-form-field input:focus { border-color: var(--accent); }

/* ── Surgery Modal ────────────────────────────────────────── */
.surgery-modal {
  width: 700px; max-height: 85vh;
  padding: 24px;
  position: relative;
  overflow-y: auto;
}
.surgery-warning {
  background: rgba(239,68,68,0.1);
  border: 1px solid var(--red2);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--red);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}
#surgery-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.surgery-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px;
  transition: border-color 0.15s;
}
.surgery-item:hover { border-color: var(--orange); }
.surgery-info { flex: 1; }
.surgery-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.surgery-desc { font-size: 12px; color: var(--text2); margin-bottom: 5px; }
.surgery-stats { display: flex; gap: 12px; }
.surgery-stat { font-size: 11px; padding: 2px 8px; border-radius: 3px; font-weight: 600; }
.sstat-risk   { background: rgba(239,68,68,0.15); color: var(--red); }
.sstat-time   { background: rgba(234,179,8,0.12); color: var(--yellow); }
.sstat-success{ background: rgba(34,197,94,0.12); color: var(--green); }
.btn-operate {
  background: var(--red2);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-operate:hover { background: var(--red); box-shadow: var(--glow-red); }

/* ── Game Over Screen ─────────────────────────────────────── */
#screen-gameover {
  align-items: center;
  justify-content: center;
}
.gameover-box {
  position: relative; z-index: 1;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 48px 52px;
  text-align: center;
  box-shadow: var(--shadow-modal);
  max-width: 600px;
  width: 90%;
}
#gameover-icon { font-size: 80px; line-height: 1; margin-bottom: 16px; }
#gameover-title { font-size: 42px; font-weight: 900; letter-spacing: 4px; margin-bottom: 8px; }
#gameover-subtitle { font-size: 14px; color: var(--text2); margin-bottom: 20px; line-height: 1.6; }
#gameover-stats {
  display: flex; justify-content: center; gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.go-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  min-width: 90px;
}
.go-stat-val { font-size: 28px; font-weight: 900; color: #fff; display: block; }
.go-stat-label { font-size: 10px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }
#gameover-rating {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
  padding: 10px 20px;
  border-radius: var(--radius);
  display: inline-block;
}
#gameover-quote {
  font-size: 13px; color: var(--muted); font-style: italic;
  margin-bottom: 28px; line-height: 1.6;
}
.gameover-buttons { display: flex; justify-content: center; gap: 14px; }

/* ── Confirm Dialog ───────────────────────────────────────── */
.confirm-box { width: 380px; padding: 28px; position: relative; text-align: center; }
.confirm-box h3 { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.confirm-box p { font-size: 13px; color: var(--text2); margin-bottom: 22px; line-height: 1.6; }
.confirm-buttons { display: flex; gap: 12px; justify-content: center; }

/* ── Reaction Toast ───────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow-card);
  max-width: 340px;
  pointer-events: auto;
  animation: toast-in 0.3s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: none; }
}
.toast.good   { border-color: var(--green); color: var(--green); }
.toast.bad    { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.12); }
.toast.warn   { border-color: var(--orange); color: var(--orange); }
.toast.funny  { border-color: var(--yellow); color: var(--yellow); }

/* ── Scrollbars ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Hidden / Utilities ───────────────────────────────────── */
.hidden { display: none !important; }
.muted  { color: var(--muted); }

/* ── Typing Indicator ─────────────────────────────────────── */
.typing-indicator {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px;
}
.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-5px); background: var(--accent); }
}

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-bar-outer {
  height: 4px; background: var(--border); border-radius: 2px; overflow: hidden;
}
.progress-bar-inner {
  height: 100%; border-radius: 2px;
  transition: width 0.5s ease;
}
