:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* ───── Home ───── */
.home-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 40px;
  gap: 4px;
}
.title {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--accent);
  text-shadow: 0 0 28px var(--focus-glow);
  margin-bottom: 2px;
}
.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.menu {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.menu-btn {
  width: 100%;
  min-height: 64px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 22px;
  font-weight: 600;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid var(--bg-tertiary);
  font-family: inherit;
}
.btn-label { color: var(--text-primary); }
.btn-meta { color: var(--text-muted); font-size: 14px; font-weight: 500; letter-spacing: 1px; }

/* ───── Game ───── */
.game-header {
  display: flex;
  justify-content: space-around;
  padding: 14px 24px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
}
.stat { text-align: center; }
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 80px);
  grid-template-rows: repeat(5, 80px);
  gap: 6px;
  margin: auto;
}
.cell {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
  outline: none;
  position: relative;
}
.cell::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 8px;
  background: transparent;
  transition: background 0.18s ease;
}
.cell.lit {
  background: var(--accent);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.55), inset 0 0 14px rgba(255, 255, 255, 0.22);
}
.cell.lit::after {
  background: rgba(255, 255, 255, 0.18);
}
.cell:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 22px var(--focus-glow);
  transform: scale(1.06);
}
.cell.lit:focus {
  box-shadow: 0 0 32px rgba(0, 212, 255, 0.85), inset 0 0 14px rgba(255, 255, 255, 0.32);
}

.game-footer {
  display: flex;
  gap: 10px;
  padding: 10px 14px 12px;
  background: var(--bg-primary);
  border-top: 1px solid var(--bg-tertiary);
}
.btn-sm {
  flex: 1;
  min-height: 52px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  border: 2px solid var(--bg-tertiary);
  font-family: inherit;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ───── Win ───── */
.win-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 40px;
  gap: 12px;
}
.win-icon {
  font-size: 72px;
  line-height: 1;
  color: var(--accent-secondary);
  text-shadow: 0 0 36px rgba(0, 255, 136, 0.6);
  margin-bottom: 4px;
}
.win-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--accent-secondary);
  margin-bottom: 12px;
}
.win-stats {
  display: flex;
  gap: 56px;
  margin-bottom: 20px;
}
.win-stat { text-align: center; }
.stat-value-big {
  font-size: 40px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ───── Help ───── */
.help-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 36px 40px 28px;
  gap: 14px;
}
.help-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.help-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.help-list li strong {
  color: var(--accent);
  font-weight: 700;
}
.help-list li {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
}
.help-content .menu-btn {
  margin-top: auto;
}
