/* =====================================================================
 * style.css — минималистичный тёмный интерфейс.
 * Один акцентный цвет, тонкие границы, без лишнего свечения и иконок.
 * ===================================================================== */

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

:root {
  --bg: #0a0a0f;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f2f3f7;
  --muted: #82869b;
  --accent: #14e0c8;
  --accent-ink: #05201d;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
}

#game { position: fixed; inset: 0; display: block; cursor: crosshair; }
.hidden { display: none !important; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; }

.panel {
  position: absolute;
  background: rgba(14, 15, 22, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#score-panel {
  top: 12px; left: 12px;
  padding: 7px 12px;
  display: flex; gap: 15px; align-items: center;
}
.stat { display: flex; flex-direction: column; gap: 0; }
.stat-label {
  font-size: 9px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 600; line-height: 1.15; }
.stat-accent { color: var(--accent); font-size: 13px; }

#leaderboard { top: 12px; right: 12px; width: 162px; padding: 8px 8px 6px; }
.lb-title {
  font-size: 9.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 5px; padding: 0 4px;
}
#leaderboard-list { list-style: none; }
#leaderboard-list li {
  display: flex; align-items: center; gap: 6px;
  padding: 2.5px 5px; font-size: 11.5px; border-radius: 6px; color: #cdd0dd;
}
#leaderboard-list li.me { background: var(--surface-2); color: var(--text); font-weight: 600; }
.lb-rank { width: 13px; color: var(--muted); text-align: right; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.lb-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-len { color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
#leaderboard-list li.me .lb-len { color: var(--accent); }

#minimap-wrap { bottom: 12px; right: 12px; padding: 5px; line-height: 0; }
#minimap { border-radius: 7px; display: block; width: 116px; height: 116px; }

.icon-btn {
  position: absolute; bottom: 14px; left: 14px;
  pointer-events: auto;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(14, 15, 22, 0.72);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
#mute-btn .snd-off { display: none; }
#mute-btn.muted { color: var(--muted); }
#mute-btn.muted .snd-on { display: none; }
#mute-btn.muted .snd-off { display: inline; }

/* Кнопка настроек в углу стартового экрана */
.icon-btn.corner { position: fixed; top: 16px; right: 16px; bottom: auto; left: auto; z-index: 11; }

/* ---------------- Оверлеи ---------------- */
.overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 7, 12, 0.78);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 10;
  padding: 20px;
}

.card {
  width: min(420px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  background: rgba(15, 16, 24, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px 28px 26px;
  text-align: center;
}
.card-narrow { width: min(360px, 94vw); }

/* тонкий скроллбар внутри карточки */
.card::-webkit-scrollbar { width: 8px; }
.card::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 8px; }

.brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 40px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1;
}
.brand-dot { color: var(--accent); }
.subtle { color: var(--muted); font-size: 13.5px; margin-top: 8px; margin-bottom: 20px; }

#name-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 15px; font-family: inherit;
  text-align: center;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
#name-input::placeholder { color: var(--muted); }
#name-input:focus { border-color: var(--accent); background: rgba(0, 0, 0, 0.35); }

/* ---------------- Кастомизатор ---------------- */
.customizer { margin-top: 16px; text-align: left; }

#skin-preview {
  width: 100%; height: 96px;
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.03), transparent 70%);
  margin-bottom: 12px;
}

.cz-tabs {
  display: flex; gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 12px;
}
.cz-tab {
  flex: 1; padding: 8px 0;
  border: none; border-radius: 7px;
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.cz-tab:hover { color: var(--text); }
.cz-tab.is-active { background: var(--surface-2); color: var(--text); }

.cz-panel { display: none; }
.cz-panel.is-active { display: block; }

.swatches {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 7px;
}
.swatch {
  aspect-ratio: 1; width: 100%;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  transition: transform 0.1s, border-color 0.12s;
}
.swatch:hover { transform: scale(1.1); }
.swatch.is-active { border-color: var(--text); }

.cz-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cz-type {
  flex: 1 1 84px; padding: 9px 0;
  border: 1px solid var(--border); border-radius: 9px;
  background: rgba(0, 0, 0, 0.2); color: var(--muted);
  font-size: 12.5px; font-family: inherit; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.cz-type:hover { color: var(--text); }
.cz-type.is-active { border-color: var(--accent); color: var(--text); background: var(--surface); }
.cz-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }

.flag-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.flag-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 3px;
  border: 1px solid var(--border); border-radius: 9px;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer; font-family: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.flag-chip:hover { border-color: var(--border-strong); background: var(--surface); }
.flag-chip.is-active { border-color: var(--accent); background: var(--surface); }
.flag-sw {
  width: 100%; display: block; border-radius: 4px;
  aspect-ratio: 3 / 2;               /* единый бокс — флаги любой высоты сидят ровно */
  height: auto;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.flag-label {
  font-size: 10px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.flag-chip.is-active .flag-label { color: var(--text); }

/* ---------------- Кнопки ---------------- */
.btn {
  width: 100%; margin-top: 18px;
  padding: 13px;
  border: none; border-radius: 11px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: transform 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  margin-top: 9px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); filter: none; }

.hint {
  margin-top: 16px;
  display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
.hint .dot { opacity: 0.5; }

/* ---------------- Настройки ---------------- */
#settings-screen { z-index: 20; }
.set-block { text-align: left; margin-bottom: 18px; }
.set-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lang-btn {
  padding: 11px 10px;
  border: 1px solid var(--border); border-radius: 10px;
  background: rgba(0, 0, 0, 0.2); color: var(--text);
  font-size: 14px; font-family: inherit; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.lang-btn:hover { border-color: var(--border-strong); background: var(--surface); }
.lang-btn.is-active { border-color: var(--accent); background: var(--surface); }

.set-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.set-row .set-label { margin-bottom: 0; color: var(--text); font-size: 15px; }

/* Переключатель (тумблер) */
.toggle {
  width: 48px; height: 28px; border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer; padding: 0; position: relative;
  transition: background 0.18s, border-color 0.18s;
}
.toggle .toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s, background 0.18s;
}
.toggle.is-on { background: var(--accent); border-color: var(--accent); }
.toggle.is-on .toggle-knob { transform: translateX(20px); background: var(--accent-ink); }

/* ---------------- Game Over ---------------- */
.go-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.go-stats {
  display: flex; flex-direction: column; gap: 1px;
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
}
.go-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 13.5px; color: var(--muted);
}
.go-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---------------- Адаптив ---------------- */
@media (max-width: 640px) {
  #leaderboard { width: 158px; padding: 10px; }
  #leaderboard-list li { font-size: 12px; }
  .stat-value { font-size: 18px; }
  #score-panel { gap: 14px; padding: 9px 12px; }
  #minimap { width: 108px; height: 108px; }
  .brand { font-size: 34px; }
  .flag-grid { grid-template-columns: repeat(3, 1fr); }
  .swatches { grid-template-columns: repeat(6, 1fr); }
}
