/* =====================================================================
 * 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; touch-action: none; }
body { overscroll-behavior: none; }
.hidden { display: none !important; }

/* ---------------- Кнопка ускорения (мобилки) ---------------- */
#boost-btn {
  display: none;
  position: absolute; bottom: 22px; right: 22px;
  width: 76px; height: 76px; border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--accent); color: var(--accent-ink);
  align-items: center; justify-content: center;
  pointer-events: auto; z-index: 6;
  box-shadow: 0 5px 0 var(--btn-shadow), 0 8px 12px rgba(0, 0, 0, 0.4);
  touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none;
}
body.touch #boost-btn { display: flex; }
#boost-btn.active { transform: translateY(4px); box-shadow: 0 1px 0 var(--btn-shadow); filter: brightness(1.12); }
/* На тач-устройствах миникарту — влево, чтобы не мешала кнопке буста справа */
body.touch #minimap-wrap { left: 12px; right: auto; }

/* ---------------- 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); }
}

/* =====================================================================
 * Загрузочный сплэш
 * ===================================================================== */
#splash {
  position: fixed; inset: 0; z-index: 100;
  background: #05070d;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
#splash.splash-hide { opacity: 0; pointer-events: none; }
.splash-box { display: flex; flex-direction: column; align-items: center; gap: 30px; padding: 24px; }
#splash-logo { max-width: min(70vw, 280px); max-height: 280px; display: block; }
.splash-word {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(34px, 9vw, 52px); letter-spacing: -0.02em; color: #f2f3f7;
  -webkit-text-stroke: 3px #0a0e1a; paint-order: stroke fill;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
}
.splash-word .brand-dot { color: var(--accent); }
.splash-loader {
  width: min(60vw, 220px); height: 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(0, 0, 0, 0.55); overflow: hidden;
}
.splash-bar { width: 0%; height: 100%; background: var(--accent); transition: width 0.2s ease; }

/* =====================================================================
 * Мультяшный стиль в духе Brawl Stars: жирные тёмные обводки + «пухлые»
 * пружинящие кнопки. Шрифт остаётся прежний.
 * ===================================================================== */
:root { --ink: #0a0e1a; --btn-shadow: #0a9184; }

.brand {
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
  font-size: clamp(26px, 8.5vw, 40px);   /* влезает и на узких экранах */
  white-space: nowrap;
}
.go-title {
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
}

.card {
  border: 3px solid rgba(0, 0, 0, 0.55);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.28), 0 18px 40px rgba(0, 0, 0, 0.6);
}

.panel {
  border: 2px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3), 0 6px 14px rgba(0, 0, 0, 0.4);
}
.stat-value, .go-val { text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }

/* Пружинящие кнопки: тёмная обводка + «толщина» снизу, вдавливание по клику */
.btn {
  border: 3px solid var(--ink);
  border-radius: 14px;
  text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700;
  box-shadow: 0 5px 0 var(--btn-shadow), 0 9px 12px rgba(0, 0, 0, 0.45);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.22);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--btn-shadow), 0 3px 6px rgba(0, 0, 0, 0.4); }
.btn-ghost {
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.5), 0 9px 12px rgba(0, 0, 0, 0.4);
  color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}
.btn-ghost:hover { filter: none; }
.btn-ghost:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }

.icon-btn { border-width: 2px; border-color: rgba(0, 0, 0, 0.5); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }

.swatch { border-width: 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4), 0 2px 0 rgba(0, 0, 0, 0.3); }
.cz-type { display: flex; flex-direction: column; align-items: center; justify-content: center; border-width: 2px; }
.cz-tab.is-active { box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }

/* Языковые кнопки с флажками */
.lang-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  border-width: 2px; min-width: 0;            /* чтобы длинные названия не ломали сетку */
  font-size: 13px; padding: 10px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lang-flag {
  width: 20px; height: 14px; object-fit: cover; border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); flex: 0 0 auto;
}

/* Кнопки качества графики */
.gfx-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.gfx-btn {
  padding: 10px 6px; border: 2px solid var(--border); border-radius: 10px;
  background: rgba(0, 0, 0, 0.2); color: var(--muted);
  font-size: 13px; font-family: inherit; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.gfx-btn:hover { color: var(--text); }
.gfx-btn.is-active { border-color: var(--accent); color: var(--text); background: var(--surface); }

/* Заглушка «Скоро» (флаги) */
.cz-soon { display: flex; align-items: center; justify-content: center; min-height: 130px; }
.cz-soon-badge {
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-size: 15px;
  padding: 12px 22px; border: 2px dashed var(--border-strong); border-radius: 12px;
}
/* Мини-тег «Скоро» на кнопке «Кольца» */
.cz-type.is-soon { opacity: 0.55; cursor: not-allowed; }
.cz-type .soon-tag {
  font-size: 8px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent); margin-top: 2px; font-weight: 700;
}

/* Уведомление об убийстве (фраг) */
#kill-feed {
  position: absolute; top: 66px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; z-index: 5;
}
.kill-item {
  display: flex; align-items: center; gap: 6px;
  background: rgba(14, 15, 22, 0.82);
  border: 2px solid var(--accent); border-radius: 999px;
  padding: 6px 15px; font-weight: 700; font-size: 14px; color: #fff;
  white-space: nowrap; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  opacity: 0; transform: translateY(-8px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.kill-item.show { opacity: 1; transform: translateY(0) scale(1); }
.kill-x { font-weight: 800; }

/* Футер настроек с лого и версией */
.set-footer {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border);
}
.set-logo { width: auto; height: 40px; max-width: 130px; object-fit: contain; flex: 0 0 auto; }
.set-footer-text { text-align: left; }
.sf-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: 0.02em; color: var(--text); }
.sf-sub { font-size: 10px; color: var(--muted); letter-spacing: 0.06em; margin-top: 1px; }
.sf-link {
  display: inline-block; margin-top: 5px;
  font-size: 11px; color: var(--accent); text-decoration: none;
  border-bottom: 1px solid rgba(20, 224, 200, 0.4);
}
.sf-link:hover { border-bottom-color: var(--accent); }
