/* ═══════════════════════════════════════════════════
   МОРСКОЙ БОЙ — style.css
════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Inter:wght@400;500;600&display=swap');

/* ─── ТЁМНАЯ ТЕМА (всегда, везде) ───────────────── */
:root {
  --bg:          #111111;
  --bg2:         #1e1e1e;
  --accent:      #e0e0e0;
  --accent-text: #111111;
  --text:        #e8e8e8;
  --hint:        #666666;
  --link:        #aaaaaa;

  --cell-empty:   #1c1c1c;
  --cell-ship:    #3d3d3d;
  --cell-miss:    #252525;
  --cell-hover:   rgba(200,200,200,.15);
  --cell-preview: rgba(200,200,200,.22);
  --cell-invalid: rgba(220,60,60,.35);
  --cell-hit-bg:  #2a2a2a;

  --green:  #5cb85c;
  --red:    #d9534f;
  --yellow: #d4ac0d;
  --blue:   #aaaaaa;

  --radius: 10px;
  --font-ui: 'Inter', sans-serif;
  --font-hd: 'Orbitron', monospace;

  --label-size: 20px;
  --cell-size: calc((100vw - 24px - var(--label-size) - 20px) / 10);
}

/* ─── СВЕТЛАЯ ТЕМА (только явный класс от JS) ───── */
body.theme-light {
  --bg:          #f0f0f0;
  --bg2:         #e0e0e0;
  --accent:      #333333;
  --accent-text: #ffffff;
  --text:        #1a1a1a;
  --hint:        #777777;
  --link:        #444444;

  --cell-empty:   #d0d0d0;
  --cell-ship:    #888888;
  --cell-miss:    #c0c0c0;
  --cell-hover:   rgba(0,0,0,.1);
  --cell-preview: rgba(0,0,0,.18);
  --cell-invalid: rgba(220,60,60,.3);
  --cell-hit-bg:  #bbbbbb;

  --green:  #2e7d32;
  --yellow: #b8860b;
  --blue:   #444444;
}

/* ─── СБРОС ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ─── ЭКРАНЫ ─────────────────────────────────────── */
.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top,0) 0 env(safe-area-inset-bottom,0) 0;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  overflow-y: auto; overflow-x: hidden;
}
.screen.active { opacity: 1; pointer-events: all; }

/* ─── ЗАГРУЗКА ───────────────────────────────────── */
#screen-loading { align-items: center; justify-content: center; }
.loading-inner { text-align: center; }
.loading-grid {
  display: grid; grid-template-columns: repeat(3, 18px); gap: 6px;
  margin: 0 auto 20px;
}
.loading-grid span {
  width: 18px; height: 18px;
  background: var(--accent); border-radius: 3px; opacity: .2;
  animation: cell-blink 1.2s ease-in-out infinite;
}
.loading-grid span:nth-child(1){animation-delay:0s}
.loading-grid span:nth-child(2){animation-delay:.1s}
.loading-grid span:nth-child(3){animation-delay:.2s}
.loading-grid span:nth-child(4){animation-delay:.3s}
.loading-grid span:nth-child(5){animation-delay:.15s}
.loading-grid span:nth-child(6){animation-delay:.4s}
.loading-grid span:nth-child(7){animation-delay:.5s}
.loading-grid span:nth-child(8){animation-delay:.35s}
.loading-grid span:nth-child(9){animation-delay:.6s}
@keyframes cell-blink { 0%,100%{opacity:.15;transform:scale(.9)} 50%{opacity:1;transform:scale(1)} }
.loading-text { font-family: var(--font-hd); font-size: 22px; letter-spacing: 6px; color: var(--accent); animation: text-pulse 1.5s ease-in-out infinite; }
@keyframes text-pulse { 0%,100%{opacity:.6} 50%{opacity:1} }

/* ─── МЕНЮ ───────────────────────────────────────── */
.menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 0;
}
.header-right { display: flex; align-items: center; gap: 12px; }
.btn-sound {
  background: var(--bg2); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 7px; cursor: pointer;
  color: var(--text); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: color .2s;
}
.btn-sound.muted { color: var(--hint); }
.sound-mute-line { stroke: var(--hint); stroke-width: 2; stroke-linecap: round; }

.user-info { display: flex; align-items: center; gap: 10px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--bg2); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; border: 2px solid var(--accent); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.username { font-weight: 600; font-size: 15px; display: block; }
.user-tag { color: var(--hint); font-size: 12px; }
.stats-mini { display: flex; gap: 16px; }
.stat-item { text-align: center; }
.stat-val { display: block; font-family: var(--font-hd); font-size: 18px; color: var(--accent); }
.stat-lbl { font-size: 11px; color: var(--hint); text-transform: uppercase; letter-spacing: 1px; }

.menu-hero { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 160px; overflow: hidden; }
.hero-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(10,1fr); grid-template-rows: repeat(6,1fr); gap: 2px; opacity: .15; }
.hero-grid-cell { background: var(--cell-empty); border-radius: 2px; transition: background .3s, opacity .3s; }
.hero-grid-cell.active { background: var(--accent); opacity: 1; }
.hero-grid-cell.hit    { background: var(--red);    opacity: 1; }
.hero-title { font-family: var(--font-hd); font-size: clamp(26px,8vw,40px); font-weight: 900; letter-spacing: 4px; text-align: center; line-height: 1.15; position: relative; z-index: 1; }

.menu-nav { padding: 0 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ─── КНОПКИ ─────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--radius);
  font-family: var(--font-ui); font-size: 15px; font-weight: 600;
  border: none; cursor: pointer;
  transition: transform .12s, opacity .12s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); opacity: .9; }
.btn-primary   { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: var(--bg2);    color: var(--text); border: 1px solid rgba(255,255,255,.1); }
.btn-ghost     { background: transparent;   color: var(--hint); border: 1px solid rgba(255,255,255,.08); }
.btn-danger    { background: var(--red);    color: #fff; }
.btn-large     { padding: 15px 20px; font-size: 16px; }
.btn-sm        { padding: 8px 14px;  font-size: 13px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-col { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* ─── PAGE HEADER ────────────────────────────────── */
.page-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.page-header h2 { font-family: var(--font-hd); font-size: 16px; font-weight: 700; letter-spacing: 2px; }
.btn-back { background: none; border: none; color: var(--hint); font-size: 14px; cursor: pointer; padding: 4px; font-family: var(--font-ui); }

/* ─── РЕЖИМ ИГРЫ ─────────────────────────────────── */
.mode-list { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.mode-card { display: flex; align-items: center; gap: 14px; background: var(--bg2); border: 1px solid rgba(255,255,255,.07); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: border-color .2s; text-align: left; color: var(--text); }
.mode-card:active { transform: scale(.98); }
.mode-card:hover  { border-color: var(--accent); }
.mode-info { flex: 1; }
.mode-info strong { display: block; font-size: 15px; }
.mode-info span   { color: var(--hint); font-size: 13px; }
.mode-badge { padding: 3px 9px; border-radius: 30px; font-size: 11px; font-weight: 700; letter-spacing: 1px; background: var(--bg); color: var(--hint); }
.mode-badge.online { background: rgba(38,166,91,.2); color: var(--green); }
.mode-badge.medium { background: rgba(244,166,29,.2); color: var(--yellow); }
.mode-badge.hard   { background: rgba(230,57,70,.2);  color: var(--red); }

/* ─── ТГ ПРОМО БАББЛ ──────────────────────────────── */
.tg-promo-banner {
  position: relative;
  margin: 10px 16px 0;
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 12px 36px 12px 14px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  flex-shrink: 0;
}
body.theme-light .tg-promo-banner { border-color: rgba(0,0,0,.1); }
.tg-promo-banner a { color: var(--link); text-decoration: underline; word-break: break-all; }
.tg-promo-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--hint); font-size: 16px; line-height: 1;
  padding: 2px 4px;
}
.tg-promo-banner.hidden { display: none; }

/* ─── РАССТАНОВКА ────────────────────────────────── */
.placement-controls { display: flex; gap: 8px; padding: 8px 16px 4px; flex-wrap: wrap; flex-shrink: 0; }

/* Корабли в доке — фиксированная высота, поле не прыгает */
.placement-ships {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 4px 16px;
  flex-shrink: 0;
  height: 72px;      /* фиксированная высота — 2 ряда */
  overflow-y: auto;
  align-content: flex-start;
  touch-action: none;
}

.ship-piece {
  display: flex; gap: 2px;
  cursor: grab; touch-action: none;
  padding: 4px; border-radius: 5px;
  border: 2px solid transparent;
  background: var(--bg2);
  transition: border-color .2s, opacity .2s;
  flex-shrink: 0;
}
.ship-piece:active { cursor: grabbing; }
.ship-piece.selected { border-color: var(--accent); box-shadow: 0 0 8px rgba(200,200,200,.2); }
.ship-piece.placed   { opacity: .25; pointer-events: none; }
.ship-piece.vertical { flex-direction: column; }
.ship-cell { width: 22px; height: 22px; background: var(--cell-ship); border-radius: 3px; }

.btn-ready-sticky { margin: 8px 16px 16px; flex-shrink: 0; }

/* ─── ПОЛЕ (ДОСКА) ───────────────────────────────── */
.board-wrap { width: 100%; padding: 6px 12px; box-sizing: border-box; flex-shrink: 0; }

.board-outer { display: flex; flex-direction: row; gap: 2px; width: 100%; align-items: flex-start; }

.board-labels-col {
  display: flex; flex-direction: column;
  flex-shrink: 0; width: var(--label-size); gap: 2px;
  padding-top: calc(var(--label-size) + 2px);
}
.board-labels-col .board-label { width: 100%; height: var(--cell-size); }

.board-container { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }

.board-labels-row { display: grid; grid-template-columns: repeat(10,1fr); gap: 2px; }
.board-labels-row .board-label { height: var(--label-size); }

.board-label { display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--hint); font-family: var(--font-hd); }

.board { display: grid; grid-template-columns: repeat(10,1fr); grid-template-rows: repeat(10,var(--cell-size)); gap: 2px; width: 100%; }

/* ─── КЛЕТКИ ─────────────────────────────────────── */
.cell { width: 100%; height: var(--cell-size); background: var(--cell-empty); border-radius: 3px; transition: background .1s; cursor: default; position: relative; overflow: hidden; }
.cell.ship { background: var(--cell-ship); }

.cell.hit  { background: var(--cell-hit-bg); }
.cell.hit::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, var(--red) 0px, var(--red) 2px, transparent 2px, transparent 6px); opacity: .85; pointer-events: none; }

.cell.sunk { background: var(--red); }
.cell.sunk::after { display: none; }

.cell.miss { background: var(--cell-miss); }
.cell.miss::before { content: ''; position: absolute; top:50%; left:50%; transform: translate(-50%,-50%); width: 4px; height: 4px; border-radius: 50%; background: #555; pointer-events: none; }

.cell.preview { background: var(--cell-preview); }
.cell.invalid { background: var(--cell-invalid); }
.cell.hoverable { cursor: pointer; }
.cell.hoverable:hover { background: var(--cell-hover); }
.cell.dimmed { opacity: .45; pointer-events: none; }

/* ─── ОЖИДАНИЕ ───────────────────────────────────── */
#screen-waiting { align-items: center; justify-content: center; }
.waiting-inner {
  text-align: center;
  padding: 24px 20px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.waiting-inner h2 { margin: 16px 0 2px; font-family: var(--font-hd); font-size: 18px; }
.waiting-inner > p { color: var(--hint); font-size: 14px; min-height: 18px; }

.invite-block { margin-top: 16px; width: 100%; text-align: left; }
.invite-block.hidden { display: none; }
.invite-label { font-size: 12px; color: var(--hint); margin-bottom: 6px; text-align: center; display: block; }
.invite-link-row {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg2); border-radius: var(--radius);
  padding: 8px 10px;
  width: 100%; overflow: hidden;
}
/* Ссылка обрезается — НЕ выходит за экран */
.invite-link {
  flex: 1; min-width: 0;
  font-size: 11px; color: var(--link);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.invite-link-row .btn { flex-shrink: 0; }

/* Кнопка отмены — центрирована */
#btn-cancel-wait { margin-top: 16px; align-self: center; }

.radar-anim { position: relative; width: 80px; height: 80px; margin: 0 auto; }
.radar-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: radar-expand 2s ease-out infinite; }
.radar-ring:nth-child(2) { animation-delay: .66s; }
.radar-ring:nth-child(3) { animation-delay: 1.33s; }
.radar-dot  { position: absolute; top:50%; left:50%; transform: translate(-50%,-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
@keyframes radar-expand { 0%{opacity:.8;transform:scale(.2)} 100%{opacity:0;transform:scale(1)} }

/* ─── ИГРОВОЙ ЭКРАН ──────────────────────────────── */
.game-topbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; flex-shrink: 0; }

.game-toggle { display: flex; background: var(--bg2); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.toggle-btn  { padding: 7px 12px; font-size: 13px; font-weight: 600; border: none; cursor: pointer; background: transparent; color: var(--hint); transition: background .2s, color .2s; }
.toggle-btn.active { background: var(--accent); color: #111; }

.game-status { flex: 1; text-align: center; font-family: var(--font-hd); font-size: 13px; letter-spacing: 1px; color: var(--accent); }

.ships-left { display: none; }
/* Fix 5: поле врага (куда МЫ бьём) — яркое, это наши атаки */
.enemy-board .cell.hit::after  { opacity: .85; }
.enemy-board .cell.sunk        { background: var(--red); }
.enemy-board .cell.sunk::after { display: none; }
/* Наше поле (куда бьёт противник) — приглушённое */
#my-board .cell.hit::after     { opacity: .42; }
#my-board .cell.sunk           { background: rgba(217,83,79,.5); }
#my-board .cell.sunk::after    { display: none; }

.shot-feedback { display: none !important; }

.game-footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
.opponent-info { font-size: 14px; }

.enemy-fleet { padding: 4px 12px 8px; flex-shrink: 0; }
.enemy-fleet-label { font-size: 11px; color: var(--hint); text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 5px; }
.enemy-fleet-ships { display: flex; flex-wrap: wrap; gap: 5px; align-items: flex-end; }
.fleet-ship { display: flex; gap: 2px; transition: opacity .3s; }
.fleet-ship.sunk { opacity: .2; }
.fleet-cell { width: 11px; height: 11px; background: var(--cell-ship); border-radius: 2px; }
.fleet-ship.sunk .fleet-cell { background: var(--red); }

/* ─── ДЕСКТОП РЕЖИМ ──────────────────────────────── */
@media (min-width: 768px) {
  :root {
    --cell-size: 38px;
    --label-size: 22px;
  }

  /* На десктопе board имеет фиксированную ширину (не растягивается) */
  .board {
    grid-template-columns: repeat(10, var(--cell-size));
    grid-template-rows:    repeat(10, var(--cell-size));
    width: auto;
  }
  .cell { width: var(--cell-size); height: var(--cell-size); }
  .board-labels-row { grid-template-columns: repeat(10, var(--cell-size)); }
  .board-labels-col .board-label { width: var(--label-size); height: var(--cell-size); }
  .board-labels-row .board-label { height: var(--label-size); width: var(--cell-size); }
  .board-wrap { width: auto; padding: 6px 0; }
  .board-outer { width: auto; }

  /* Игровой экран — два поля в ряд */
  #screen-game.desktop .game-boards-row {
    display: flex;
    flex-direction: row;
    gap: 32px;
    padding: 8px 24px;
    flex: 1;
    align-items: flex-start;
    justify-content: center;
  }

  #screen-game.desktop #game-board-wrap,
  #screen-game.desktop #my-board-wrap {
    display: block !important;
    flex: 0 0 auto;
    width: auto;
    padding: 6px 0;
  }

  /* Скрываем тогл на десктопе */
  #screen-game.desktop #field-toggle { display: none; }

  /* Бургер — только на мобайл */
  .burger-btn { display: none; }

  /* Сдаться — показываем в футере на десктопе */
  .desktop-only { display: flex !important; }

  .ship-cell { width: 32px; height: 32px; }
}

/* Обёртка для двух полей на десктопе (добавляется через JS) */
.game-boards-row { display: contents; }
#screen-game.desktop .game-boards-row { display: flex !important; flex-direction: row; gap: 24px; padding: 0 24px; justify-content: center; }

/* Заголовки над полями на десктопе */
.board-title { font-size: 12px; color: var(--hint); text-transform: uppercase; letter-spacing: 2px; text-align: center; padding-bottom: 4px; font-family: var(--font-hd); }

/* Тряска при невозможности повернуть */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.shake { animation: shake .35s ease; }

/* mobile-only — скрывается на десктопе */
.mobile-only { display: flex; }
@media (min-width: 768px) { .mobile-only { display: none !important; } }
.board-col { display: flex; flex-direction: column; align-items: center; }

/* ─── БУРГЕР МЕНЮ ────────────────────────────────── */
.burger-btn {
  width: 36px; height: 36px;
  background: var(--bg2); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  flex-shrink: 0; padding: 0;
}
.burger-btn span { display: block; width: 16px; height: 2px; background: var(--text); border-radius: 2px; }

.burger-overlay { position: fixed; inset: 0; z-index: 199; background: rgba(0,0,0,.4); }
.burger-overlay.hidden { display: none; }

.burger-menu {
  position: fixed; top: 0; right: -220px; bottom: 0;
  width: 220px; z-index: 200;
  background: var(--bg2); border-left: 1px solid rgba(255,255,255,.1);
  display: flex; flex-direction: column;
  transition: right .25s ease;
  padding-top: env(safe-area-inset-top, 0);
}
.burger-menu.open { right: 0; }

.burger-menu-header { padding: 18px 20px 14px; font-family: var(--font-hd); font-size: 13px; letter-spacing: 2px; color: var(--hint); border-bottom: 1px solid rgba(255,255,255,.07); }

.burger-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; background: transparent;
  border: none; border-bottom: 1px solid rgba(255,255,255,.05);
  color: var(--text); font-size: 15px; cursor: pointer;
  text-align: left; font-family: var(--font-ui);
  transition: background .15s;
}
.burger-item:active { background: rgba(255,255,255,.06); }
.burger-item.muted  { color: var(--hint); }
.burger-item.danger { color: var(--red); }
.burger-divider { flex: 1; }

/* ─── КОНЕЦ ИГРЫ ─────────────────────────────────── */
#screen-gameover { align-items: center; justify-content: center; }
.gameover-inner { text-align: center; padding: 24px; }
.gameover-icon  { font-size: 64px; }
.gameover-title { font-family: var(--font-hd); font-size: clamp(28px,8vw,42px); margin: 12px 0 6px; }
.gameover-sub   { color: var(--hint); margin-bottom: 24px; }
.gameover-stats { display: flex; gap: 20px; justify-content: center; margin-bottom: 8px; }
.go-stat { text-align: center; }
.go-stat span  { display: block; font-family: var(--font-hd); font-size: 24px; }
.go-stat small { color: var(--hint); font-size: 12px; }

/* ─── РЕЙТИНГ ────────────────────────────────────── */
.rating-info-btn {
  margin-left: auto; width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg2); border: 1px solid var(--hint);
  color: var(--hint); font-size: 13px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.rating-info-btn:active { opacity: .7; }
.rating-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--hint);
  padding: 12px 16px 6px;
  display: flex; align-items: center; gap: 8px;
}
.rating-hint { font-weight: 400; font-size: 10px; letter-spacing: 0; text-transform: none; }

.my-record-card {
  margin: 0 16px 8px;
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.my-record-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  text-align: center;
}
.my-record-val  { font-family: var(--font-hd); font-size: 20px; color: var(--accent); display: block; }
.my-record-lbl  { font-size: 10px; color: var(--hint); text-transform: uppercase; letter-spacing: 1px; }
.my-record-name { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.rating-score-badge {
  display: inline-block; background: var(--accent); color: var(--accent-text);
  border-radius: 20px; padding: 2px 10px; font-size: 12px; font-weight: 700;
  margin-left: 8px; vertical-align: middle;
}

/* ─── ЛИДЕРБОРД ────────────────────────────────── */
.leaderboard-list { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.lb-item { display: flex; align-items: center; gap: 12px; background: var(--bg2); border-radius: var(--radius); padding: 10px 14px; }
.lb-item-me { border: 1px solid var(--accent); }
.lb-rank { font-family: var(--font-hd); font-size: 16px; width: 28px; color: var(--hint); text-align: center; }
.lb-rank.gold{color:#ffd700} .lb-rank.silver{color:#c0c0c0} .lb-rank.bronze{color:#cd7f32}
.lb-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.lb-info   { flex: 1; }
.lb-info strong { display: block; font-size: 14px; }
.lb-info small  { color: var(--hint); font-size: 12px; }
.lb-wins   { font-family: var(--font-hd); color: var(--green); font-size: 16px; }

.stats-profile { display: flex; flex-direction: column; align-items: center; padding: 20px 0 12px; }
.stats-avatar  { width: 60px; height: 60px; border-radius: 50%; background: var(--bg2); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; border: 3px solid var(--accent); margin-bottom: 10px; }
.stats-name    { font-family: var(--font-hd); font-size: 16px; letter-spacing: 2px; }
.stats-grid    { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 0 16px 16px; }
.stat-card     { background: var(--bg2); border-radius: var(--radius); padding: 12px 8px; text-align: center; border-left: 3px solid var(--hint); }
.stat-card.green{border-color:var(--green)} .stat-card.red{border-color:var(--red)} .stat-card.yellow{border-color:var(--yellow)} .stat-card.blue{border-color:var(--blue)}
.stat-card span  { display: block; font-family: var(--font-hd); font-size: 22px; }
.stat-card small { color: var(--hint); font-size: 11px; }
.section-title   { padding: 4px 16px 10px; font-family: var(--font-hd); font-size: 13px; letter-spacing: 2px; color: var(--hint); }
.history-list    { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.history-item    { display: flex; align-items: center; gap: 12px; background: var(--bg2); border-radius: var(--radius); padding: 10px 14px; }
.history-icon    { font-size: 18px; }
.history-info    { flex: 1; font-size: 14px; }
.history-info span { color: var(--hint); font-size: 12px; display: block; }
.history-time    { font-size: 11px; color: var(--hint); }

/* ─── НАСТРОЙКИ ──────────────────────────────────── */
.settings-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.setting-item  { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 15px; }
.setting-input { background: var(--bg2); border: 1px solid rgba(255,255,255,.1); border-radius: 6px; color: var(--text); padding: 6px 10px; font-size: 13px; width: 50%; outline: none; }
.setting-input:focus { border-color: var(--accent); }

.toggle-switch { position: relative; width: 44px; height: 24px; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-track { position: absolute; inset: 0; background: var(--bg); border-radius: 30px; border: 1px solid rgba(255,255,255,.15); transition: background .25s; }
.toggle-track::before { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--hint); transition: transform .25s, background .25s; }
.toggle-switch input:checked + .toggle-track { background: rgba(200,200,200,.2); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(20px); background: var(--accent); }

/* ─── МОДАЛКА ────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--bg2); border-radius: 14px; padding: 24px; width: calc(100% - 48px); max-width: 320px; border: 1px solid rgba(255,255,255,.1); }
.modal h3 { font-family: var(--font-hd); font-size: 15px; letter-spacing: 2px; margin-bottom: 10px; }
.modal p  { color: var(--hint); font-size: 14px; line-height: 1.5; }
.modal-btns { display: flex; gap: 8px; margin-top: 18px; }
.modal-btns .btn { flex: 1; }

/* ─── УТИЛИТЫ ────────────────────────────────────── */
.empty-state { color: var(--hint); text-align: center; padding: 32px 16px; font-size: 14px; }
.hidden { display: none !important; }
.desktop-only { display: none; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }
