:root {
  --bg: #04060d;
  --bg-trans: rgba(4, 6, 13, 0.85);
  --bg-panel: rgba(7, 12, 24, 0.82);
  --bg-card: rgba(12, 19, 36, 0.7);
  --fg: #dfe9ff;
  --dim: #6f7ea6;
  --cyan: #3ee7ff;
  --cyan-glow: rgba(62, 231, 255, 0.4);
  --magenta: #ff4fd8;
  --magenta-glow: rgba(255, 79, 216, 0.4);
  --lime: #b8ff3c;
  --lime-glow: rgba(184, 255, 60, 0.4);
  --orange: #ffb23c;
  --red: #ff5a5a;
  --red-glow: rgba(255, 90, 90, 0.4);
  --gold: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.5);
  --purple: #bf77ff;
  --border-cyan: rgba(62, 231, 255, 0.3);
  --font-display: 'Orbitron', 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;
}

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

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

/* ---- Layout container ---- */
#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
}

#game-canvas {
  flex: 1;
  height: 100%;
  display: block;
  background-color: #020307;
  cursor: crosshair;
}

/* ---- Top Header Bar ---- */
#top-bar {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 364px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-cyan);
  box-shadow: 0 0 15px rgba(62, 231, 255, 0.12), inset 0 0 20px rgba(62, 231, 255, 0.04);
  backdrop-filter: blur(6px);
  z-index: 10;
  border-radius: 4px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.logo-text {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.2em;
  color: #fff;
  text-shadow: 0 0 6px #fff, 0 0 14px var(--cyan);
}

.sub-text {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--magenta);
  text-shadow: 0 0 8px var(--magenta-glow);
}

.floor-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(62, 231, 255, 0.08);
  padding: 4px 12px;
  border: 1px solid var(--cyan);
  border-radius: 3px;
  box-shadow: 0 0 8px var(--cyan-glow);
}

.floor-badge .label {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--dim);
}

.floor-badge .value {
  font-size: 15px;
  font-weight: 800;
  color: var(--cyan);
}

.amulet-badge {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid var(--gold);
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-shadow: 0 0 10px var(--gold-glow);
  box-shadow: 0 0 12px var(--gold-glow);
}

.pulse-glow {
  animation: pulse 1.8s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.75; transform: scale(0.985); }
  100% { opacity: 1; transform: scale(1.015); }
}

.top-controls {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: rgba(111, 126, 166, 0.15);
  border: 1px solid rgba(111, 126, 166, 0.35);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(62, 231, 255, 0.25);
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 10px var(--cyan-glow);
}

.icon-btn.active {
  border-color: var(--lime);
  color: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow);
}

/* ---- Side HUD Panel ---- */
#side-panel {
  width: 350px;
  height: 100%;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-cyan);
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(62, 231, 255, 0.04);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
  overflow-y: auto;
  z-index: 10;
}

.panel-section {
  background: var(--bg-card);
  border: 1px solid rgba(62, 231, 255, 0.2);
  border-radius: 4px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--cyan);
  margin-bottom: 8px;
  text-shadow: 0 0 6px var(--cyan-glow);
}

/* ---- Vitals Card ---- */
.vitals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.char-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.char-name.clickable {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.char-name.clickable:hover {
  color: var(--cyan);
  border-color: rgba(62, 231, 255, 0.4);
  background: rgba(62, 231, 255, 0.1);
  text-shadow: 0 0 10px var(--cyan);
}

.hunger-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 2px 6px;
  border-radius: 2px;
}
.hunger-badge.normal {
  color: var(--dim);
  border: 1px solid rgba(111, 126, 166, 0.3);
}
.hunger-badge.hungry {
  color: var(--orange);
  border: 1px solid var(--orange);
  background: rgba(255, 178, 60, 0.12);
  text-shadow: 0 0 6px var(--orange);
}
.hunger-badge.weak {
  color: var(--red);
  border: 1px solid var(--red);
  background: rgba(255, 90, 90, 0.15);
  text-shadow: 0 0 8px var(--red);
  animation: pulseHungerWeak 1.8s ease-in-out infinite alternate;
}
.hunger-badge.faint {
  color: #fff;
  background: var(--red);
  border: 1px solid #fff;
  animation: pulseHungerFaint 1.2s ease-in-out infinite alternate;
}

@keyframes pulseHungerWeak {
  0% {
    opacity: 0.75;
    box-shadow: 0 0 3px rgba(255, 90, 90, 0.2);
  }
  100% {
    opacity: 1;
    box-shadow: 0 0 10px rgba(255, 90, 90, 0.7);
  }
}

@keyframes pulseHungerFaint {
  0% {
    opacity: 0.7;
    transform: scale(0.97);
    box-shadow: 0 0 4px rgba(255, 51, 102, 0.4);
  }
  100% {
    opacity: 1;
    transform: scale(1.03);
    box-shadow: 0 0 14px rgba(255, 51, 102, 0.9), 0 0 6px #fff;
  }
}

.stat-bar-group {
  margin-bottom: 6px;
}

.stat-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

.progress-bar-bg {
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-fill {
  height: 100%;
  transition: width 0.25s ease;
}

.hp-bar .progress-fill {
  background: linear-gradient(90deg, #ff3366, #ff6b8b);
  box-shadow: 0 0 8px rgba(255, 51, 102, 0.6);
}

.xp-bar .progress-fill {
  background: linear-gradient(90deg, #4ade80, #b8ff3c);
  box-shadow: 0 0 8px rgba(184, 255, 60, 0.5);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 8px 0;
  text-align: center;
}

.stat-cell {
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 2px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-lbl {
  display: block;
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--dim);
}

.stat-val {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.stat-val.gold {
  color: var(--gold);
  text-shadow: 0 0 6px var(--gold-glow);
}

.equipment-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.eq-slot {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}

.eq-type {
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.eq-name {
  color: var(--cyan);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* ---- Hotbar Actions ---- */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.act-btn {
  background: rgba(62, 231, 255, 0.06);
  border: 1px solid rgba(62, 231, 255, 0.25);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  padding: 8px 4px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.act-btn:hover {
  background: rgba(62, 231, 255, 0.2);
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 8px var(--cyan-glow);
}

.act-btn.highlight {
  border-color: var(--magenta);
  color: var(--magenta);
  background: rgba(255, 79, 216, 0.1);
  box-shadow: 0 0 8px var(--magenta-glow);
}

.act-btn.highlight:hover {
  background: rgba(255, 79, 216, 0.25);
  color: #fff;
}

/* ---- Minimap ---- */
.minimap-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.minimap-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.minimap-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #020409;
  border-radius: 3px;
  padding: 4px;
  border: 1px solid rgba(62, 231, 255, 0.15);
  transition: all 0.2s ease;
}

.minimap-wrapper.clickable {
  cursor: pointer;
}

.minimap-wrapper.clickable:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
  background: rgba(62, 231, 255, 0.05);
}

#minimap-canvas {
  display: block;
  image-rendering: pixelated;
}

.minimap-coords {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--dim);
}

/* ---- Inspector Card ---- */
.inspector-content {
  font-size: 11px;
  line-height: 1.4;
  min-height: 48px;
}

.inspector-prompt {
  color: var(--dim);
  font-size: 10px;
  font-style: italic;
  padding: 8px 0;
  text-align: center;
}

.inspect-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.inspect-glyph {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 3px;
  box-shadow: 0 0 6px currentColor;
}

.inspect-name {
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}

.inspect-danger {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 2px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.danger-low { background: rgba(184, 255, 60, 0.2); color: var(--lime); border: 1px solid var(--lime); }
.danger-med { background: rgba(255, 178, 60, 0.2); color: var(--orange); border: 1px solid var(--orange); }
.danger-high { background: rgba(255, 90, 90, 0.25); color: var(--red); border: 1px solid var(--red); }
.danger-fatal {
  background: #ff3366;
  color: #fff;
  animation: pulseFatalDanger 1.2s ease-in-out infinite alternate;
}

@keyframes pulseFatalDanger {
  0% {
    opacity: 0.75;
    box-shadow: 0 0 4px rgba(255, 51, 102, 0.4);
  }
  100% {
    opacity: 1;
    box-shadow: 0 0 14px rgba(255, 51, 102, 0.9);
  }
}

.inspect-details {
  font-size: 10px;
  color: var(--dim);
  margin-top: 4px;
}

.inspect-power {
  color: var(--magenta);
  font-weight: 600;
}

.inspect-dist {
  font-size: 9px;
  color: var(--dim);
  margin-left: auto;
}
.inspect-badge-asleep {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold);
  border: 1px solid var(--gold);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 2px;
}
.inspect-badge-hostile {
  background: rgba(255, 90, 90, 0.2);
  color: var(--red);
  border: 1px solid var(--red);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 2px;
}
.inspect-badge-memory {
  background: rgba(111, 126, 166, 0.2);
  color: var(--dim);
  border: 1px solid var(--dim);
  font-size: 8px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 2px;
}
.inspect-badge-arcane {
  background: rgba(142, 68, 245, 0.22);
  color: #ba82ff;
  border: 1px solid rgba(186, 130, 255, 0.65);
  font-size: 8px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 2px;
  text-shadow: 0 0 6px rgba(186, 130, 255, 0.4);
}
.inspect-hp-wrap {
  margin: 6px 0;
}
.inspect-hp-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 2px;
}
.inspect-hp-track {
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.inspect-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff3366, #ff7b90);
  box-shadow: 0 0 6px rgba(255, 51, 102, 0.5);
  transition: width 0.2s ease;
}
.inspect-threat-alert {
  background: rgba(255, 79, 216, 0.1);
  border: 1px solid rgba(255, 79, 216, 0.35);
  color: var(--magenta);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 3px;
  margin-top: 6px;
}
.inspect-combat-forecast {
  background: rgba(62, 231, 255, 0.08);
  border: 1px solid rgba(62, 231, 255, 0.25);
  padding: 6px 8px;
  border-radius: 3px;
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}
.forecast-val {
  font-weight: 700;
  color: #fff;
}
.forecast-lbl {
  color: var(--dim);
  font-size: 9px;
}

/* ---- Message Chronicle Log ---- */
.message-log-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 140px;
}

.message-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding-right: 4px;
  scroll-behavior: smooth;
}

.message-log::-webkit-scrollbar {
  width: 4px;
}
.message-log::-webkit-scrollbar-thumb {
  background: var(--border-cyan);
  border-radius: 2px;
}

.log-entry {
  padding: 2px 4px;
  border-radius: 2px;
  word-break: break-word;
  animation: logFade 0.2s ease-out;
}
@keyframes logFade {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: none; }
}

.log-entry.sys { color: var(--dim); }
.log-entry.hit-player { color: var(--red); font-weight: 600; }
.log-entry.hit-monster { color: var(--lime); }
.log-entry.kill { color: var(--cyan); font-weight: 700; text-shadow: 0 0 6px var(--cyan-glow); }
.log-entry.item { color: var(--gold); }
.log-entry.warn { color: var(--orange); font-weight: 600; }
.log-entry.level-up { color: #fff; background: rgba(62, 231, 255, 0.2); border-left: 2px solid var(--cyan); }
.log-entry.magic { color: var(--purple); }

.log-turn {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-right: 4px;
  user-select: none;
  opacity: 0.85;
}

.chronicle-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* ---- Modals ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 8, 0.75);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.hidden { display: none; }
.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--cyan);
  box-shadow: 0 0 35px var(--cyan-glow), inset 0 0 30px rgba(62, 231, 255, 0.05);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inventory-modal {
  width: min(840px, 94vw);
  height: min(600px, 88vh);
}

.codex-modal {
  width: min(880px, 94vw);
  height: min(640px, 90vh);
}

.help-modal {
  width: min(720px, 92vw);
  max-height: 85vh;
}

.sheet-modal {
  width: min(940px, 95vw);
  height: min(760px, 90vh);
}

.modal-header-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-subtitle {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--cyan);
  opacity: 0.85;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-cyan);
  background: rgba(62, 231, 255, 0.05);
}

.modal-header h2 {
  font-size: 16px;
  letter-spacing: 0.2em;
  color: #fff;
  text-shadow: 0 0 10px var(--cyan);
}

.modal-close {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--red); }

/* Inventory UI */
.inv-filter-bar {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  overflow-x: auto;
}

.filter-tab {
  background: transparent;
  border: 1px solid rgba(111, 126, 166, 0.3);
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.filter-tab:hover {
  border-color: var(--cyan);
  color: #fff;
}
.filter-tab.active {
  background: rgba(62, 231, 255, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}

.inv-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.inventory-list {
  flex: 1.2;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.inv-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.inv-item-row:hover {
  background: rgba(62, 231, 255, 0.08);
  border-color: var(--border-cyan);
}
.inv-item-row.selected {
  background: rgba(62, 231, 255, 0.18);
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.item-letter {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--dim);
  width: 20px;
}

.item-icon-glyph {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  width: 24px;
  text-align: center;
}

.item-main-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.item-sub {
  font-size: 10px;
  color: var(--dim);
}

.item-status-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
}
.badge-equipped {
  background: rgba(184, 255, 60, 0.15);
  color: var(--lime);
  border: 1px solid var(--lime);
}
.badge-cursed {
  background: rgba(255, 90, 90, 0.15);
  color: var(--red);
  border: 1px solid var(--red);
}

.item-detail-pane {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  overflow-y: auto;
}

.item-placeholder {
  color: var(--dim);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  margin-top: 40px;
}

.detail-header {
  margin-bottom: 12px;
}

.detail-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
  margin-bottom: 4px;
}

.detail-type {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--magenta);
}

.detail-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-item-action {
  flex: 1 1 40%;
  background: rgba(62, 231, 255, 0.1);
  border: 1px solid var(--cyan);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 10px 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.btn-item-action:hover {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 12px var(--cyan);
}
.btn-item-action.drop {
  border-color: var(--red);
  color: var(--red);
  background: rgba(255, 90, 90, 0.08);
}
.btn-item-action.drop:hover {
  background: var(--red);
  color: #fff;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  font-size: 11px;
  color: var(--dim);
}

/* Codex UI */
.codex-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}
.codex-tab {
  background: transparent;
  border: 1px solid rgba(111, 126, 166, 0.3);
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 3px;
  cursor: pointer;
}
.codex-tab.active {
  background: rgba(184, 255, 60, 0.15);
  border-color: var(--lime);
  color: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow);
}

.codex-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.bestiary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.monster-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.monster-card.discovered {
  border-color: rgba(62, 231, 255, 0.3);
}

.mcard-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mcard-glyph {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  box-shadow: 0 0 6px currentColor;
}

.mcard-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.mcard-danger {
  margin-left: auto;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 2px;
}

.mcard-desc {
  font-size: 10px;
  color: var(--dim);
  line-height: 1.4;
  font-family: var(--font-mono);
}

.mcard-special {
  font-size: 10px;
  color: var(--orange);
  font-weight: 600;
}

/* Help UI */
.help-content {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.help-section h3 {
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--cyan);
  margin-bottom: 8px;
  text-shadow: 0 0 6px var(--cyan-glow);
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.help-table th, .help-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.help-table th {
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.15em;
}

.help-table td:nth-child(2), .help-table td:nth-child(3) {
  font-family: var(--font-mono);
  color: var(--lime);
}

.help-section p, .help-section li {
  font-size: 11px;
  line-height: 1.6;
  color: var(--fg);
}

.help-section ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---- Title & Game Over Screens ---- */
.screen-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 13, 0.88);
  backdrop-filter: blur(10px);
  z-index: 50;
  animation: fadeIn 0.4s ease-out;
}
.screen-overlay.hidden { display: none; }

.title-content, .gameover-content {
  width: min(840px, 92vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.neon-title {
  font-size: clamp(48px, 10vw, 110px);
  font-weight: 900;
  letter-spacing: 0.22em;
  color: #fff;
  text-shadow:
    0 0 8px #fff,
    0 0 20px var(--cyan),
    0 0 50px var(--cyan),
    0 0 90px rgba(62, 231, 255, 0.6);
  animation: titleGlowPulse 4s ease-in-out infinite alternate;
}

@keyframes titleGlowPulse {
  0% {
    opacity: 0.88;
    text-shadow:
      0 0 8px #fff,
      0 0 16px var(--cyan),
      0 0 40px var(--cyan),
      0 0 70px rgba(62, 231, 255, 0.4);
  }
  100% {
    opacity: 1;
    text-shadow:
      0 0 12px #fff,
      0 0 24px var(--cyan),
      0 0 60px var(--cyan),
      0 0 100px rgba(62, 231, 255, 0.75);
  }
}

.neon-subtitle {
  font-size: clamp(11px, 2vw, 16px);
  letter-spacing: 0.35em;
  color: var(--magenta);
  text-shadow: 0 0 10px var(--magenta), 0 0 25px var(--magenta-glow);
}

.neon-tagline {
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--dim);
}

.title-buttons {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}

.huge-btn {
  background: rgba(184, 255, 60, 0.15);
  border: 2px solid var(--lime);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.25em;
  padding: 14px 28px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 20px var(--lime-glow), inset 0 0 15px rgba(184, 255, 60, 0.2);
  transition: all 0.2s ease;
}
.huge-btn:hover {
  background: var(--lime);
  color: #000;
  box-shadow: 0 0 30px var(--lime);
}

.medium-btn {
  background: rgba(62, 231, 255, 0.12);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.medium-btn:hover {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 15px var(--cyan);
}

.blink,
.pulse-action {
  animation: pulseGlowBtn 2s ease-in-out infinite alternate;
}

#btn-continue-game.blink,
#btn-continue-game.pulse-action {
  animation: pulseCyanBtn 2s ease-in-out infinite alternate;
}

@keyframes pulseGlowBtn {
  0% {
    opacity: 0.82;
    transform: scale(0.985);
    box-shadow: 0 0 10px rgba(184, 255, 60, 0.4), inset 0 0 8px rgba(184, 255, 60, 0.15);
  }
  100% {
    opacity: 1;
    transform: scale(1.025);
    box-shadow: 0 0 25px rgba(184, 255, 60, 0.85), inset 0 0 20px rgba(184, 255, 60, 0.4);
  }
}

@keyframes pulseCyanBtn {
  0% {
    opacity: 0.82;
    transform: scale(0.985);
    box-shadow: 0 0 10px rgba(62, 231, 255, 0.4), inset 0 0 8px rgba(62, 231, 255, 0.15);
  }
  100% {
    opacity: 1;
    transform: scale(1.025);
    box-shadow: 0 0 26px rgba(62, 231, 255, 0.9), inset 0 0 20px rgba(62, 231, 255, 0.4);
  }
}

.features-summary {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.feat-box {
  flex: 1 1 220px;
  max-width: 250px;
  padding: 12px 14px;
  border: 1px solid rgba(62, 231, 255, 0.25);
  background: rgba(4, 6, 13, 0.6);
  border-radius: 4px;
  text-align: left;
}

.feat-box h4 {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--cyan);
  margin-bottom: 6px;
}

.feat-box p {
  font-size: 10px;
  line-height: 1.4;
  color: var(--dim);
}

.audio-notice {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--orange);
  text-shadow: 0 0 8px rgba(255, 178, 60, 0.5);
}

/* Tombstone Game Over */
.tombstone-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#endgame-title {
  font-size: clamp(28px, 6vw, 56px);
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #fff;
  text-shadow: 0 0 10px #fff, 0 0 25px var(--red);
  margin-bottom: 12px;
}

.tombstone {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 12px auto;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  white-space: normal;
}

.vector-tombstone-svg {
  width: 100%;
  max-width: 380px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.9));
  animation: floatTombstone 3s ease-in-out infinite alternate;
}

@keyframes floatTombstone {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-4px); }
}

.endgame-stats {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 16px;
  border-radius: 4px;
}
.stat-pill .val {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.stat-pill .lbl {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--dim);
}

/* Direction Prompt */
.direction-prompt {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  pointer-events: none;
}
.direction-prompt.hidden { display: none; }

.prompt-box {
  background: rgba(4, 6, 13, 0.9);
  border: 2px solid var(--magenta);
  box-shadow: 0 0 20px var(--magenta-glow);
  padding: 12px 24px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.prompt-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.25em;
  color: #fff;
  text-shadow: 0 0 8px var(--magenta);
}
.prompt-sub {
  font-size: 10px;
  color: var(--dim);
}

/* ---- CRT Dressing ---- */
#scanlines {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.16) 3px
  );
  mix-blend-mode: multiply;
}

#vignette {
  position: fixed;
  inset: 0;
  z-index: 1001;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.6) 100%
  );
}

.mobile-toggle {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .mobile-toggle {
    display: inline-flex;
  }
  #top-bar {
    right: 14px;
  }
  #side-panel {
    position: fixed;
    right: 0;
    top: 64px;
    bottom: 0;
    width: 300px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  #side-panel.open {
    transform: translateX(0);
  }
}

/* ==========================================================================
   Character Sheet & Hero Dossier Modal Styles
   ========================================================================== */

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(4, 7, 16, 0.95);
}

/* Hero Dossier Banner */
.sheet-hero-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(12, 22, 45, 0.9) 0%, rgba(7, 12, 26, 0.95) 100%);
  border: 1px solid rgba(62, 231, 255, 0.35);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 0 25px rgba(62, 231, 255, 0.05);
}

.sheet-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 15px var(--cyan-glow), inset 0 0 12px var(--cyan-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 4, 10, 0.6);
  flex-shrink: 0;
}

.sheet-avatar-glyph {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan);
}

.sheet-hero-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-hero-name-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.sheet-hero-rank {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: #fff;
  text-shadow: 0 0 10px var(--cyan), 0 0 20px var(--cyan-glow);
}

.sheet-hero-class {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--magenta);
  text-shadow: 0 0 6px var(--magenta-glow);
}

.sheet-hero-tags {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  flex-wrap: wrap;
}

.sheet-tag-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
}

.sheet-tag-val {
  color: var(--fg);
  font-weight: 700;
  font-family: var(--font-mono);
}

.sheet-tag-val.cyan { color: var(--cyan); text-shadow: 0 0 6px var(--cyan-glow); }
.sheet-tag-val.gold { color: var(--gold); text-shadow: 0 0 6px var(--gold-glow); }
.sheet-tag-val.lime { color: var(--lime); text-shadow: 0 0 6px var(--lime-glow); }

/* Quest Banner */
.sheet-quest-banner {
  padding: 10px 14px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.sheet-quest-banner.seeking {
  background: rgba(62, 231, 255, 0.07);
  border: 1px solid rgba(62, 231, 255, 0.28);
  color: var(--fg);
}

.sheet-quest-banner.seeking strong {
  color: var(--cyan);
}

.sheet-quest-banner.possessed {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid var(--gold);
  color: #fff;
  box-shadow: 0 0 15px var(--gold-glow);
  animation: pulse-border 1.6s infinite alternate ease-in-out;
}

.sheet-quest-banner.possessed strong {
  color: var(--gold);
  text-shadow: 0 0 8px var(--gold);
}

/* XP Progress Bar in Dossier */
.sheet-xp-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sheet-xp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dim);
}

.sheet-xp-fill-val {
  color: var(--magenta);
  font-weight: 700;
}

.sheet-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.sheet-progress-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.sheet-progress-fill.xp {
  background: linear-gradient(90deg, var(--purple), var(--magenta));
  box-shadow: 0 0 8px var(--magenta-glow);
}

.sheet-progress-fill.bestiary {
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  box-shadow: 0 0 8px var(--cyan-glow);
}

/* 2-Column Responsive Card Grid */
.sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .sheet-grid {
    grid-template-columns: 1fr;
  }
}

.sheet-card {
  background: var(--bg-card);
  border: 1px solid rgba(62, 231, 255, 0.22);
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35), inset 0 0 15px rgba(62, 231, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(62, 231, 255, 0.18);
  text-shadow: 0 0 6px var(--cyan-glow);
}

.sheet-card-title .card-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-stat-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sheet-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sheet-stat-row:last-child {
  border-bottom: none;
}

.sheet-stat-lbl {
  color: var(--dim);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sheet-stat-val {
  color: var(--fg);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

.sheet-stat-val.cyan { color: var(--cyan); }
.sheet-stat-val.lime { color: var(--lime); }
.sheet-stat-val.gold { color: var(--gold); }
.sheet-stat-val.orange { color: var(--orange); }
.sheet-stat-val.red { color: var(--red); }
.sheet-stat-val.dim { color: var(--dim); }

.sheet-sub-detail {
  font-size: 10px;
  color: var(--dim);
  font-family: var(--font-display);
  margin-top: 1px;
}

/* Badges for Conditions & Equipment */
.sheet-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  display: inline-block;
}

.sheet-badge.active-ward {
  background: rgba(184, 255, 60, 0.15);
  border: 1px solid var(--lime);
  color: var(--lime);
  box-shadow: 0 0 6px var(--lime-glow);
}

.sheet-badge.inactive-ward {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(111, 126, 166, 0.3);
  color: var(--dim);
}

.sheet-badge.buff {
  background: rgba(62, 231, 255, 0.15);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 6px var(--cyan-glow);
}

.sheet-badge.debuff {
  background: rgba(255, 90, 90, 0.18);
  border: 1px solid var(--red);
  color: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
  animation: pulse-border 1.6s ease-in-out infinite alternate;
}

@keyframes pulse-border {
  0% {
    opacity: 0.82;
    box-shadow: 0 0 5px rgba(255, 90, 90, 0.4);
  }
  100% {
    opacity: 1;
    box-shadow: 0 0 14px rgba(255, 90, 90, 0.85);
  }
}

.sheet-badge.cursed {
  background: rgba(255, 90, 90, 0.25);
  border: 1px solid var(--red);
  color: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
}

.sheet-badge.enchanted {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
}

/* Equipment Slot Cards in Sheet */
.sheet-equip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-equip-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
}

.sheet-equip-item.empty {
  opacity: 0.6;
  border-style: dashed;
}

.sheet-equip-slot-lbl {
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--dim);
  width: 65px;
  flex-shrink: 0;
}

.sheet-equip-glyph {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sheet-equip-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sheet-equip-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.sheet-equip-props {
  font-size: 10px;
  color: var(--dim);
}

/* Bestiary progress & Top Kills */
.sheet-kill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 11px;
}

.sheet-kill-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
}

.sheet-kill-glyph {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}

.sheet-kill-count {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--cyan);
}

/* ---- Bottom Command Toolbar (Single-Click Actions & Keybinds) ---- */
#bottom-toolbar {
  position: absolute;
  bottom: 12px;
  left: 14px;
  right: 364px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 0 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border-cyan);
  box-shadow: 0 0 15px rgba(62, 231, 255, 0.12), inset 0 0 20px rgba(62, 231, 255, 0.04);
  backdrop-filter: blur(8px);
  z-index: 10;
  border-radius: 4px;
  overflow-x: auto;
  overflow-y: hidden;
}

#bottom-toolbar::-webkit-scrollbar {
  height: 3px;
}

#bottom-toolbar::-webkit-scrollbar-thumb {
  background: rgba(62, 231, 255, 0.35);
  border-radius: 2px;
}

.tb-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(14, 22, 42, 0.85);
  border: 1px solid rgba(62, 231, 255, 0.28);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  user-select: none;
  flex-shrink: 0;
}

.tb-btn:hover {
  background: rgba(62, 231, 255, 0.22);
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 10px var(--cyan-glow);
  transform: translateY(-1px);
}

.tb-btn:active {
  transform: translateY(1px);
  box-shadow: 0 0 5px var(--cyan-glow);
}

.tb-btn.highlight {
  border-color: var(--magenta);
}

.tb-btn.highlight:hover {
  background: rgba(255, 79, 216, 0.22);
  border-color: var(--magenta);
  box-shadow: 0 0 10px var(--magenta-glow);
}

.tb-btn.contextual-active,
.act-btn.contextual-active {
  border-color: #ffd700 !important;
  color: #fff !important;
  background: rgba(255, 215, 0, 0.18) !important;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.45) !important;
  animation: pulseGold 2s infinite ease-in-out;
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.35); }
  50% { box-shadow: 0 0 16px rgba(255, 215, 0, 0.7); }
}

.tb-icon {
  font-size: 14px;
  line-height: 1;
}

.tb-label {
  letter-spacing: 0.06em;
}

.tb-key {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(62, 231, 255, 0.14);
  border: 1px solid rgba(62, 231, 255, 0.35);
  border-radius: 2px;
  padding: 1px 4px;
  margin-left: 2px;
}

@media (max-width: 900px) {
  #bottom-toolbar {
    right: 14px;
    bottom: 8px;
    height: 48px;
  }
}

/* ==========================================================================
   Dedicated Glanceable Status Bar beneath Top Toolbar (HP, XP, and Hunger Bars)
   ========================================================================== */
#status-bar {
  position: absolute;
  top: 64px;
  left: 14px;
  right: 364px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: rgba(10, 16, 28, 0.92);
  border: 1px solid rgba(62, 231, 255, 0.28);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6), inset 0 0 12px rgba(62, 231, 255, 0.04);
  backdrop-filter: blur(6px);
  z-index: 10;
  border-radius: 4px;
}

@media (max-width: 900px) {
  #status-bar {
    right: 14px;
    gap: 10px;
    padding: 0 10px;
  }
}

.status-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  line-height: 1;
}

.status-lbl {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.vital-icon {
  font-size: 10px;
}

.status-val {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.status-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.25s ease, background 0.3s ease;
}

.hp-fill {
  background: linear-gradient(90deg, #32e078, #b8ff3c);
  box-shadow: 0 0 6px rgba(50, 224, 120, 0.6);
}

.xp-fill {
  background: linear-gradient(90deg, #9d4edd, #c084fc);
  box-shadow: 0 0 6px rgba(192, 132, 252, 0.6);
}

.hunger-fill {
  background: linear-gradient(90deg, #3ee7ff, #00b4d8);
  box-shadow: 0 0 6px rgba(62, 231, 255, 0.5);
}

/* ==========================================================================
   3-Line Scrolling Combat & Action Log Overlay (Above Equipment Bar)
   ========================================================================== */
#bottom-log {
  position: absolute;
  bottom: 114px;
  left: 14px;
  right: 364px;
  height: 60px;
  background: rgba(3, 6, 14, 0.75);
  border: 1px solid rgba(62, 231, 255, 0.2);
  border-radius: 4px;
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  z-index: 9;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

#bottom-log:hover {
  border-color: var(--cyan);
  background: rgba(3, 6, 14, 0.92);
  box-shadow: 0 0 14px var(--cyan-glow);
}

.bottom-log-stream {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  overflow: hidden;
  height: 100%;
}

.bottom-log-row {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.25s ease;
}

.bottom-log-stream > .bottom-log-row:first-child:not(:last-child):not(:nth-last-child(2)) {
  opacity: 0.55;
}
.bottom-log-stream > .bottom-log-row:nth-last-child(2) {
  opacity: 0.85;
}
.bottom-log-stream > .bottom-log-row:last-child {
  opacity: 1;
}

@media (max-width: 900px) {
  #bottom-log {
    right: 14px;
    bottom: 102px;
    height: 52px;
  }
  .bottom-log-stream {
    font-size: 10px;
  }
}

/* ==========================================================================
   Real-Time Arsenal Quick-Bar (Equipped Melee, Thrown, Zap)
   ========================================================================== */
#arsenal-bar {
  position: absolute;
  bottom: 70px;
  left: 14px;
  right: 364px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  background: rgba(10, 16, 30, 0.85);
  border: 1px solid rgba(62, 231, 255, 0.22);
  box-shadow: 0 0 14px rgba(62, 231, 255, 0.08);
  backdrop-filter: blur(8px);
  z-index: 10;
  border-radius: 4px;
}

@media (max-width: 900px) {
  #arsenal-bar {
    right: 14px;
    bottom: 60px;
  }
}

.arsenal-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  font-size: 11px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  user-select: none;
}

.arsenal-slot.clickable {
  cursor: pointer;
  transition: all 0.16s ease;
}

.arsenal-slot.clickable:hover {
  background: rgba(62, 231, 255, 0.12);
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(62, 231, 255, 0.25);
}

.slot-badge {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--dim);
  display: flex;
  align-items: center;
}

.slot-kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(62, 231, 255, 0.16);
  border: 1px solid rgba(62, 231, 255, 0.35);
  border-radius: 2px;
  padding: 0 3px;
  margin-left: 3px;
}

.slot-icon {
  font-size: 13px;
  line-height: 1;
}

.slot-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-hint {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: auto;
  flex-shrink: 0;
  background: rgba(50, 224, 120, 0.18);
  color: #32e078;
  border: 1px solid rgba(50, 224, 120, 0.4);
}

.slot-hint.empty {
  background: rgba(255, 255, 255, 0.06);
  color: var(--dim);
  border-color: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   Game Options & Preferences Modal
   ========================================================================== */
.options-modal {
  width: 90%;
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.options-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.options-group h3 {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--cyan);
  border-bottom: 1px solid rgba(62, 231, 255, 0.2);
  padding-bottom: 5px;
  margin-bottom: 10px;
}

.option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  margin-bottom: 8px;
  gap: 16px;
  transition: background 0.15s ease;
}

.option-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(62, 231, 255, 0.2);
}

.option-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.option-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.option-desc {
  font-size: 10.5px;
  color: var(--dim);
  line-height: 1.35;
}

.option-desc strong {
  color: var(--cyan);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.25s;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background-color: #0b101d;
}

/* ---- Micro & Secondary Buttons ---- */
.btn-micro {
  background: rgba(62, 231, 255, 0.12);
  border: 1px solid var(--border-cyan);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
  line-height: 1.2;
  user-select: none;
}

.btn-micro:hover {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 8px var(--cyan);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-dim);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-secondary:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

/* ---- Full Expedition Chronicle Modal ---- */
.chronicle-modal {
  width: 920px;
  max-width: 95vw;
  height: 85vh;
  max-height: 780px;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border-cyan);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.28);
  border-radius: 6px;
  overflow: hidden;
}

.chronicle-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(10, 16, 26, 0.88);
  border-bottom: 1px solid var(--border-dim);
  flex-wrap: wrap;
}

.chronicle-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chronicle-tab {
  background: rgba(20, 30, 48, 0.65);
  border: 1px solid var(--border-dim);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.chronicle-tab:hover {
  border-color: var(--cyan);
  color: #fff;
}

.chronicle-tab.active {
  background: rgba(0, 240, 255, 0.16);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.35);
}

.chronicle-search-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  min-width: 230px;
  flex: 1 1 230px;
  max-width: 320px;
}

#chronicle-search-input {
  width: 100%;
  padding: 6px 28px 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(14, 22, 34, 0.95);
  border: 1px solid var(--border-dim);
  color: #fff;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease;
}

#chronicle-search-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

#btn-chronicle-clear-search {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}

#btn-chronicle-clear-search:hover {
  color: #fff;
}

.chronicle-log-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(5, 8, 14, 0.95);
  line-height: 1.5;
}

.chronicle-log-container::-webkit-scrollbar {
  width: 6px;
}

.chronicle-log-container::-webkit-scrollbar-thumb {
  background: var(--border-cyan);
  border-radius: 3px;
}

.chronicle-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-style: italic;
  padding: 40px 20px;
  text-align: center;
}

.chronicle-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 3px;
  transition: background 0.1s ease;
}

.chronicle-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.chronicle-turn-stamp {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  opacity: 0.9;
  letter-spacing: 0.5px;
  white-space: nowrap;
  user-select: none;
  min-width: 64px;
}

.chronicle-depth-stamp {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.25);
  padding: 0 4px;
  border-radius: 2px;
  white-space: nowrap;
  user-select: none;
}

.chronicle-text {
  flex: 1;
  word-break: break-word;
}

/* Event color styles in chronicle */
.chronicle-row.sys .chronicle-text { color: var(--text-muted); }
.chronicle-row.hit-player .chronicle-text { color: #ff6b6b; font-weight: 600; }
.chronicle-row.hit-monster .chronicle-text { color: #69ff94; }
.chronicle-row.crit .chronicle-text { color: #ff4fd8; font-weight: 700; }
.chronicle-row.kill .chronicle-text { color: #3ee7ff; font-weight: 700; text-shadow: 0 0 6px rgba(62, 231, 255, 0.5); }
.chronicle-row.item .chronicle-text { color: #ffd700; }
.chronicle-row.magic .chronicle-text { color: #c084fc; }
.chronicle-row.warn .chronicle-text { color: #ff9f43; font-weight: 600; }
.chronicle-row.level-up .chronicle-text { color: #ffffff; background: rgba(62, 231, 255, 0.2); padding: 2px 4px; border-left: 2px solid var(--cyan); }

.chronicle-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(10, 16, 26, 0.95);
  border-top: 1px solid var(--border-dim);
  flex-wrap: wrap;
  gap: 8px;
}

.chronicle-footer-stats {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.chronicle-sep {
  opacity: 0.4;
}

.chronicle-footer-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ==========================================================================
   Tactical Floor Map Modal Styles
   ========================================================================== */

.tactical-map-modal {
  width: min(880px, 95vw);
  max-height: 90vh;
}

.tactical-map-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: rgba(3, 6, 12, 0.96);
  overflow-y: auto;
}

.tactical-map-canvas-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #020409;
  border: 1px solid var(--border-cyan);
  border-radius: 4px;
  padding: 10px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(62, 231, 255, 0.08);
}

#tactical-map-canvas {
  width: 100%;
  max-width: 800px;
  height: auto;
  aspect-ratio: 2 / 1;
  display: block;
  image-rendering: pixelated;
  border-radius: 2px;
}

.tactical-map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  padding: 10px 16px;
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  font-size: 11px;
  color: var(--dim);
}

.tactical-map-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.legend-swatch.wall-lit { background: var(--cyan); box-shadow: 0 0 6px var(--cyan-glow); }
.legend-swatch.wall-dark { background: #556987; }
.legend-swatch.magic-mapped { background: #ba82ff; box-shadow: 0 0 6px rgba(186, 130, 255, 0.6); }
.legend-swatch.corridor { background: #ffb23c; }
.legend-swatch.door { background: var(--magenta); }
.legend-swatch.stairs { background: var(--lime); box-shadow: 0 0 6px var(--lime-glow); }
.legend-swatch.item { background: var(--gold); }
.legend-swatch.trap { background: var(--red); }
.legend-swatch.player-swatch {
  background: #fff;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 8px #fff, 0 0 10px var(--cyan);
  border-radius: 50%;
}

.tactical-map-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(8, 12, 22, 0.95);
  border-top: 1px solid var(--border-dim);
  font-size: 11px;
  flex-wrap: wrap;
  gap: 10px;
}

.tactical-map-stats {
  color: var(--cyan);
  font-family: var(--font-mono);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.tactical-map-stats strong {
  color: #fff;
}

/* ==========================================================================
   TITLE SCREEN GAME MODE PANEL
   ========================================================================== */
.title-game-mode-panel {
  margin: 18px 0;
  padding: 16px;
  background: rgba(10, 16, 30, 0.85);
  border: 1px solid rgba(62, 231, 255, 0.3);
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.6), inset 0 0 12px rgba(62, 231, 255, 0.05);
  text-align: left;
  max-width: 740px;
  width: 100%;
}

.mode-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(62, 231, 255, 0.2);
}

.mode-panel-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px var(--cyan-glow);
}

.mode-panel-hint {
  font-size: 11px;
  color: var(--dim);
}

.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: rgba(14, 22, 40, 0.9);
  border: 1px solid rgba(62, 231, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-card:hover {
  border-color: var(--cyan);
  background: rgba(18, 30, 56, 0.95);
  box-shadow: 0 0 12px rgba(62, 231, 255, 0.2);
}

.mode-card.hard-mode {
  border-color: rgba(255, 51, 102, 0.3);
}

.mode-card.hard-mode:hover {
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.25);
}

.mode-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.mode-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
  cursor: pointer;
}

.mode-card.hard-mode .mode-checkbox {
  accent-color: var(--red);
}

.mode-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.mode-card.hard-mode .mode-name {
  color: #ff7b90;
}

.mode-desc {
  font-size: 11px;
  color: rgba(195, 215, 240, 0.8);
  line-height: 1.4;
  margin: 0;
}

/* ==========================================================================
   GRAVEYARD & EPITAPHS MODAL
   ========================================================================== */
.graveyard-modal {
  max-width: 820px;
  width: 95%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.graveyard-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.graveyard-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 14px;
  background: rgba(12, 18, 32, 0.85);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
}

.graveyard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.graveyard-card {
  padding: 14px;
  background: rgba(14, 20, 36, 0.9);
  border: 1px solid rgba(62, 231, 255, 0.25);
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.graveyard-card:hover {
  background: rgba(18, 26, 48, 0.95);
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(62, 231, 255, 0.15);
}

.graveyard-card.victory {
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}

.graveyard-card.slain {
  border-left: 4px solid var(--red);
}

.graveyard-card.victory {
  border-left: 4px solid var(--gold);
}

.graveyard-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.graveyard-hero-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.graveyard-hero-name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.graveyard-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.graveyard-badge.slain {
  background: rgba(255, 51, 102, 0.2);
  color: #ff5a5a;
  border: 1px solid rgba(255, 51, 102, 0.4);
}

.graveyard-badge.victory {
  background: rgba(255, 215, 0, 0.2);
  color: var(--gold);
  border: 1px solid rgba(255, 215, 0, 0.4);
}

.graveyard-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

.graveyard-stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 11px;
  color: rgba(200, 220, 245, 0.9);
  flex-wrap: wrap;
}

.graveyard-stats-row span strong {
  color: var(--cyan);
}

.graveyard-epitaph-quote {
  font-style: italic;
  font-size: 12px;
  line-height: 1.5;
  color: #e2e8f0;
  padding-left: 12px;
  border-left: 2px solid rgba(62, 231, 255, 0.4);
  margin-top: 4px;
}

.graveyard-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ==========================================================================
   BOSS KEY FULLSCREEN OVERLAY
   ========================================================================== */
.boss-key-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #020a05;
  color: #33ff66;
  font-family: 'Courier New', Courier, monospace;
  padding: 24px;
  overflow: auto;
  box-sizing: border-box;
}

.boss-key-terminal {
  max-width: 900px;
  margin: 0 auto;
}

.boss-key-dos-header {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  background: #113318;
  color: #66ff88;
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 13px;
  border-bottom: 1px solid #33ff66;
}

.boss-key-fake-sheet {
  background: #051408;
  padding: 12px;
  border: 1px solid #1a5525;
  line-height: 1.8;
  font-size: 12px;
  color: #55ee77;
  margin-bottom: 24px;
}

.boss-key-neon-box {
  background: rgba(10, 2, 20, 0.95);
  border: 2px solid #ff3366;
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 0 30px rgba(255, 51, 102, 0.4), inset 0 0 20px rgba(62, 231, 255, 0.2);
  animation: bossGlitchGlow 3s infinite alternate;
}

@keyframes bossGlitchGlow {
  0% { border-color: #ff3366; box-shadow: 0 0 25px rgba(255, 51, 102, 0.4); }
  50% { border-color: #3ee7ff; box-shadow: 0 0 35px rgba(62, 231, 255, 0.5); }
  100% { border-color: #ffe259; box-shadow: 0 0 30px rgba(255, 226, 89, 0.4); }
}

.boss-neon-glitch-badge {
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #ffe259;
  text-shadow: 0 0 10px #ffe259;
  margin-bottom: 12px;
}

.boss-neon-title {
  font-family: var(--font-mono, monospace);
  font-size: 26px;
  font-weight: 900;
  color: #3ee7ff;
  text-shadow: 0 0 16px #3ee7ff, 0 0 30px rgba(62, 231, 255, 0.6);
  margin-bottom: 14px;
  letter-spacing: 0.05em;
}

.boss-neon-msg {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: #f1f5f9;
  line-height: 1.6;
  margin-bottom: 10px;
}

.boss-neon-submsg {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.8);
  line-height: 1.5;
  margin-bottom: 20px;
}

