:root {
  --bg: #0a0a0a;
  --panel: #121212;
  --border: #3a2a1a;
  --accent: #c45c26;
  --accent2: #8b1e1e;
  --text: #e8dcc8;
  --muted: #7a6f5f;
  --hp: #8b1e1e;
  --hp-bg: #2a1515;
  --green: #4a7a3a;
  --font-mono: "Share Tech Mono", ui-monospace, monospace;
  --font-display: "Black Ops One", Impact, sans-serif;
}

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

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

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}

.screen.active {
  display: flex;
}

/* Title */
#title-screen {
  flex-direction: column;
  background: radial-gradient(ellipse at center, #1a1008 0%, #050505 70%);
}

.title-bg {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.15) 2px,
      rgba(0, 0, 0, 0.15) 4px
    ),
    radial-gradient(circle at 30% 40%, rgba(139, 30, 30, 0.12), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(196, 92, 38, 0.08), transparent 45%);
  pointer-events: none;
}

.title-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  max-width: 640px;
}

.tape-label {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.main-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 5.5rem);
  letter-spacing: 0.08em;
  color: var(--text);
  text-shadow: 0 0 40px rgba(196, 92, 38, 0.4), 2px 2px 0 #000;
  line-height: 1;
}

.subtitle {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.title-divider {
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 1.5rem auto;
}

.tagline {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
}

.menu-btn {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  padding: 0.75rem 2rem;
  min-width: 240px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.menu-btn:hover,
.menu-btn:focus {
  background: #1c1410;
  border-color: var(--accent);
  color: #fff;
  outline: none;
}

.menu-btn.primary {
  background: linear-gradient(180deg, #3a1a12 0%, #1a0c08 100%);
  border-color: var(--accent);
}

.menu-btn.primary:hover {
  background: linear-gradient(180deg, #4a2218 0%, #2a100c 100%);
}

.disclaimer {
  margin-top: 2.5rem;
  font-size: 0.65rem;
  color: #4a4238;
  letter-spacing: 0.05em;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 2rem 2.5rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

.panel.wide {
  max-width: 720px;
}

.panel h2 {
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.howto-list {
  list-style: none;
  margin-bottom: 1.25rem;
}

.howto-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #1e1a16;
  font-size: 0.9rem;
}

kbd {
  display: inline-block;
  background: #1a1510;
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem;
  margin-right: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.howto-note,
.panel p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.muted {
  color: var(--muted) !important;
  font-size: 0.75rem !important;
}

/* Character select */
.char-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.char-card {
  background: #0e0c0a;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 1.25rem;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: border-color 0.15s, background 0.15s;
}

.char-card:hover {
  border-color: var(--accent);
  background: #16120e;
}

.char-portrait {
  width: 64px;
  height: 64px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  image-rendering: pixelated;
}

.char-portrait.reb {
  background:
    linear-gradient(135deg, #2a1810 30%, #1a0c08 100%),
    repeating-linear-gradient(45deg, #3a2010 0 4px, #2a1810 4px 8px);
  box-shadow: inset 0 0 20px #000;
  position: relative;
}

.char-portrait.reb::after {
  content: "R";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--accent);
}

.char-portrait.vodka {
  background:
    linear-gradient(135deg, #181828 30%, #0c0c1a 100%),
    repeating-linear-gradient(-45deg, #202038 0 4px, #181828 4px 8px);
  box-shadow: inset 0 0 20px #000;
  position: relative;
}

.char-portrait.vodka::after {
  content: "V";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: #6a8ab0;
}

.char-card h3 {
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.char-card p {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.char-card ul {
  list-style: none;
  font-size: 0.75rem;
  color: #a89880;
}

.char-card ul li::before {
  content: "› ";
  color: var(--accent);
}

/* Game canvas */
#game-screen {
  background: #000;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  background: #0d0d0d;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.hud-top,
.hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent);
}

.hud-top {
  top: 0;
  align-items: flex-start;
}

.hud-bottom {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), transparent);
  align-items: flex-end;
}

.hud-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hud-block.center {
  text-align: center;
}

.hud-block.right {
  text-align: right;
}

.hud-label {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

#hud-name,
#hud-zone,
#hud-time {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.hp-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bar {
  width: 120px;
  height: 10px;
  background: var(--hp-bg);
  border: 1px solid #4a2020;
}

#hp-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent2), #c44);
  transition: width 0.15s;
}

#hp-text {
  font-size: 0.85rem;
  min-width: 2rem;
}

.weapon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

#weapon-name {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

#ammo-text {
  font-size: 1.1rem;
}

.obj-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#kill-count {
  font-size: 1.2rem;
  color: var(--accent);
}

#minimap-wrap {
  position: absolute;
  top: 3.2rem;
  right: 1rem;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.7);
  opacity: 0.9;
}

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

#msg-log {
  position: absolute;
  left: 1rem;
  bottom: 4.5rem;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#msg-log .msg {
  font-size: 0.75rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  padding: 0.25rem 0.5rem;
  border-left: 2px solid var(--accent);
  animation: fadeMsg 4s forwards;
}

@keyframes fadeMsg {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

#interact-prompt {
  position: absolute;
  left: 50%;
  bottom: 22%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid var(--accent);
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: auto;
}

.overlay .panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
}

.overlay .menu-btn {
  min-width: 0;
  width: 100%;
}

#obj-list {
  list-style: none;
  margin-bottom: 1rem;
}

#obj-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #1e1a16;
  font-size: 0.85rem;
}

#obj-list li.done {
  color: var(--green);
  text-decoration: line-through;
}

#obj-list li::before {
  content: "□ ";
  color: var(--muted);
}

#obj-list li.done::before {
  content: "■ ";
  color: var(--green);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0 1.5rem;
  text-align: center;
}

.stats span {
  display: block;
}

.stats .hud-label {
  margin-bottom: 0.25rem;
}

#end-title {
  color: var(--accent);
}

/* Mobile-ish */
@media (max-width: 600px) {
  .char-grid {
    grid-template-columns: 1fr;
  }
  #minimap-wrap {
    display: none;
  }
}
