/* ═══════════════════════════════════════════════════════════
   Угадай флаг — мини-приложение Telegram
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:            #080b14;
  --bg-soft:       #0f1421;
  --surface:       rgba(255, 255, 255, 0.055);
  --surface-hi:    rgba(255, 255, 255, 0.09);
  --stroke:        rgba(255, 255, 255, 0.10);
  --stroke-hi:     rgba(255, 255, 255, 0.18);

  --text:          #eef2ff;
  --muted:         #93a0bd;
  --faint:         #64708d;

  --accent:        #6366f1;
  --accent-2:      #a855f7;
  --accent-3:      #22d3ee;
  --ok:            #22c55e;
  --ok-soft:       rgba(34, 197, 94, 0.16);
  --bad:           #f43f5e;
  --bad-soft:      rgba(244, 63, 94, 0.16);
  --gold:          #fbbf24;

  --r-lg:          26px;
  --r-md:          18px;
  --r-sm:          13px;

  --shadow:        0 18px 50px -18px rgba(0, 0, 0, 0.85);
  --shadow-glow:   0 0 0 1px var(--stroke), 0 20px 45px -20px rgba(99, 102, 241, 0.55);

  --safe-top:      env(safe-area-inset-top, 0px);
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
  --ease:          cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
}

/* ─────────── фон: медленно плывущие пятна ─────────── */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 50% -10%, #141c33 0%, transparent 70%),
    var(--bg);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  will-change: transform;
}

.blob-1 {
  width: 60vw; height: 60vw;
  top: -18vw; left: -14vw;
  background: radial-gradient(circle, #6366f1 0%, transparent 68%);
  animation: drift-1 22s ease-in-out infinite;
}

.blob-2 {
  width: 55vw; height: 55vw;
  top: 22vh; right: -20vw;
  background: radial-gradient(circle, #a855f7 0%, transparent 68%);
  animation: drift-2 27s ease-in-out infinite;
}

.blob-3 {
  width: 48vw; height: 48vw;
  bottom: -14vw; left: 12vw;
  background: radial-gradient(circle, #22d3ee 0%, transparent 68%);
  animation: drift-3 31s ease-in-out infinite;
  opacity: 0.32;
}

@keyframes drift-1 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(6vw, 5vh, 0) scale(1.12); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); }
  50%      { transform: translate3d(-7vw, 7vh, 0) scale(0.92); }
}
@keyframes drift-3 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(0.95); }
  50%      { transform: translate3d(8vw, -6vh, 0) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
}

/* ─────────── каркас экранов ─────────── */
#app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 14px) 18px calc(var(--safe-bottom) + 26px);
}

.screen { display: none; animation: screen-in 0.42s var(--ease); }
.screen.is-active { display: block; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ─────────── шапка главного экрана ─────────── */
.hero { text-align: center; padding: 20px 0 26px; }

.hero-globe {
  font-size: 60px;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 12px 26px rgba(99, 102, 241, 0.55));
  animation: float 5.5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-10px) rotate(4deg); }
}

.hero-title {
  margin: 14px 0 6px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.6px;
  background: linear-gradient(120deg, #ffffff 10%, #c7d2fe 45%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

/* ─────────── карточки режимов ─────────── */
.modes { display: grid; gap: 13px; }

.mode-card {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 17px 16px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  transition: transform 0.22s var(--ease), border-color 0.22s, background 0.22s;
  font-family: inherit;
}

.mode-card:active { transform: scale(0.975); background: var(--surface-hi); }

.mode-icon {
  flex: 0 0 54px;
  height: 54px;
  display: grid;
  place-items: center;
  font-size: 26px;
  border-radius: var(--r-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.mode-icon-type   { background: linear-gradient(140deg, #6366f1, #a855f7); }
.mode-icon-choice { background: linear-gradient(140deg, #06b6d4, #3b82f6); }

.mode-body { flex: 1; min-width: 0; }
.mode-body h2 { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.mode-body p  { margin: 0; font-size: 12.8px; line-height: 1.45; color: var(--muted); }

.mode-arrow {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 19px;
  transition: transform 0.22s var(--ease), color 0.22s;
}
.mode-card:active .mode-arrow { transform: translateX(4px); color: var(--accent-2); }

/* ─────────── настройки раунда ─────────── */
.settings {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  overflow: hidden;
}

.settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
}
.settings summary::-webkit-details-marker { display: none; }

.settings-label { flex: 0 0 auto; white-space: nowrap; }

.settings-hint {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--faint);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-body { padding: 2px 16px 16px; }
.filter-group + .filter-group { margin-top: 14px; }

.filter-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 9px;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.chip:active { transform: scale(0.94); }

.chip.is-on {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 6px 18px -8px var(--accent);
}

/* Длина раунда, которая не влезает в выборку: жать можно, но видно, что коротко. */
.chip.is-capped {
  opacity: 0.45;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.pool-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--faint);
}

.pool-note b { color: var(--muted); font-weight: 700; }

.pool-note.is-warn {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: var(--r-sm);
  padding: 8px 11px;
}
.pool-note.is-warn b { color: #fde68a; }

/* ─────────── нижняя навигация ─────────── */
.home-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 16px; }

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s;
}
.nav-btn:active { transform: scale(0.96); background: var(--surface-hi); }
.nav-btn span { font-size: 17px; }

/* ─────────── игровая шапка ─────────── */
.game-bar { display: flex; align-items: center; gap: 12px; padding: 6px 0 4px; }

.icon-btn {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-family: inherit;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.18s var(--ease), color 0.18s;
}
.icon-btn:active { transform: scale(0.9); color: var(--text); }

.progress {
  flex: 1;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent-3), var(--accent), var(--accent-2));
  transition: width 0.5s var(--ease);
}

.score-pill {
  flex: 0 0 auto;
  padding: 7px 13px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 100px;
}
.score-slash { color: var(--faint); margin: 0 1px; }
#asked-value { color: var(--muted); }

.streak-line {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.progress-count {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

.streak {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  padding: 3px 11px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 100px;
  animation: pop 0.42s var(--ease);
}

@keyframes pop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.14); }
  100% { transform: scale(1); opacity: 1; }
}

/* ─────────── карточка флага ─────────── */
.flag-stage { padding: 6px 0 4px; perspective: 1200px; }

.flag-card {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--stroke-hi);
  box-shadow: var(--shadow), 0 0 60px -30px rgba(99, 102, 241, 0.8);
  transform-style: preserve-3d;
}

.flag-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.flag-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.20) 0%, transparent 42%);
}

.flag-card.is-new { animation: flag-in 0.5s var(--ease); }

@keyframes flag-in {
  0%   { opacity: 0; transform: rotateY(-22deg) scale(0.9); }
  100% { opacity: 1; transform: none; }
}

.flag-card.shake { animation: shake 0.45s ease; }

@keyframes shake {
  0%, 100%     { transform: translateX(0); }
  20%, 60%     { transform: translateX(-9px); }
  40%, 80%     { transform: translateX(9px); }
}

.question-title {
  margin: 18px 0 14px;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* ─────────── ввод ответа ─────────── */
.answer-block { display: grid; gap: 11px; }

.input-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 6px 6px 17px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 100px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-row:focus-within {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

#answer-input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: none;
  outline: none;
}
#answer-input::placeholder { color: var(--faint); font-weight: 500; }

.send-btn {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  font-size: 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.18s var(--ease), opacity 0.2s;
  box-shadow: 0 8px 22px -10px var(--accent);
}
.send-btn:active { transform: scale(0.9); }
.send-btn:disabled { opacity: 0.4; cursor: default; }

.ghost-btn {
  width: 100%;
  padding: 14px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform 0.18s var(--ease), color 0.18s, background 0.18s;
}
.ghost-btn:active { transform: scale(0.97); color: var(--text); background: var(--surface-hi); }

/* ─────────── варианты ответа ─────────── */
.options { gap: 10px; }

.option {
  position: relative;
  width: 100%;
  padding: 16px 18px;
  text-align: left;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s var(--ease), background 0.2s, border-color 0.2s;
}

.option:active { transform: scale(0.98); background: var(--surface-hi); }

/* Верный вариант: зелёная заливка и импульс-волна от кнопки. */
.option.is-correct {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.30), rgba(34, 197, 94, 0.15));
  border-color: rgba(34, 197, 94, 0.75);
  color: #dcfce7;
  box-shadow: 0 10px 28px -12px rgba(34, 197, 94, 0.9);
  animation: option-correct 0.62s var(--ease);
}

@keyframes option-correct {
  0%   { transform: scale(1);     box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  45%  { transform: scale(1.035); box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
  100% { transform: scale(1);     box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Промах: красная заливка и короткая тряска. */
.option.is-wrong {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.30), rgba(244, 63, 94, 0.15));
  border-color: rgba(244, 63, 94, 0.75);
  color: #ffe4e6;
  box-shadow: 0 10px 28px -12px rgba(244, 63, 94, 0.85);
  animation: option-wrong 0.5s ease;
}

@keyframes option-wrong {
  0%, 100% { transform: translateX(0); }
  15%      { transform: translateX(-8px); }
  30%      { transform: translateX(8px); }
  45%      { transform: translateX(-5px); }
  60%      { transform: translateX(5px); }
  75%      { transform: translateX(-2px); }
}

/* Если игрок ошибся — верный ответ проявляется чуть позже, отдельным акцентом. */
.option.is-correct.is-reveal {
  animation: option-reveal 0.55s var(--ease) 0.18s both;
}

@keyframes option-reveal {
  0%   { transform: scale(0.98); opacity: 0.45; }
  45%  { transform: scale(1.045); opacity: 1; }
  100% { transform: scale(1);     opacity: 1; }
}

.option.is-dim {
  opacity: 0.32;
  transform: scale(0.985);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.option:disabled { cursor: default; }

.option::after {
  content: attr(data-mark);
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
}

.option.is-correct::after,
.option.is-wrong::after {
  animation: mark-pop 0.42s var(--ease) backwards;
}
.option.is-correct.is-reveal::after { animation-delay: 0.26s; }

@keyframes mark-pop {
  0%   { transform: translateY(-50%) scale(0);    opacity: 0; }
  60%  { transform: translateY(-50%) scale(1.3);  opacity: 1; }
  100% { transform: translateY(-50%) scale(1);    opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .option.is-correct,
  .option.is-wrong,
  .option.is-correct.is-reveal,
  .option.is-correct::after,
  .option.is-wrong::after { animation: none; }
}

/* ─────────── плашка результата ─────────── */
.verdict {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  background: rgba(4, 6, 12, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.24s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.verdict-card {
  width: 100%;
  max-width: 488px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: center;
  padding: 18px;
  background: linear-gradient(160deg, #161d31, #10141f);
  border: 1px solid var(--stroke-hi);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  animation: slide-up 0.4s var(--ease);
}

@keyframes slide-up {
  from { transform: translateY(90px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.verdict-card.ok   { border-color: rgba(34, 197, 94, 0.45); }
.verdict-card.bad  { border-color: rgba(244, 63, 94, 0.45); }

.verdict-icon {
  grid-row: 1;
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  font-size: 25px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}
.verdict-card.ok  .verdict-icon { background: var(--ok-soft); }
.verdict-card.bad .verdict-icon { background: var(--bad-soft); }

.verdict-text { grid-row: 1; min-width: 0; }

.verdict-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.verdict-card.ok  .verdict-head { color: var(--ok); }
.verdict-card.bad .verdict-head { color: var(--bad); }

.verdict-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verdict-note { font-size: 12.5px; color: var(--faint); margin-top: 3px; }

.verdict-next { grid-column: 1 / -1; margin-top: 14px; }

.primary-btn {
  width: 100%;
  padding: 15px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform 0.18s var(--ease);
  box-shadow: 0 12px 30px -14px var(--accent);
}
.primary-btn:active { transform: scale(0.975); }

/* ─────────── экран итогов ─────────── */
.result-card {
  margin-top: 12px;
  padding: 26px 20px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.result-emoji { font-size: 44px; animation: pop 0.6s var(--ease); }

.ring-wrap { position: relative; width: 168px; height: 168px; margin: 10px auto 4px; }

.ring { width: 100%; height: 100%; transform: rotate(-90deg); }

.ring-bg, .ring-fg {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}
.ring-bg { stroke: rgba(255, 255, 255, 0.08); }

.ring-fg {
  stroke: url(#g);
  stroke: var(--accent-2);
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 1.1s var(--ease), stroke 0.4s;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 2px;
}

.ring-score {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.ring-pct { font-size: 13px; font-weight: 600; color: var(--muted); }

.result-title { margin: 10px 0 4px; font-size: 21px; font-weight: 800; }
.result-sub { margin: 0 0 18px; font-size: 14px; color: var(--muted); line-height: 1.5; }

.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }

.stat-box {
  padding: 13px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
}
.stat-value { font-size: 21px; font-weight: 800; }
.stat-label { font-size: 11px; color: var(--faint); margin-top: 3px; }

.missed { text-align: left; margin-bottom: 16px; }

.missed-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 9px;
}

.missed-list { display: grid; gap: 7px; }

.missed-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
}

.missed-item img {
  width: 34px;
  height: 23px;
  object-fit: cover;
  border-radius: 4px;
  flex: 0 0 auto;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.7);
}

.result-actions { display: grid; gap: 9px; }

/* ─────────── страницы статистики и рейтинга ─────────── */
.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 18px;
}
.page-head h2 { margin: 0; font-size: 20px; font-weight: 800; flex: 1; text-align: center; }
.head-spacer { width: 36px; flex: 0 0 auto; }

.page-body { display: grid; gap: 11px; }

.panel {
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
}

.panel-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}

.big-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.big-value { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.big-label { font-size: 11px; color: var(--faint); margin-top: 2px; }

.kv { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; }
.kv + .kv { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  font-size: 14.5px;
}

.rank-row.is-me {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(168, 85, 247, 0.14));
  border-color: rgba(139, 92, 246, 0.5);
}

.rank-place {
  flex: 0 0 30px;
  font-size: 15px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}
.rank-name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.rank-pct { font-size: 11.5px; color: var(--faint); margin-left: 6px; }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}
.empty-emoji { font-size: 40px; display: block; margin-bottom: 12px; }

.skeleton {
  height: 74px;
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hi) 50%, var(--surface) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  from { background-position: 150% 0; }
  to   { background-position: -150% 0; }
}

/* ─────────── конфетти ─────────── */
.confetti { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }

.confetti i {
  position: absolute;
  top: -14px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: fall 1.5s cubic-bezier(0.35, 0.6, 0.55, 1) forwards;
}

@keyframes fall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(105vh) rotate(680deg); }
}

/* ─────────── мелочи ─────────── */
[hidden] { display: none !important; }

@media (max-width: 360px) {
  .hero-title { font-size: 29px; }
  .mode-body p { font-size: 12px; }
  .ring-wrap { width: 148px; height: 148px; }
}
