/* battle-grid HEX prototype — programmer-art styling. Founder reskins freely. */
:root {
  --bg: #14110d; --panel: #211c15; --ink: #efe6d6; --muted: #a89a82;
  --accent: #f1c40f; --player: #2ecc71; --enemy: #e67e22;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink);
  background: linear-gradient(rgba(10,8,5,.74), rgba(10,8,5,.86)), url("../art/rooms/deck.png") center/cover fixed, var(--bg);
  font-family: system-ui, "Segoe UI", sans-serif;
  display: flex; flex-direction: column; align-items: center; padding: 16px;
}
h1 { font-size: 18px; margin: 0 0 4px; letter-spacing: .5px; }
.subtitle { color: var(--muted); font-size: 12px; margin: 0 0 12px; max-width: 720px; text-align: center; }

.layout { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.board-wrap { position: relative; }
#board {
  background: #000; border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.6); max-width: 100%;
}
#banner {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800; color: var(--accent);
  background: rgba(0,0,0,.62); border-radius: 10px; letter-spacing: 2px; text-shadow: 0 2px 10px #000;
}
#banner.show { display: flex; }

.side { width: 330px; display: flex; flex-direction: column; gap: 12px; }
#turn-indicator {
  background: var(--panel); border: 1px solid #3a3122; border-radius: 8px;
  padding: 10px 12px; font-weight: 600; font-size: 13px;
}
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
button {
  background: #3a2f1d; color: var(--ink); border: 1px solid #5a4a2e; border-radius: 6px;
  padding: 8px 12px; font-size: 13px; cursor: pointer; font-weight: 600;
}
button:hover:not(:disabled) { background: #4a3c25; }
button:disabled { opacity: .4; cursor: default; }
#btn-reset { margin-left: auto; }

.spell-btn { background: #2a2342; border-color: #4a3a72; font-size: 12px; padding: 6px 10px; }
.spell-btn.active { background: #5a3a92; border-color: var(--accent); }
#spellbar { display: flex; gap: 6px; flex-wrap: wrap; min-height: 4px; }

/* Equip bar — one row per slot, items as toggle buttons. */
#equipbar { display: flex; flex-direction: column; gap: 6px; }
.equip-slot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.slot-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); width: 52px; flex: none; }
.equip-btn { background: #2a2417; border: 1px solid #4a3f24; color: var(--ink); border-radius: 6px; font-size: 12px; padding: 5px 9px; cursor: pointer; }
.equip-btn:hover { border-color: var(--muted); }
.equip-btn.on { background: #5a4a16; border-color: var(--accent); color: #fff; }
.equip-btn.locked { opacity: .5; border-style: dashed; cursor: help; }
.equip-btn.locked:hover { border-color: #6a5a3a; }
.equip-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.equip-hint a { color: var(--accent); text-decoration: none; }

.panel { background: var(--panel); border: 1px solid #3a3122; border-radius: 8px; padding: 10px 12px; }
.panel h2 { font-size: 12px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.stat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.badge { margin-left: auto; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.badge.ally { background: #14361f; color: var(--player); }
.badge.foe { background: #3a2410; color: var(--enemy); }
.hpbar {
  position: relative; height: 16px; background: #1a1610; border-radius: 4px;
  overflow: hidden; margin: 4px 0 8px; border: 1px solid #3a3122;
}
.hpfill { height: 100%; background: linear-gradient(90deg,#27ae60,#2ecc71); transition: width .2s; }
.hptext { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 16px; color: #fff; }
.grid6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 8px; }
.grid6 > div { background: #1a1610; border-radius: 4px; padding: 4px 6px; font-size: 11px; color: var(--muted); }
.grid6 b { color: var(--ink); float: right; }
.derived { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; margin-bottom: 6px; }
.derived b { color: var(--accent); }

#log { height: 260px; overflow-y: auto; font-size: 12px; font-family: "Consolas","Courier New",monospace; line-height: 1.5; }
.log-line { padding: 1px 0; border-bottom: 1px dotted #2a2419; }
.log-line.hit { color: #ff8a65; }
.log-line.miss { color: #90a4ae; }
.log-line.down { color: #ffd54f; font-weight: 700; }
.log-line.win { color: var(--accent); font-weight: 800; }
.log-line.turn { color: #81d4fa; font-weight: 700; margin-top: 4px; }
.log-line.info { color: var(--muted); }
