/* ==========================================================================
   ВИКТОРИНА «ТАЙНЫ ГИМАЛАЕВ И НЕПАЛА» — АВТОРСКИЙ СТИЛЬ
   ========================================================================== */

:root {
  /* Цветовая палитра */
  --bg-deep: #080c16;
  --bg-dark: #0f172a;
  --bg-surface: rgba(18, 27, 49, 0.78);
  --bg-card: rgba(23, 34, 60, 0.85);
  --bg-card-hover: rgba(32, 47, 82, 0.95);

  --accent-gold: #ffc300;
  --accent-amber: #ff9e00;
  --accent-crimson: #e63946;
  --rhododendron-red: #c1121f;
  --rhododendron-light: #ff4d6d;
  --mountain-cyan: #48cae4;
  --himalaya-blue: #0077b6;
  --success-emerald: #10b981;
  --danger-coral: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-gold: #fde047;

  /* Лунгта — 5 священных цветов */
  --flag-blue: #1d4ed8;
  --flag-white: #f1f5f9;
  --flag-red: #dc2626;
  --flag-green: #059669;
  --flag-yellow: #d97706;

  --border-gold: rgba(255, 195, 0, 0.35);
  --border-glass: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.55), 0 0 20px rgba(255, 195, 0, 0.08);

  --font-serif: 'Cinzel', serif, Georgia;
  --font-sans: 'Montserrat', system-ui, -apple-system, sans-serif;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* ==========================================================================
   ГИРЛЯНДА МОЛИТВЕННЫХ ФЛАЖКОВ ЛУНГТА (КАК В ТЕТРИС И ДРУГИХ ИГРАХ)
   ========================================================================== */
.prayer-flags {
  display: flex;
  width: 100%;
  height: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1000;
}

.flag {
  flex: 1;
  height: 100%;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%);
  animation: flagWave 3s ease-in-out infinite alternate;
}

.flag.blue, .flag-blue   { background-color: #1e6fa8; animation-delay: 0s; }
.flag.white, .flag-white  { background-color: #f8fafc; animation-delay: 0.3s; }
.flag.red, .flag-red    { background-color: #cd2e48; animation-delay: 0.6s; }
.flag.green, .flag-green  { background-color: #43a047; animation-delay: 0.9s; }
.flag.yellow, .flag-yellow { background-color: #f5a425; animation-delay: 1.2s; }

@keyframes flagWave {
  0%   { transform: translateY(0) skewY(0deg); }
  100% { transform: translateY(2px) skewY(3deg); }
}

/* ==========================================================================
   ФОНОВЫЕ СЛОИ ГОР, ЗВЕЗД И РАССВЕТА
   ========================================================================== */
.mountain-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Звездное ночное небо */
.stars-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 65%;
  background-image: 
    radial-gradient(1px 1px at 25px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 80px 120px, rgba(255,255,255,0.8), rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 150px 70px, #ffd166, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 240px 180px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 320px 40px, rgba(255,255,255,0.9), rgba(0,0,0,0)),
    radial-gradient(2px 2px at 420px 150px, #ffb703, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 580px 80px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 700px 190px, #e2e8f0, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 850px 60px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 960px 130px, #fef08a, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 500px 300px;
  opacity: 0.65;
}

/* Закат/рассвет над пиками */
.ambient-glow {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 158, 0, 0.18) 0%, rgba(220, 38, 38, 0.12) 40%, rgba(15, 23, 42, 0) 75%);
  filter: blur(60px);
}

/* Горные силуэты (SVG-слои) */
.mountain-silhouette {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-repeat: repeat-x;
  background-position: bottom center;
}

.far-range {
  height: 48vh;
  opacity: 0.35;
  background-size: 1400px 100%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 500" preserveAspectRatio="none"><polygon points="0,500 0,320 180,180 340,310 520,110 700,280 880,140 1060,330 1240,160 1400,320 1400,500" fill="%231e293b"/></svg>');
}

.mid-range {
  height: 38vh;
  opacity: 0.65;
  background-size: 1100px 100%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1100 400" preserveAspectRatio="none"><polygon points="0,400 0,260 130,130 260,250 420,90 560,240 730,120 890,260 1010,160 1100,250 1100,400" fill="%23131c31"/><polygon points="420,90 380,150 420,170 460,150" fill="%23f8fafc" opacity="0.4"/></svg>');
}

.snow-peaks {
  height: 28vh;
  opacity: 0.85;
  background-size: 900px 100%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 300" preserveAspectRatio="none"><polygon points="0,300 0,210 90,120 190,210 320,80 440,200 570,100 700,210 810,130 900,200 900,300" fill="%230b1120"/><polygon points="320,80 280,130 320,150 360,130" fill="%23ffffff" opacity="0.75"/><polygon points="570,100 535,145 570,160 605,145" fill="%23ffffff" opacity="0.75"/></svg>');
}

/* ==========================================================================
   БОКОВЫЕ ИЛЛЮСТРАЦИИ: ЯКИ И РОДОДЕНДРОНЫ
   ========================================================================== */
.decor-side {
  position: fixed;
  bottom: 0;
  height: 100vh;
  width: 260px;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.decor-left {
  left: 0;
}

.decor-right {
  right: 0;
  transform: scaleX(-1);
}

/* Ветка цветущего алого рододендрона (Лалигурас) */
.rhododendron-branch {
  width: 260px;
  height: 280px;
  margin-top: 55px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 1;
  filter: drop-shadow(0 6px 14px rgba(230, 57, 70, 0.35));
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 260 280"><g fill="none" stroke-linecap="round"><path d="M-8,36 Q68,78 124,132 Q165,172 222,205" stroke="%233b2319" stroke-width="8"/><path d="M-8,35 Q68,77 124,131" stroke="%235c3a2b" stroke-width="3"/><path d="M62,74 Q112,48 164,66" stroke="%233b2319" stroke-width="5.5"/><path d="M114,122 Q156,104 198,128" stroke="%233b2319" stroke-width="4.5"/><path d="M88,92 Q68,125 78,158" stroke="%233b2319" stroke-width="4"/></g><g><path d="M86,62 C64,28 98,8 128,32 C136,52 114,72 86,62 Z" fill="%23143d2b"/><path d="M88,60 Q108,42 124,33" stroke="%232d6a4f" stroke-width="1.5" fill="none"/><path d="M148,112 C138,76 178,66 202,92 C200,122 168,132 148,112 Z" fill="%231b4332"/><path d="M152,110 Q174,98 196,92" stroke="%2340916c" stroke-width="1.5" fill="none"/><path d="M44,104 C16,84 36,48 68,66 C80,88 68,112 44,104 Z" fill="%23143d2b"/><path d="M46,100 Q58,82 66,68" stroke="%232d6a4f" stroke-width="1.4" fill="none"/><path d="M158,166 C142,138 178,122 204,146 C210,174 178,186 158,166 Z" fill="%231b4332"/><path d="M162,164 Q182,154 200,147" stroke="%2340916c" stroke-width="1.4" fill="none"/><path d="M74,158 C50,152 54,186 82,192 C102,190 98,164 74,158 Z" fill="%23143d2b"/><path d="M75,160 Q80,175 82,188" stroke="%232d6a4f" stroke-width="1.3" fill="none"/></g><g><g transform="translate(154,66)"><path d="M0,-28 C10,-28 16,-16 8,-6 C20,-12 30,-2 24,10 C18,20 4,14 2,6 C10,18 2,30 -10,24 C-20,18 -12,4 -4,2 C-16,12 -28,4 -24,-8 C-20,-20 -6,-14 -2,-4 C-10,-16 -8,-28 0,-28 Z" fill="%23c1121f" stroke="%23800f2f" stroke-width="1.2"/><circle cx="0" cy="0" r="11" fill="%23ff4d6d"/><circle cx="0" cy="-2" r="5" fill="%23590d22" opacity="0.45"/><g stroke="%23fde047" stroke-width="1.3" stroke-linecap="round"><line x1="0" y1="0" x2="-5" y2="-10"/><line x1="0" y1="0" x2="4" y2="-11"/><line x1="0" y1="0" x2="9" y2="-3"/><line x1="0" y1="0" x2="-8" y2="-2"/></g><g fill="%23ffb703"><circle cx="-5" cy="-10" r="2"/><circle cx="4" cy="-11" r="2"/><circle cx="9" cy="-3" r="1.8"/><circle cx="-8" cy="-2" r="1.8"/></g></g><g transform="translate(122,48) scale(0.84)"><path d="M0,-26 C9,-26 15,-14 7,-5 C18,-10 28,-1 22,10 C16,19 4,13 2,5 C9,16 1,28 -10,22 C-19,16 -11,3 -3,2 C-14,11 -26,3 -22,-8 C-18,-18 -5,-13 -2,-3 C-9,-14 -7,-26 0,-26 Z" fill="%23e63946" stroke="%23800f2f" stroke-width="1.2"/><circle cx="0" cy="0" r="9" fill="%23ff758f"/><circle cx="0" cy="0" r="3" fill="%23ffb703"/><circle cx="-5" cy="-7" r="1.7" fill="%23fde047"/><circle cx="5" cy="-6" r="1.7" fill="%23fde047"/></g><g transform="translate(186,124) scale(0.88)"><path d="M0,-26 C9,-26 15,-14 7,-5 C18,-10 28,-1 22,10 C16,19 4,13 2,5 C9,16 1,28 -10,22 C-19,16 -11,3 -3,2 C-14,11 -26,3 -22,-8 C-18,-18 -5,-13 -2,-3 C-9,-14 -7,-26 0,-26 Z" fill="%23c1121f" stroke="%23800f2f" stroke-width="1.2"/><circle cx="0" cy="0" r="10" fill="%23ff4d6d"/><circle cx="0" cy="0" r="3.2" fill="%23ffb703"/><circle cx="-4" cy="-8" r="1.8" fill="%23fde047"/><circle cx="6" cy="-5" r="1.8" fill="%23fde047"/></g><g transform="translate(80,148) scale(0.72)"><path d="M0,-26 C9,-26 15,-14 7,-5 C18,-10 28,-1 22,10 C16,19 4,13 2,5 C9,16 1,28 -10,22 C-19,16 -11,3 -3,2 C-14,11 -26,3 -22,-8 C-18,-18 -5,-13 -2,-3 C-9,-14 -7,-26 0,-26 Z" fill="%23e63946" stroke="%23800f2f" stroke-width="1.2"/><circle cx="0" cy="0" r="8" fill="%23ff758f"/><circle cx="0" cy="0" r="3" fill="%23ffb703"/></g></g></svg>');
}

/* Могучий гималайский як на скале */
.yak-figure {
  width: 240px;
  height: 220px;
  margin-bottom: 20px;
  margin-left: 10px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: bottom left;
  opacity: 1;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.75));
  animation: yakBreathe 6s ease-in-out infinite alternate;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 260"><polygon points="14,246 286,246 266,204 202,196 116,200 44,220" fill="%231e293b"/><polygon points="44,220 116,200 132,246 14,246" fill="%23334155"/><polygon points="202,196 266,204 286,246 196,246" fill="%230f172a"/><ellipse cx="152" cy="218" rx="88" ry="12" fill="%23050811" opacity="0.7"/><path d="M236,118 Q274,142 262,196 Q256,210 242,202 Q252,162 232,130 Z" fill="%231c1518"/><path d="M84,174 L78,224 L98,224 L106,178 Z" fill="%231a1417"/><path d="M116,180 L112,226 L132,226 L138,180 Z" fill="%23261d20"/><path d="M188,180 L184,226 L204,226 L208,180 Z" fill="%231a1417"/><path d="M218,176 L216,224 L236,224 L240,176 Z" fill="%23261d20"/><rect x="76" y="220" width="24" height="6" rx="2" fill="%23475569"/><rect x="110" y="222" width="24" height="6" rx="2" fill="%23475569"/><rect x="182" y="222" width="24" height="6" rx="2" fill="%23475569"/><rect x="214" y="220" width="24" height="6" rx="2" fill="%23475569"/><path d="M72,164 C66,112 94,64 142,60 C168,58 188,74 212,82 C240,92 256,118 248,154 C242,182 216,192 178,194 C132,196 86,194 72,164 Z" fill="%23231a1d" stroke="%233b2d31" stroke-width="1.8"/><path d="M88,124 C96,82 126,66 158,70 C136,88 122,118 114,150 Z" fill="%232f2326"/><path d="M70,154 L84,196 L96,178 L110,204 L126,182 L144,206 L162,184 L182,204 L200,182 L218,198 L234,174 L246,188 L250,152 C226,174 120,178 70,154 Z" fill="%23171113"/><path d="M144,84 L198,90 L208,136 L148,132 Z" fill="%23c1121f"/><path d="M146,90 L200,95 L202,104 L147,99 Z" fill="%23ffc300"/><path d="M147,116 L205,121 L207,129 L148,124 Z" fill="%2348cae4"/><path d="M98,98 Q118,134 110,168" stroke="%23d97706" stroke-width="6" fill="none" stroke-linecap="round"/><path d="M98,98 Q118,134 110,168" stroke="%23ffc300" stroke-width="2.5" fill="none" stroke-linecap="round"/><circle cx="109" cy="168" r="8" fill="%23ffc300" stroke="%23b45309" stroke-width="1.5"/><circle cx="107" cy="166" r="2.5" fill="%23fef08a"/><path d="M36,104 Q24,96 28,112 Q34,116 42,110 Z" fill="%23231a1d" stroke="%233b2d31" stroke-width="1.2"/><path d="M92,100 Q106,92 104,108 Q96,114 88,108 Z" fill="%23231a1d" stroke="%233b2d31" stroke-width="1.2"/><path d="M40,94 C36,74 90,70 94,94 C98,118 90,148 64,152 C40,152 34,124 40,94 Z" fill="%232b2023" stroke="%233b2d31" stroke-width="1.6"/><path d="M42,92 Q66,76 92,90 Q84,104 66,102 Q48,104 42,92 Z" fill="%23171113"/><path d="M42,132 C42,118 82,118 82,134 C82,148 70,154 60,154 C50,154 42,146 42,132 Z" fill="%233b2d31"/><path d="M52,144 Q62,149 72,144" stroke="%23171113" stroke-width="2" fill="none" stroke-linecap="round"/><ellipse cx="53" cy="136" rx="3" ry="2.2" transform="rotate(-15 53 136)" fill="%230f172a"/><ellipse cx="69" cy="136" rx="3" ry="2.2" transform="rotate(15 69 136)" fill="%230f172a"/><circle cx="48" cy="112" r="4.2" fill="%23090d16"/><circle cx="46.8" cy="110.8" r="1.5" fill="%23f8fafc"/><circle cx="76" cy="112" r="4.2" fill="%23090d16"/><circle cx="74.8" cy="110.8" r="1.5" fill="%23f8fafc"/><path d="M46,84 Q20,74 14,50 Q12,34 24,26" stroke="%23d1d5db" stroke-width="8.5" fill="none" stroke-linecap="round"/><path d="M84,82 Q112,72 118,46 Q120,30 108,22" stroke="%23d1d5db" stroke-width="8.5" fill="none" stroke-linecap="round"/><path d="M14,50 Q12,34 24,26" stroke="%234b5563" stroke-width="5.5" fill="none" stroke-linecap="round"/><path d="M118,46 Q120,30 108,22" stroke="%234b5563" stroke-width="5.5" fill="none" stroke-linecap="round"/></svg>');
}

@keyframes yakBreathe {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(-4px) scale(1.015); }
}

/* ==========================================================================
   ОСНОВНОЙ КОНТЕЙНЕР ПРИЛОЖЕНИЯ
   ========================================================================== */
.app-container {
  position: relative;
  z-index: 20;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   ЦЕНТРАЛЬНЫЙ ЗАГОЛОВОК ИГРЫ В КАРТОЧКЕ
   ========================================================================== */
.hero-title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

.hero-title-group .tibetan-script {
  font-size: 16px;
  color: var(--accent-gold);
  letter-spacing: 3px;
  opacity: 0.95;
  margin-bottom: 6px;
  text-shadow: 0 0 14px rgba(255, 195, 0, 0.45);
}

.hero-title-group .hero-logo-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.hero-title-group .flag-icon {
  display: flex;
  align-items: center;
}

.hero-title-group .flag-img-header {
  width: 30px;
  height: 38px;
  filter: drop-shadow(0 2px 10px rgba(200, 16, 46, 0.65));
}

.hero-title-group h1 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 900;
  letter-spacing: 2.5px;
  background: linear-gradient(135deg, #ffffff 15%, var(--accent-gold) 60%, var(--accent-amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(255, 195, 0, 0.28);
  margin: 0;
  line-height: 1.2;
}

/* ==========================================================================
   ИГРОВАЯ СТАТУС-ПАНЕЛЬ (SCORE, TIMER, STREAK)
   ========================================================================== */
.game-statusbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 24px;
  background: rgba(10, 15, 30, 0.97);
  border-top: 1px solid var(--border-gold);
  backdrop-filter: blur(16px);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}

.category-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 20px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-pill {
  color: var(--mountain-cyan);
  background: rgba(72, 202, 228, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(72, 202, 228, 0.3);
  letter-spacing: 1px;
}

.streak-pill {
  color: #fff;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(239, 68, 68, 0.25));
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(249, 115, 22, 0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.streak-pill.streak-active {
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(255, 158, 0, 0.5);
  animation: pulseStreak 1.4s infinite alternate;
}

@keyframes pulseStreak {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); box-shadow: 0 0 24px rgba(255, 195, 0, 0.7); }
}

.score-pill {
  color: var(--accent-gold);
  background: rgba(255, 195, 0, 0.12);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-gold);
  font-size: 16px;
}

.score-value {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 1px;
}

/* ==========================================================================
   ГЛАВНАЯ СЕКЦИЯ (VIEW PANELS)
   ========================================================================== */
.quiz-main {
  flex: 1;
}

/* Отступ снизу во время викторины, чтобы контент не прятался за фикс. панелью */
#quizView {
  padding-bottom: 90px;
}

.view-panel {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   1. ЭКРАН СТАРТА
   ========================================================================== */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    var(--flag-blue), 
    var(--flag-white), 
    var(--flag-red), 
    var(--flag-green), 
    var(--flag-yellow)
  );
}

.nepal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 195, 0, 0.12);
  color: var(--accent-gold);
  border: 1px solid var(--border-gold);
  padding: 6px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.ornament {
  font-size: 14px;
}

.hero-desc {
  max-width: 700px;
  margin: 0 auto 26px;
  font-size: 15px;
  color: #cbd5e1;
  line-height: 1.7;
}

/* Сетка правил */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 34px;
  text-align: left;
}

.rule-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  transition: transform 0.2s ease;
}

.rule-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
}

.rule-icon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.rule-info {
  display: flex;
  flex-direction: column;
}

.rule-info strong {
  font-size: 15px;
  color: #fff;
}

.rule-correct strong { color: var(--success-emerald); }
.rule-wrong strong { color: var(--danger-coral); }
.rule-streak strong { color: var(--accent-amber); }
.rule-timer strong { color: var(--mountain-cyan); }

.rule-info span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Сетка выбора категорий */
.category-select-section {
  margin-bottom: 32px;
  text-align: left;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--accent-gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.cat-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.25s ease;
  position: relative;
}
.cat-top-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
}
.cat-content {
  flex: 1;
  min-width: 0;
}
.cat-meta-bar {
  width: 100%;
}
.cat-meta-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 7px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.cat-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.cat-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), #22c55e);
  border-radius: 3px;
  transition: width 0.35s ease;
}

.cat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.cat-card.selected {
  background: linear-gradient(135deg, rgba(255, 195, 0, 0.15), rgba(230, 57, 70, 0.15));
  border-color: var(--accent-gold);
  box-shadow: 0 0 18px rgba(255, 195, 0, 0.3);
}

.cat-icon {
  font-size: 28px;
  line-height: 1;
}

.cat-content {
  display: flex;
  flex-direction: column;
}

.cat-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.cat-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.cat-card.selected .cat-name {
  color: var(--accent-gold);
}

.cat-play-badge {
  margin-left: auto;
  align-self: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 195, 0, 0.12);
  border: 1px solid var(--border-gold);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  padding-left: 2px;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cat-card:hover .cat-play-badge {
  background: var(--accent-gold);
  color: #0f172a;
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(255, 195, 0, 0.5);
}

/* Главная кнопка */
.cta-btn {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  padding: 16px 36px;
  border-radius: 40px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  letter-spacing: 0.5px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.start-btn {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-amber) 60%, var(--rhododendron-red) 100%);
  color: #0f172a;
  font-weight: 800;
  font-size: 17px;
}

.start-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(255, 195, 0, 0.45);
}

/* ==========================================================================
   2. ЭКРАН ИГРЫ (ВОПРОС)
   ========================================================================== */
.progress-wrap {
  margin-bottom: 18px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-label {
  color: #fff;
}

.progress-category {
  color: var(--accent-gold);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-fill {
  height: 100%;
  width: 2%;
  background: linear-gradient(90deg, var(--mountain-cyan), var(--accent-gold), var(--rhododendron-red));
  border-radius: 10px;
  transition: width 0.4s ease;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px 30px;
  backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

.card-tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.tricky-badge {
  background: rgba(255, 158, 0, 0.15);
  border: 1px solid rgba(255, 158, 0, 0.4);
  color: var(--accent-amber);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.question-text {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.45;
  color: #ffffff;
  margin-bottom: 26px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Варианты ответов */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.option-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: #f1f5f9;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.option-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  transform: translateX(6px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.option-letter {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--accent-gold);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.option-btn:hover:not(:disabled) .option-letter {
  background: var(--accent-gold);
  color: #0f172a;
}

.option-text {
  flex: 1;
}

/* Статусы ответов после клика */
.option-btn.correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: var(--success-emerald) !important;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.option-btn.correct .option-letter {
  background: var(--success-emerald);
  color: #fff;
  border-color: var(--success-emerald);
}

.option-btn.wrong {
  background: rgba(244, 63, 94, 0.25) !important;
  border-color: var(--danger-coral) !important;
  color: #fff !important;
  animation: shakeWrong 0.4s ease;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
}

.option-btn.wrong .option-letter {
  background: var(--danger-coral);
  color: #fff;
  border-color: var(--danger-coral);
}

.option-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

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

/* Блок объяснения подвоха */
.explanation-box {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(26, 38, 68, 0.95));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-top: 10px;
  animation: fadeInDown 0.35s ease-out;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.explanation-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.exp-icon {
  font-size: 22px;
}

.exp-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-gold);
  flex: 1;
}

.score-delta {
  font-weight: 800;
  font-size: 15px;
  padding: 4px 12px;
  border-radius: 20px;
}

.score-delta.positive {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.score-delta.negative {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.explanation-text {
  font-size: 14px;
  line-height: 1.65;
  color: #e2e8f0;
  margin-bottom: 0;
}

.question-next-wrap {
  margin-top: 16px;
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
  animation: fadeInDown 0.35s ease-out;
}

.question-next-wrap .next-btn {
  width: 100%;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(255, 195, 0, 0.3);
  cursor: pointer;
}

.explanation-action {
  display: flex;
  justify-content: flex-end;
}

.next-btn {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber));
  color: #0f172a;
  padding: 12px 28px;
  font-size: 15px;
}

.next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 195, 0, 0.4);
}

/* ==========================================================================
   3. ЭКРАН РЕЗУЛЬТАТОВ
   ========================================================================== */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
  text-align: center;
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.result-crest {
  margin-bottom: 12px;
}

.crest-prayer {
  font-size: 13px;
  color: var(--accent-gold);
  letter-spacing: 2px;
}

.result-rank-icon {
  font-size: 44px;
  margin: 6px 0 2px;
  filter: drop-shadow(0 4px 12px rgba(255, 195, 0, 0.4));
  animation: bounceCrest 2s ease-in-out infinite alternate;
}

@keyframes bounceCrest {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

.result-rank-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.result-rank-desc {
  font-size: 13.5px;
  line-height: 1.45;
  color: #cbd5e1;
  max-width: 580px;
  margin: 0 auto;
}

.final-score-box {
  background: linear-gradient(135deg, rgba(255, 195, 0, 0.1), rgba(230, 57, 70, 0.1));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin: 14px auto;
  max-width: 260px;
}

.final-score-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
  display: block;
  margin-bottom: 2px;
}

.final-score-number {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1px;
  line-height: 1.1;
  text-shadow: 0 3px 15px rgba(255, 195, 0, 0.4);
}

.score-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

/* Сетка статистики */
.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.stat-val {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.stat-name {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Кнопки результатов - компактные и в одну строку */
.result-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 0 auto;
  max-width: 100%;
}

.result-actions .cta-btn {
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 24px;
  gap: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  flex: 0 1 auto;
  min-height: 40px;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #fff;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.restart-btn {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber));
  color: #0f172a;
}

.restart-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 18px rgba(255, 195, 0, 0.4);
}

/* Панель детального разбора ответов */
.review-panel {
  margin-top: 36px;
  text-align: left;
  border-top: 1px solid var(--border-glass);
  padding-top: 24px;
}

.review-heading {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--accent-gold);
  margin-bottom: 18px;
  text-align: center;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 8px;
}

.review-list::-webkit-scrollbar {
  width: 6px;
}
.review-list::-webkit-scrollbar-thumb {
  background: var(--border-gold);
  border-radius: 4px;
}

.review-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
}

.review-item.was-correct {
  border-left: 4px solid var(--success-emerald);
}

.review-item.was-wrong {
  border-left: 4px solid var(--danger-coral);
}

.review-q-title {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  margin-bottom: 8px;
}

.review-answer-line {
  font-size: 13px;
  margin-bottom: 4px;
}

.review-answer-line.user-answer {
  color: #94a3b8;
}

.review-answer-line.correct-answer {
  color: #34d399;
  font-weight: 600;
}

.review-exp {
  font-size: 13px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  line-height: 1.5;
}

/* ==========================================================================
   ФУТЕР И БЛАГОСЛОВЕНИЕ В ДОРОГУ
   ========================================================================== */
.hero-blessing-wrap {
  margin-top: 26px;
  text-align: center;
}

.footer-blessing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  padding: 8px 22px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   АДАПТИВНОСТЬ (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 1100px) {
  .decor-side {
    display: none; /* скрываем боковых яков на узких экранах, чтобы не перекрывать контент */
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 30px 14px 24px;
  }

  .logo-title h1 {
    font-size: 22px;
  }

  .hero-title {
    font-size: 26px;
  }

  .hero-card, .question-card, .result-card {
    padding: 24px 18px;
  }

  .question-text {
    font-size: 19px;
  }

  .option-btn {
    padding: 13px 16px;
    font-size: 14px;
  }

  .game-statusbar {
    padding: 10px 14px;
    gap: 8px;
  }

  .status-item {
    font-size: 13px;
  }

  .score-value {
    font-size: 15px;
  }

  .final-score-number {
    font-size: 30px;
  }

  .stats-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .result-actions {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .result-actions .cta-btn {
    width: auto;
    padding: 8px 12px;
    font-size: 12.5px;
  }

  .header-record-badge {
    padding: 6px 14px;
    font-size: 12.5px;
  }
}

@media (max-width: 580px) {
  .result-actions {
    flex-wrap: wrap;
  }

  .result-actions .cta-btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .header-content {
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================================================================
   ПРОФИЛЬ ИГРОКА, АВАТАРЫ И БАЗА ДАННЫХ SQLITE
   ========================================================================== */

/* Бейдж рекорда напротив названия */
.header-record-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 195, 0, 0.12);
  border: 1px solid var(--border-gold);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.header-record-badge span {
  color: var(--accent-gold);
  font-weight: 800;
  font-family: var(--font-serif);
  font-size: 15px;
}

/* Бейдж игрока в шапке */
.active-player-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 195, 0, 0.12);
  border: 1px solid var(--border-gold);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.player-avatar-icon {
  font-size: 20px;
  line-height: 1;
}

.player-name-text {
  color: #fff;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-best-pill {
  font-size: 11px;
  color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 195, 0, 0.3);
}

/* Кнопка выхода в меню во время теста */
.exit-btn {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.exit-btn:hover {
  background: rgba(244, 63, 94, 0.35);
  border-color: var(--danger-coral);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

/* Карточка профиля */
.player-profile-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 28px;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.profile-icon {
  font-size: 26px;
}

.profile-titles h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--accent-gold);
  font-weight: 700;
}

.profile-titles p {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-input-group {
  margin-bottom: 18px;
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.input-with-button {
  display: flex;
  gap: 10px;
}

.player-input {
  flex: 1;
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}

.player-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(255, 195, 0, 0.25);
}

.save-profile-btn {
  background: linear-gradient(135deg, rgba(255, 195, 0, 0.25), rgba(255, 158, 0, 0.25));
  border: 1px solid var(--border-gold);
  color: var(--accent-gold);
  font-weight: 700;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.save-profile-btn:hover {
  background: var(--accent-gold);
  color: #0f172a;
}

/* Сетка выбора аватаров */
.avatar-selector-section {
  margin-bottom: 18px;
}

.avatar-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.avatars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 10px;
}

.avatar-card {
  background: rgba(8, 12, 22, 0.65);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.avatar-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 195, 0, 0.4);
  transform: translateY(-2px);
}

.avatar-card.selected {
  background: linear-gradient(135deg, rgba(255, 195, 0, 0.2), rgba(230, 57, 70, 0.2));
  border-color: var(--accent-gold);
  box-shadow: 0 0 14px rgba(255, 195, 0, 0.35);
}

.avatar-card-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.avatar-card-name {
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.2;
}

.avatar-card.selected .avatar-card-name {
  color: var(--accent-gold);
}

/* Персональная статистика игрока */
.player-quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pstat-item {
  background: rgba(0, 0, 0, 0.35);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.pstat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.pstat-val {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

/* Кнопка Зала Славы */
.leaderboard-btn-wrap {
  margin-top: 26px;
  margin-bottom: 8px;
}

.leaderboard-cta-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(255, 195, 0, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  text-decoration: none;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.leaderboard-cta-btn:hover {
  background: linear-gradient(135deg, rgba(255, 195, 0, 0.22) 0%, rgba(30, 41, 59, 0.95) 100%);
  border-color: var(--accent-gold);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(255, 195, 0, 0.25);
  color: #fff;
}

.lb-btn-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(255, 195, 0, 0.4));
  flex-shrink: 0;
}

.lb-btn-content {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex: 1;
  gap: 2px;
}

.lb-btn-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
}

.lb-btn-sub {
  font-size: 12px;
  color: #cbd5e1;
}

.lb-btn-arrow {
  font-size: 22px;
  color: var(--accent-gold);
  font-weight: bold;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.leaderboard-cta-btn:hover .lb-btn-arrow {
  transform: translateX(6px);
}

/* Таблица лидеров (Leaderboard) */
.leaderboard-section {
  margin-top: 36px;
  text-align: left;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 22px;
}

.leaderboard-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.lb-icon {
  font-size: 24px;
}

.lb-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--accent-gold);
  flex: 1;
}

.db-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--mountain-cyan);
  background: rgba(72, 202, 228, 0.12);
  border: 1px solid rgba(72, 202, 228, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.lb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(8, 12, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease;
}

.lb-item:hover {
  border-color: rgba(255, 195, 0, 0.3);
  transform: translateX(4px);
}

.lb-item.is-current-user {
  border-color: var(--accent-gold);
  background: linear-gradient(90deg, rgba(255, 195, 0, 0.12), rgba(8, 12, 22, 0.8));
}

.lb-rank {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 800;
  width: 24px;
  color: var(--text-muted);
  text-align: center;
}

.lb-rank.rank-1 { color: #ffd700; font-size: 18px; }
.lb-rank.rank-2 { color: #c0c0c0; font-size: 16px; }
.lb-rank.rank-3 { color: #cd7f32; font-size: 15px; }

.lb-avatar {
  font-size: 22px;
  line-height: 1;
}

.lb-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.lb-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.lb-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.lb-score {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
}

.lb-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ==========================================================================
   МОДАЛЬНОЕ ОКНО ПОДТВЕРЖДЕНИЯ ВЫХОДА В МЕНЮ
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.25s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content.exit-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 30px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 195, 0, 0.15);
  animation: scaleInModal 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}

@keyframes scaleInModal {
  from { transform: scale(0.92); }
  to { transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-icon {
  font-size: 28px;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.modal-desc {
  font-size: 14px;
  color: #cbd5e1;
  margin-bottom: 20px;
  line-height: 1.6;
}

.exit-summary-box {
  background: rgba(8, 12, 22, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.exit-summary-item {
  display: flex;
  flex-direction: column;
}

.exit-summary-item span {
  font-size: 11px;
  color: var(--text-muted);
}

.exit-summary-item strong {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--accent-gold);
}

.modal-subtext {
  font-size: 12px;
  color: var(--mountain-cyan);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn {
  padding: 12px 22px;
  font-size: 14px;
  flex: 1;
}

.danger-btn {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.danger-btn:hover {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.45);
  transform: translateY(-2px);
}

/* ==========================================================================
   ВЕКТОРНЫЙ ФЛАГ НЕПАЛА (SVG ВМЕСТО ЭМОДЗИ)
   ========================================================================== */
.flag-img-header {
  width: 24px;
  height: 30px;
  vertical-align: middle;
  filter: drop-shadow(0 2px 6px rgba(200, 16, 46, 0.55));
}

.flag-img-footer {
  width: 18px;
  height: 22px;
  vertical-align: middle;
  margin-right: 8px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.flag-img-cat {
  width: 22px;
  height: 26px;
  vertical-align: middle;
  display: inline-block;
}

/* ==========================================================================
   КОМПАКТНАЯ ПЛАШКА ПРОФИЛЯ НА ГЛАВНОЙ СТРАНИЦЕ
   ========================================================================== */
.profile-preview-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 28px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  text-align: left;
}

.profile-preview-card:hover {
  background: rgba(23, 34, 60, 0.95);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 195, 0, 0.2);
}

.preview-avatar {
  font-size: 34px;
  width: 52px;
  height: 52px;
  background: rgba(255, 195, 0, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(255, 195, 0, 0.25);
}

.preview-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preview-name {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

.preview-sub-row {
  font-size: 13px;
  color: #cbd5e1;
}

.preview-sub-row b {
  color: var(--accent-gold);
  font-family: var(--font-serif);
}

.preview-edit-btn {
  background: rgba(255, 195, 0, 0.12);
  border: 1px solid var(--border-gold);
  color: var(--accent-gold);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.preview-edit-btn:hover {
  background: var(--accent-gold);
  color: #0f172a;
}

/* ==========================================================================
   МОДАЛЬНОЕ ОКНО ПРОФИЛЯ
   ========================================================================== */
.profile-modal {
  max-width: 540px !important;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close-x {
  position: absolute;
  top: 18px;
  right: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-x:hover {
  background: rgba(244, 63, 94, 0.3);
  border-color: var(--danger-coral);
  color: #fff;
}

/* ==========================================================================
   СЕКЦИЯ ПРАВИЛ ПОД ТАБЛИЦЕЙ ОЧКОВ
   ========================================================================== */
.rules-section {
  margin-top: 32px;
  text-align: left;
  border-top: 1px solid var(--border-glass);
  padding-top: 24px;
}

.rules-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.rules-icon {
  font-size: 22px;
}

.rules-title {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--accent-gold);
}


