* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  background: #0f1318;
  color: #e8e3d4;
  font-family: "Courier New", monospace;
  height: 100%;
  overflow: hidden;
  user-select: none;
}
#game {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: #141a22;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #1d2430;
  border-bottom: 2px solid #2a3446;
  font-size: 14px;
  letter-spacing: 1px;
}
.topbar .back {
  color: #ffe08a;
  text-decoration: none;
  font-size: 20px;
  padding: 2px 8px;
  background: #2a3446;
  border-radius: 6px;
}
.topbar .title { flex: 1; text-align: center; color: #ffe08a; font-weight: bold; }
.topbar .who { color: #8b9bb4; font-size: 11px; }

.hud {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px;
  background: #0e1218;
  font-size: 11px;
}
.hud-cell {
  background: #1a2230;
  padding: 6px 4px;
  text-align: center;
  border-radius: 4px;
  border: 1px solid #2a3446;
}
.hud-cell .label {
  display: block;
  color: #6d7a8e;
  font-size: 9px;
  letter-spacing: 1px;
}
.hud-cell span:last-child {
  color: #ffe08a;
  font-weight: bold;
  font-size: 13px;
}

#stage {
  width: 100%;
  flex: 1;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #1a1008;
  display: block;
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px;
  background: #1d2430;
  border-top: 2px solid #2a3446;
}
.btn {
  background: #2c3e50;
  color: #e8e3d4;
  border: 2px solid #3d5068;
  padding: 10px 4px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: 1px;
}
.btn:active { transform: translateY(1px); background: #34495e; }
.btn.primary { background: #8b5a2b; border-color: #a6712e; color: #fff; }

.log {
  max-height: 110px;
  overflow-y: auto;
  padding: 6px 10px;
  background: #0a0d12;
  border-top: 1px solid #2a3446;
  font-size: 11px;
  line-height: 1.5;
  color: #9ba9bf;
}
.log .entry { padding: 1px 0; }
.log .entry.warn { color: #f39c12; }
.log .entry.err { color: #e74c3c; }
.log .entry.ok { color: #2ecc71; }
