/* Minimal, clean UI */
:root {
  --bg: #0e0f12;
  --card: #171921;
  --muted: #a7b0c0;
  --text: #e9edf5;
  --accent: #8bd3ff;
  --accent-2: #a68bff;
  --danger: #ff6b6b;
  --success: #2dd4bf;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 70% -10%, #1e2230 0%, var(--bg) 50%);
  color: var(--text);
}

.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
}

.brand { display: flex; gap: 12px; align-items: center; }
.brand-icon { width: 28px; height: 28px; }
h1 { font-size: 1.25rem; margin: 0; }

.container {
  max-width: 860px;
  margin: 20px auto 64px;
  padding: 0 16px;
  display: grid;
  gap: 16px;
}

.card {
  background: linear-gradient(180deg, #1a1e29 0%, var(--card) 100%);
  border: 1px solid #23283a;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.row { display: flex; gap: 8px; }
.btn {
  appearance: none;
  border: 1px solid #384154;
  background: linear-gradient(180deg, #202636 0%, #1b2030 100%);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: #2a3042; }

input {
  flex: 1;
  background: #121622;
  color: var(--text);
  border: 1px solid #2a3042;
  border-radius: 10px;
  padding: 10px 12px;
}

.hidden { display: none; }
.muted { color: var(--muted); }
.center { text-align: center; }

.game-top {
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}

.guesses {
  display: grid; gap: 8px; margin: 8px 0 12px;
}
.guess {
  border: 1px solid #2a3042;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
}
.guess.correct { border-color: var(--success); background: rgba(45,212,191,0.08); }
.guess.wrong { border-color: #2a3042; opacity: 0.8; }
.guess .answer { color: var(--muted); }
.status { min-height: 1.2em; }
.status.ok { color: var(--success); }
.status.err { color: var(--danger); }

/* --- Modal & stats --- */
.header-actions { display:flex; gap:8px; align-items:center; }
.backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: grid; place-items: center; z-index: 1000;
}
.modal { max-width: 640px; width: min(92vw, 640px); }
.modal-head { display:flex; align-items:center; justify-content: space-between; margin-bottom: 8px; }
.stats-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 8px 0 12px;
}
.stat { text-align: center; border: 1px solid #2a3042; border-radius: 10px; padding: 8px; }
.stat-num { font-size: 1.4rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.bars { display: grid; gap: 6px; margin-bottom: 8px; }
.bar { display:flex; gap:8px; align-items:center; }
.bar .label { width: 24px; text-align: right; color: var(--muted); }
.bar .track { flex:1; background: #101420; border-radius: 999px; overflow: hidden; border: 1px solid #2a3042; }
.bar .fill { height: 18px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0%; display:block; }
.small { font-size: 0.9rem; }

@media (max-width: 520px) {
  .row { flex-direction: column; }
  .btn { width: 100%; }
}
