:root {
  --bg: #1a1f2e;
  --panel: #242b3d;
  --text: #e8ecf4;
  --muted: #9aa8c7;
  --accent: #6cb6ff;
  --good: #6fdc8c;
  --warn: #ffb347;
  --bad: #ff6b6b;
  --border: #3a4660;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 1rem;
  max-width: 960px;
  margin-inline: auto;
}

header h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
#subtitle { color: var(--muted); margin: 0 0 1rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.hidden { display: none; }

.message {
  font-size: 1.05rem;
  padding: 0.75rem;
  background: #1e2638;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.stats span { color: var(--muted); display: block; font-size: 0.75rem; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

@media (max-width: 600px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
}

.tile {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem;
  cursor: default;
  min-height: 90px;
  font-size: 0.85rem;
}

.tile.you { border-color: var(--accent); }
.tile.enemy { border-color: var(--bad); }
.tile.neutral { border-color: var(--muted); opacity: 0.85; }
.tile.selected { outline: 2px solid var(--good); }

.tile-id { font-weight: 700; font-size: 1.1rem; }
.tile-meta { color: var(--muted); font-size: 0.75rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }

.btn {
  background: #2f3a52;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn:hover { background: #3a4763; }
.btn.primary { background: #2a6db5; border-color: #3d8fd9; }
.btn.primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.active { background: var(--accent); color: #111; }
.btn.subtle { background: transparent; color: var(--muted); }

#report .outcome { font-weight: 700; text-transform: capitalize; }
#report .reason { margin: 0.5rem 0; }
#report .advice { color: var(--good); }
#report ul { margin: 0.5rem 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.9rem; }

#log { margin: 0; padding-left: 1.2rem; font-size: 0.85rem; color: var(--muted); }
#rivals .rival { padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }

footer { text-align: center; margin-top: 1rem; }
