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

html, body {
  height: 100%;
  overflow: hidden;
  background: #0f172a;
  color: #e2e8f0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  user-select: none;
}

body { display: flex; flex-direction: column; }

/* ---------- Barra superior ---------- */
#topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 38px;
  padding: 0 14px;
  background: #111827;
  border-bottom: 1px solid #1f2937;
  font-size: 14px;
}
.res { display: flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.coin {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fde68a, #f59e0b);
  box-shadow: 0 0 0 1px #92400e;
}
#help {
  margin-left: auto;
  color: #94a3b8;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Vista del juego ---------- */
#view { position: relative; flex: 1; min-height: 0; }
#game { position: absolute; inset: 0; display: block; }

#msg {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(15, 23, 42, .88);
  border: 1px solid #334155;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
#msg.show { opacity: 1; }

/* ---------- Panel inferior ---------- */
#panel {
  height: 160px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  padding: 10px 14px;
  background: #111827;
  border-top: 1px solid #1f2937;
}
#minimap { width: 210px; height: 140px; border: 1px solid #334155; border-radius: 4px; cursor: pointer; }

#info { overflow: auto; font-size: 13px; }
#info h3 { font-size: 15px; margin-bottom: 6px; }
.enemy-tag { color: #f87171; font-weight: 500; }
.muted { color: #94a3b8; }
.hint { color: #94a3b8; line-height: 1.6; }

.bar { height: 8px; max-width: 260px; margin: 4px 0 6px; background: #1f2937; border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; background: #22c55e; }
.bar.prog > div { background: #38bdf8; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  padding: 4px 8px;
  background: #1f2937;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.chip:hover { border-color: #64748b; }

#actions {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  grid-auto-rows: 62px;
  gap: 6px;
  align-content: start;
}
.btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  padding: 4px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #e2e8f0;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.btn:hover:not(:disabled) { background: #273449; border-color: #60a5fa; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.active { border-color: #facc15; background: #3a3417; }
.btn .ico { font-size: 18px; line-height: 1; }
.btn small { color: #fcd34d; }
.btn kbd { position: absolute; top: 3px; right: 6px; font-size: 10px; color: #94a3b8; font-family: inherit; }

/* ---------- Pantalla de inicio / fin ---------- */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 23, .72);
}
#overlay.hidden { display: none; }
.box {
  max-width: 480px;
  padding: 28px 32px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 12px;
  text-align: center;
}
.box h1 { font-size: 28px; margin-bottom: 12px; }
#ov-text { color: #cbd5e1; font-size: 14px; line-height: 1.55; text-align: left; margin-bottom: 20px; }
#ov-text ul { margin: 8px 0 0 18px; }
.box button {
  padding: 10px 24px;
  background: #2563eb;
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.box button:hover { background: #1d4ed8; }
