@charset "UTF-8";
:root {
  --bg-color: #121a2d;
  --bg-gradient: radial-gradient(ellipse at 50% 0%, #24355a 0%, #152037 45%, #0e1626 100%);
  --surface-color: rgba(26, 38, 64, 0.85);
  --surface-hover: rgba(38, 55, 90, 0.95);
  --surface-border: rgba(255, 255, 255, 0.14);
  --surface-border-hover: rgba(56, 189, 248, 0.55);
  --text-color: #e2e8f0;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --highlight: #38bdf8;
  --highlight-hover: #0ea5e9;
  --accent-glow: rgba(56, 189, 248, 0.28);
  --glass-bg: rgba(26, 38, 64, 0.88);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.45);
  --glass-blur: 20px;
  --blob-1: transparent;
  --blob-2: transparent;
  --ease-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
  --tile-color: #38bdf8;
  --tile-gradient: linear-gradient(to bottom, #0284c7, #38bdf8);
}

body[data-theme=light] {
  --bg-color: #f8fafc;
  --bg-gradient: radial-gradient(circle at 50% 10%, #ffffff 0%, #f1f5f9 85%);
  --surface-color: #ffffff;
  --surface-hover: #f1f5f9;
  --surface-border: #e2e8f0;
  --surface-border-hover: #cbd5e1;
  --text-color: #334155;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --highlight: #0284c7;
  --highlight-hover: #0369a1;
  --accent-glow: rgba(2, 132, 199, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-border: #e2e8f0;
  --glass-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06);
  --glass-blur: 16px;
  --blob-1: transparent;
  --blob-2: transparent;
  --tile-color: #0284c7;
  --tile-gradient: linear-gradient(to bottom, #0369a1, #38bdf8);
}

body[data-theme=light] .glass-panel {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
}
body[data-theme=light] .action-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}
body[data-theme=light] .action-btn:hover {
  background: var(--highlight) !important;
  border-color: var(--highlight) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25) !important;
}
body[data-theme=light] .shimmer-text {
  background: linear-gradient(120deg, #243B55 40%, #B388EB 50%, #243B55 60%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
body[data-theme=light] .center-console, body[data-theme=light] .video-card, body[data-theme=light] .mega-button .small-text {
  color: var(--text-color) !important;
  text-shadow: none;
}
body[data-theme=light] .center-console .console-text h2 {
  color: #141E30 !important;
}
body[data-theme=light] .center-console .console-text p {
  color: var(--text-color) !important;
  opacity: 1 !important;
}
body[data-theme=light] .sketch-spin-btn {
  background: var(--text-color);
  color: #fff;
  -webkit-box-shadow: 0 0 20px var(--accent-glow);
          box-shadow: 0 0 20px var(--accent-glow);
  border: 2px solid var(--highlight);
}
body[data-theme=light] .sketch-spin-btn:hover {
  background: var(--highlight);
  -webkit-transform: scale(1.05);
      -ms-transform: scale(1.05);
          transform: scale(1.05);
  -webkit-box-shadow: 0 0 30px var(--highlight);
          box-shadow: 0 0 30px var(--highlight);
}
body[data-theme=light] .sketch-spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  -webkit-transform: none !important;
      -ms-transform: none !important;
          transform: none !important;
  -webkit-box-shadow: none !important;
          box-shadow: none !important;
  pointer-events: none;
}
body[data-theme=light] .slot-window-horizontal {
  background: #141E30 !important;
  border: 2px solid var(--highlight) !important;
  -webkit-box-shadow: 0 0 15px var(--accent-glow);
          box-shadow: 0 0 15px var(--accent-glow);
}
body[data-theme=light] .shadow-left {
  background: -webkit-gradient(linear, left top, right top, from(#DCE6F1), to(transparent));
  background: linear-gradient(to right, #DCE6F1 0%, transparent 100%);
}
body[data-theme=light] .shadow-right {
  background: -webkit-gradient(linear, right top, left top, from(#DCE6F1), to(transparent));
  background: linear-gradient(to left, #DCE6F1 0%, transparent 100%);
}
body[data-theme=light] .simple-back, body[data-theme=light] .pointer-arrow {
  color: var(--text-color);
}
body[data-theme=light] .secret-lock-content, body[data-theme=light] .name-input-content, body[data-theme=light] .leaderboard-content {
  background: rgba(255, 255, 255, 0.95);
  color: #333;
}
body[data-theme=light] .name-input-field {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--text-color);
  color: var(--text-color);
}
body[data-theme=light] .name-input-field:focus {
  border-color: var(--highlight);
  -webkit-box-shadow: 0 0 10px var(--accent-glow);
          box-shadow: 0 0 10px var(--accent-glow);
}
body[data-theme=light] .name-submit-btn {
  background: var(--highlight);
  color: #fff;
}
body[data-theme=light] .name-submit-btn:hover {
  background: var(--text-color);
  -webkit-box-shadow: 0 0 15px var(--highlight);
          box-shadow: 0 0 15px var(--highlight);
}
body[data-theme=light] .leaderboard-modal {
  background: rgba(255, 255, 255, 0.6);
}
body[data-theme=light] .leaderboard-content {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--highlight); /* Фіолетовий */
}
body[data-theme=light] .lb-table th {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
body[data-theme=light] .lb-table td {
  border-bottom-color: rgba(0, 0, 0, 0.05);
  color: #2c3e50; /* Темний текст */
}
body[data-theme=light] {
  /* Секретна пісня у світлій темі */
}
body[data-theme=light] .secret-song-card {
  background: rgba(255, 255, 255, 0.8) !important;
}
body[data-theme=light] .song-locked::after {
  color: #555; /* Темний замок */
}
body[data-theme=light] {
  /* Текст "Архів" під спіном */
}
body[data-theme=light] .archive-link:hover {
  color: #fff;
}
body[data-theme=light] {
  /* Фон контейнера гри у світлій темі */
}
body[data-theme=light] #game-container {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}
body[data-theme=light] {
  /* Сітка доріжок у світлій темі */
}
body[data-theme=light] .lane-col {
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.3); /* Легке скло */
}
body[data-theme=light] {
  /* Активна доріжка (світла) */
}
body[data-theme=light] .lane-col.active {
  background: -webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.1)), to(transparent));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.1) 0%, transparent 100%);
}
body[data-theme=light] {
  /* Кнопка паузи (світла) */
}
body[data-theme=light] .pause-btn {
  background: #fff;
  border: 1px solid #ccc;
  color: #333;
  -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
          box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
body[data-theme=light] {
  /* Тексти в грі (світла) */
}
body[data-theme=light] #score-display, body[data-theme=light] #combo-display {
  color: #2c3e50 !important;
  text-shadow: none;
  font-weight: 800;
}
body[data-theme=light] {
  /* Підказки клавіш (світла) */
}
body[data-theme=light] .lane-key {
  color: rgba(0, 0, 0, 0.6) !important;
  font-weight: bold;
}
body[data-theme=light] {
  /* Прогрес бар (світла) */
}
body[data-theme=light] .progress-container {
  background: rgba(0, 0, 0, 0.1);
}
body[data-theme=light] {
  /* Вікно результатів/паузи у світлій темі */
}
body[data-theme=light] .pause-overlay {
  background: rgba(255, 255, 255, 0.85); /* Світле скло */
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
body[data-theme=light] .pause-overlay h1, body[data-theme=light] .pause-overlay h2 {
  color: #2c3e50;
  text-shadow: none;
}

body[data-lang=MEOW] {
  --blob-1: #4a2c2c;
}
body[data-lang=MEOW] .action-btn, body[data-lang=MEOW] .mega-button {
  border-color: #ff9999;
}

/* ☀️ СВІТЛА ТЕМА (REMASTERED) */
body[data-theme=light] #game-container {
  /* Приємний світлий градієнт замість білого */
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Сітка доріжок у світлій темі */
body[data-theme=light] .lane-col {
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.3); /* Легке скло */
}

/* Активна доріжка (світла) */
body[data-theme=light] .lane-col.active {
  background: -webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.1)), to(transparent));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.1) 0%, transparent 100%);
}

/* Кнопка паузи (світла) */
body[data-theme=light] .pause-btn {
  background: #fff;
  border: 1px solid #ccc;
  color: #333;
  -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
          box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Тексти в грі (світла) */
body[data-theme=light] #score-display,
body[data-theme=light] #combo-display {
  color: #2c3e50 !important;
  text-shadow: none;
  font-weight: 800;
}

/* Підказки клавіш (світла) */
body[data-theme=light] .lane-key {
  color: rgba(0, 0, 0, 0.6) !important;
  font-weight: bold;
}

/* Прогрес бар (світла) */
body[data-theme=light] .progress-container {
  background: rgba(0, 0, 0, 0.1);
}

/* Вікно результатів/паузи у світлій темі */
body[data-theme=light] .pause-overlay {
  background: rgba(255, 255, 255, 0.85); /* Світле скло */
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}

body[data-theme=light] .pause-overlay h1,
body[data-theme=light] .pause-overlay h2 {
  color: #2c3e50;
  text-shadow: none;
}

body[data-theme=light] #global-back-btn {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--highlight);
  color: var(--text-color);
  -webkit-box-shadow: 0 4px 15px rgba(179, 136, 235, 0.2);
          box-shadow: 0 4px 15px rgba(179, 136, 235, 0.2);
}
body[data-theme=light] #global-back-btn:hover {
  background: var(--highlight);
  color: #fff;
}

/* ==========================================
   ☀️ АДАПТАЦІЯ ПІД СВІТЛУ ТЕМУ (Light Mode)
   ========================================== */
body[data-theme=light] {
  /* Змінюємо фон модалки на світлий напівпрозорий */
}
body[data-theme=light] .leaderboard-modal {
  background: rgba(255, 255, 255, 0.6);
}
body[data-theme=light] .leaderboard-content {
  border-color: var(--highlight); /* Фіолетовий */
  background: rgba(255, 255, 255, 0.9);
}
body[data-theme=light] .lb-table th {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
body[data-theme=light] .lb-table td {
  border-bottom-color: rgba(0, 0, 0, 0.05);
  color: #2c3e50; /* Темний текст */
}
body[data-theme=light] {
  /* Секретна пісня у світлій темі */
}
body[data-theme=light] .secret-song-card {
  background: rgba(255, 255, 255, 0.8) !important;
}
body[data-theme=light] .song-locked::after {
  color: #555; /* Темний замок */
}

body[data-theme=light] .name-input-content {
  border-color: var(--highlight);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-color);
  -webkit-box-shadow: 0 0 30px rgba(179, 136, 235, 0.6);
          box-shadow: 0 0 30px rgba(179, 136, 235, 0.6);
}
body[data-theme=light] .name-input-field {
  border-color: var(--text-color);
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-color);
}
body[data-theme=light] .name-input-field:focus {
  border-color: var(--highlight);
  -webkit-box-shadow: 0 0 10px var(--accent-glow);
          box-shadow: 0 0 10px var(--accent-glow);
}
body[data-theme=light] .name-submit-btn {
  background: var(--highlight);
  color: #fff;
}
body[data-theme=light] .name-submit-btn:hover {
  background: var(--text-color);
  -webkit-box-shadow: 0 0 15px var(--highlight);
          box-shadow: 0 0 15px var(--highlight);
}

/* Адаптація під світлу тему */
body[data-theme=light] .game-notification {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-color);
  -webkit-box-shadow: 0 5px 20px rgba(179, 136, 235, 0.4);
          box-shadow: 0 5px 20px rgba(179, 136, 235, 0.4);
}

body[data-theme=light] {
  /* 1. ПОВІДОМЛЕННЯ (TOAST) */
}
body[data-theme=light] .game-notification {
  background: rgba(255, 255, 255, 0.95); /* Білий фон */
  color: var(--text-color); /* Темно-синій текст */
  border-color: var(--highlight); /* Фіолетова рамка */
  -webkit-box-shadow: 0 5px 20px rgba(179, 136, 235, 0.4);
          box-shadow: 0 5px 20px rgba(179, 136, 235, 0.4); /* Фіолетова тінь */
}
body[data-theme=light] {
  /* 2. КНОПКА "ЗМІНИТИ ІМ'Я" В МЕНЮ */
}
body[data-theme=light] .btn-change-name {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-color);
  border-color: var(--glass-border);
}
body[data-theme=light] .btn-change-name:hover {
  background: var(--highlight); /* Фіолетовий при наведенні */
  color: #fff;
}
body[data-theme=light] {
  /* 3. МОДАЛЬНЕ ВІКНО ВВОДУ ІМЕНІ */
}
body[data-theme=light] .name-input-content {
  background: rgba(255, 255, 255, 0.95); /* Світлий фон */
  border-color: var(--highlight); /* Фіолетова рамка */
  color: var(--text-color); /* Темний текст заголовка */
  -webkit-box-shadow: 0 0 40px rgba(179, 136, 235, 0.6);
          box-shadow: 0 0 40px rgba(179, 136, 235, 0.6);
}
body[data-theme=light] {
  /* Поле вводу */
}
body[data-theme=light] .name-input-field {
  background: rgba(0, 0, 0, 0.05); /* Сірий фон поля */
  color: #000; /* Чорний текст вводу */
  border-color: rgba(0, 0, 0, 0.2);
}
body[data-theme=light] .name-input-field::-webkit-input-placeholder {
  color: rgba(0, 0, 0, 0.4);
}
body[data-theme=light] .name-input-field::-moz-placeholder {
  color: rgba(0, 0, 0, 0.4);
}
body[data-theme=light] .name-input-field:-ms-input-placeholder {
  color: rgba(0, 0, 0, 0.4);
}
body[data-theme=light] .name-input-field::-ms-input-placeholder {
  color: rgba(0, 0, 0, 0.4);
}
body[data-theme=light] .name-input-field::placeholder {
  color: rgba(0, 0, 0, 0.4);
}
body[data-theme=light] .name-input-field:focus {
  border-color: var(--highlight);
  background: #fff;
  -webkit-box-shadow: 0 0 10px var(--accent-glow);
          box-shadow: 0 0 10px var(--accent-glow);
}
body[data-theme=light] {
  /* Кнопки ОК / Cancel */
}
body[data-theme=light] .name-submit-btn {
  background: var(--highlight); /* Фіолетовий */
  color: #fff;
}
body[data-theme=light] .name-submit-btn:hover {
  background: var(--text-color); /* Темно-синій */
  -webkit-box-shadow: 0 0 15px var(--highlight);
          box-shadow: 0 0 15px var(--highlight);
}
body[data-theme=light] {
  /* Кнопка Cancel (сіра) */
}
body[data-theme=light] #cancel-name-btn {
  background: #ccc !important;
  color: #333 !important;
}
body[data-theme=light] #cancel-name-btn:hover {
  background: #aaa !important;
}

/* Адаптація під Світлу Тему */
body[data-theme=light] #song-search-input {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-color);
  border-color: rgba(0, 0, 0, 0.1);
}
body[data-theme=light] #song-search-input::-webkit-input-placeholder {
  color: rgba(0, 0, 0, 0.4);
}
body[data-theme=light] #song-search-input::-moz-placeholder {
  color: rgba(0, 0, 0, 0.4);
}
body[data-theme=light] #song-search-input:-ms-input-placeholder {
  color: rgba(0, 0, 0, 0.4);
}
body[data-theme=light] #song-search-input::-ms-input-placeholder {
  color: rgba(0, 0, 0, 0.4);
}
body[data-theme=light] #song-search-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}
body[data-theme=light] #song-search-input:focus {
  background: #fff;
  border-color: var(--highlight);
}
body[data-theme=light] #no-songs-msg {
  color: var(--text-color) !important;
}

.btn {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
          backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: var(--text-color);
  cursor: pointer;
  -webkit-transition: 0.3s;
  transition: 0.3s;
  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
          box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.btn:hover {
  background: var(--accent-glow);
  -webkit-transform: scale(1.1);
      -ms-transform: scale(1.1);
          transform: scale(1.1);
}

.mega-button {
  position: relative;
  width: 300px;
  height: 200px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
          backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  cursor: pointer;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  overflow: hidden;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
  -webkit-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
          box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  -webkit-animation: pulse-block 3s infinite;
          animation: pulse-block 3s infinite;
}
.mega-button .content-wrapper {
  position: relative;
  z-index: 2;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 10px;
}
.mega-button .emoji-icon {
  font-size: 3rem;
  margin-bottom: 5px;
}
.mega-button .small-text {
  font-size: 1rem;
  opacity: 0.7;
  color: var(--text-color);
}
.mega-button:hover {
  -webkit-transform: scale(1.05);
      -ms-transform: scale(1.05);
          transform: scale(1.05);
  -webkit-animation: none;
          animation: none;
  border-color: var(--highlight);
  -webkit-box-shadow: 0 0 50px var(--accent-glow);
          box-shadow: 0 0 50px var(--accent-glow);
}
.mega-button:active {
  -webkit-transform: scale(0.95);
      -ms-transform: scale(0.95);
          transform: scale(0.95);
}

.action-btn {
  padding: 15px 40px;
  font-size: 1.5rem;
  font-weight: bold;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(15px);
          backdrop-filter: blur(15px);
  border: 2px solid var(--highlight);
  -webkit-box-shadow: 0 0 10px var(--accent-glow);
          box-shadow: 0 0 10px var(--accent-glow);
  color: var(--text-color);
  cursor: pointer;
  -webkit-transition: 0.3s;
  transition: 0.3s;
  text-decoration: none;
  display: inline-block;
}
.action-btn:hover {
  background: var(--highlight);
  color: var(--bg-color);
  -webkit-box-shadow: 0 0 30px var(--highlight);
          box-shadow: 0 0 30px var(--highlight);
  -webkit-transform: scale(1.05);
      -ms-transform: scale(1.05);
          transform: scale(1.05);
  border-color: var(--highlight);
}

.action-btn.btn-danger {
  border-color: #ff5555;
}
.action-btn.btn-danger:hover {
  background: #ff5555;
}

.sketch-spin-btn {
  background: var(--highlight);
  color: var(--bg-color);
  font-family: "Comic Sans MS", sans-serif;
  font-weight: bold;
  font-size: 1.5rem;
  padding: 15px 80px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  -webkit-transition: -webkit-transform 0.1s;
  transition: -webkit-transform 0.1s;
  transition: transform 0.1s;
  transition: transform 0.1s, -webkit-transform 0.1s;
  -webkit-box-shadow: 0 0 15px var(--accent-glow);
          box-shadow: 0 0 15px var(--accent-glow);
}
.sketch-spin-btn:hover {
  -webkit-transform: scale(1.05);
      -ms-transform: scale(1.05);
          transform: scale(1.05);
  -webkit-box-shadow: 0 0 25px var(--highlight);
          box-shadow: 0 0 25px var(--highlight);
}
.sketch-spin-btn:active {
  -webkit-transform: scale(0.95);
      -ms-transform: scale(0.95);
          transform: scale(0.95);
}

.simple-back {
  position: absolute;
  top: 20px;
  left: 20px;
  color: #fff;
  text-decoration: none;
  opacity: 0.7;
}
.simple-back:hover {
  opacity: 1;
}

.close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
}
.close-btn:hover {
  background: var(--highlight);
  color: #000;
  border-color: var(--highlight);
  -webkit-box-shadow: 0 0 15px var(--highlight);
          box-shadow: 0 0 15px var(--highlight);
  -webkit-transform: rotate(90deg);
      -ms-transform: rotate(90deg);
          transform: rotate(90deg);
}

/* Кнопка Паузи */
.pause-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 150;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}

#global-back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 200;
  padding: 10px 22px;
  border-radius: 30px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--highlight);
  -webkit-box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
          box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
#global-back-btn:hover {
  background: var(--highlight);
  color: var(--bg-color);
  -webkit-box-shadow: 0 0 20px var(--accent-glow);
          box-shadow: 0 0 20px var(--accent-glow);
  -webkit-transform: scale(1.05);
      -ms-transform: scale(1.05);
          transform: scale(1.05);
}

/* --- КНОПКА ТАБЛИЦІ ЛІДЕРІВ --- */
.btn-leaderboard {
  display: block;
  margin: 15px auto;
  padding: 10px 25px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(45deg, var(--highlight), var(--blob-1));
  color: #fff;
  font-family: inherit;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  -webkit-box-shadow: 0 0 15px var(--accent-glow);
          box-shadow: 0 0 15px var(--accent-glow);
  -webkit-transition: -webkit-transform 0.2s;
  transition: -webkit-transform 0.2s;
  transition: transform 0.2s;
  transition: transform 0.2s, -webkit-transform 0.2s;
}
.btn-leaderboard:hover {
  -webkit-box-shadow: 0 0 25px var(--highlight);
          box-shadow: 0 0 25px var(--highlight);
  -webkit-transform: scale(1.05);
      -ms-transform: scale(1.05);
          transform: scale(1.05);
}

.name-submit-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 50px;
  background: #00d2ff;
  color: #000;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-transition: 0.3s;
  transition: 0.3s;
}
.name-submit-btn:hover {
  background: #fff;
  -webkit-box-shadow: 0 0 15px #fff;
          box-shadow: 0 0 15px #fff;
  -webkit-transform: scale(1.05);
      -ms-transform: scale(1.05);
          transform: scale(1.05);
}
.name-submit-btn:disabled {
  background: #555;
  opacity: 0.6;
  -webkit-transform: none;
      -ms-transform: none;
          transform: none;
  cursor: wait;
}

/* Кнопка зміни імені в меню */
.btn-change-name {
  display: block;
  margin: 0 auto 10px auto; /* Центруємо і відступ знизу */
  padding: 8px 20px;
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
  -webkit-backdrop-filter: blur(5px);
          backdrop-filter: blur(5px);
}
.btn-change-name:hover {
  background: var(--highlight);
  color: var(--bg-color);
  border-color: var(--highlight);
  -webkit-box-shadow: 0 0 10px var(--accent-glow);
          box-shadow: 0 0 10px var(--accent-glow);
}

.secret-lock-btn {
  padding: 10px 30px;
  border: none;
  border-radius: 50px;
  background: var(--highlight);
  color: var(--bg-color); /* Адаптується під тему через змінні */
  font-weight: bold;
  cursor: pointer;
  -webkit-transition: 0.3s;
  transition: 0.3s;
}
.secret-lock-btn:hover {
  -webkit-box-shadow: 0 0 15px var(--highlight);
          box-shadow: 0 0 15px var(--highlight);
  -webkit-transform: scale(1.05);
      -ms-transform: scale(1.05);
          transform: scale(1.05);
}

.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 2000;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  -webkit-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.video-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}
.video-overlay:not(.hidden) .video-card {
  -webkit-transform: scale(1) translateY(0);
      -ms-transform: scale(1) translateY(0);
          transform: scale(1) translateY(0);
  opacity: 1;
}

.video-card {
  width: 100%;
  max-width: 800px;
  background: var(--glass-bg);
  border: 2px solid var(--highlight);
  -webkit-box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 30px var(--accent-glow), inset 0 0 20px rgba(0, 0, 0, 0.2);
          box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 30px var(--accent-glow), inset 0 0 20px rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  overflow: hidden;
  -webkit-transform: scale(0.92) translateY(20px);
      -ms-transform: scale(0.92) translateY(20px);
          transform: scale(0.92) translateY(20px);
  opacity: 0;
  -webkit-transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.video-header {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.video-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--highlight);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  text-shadow: 0 0 10px var(--accent-glow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.player-wrapper {
  position: relative;
  background: #000;
  padding: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.player-wrapper video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0 0 16px 16px;
}

.winner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  -webkit-animation: fadeIn 0.5s ease;
          animation: fadeIn 0.5s ease;
}
.winner-overlay.hidden {
  display: none;
}

.winner-card {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 20px;
  width: 90%;
  max-width: 500px;
  -webkit-animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
          animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.winner-card h1 {
  font-size: 2.5rem;
  text-align: center;
  margin: 0;
}

.winner-img-wrapper {
  width: 100%;
  max-height: 60vh;
  border-radius: 20px;
  overflow: hidden;
  border: 4px solid var(--highlight);
  -webkit-box-shadow: 0 0 50px var(--accent-glow);
          box-shadow: 0 0 50px var(--accent-glow);
}
.winner-img-wrapper img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
  display: block;
}

/* Результат */
.result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 100;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}

/* Модальне вікно паузи */
.pause-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(5px);
          backdrop-filter: blur(5px);
  z-index: 160;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  gap: 20px;
}

/* --- МОДАЛЬНЕ ВІКНО ЛІДЕРІВ (ЛЕГАСІ) --- */
.leaderboard-modal-legacy-unused {
  position: fixed;
  top: 0;
  left: 0;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.9); /* Темний фон за замовчуванням */
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  color: var(--text-color);
}

.leaderboard-content {
  position: relative;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  padding: 25px;
  border: 2px solid var(--highlight);
  border-radius: 20px;
  background: var(--glass-bg);
  overflow-y: auto;
  -webkit-box-shadow: 0 0 30px var(--accent-glow);
          box-shadow: 0 0 30px var(--accent-glow);
  text-align: center;
}

.lb-close-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  color: #ff5555;
  font-size: 28px;
  cursor: pointer;
  -webkit-transition: 0.2s;
  transition: 0.2s;
}
.lb-close-btn:hover {
  -webkit-transform: scale(1.2);
      -ms-transform: scale(1.2);
          transform: scale(1.2);
}

/* Таблиця всередині модалки */
.lb-table {
  width: 100%;
  margin-top: 15px;
  border-collapse: collapse;
}
.lb-table th {
  padding: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  color: var(--highlight);
}
.lb-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

.name-input-modal {
  position: fixed;
  top: 0;
  left: 0;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.95);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}

.name-input-content {
  position: relative;
  width: 90%;
  max-width: 350px;
  padding: 30px;
  border: 2px solid #00d2ff;
  border-radius: 20px;
  background: rgba(20, 20, 20, 0.9);
  color: #fff;
  text-align: center;
  -webkit-box-shadow: 0 0 30px rgba(0, 210, 255, 0.5);
          box-shadow: 0 0 30px rgba(0, 210, 255, 0.5);
  -webkit-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.name-input-field {
  width: 100%;
  box-sizing: border-box !important;
  margin: 12px 0;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  text-align: left;
  outline: none;
}
.name-input-field:focus {
  border-color: #00d2ff;
  -webkit-box-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
          box-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
}

.input-error-msg {
  display: none;
  margin-top: 15px;
  color: #ff3333;
  font-size: 0.9rem;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(255, 51, 51, 0.5);
  -webkit-animation: fadeIn 0.3s ease;
          animation: fadeIn 0.3s ease;
}

/* --- МОДАЛЬНЕ ВІКНО БЛОКУВАННЯ СЕКРЕТУ --- */
.secret-lock-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-animation: fadeIn 0.3s ease;
          animation: fadeIn 0.3s ease;
}

.secret-lock-content {
  position: relative;
  width: 90%;
  max-width: 400px;
  padding: 30px;
  border-radius: 24px;
  border: 2px solid var(--highlight);
  background: var(--glass-bg);
  color: var(--text-color);
  text-align: center;
  -webkit-box-shadow: 0 0 30px var(--accent-glow);
          box-shadow: 0 0 30px var(--accent-glow);
}
.secret-lock-content .secret-lock-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.6;
  color: var(--text-color);
}
.secret-lock-content .secret-lock-close:hover {
  color: #ff5555;
  opacity: 1;
}
.secret-lock-content .secret-lock-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}
.secret-lock-content p {
  margin-bottom: 20px;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.4;
}

.game-notification {
  position: fixed;
  top: 30px;
  left: 50%;
  -webkit-transform: translateX(-50%);
      -ms-transform: translateX(-50%);
          transform: translateX(-50%);
  z-index: 10000; /* Поверх усього */
  background: rgba(15, 23, 42, 0.9); /* Темна основа */
  backdrop-filter: blur(10px); /* Ефект скла */
  -webkit-backdrop-filter: blur(10px);
  padding: 15px 30px;
  border-radius: 50px;
  border: 1px solid var(--highlight); /* Неонова рамка кольору теми */
  color: #fff;
  font-family: inherit;
  font-weight: bold;
  font-size: 1rem;
  letter-spacing: 0.5px;
  text-align: center;
  -webkit-box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
          box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
  /* Анімація появи */
  -webkit-animation: toastSlideDown 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
          animation: toastSlideDown 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none; /* Щоб не заважало клікати, якщо висить */
}

/* Анімація появи (зверху вниз пружинкою) */
@-webkit-keyframes toastSlideDown {
  from {
    top: -100px;
    opacity: 0;
    -webkit-transform: translateX(-50%) scale(0.8);
            transform: translateX(-50%) scale(0.8);
  }
  to {
    top: 30px;
    opacity: 1;
    -webkit-transform: translateX(-50%) scale(1);
            transform: translateX(-50%) scale(1);
  }
}
@keyframes toastSlideDown {
  from {
    top: -100px;
    opacity: 0;
    -webkit-transform: translateX(-50%) scale(0.8);
            transform: translateX(-50%) scale(0.8);
  }
  to {
    top: 30px;
    opacity: 1;
    -webkit-transform: translateX(-50%) scale(1);
            transform: translateX(-50%) scale(1);
  }
}
/* Анімація зникнення (вгору) */
@-webkit-keyframes toastFadeOut {
  to {
    top: -100px;
    opacity: 0;
  }
}
@keyframes toastFadeOut {
  to {
    top: -100px;
    opacity: 0;
  }
}
/* ==========================================
   🎹 NEON PIANO: ULTIMATE EDITION
   // SCSS FIXED: Game Isolation & UI Restoration
   ========================================== */
* {
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
  background: var(--bg-gradient);
  background-attachment: fixed;
  background-size: cover;
  -webkit-transition: background 0.6s;
  transition: background 0.6s;
  /* ВАЖЛИВО ДЛЯ ТЕЛЕФОНІВ: Забороняємо подвійний тап і зум */
  -ms-touch-action: none;
      touch-action: none;
  -webkit-user-select: none;
  -moz-user-select: none;
   -ms-user-select: none;
       user-select: none;
}

#snow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.snowflake {
  position: absolute;
  top: -20px;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  -webkit-animation-name: fall;
          animation-name: fall;
  -webkit-animation-timing-function: linear;
          animation-timing-function: linear;
  -webkit-animation-iteration-count: infinite;
          animation-iteration-count: infinite;
}

@-webkit-keyframes fall {
  to {
    -webkit-transform: translateY(110vh);
            transform: translateY(110vh);
  }
}

@keyframes fall {
  to {
    -webkit-transform: translateY(110vh);
            transform: translateY(110vh);
  }
}
/* ==========================================
   LAVA LAMP AMBIENT BACKGROUND EFFECT
   ========================================== */
.lava-lamp-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.55;
  contain: strict;
  transition: opacity 0.4s ease;
}

body[data-theme="light"] .lava-lamp-container {
  opacity: 0.35;
}

/* Completely halt animations and hide during active gameplay for 100% Canvas GPU focus */
body.in-game .lava-lamp-container,
body.in-game .lava-blob,
body.in-game #lava-lamp-bg,
body:has(#game-container:not(.hidden)) .lava-lamp-container,
body:has(#game-container:not(.hidden)) .lava-blob,
body:has(#game-container:not(.hidden)) #lava-lamp-bg,
#game-container:not(.hidden) ~ .lava-lamp-container {
  opacity: 0 !important;
  visibility: hidden !important;
  display: none !important;
  animation: none !important;
  animation-play-state: paused !important;
}

/* Hardcore Mobile & Desktop GPU Optimization: Disable all backdrop-filters during active gameplay */
body.in-game #game-container,
body.in-game .game-header,
body.in-game .lane-key,
body.in-game .pause-btn,
body.in-game .game-combo-pill,
body.in-game .game-mod-pill,
body.in-game .progress-container,
body.in-game .star-marker,
body.in-game .hud-star,
body.in-game #rating-container,
body.in-game .rating-popup,
body:has(#game-container:not(.hidden)) .game-header,
body:has(#game-container:not(.hidden)) .lane-key,
body:has(#game-container:not(.hidden)) .game-combo-pill {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.lava-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  pointer-events: none;
  contain: layout style paint;
}

.lava-blob.blob-1 {
  top: -10%;
  left: 15%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.45) 0%, rgba(99, 102, 241, 0.15) 45%, transparent 70%);
  animation: lava-morph-1 26s infinite alternate ease-in-out;
}

.lava-blob.blob-2 {
  bottom: -15%;
  right: 10%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.45) 0%, rgba(236, 72, 153, 0.15) 45%, transparent 70%);
  animation: lava-morph-2 30s infinite alternate ease-in-out;
}

.lava-blob.blob-3 {
  top: 35%;
  left: -10%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, rgba(56, 189, 248, 0.12) 45%, transparent 70%);
  animation: lava-morph-3 24s infinite alternate ease-in-out;
}

.lava-blob.blob-4 {
  bottom: 20%;
  left: 30%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, rgba(139, 92, 246, 0.12) 45%, transparent 70%);
  animation: lava-morph-4 28s infinite alternate ease-in-out;
}

.lava-blob.blob-5 {
  top: 15%;
  right: 25%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, rgba(245, 158, 11, 0.1) 45%, transparent 70%);
  animation: lava-morph-5 22s infinite alternate ease-in-out;
}

@keyframes lava-morph-1 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(60px, 80px, 0) scale(1.1); }
  100% { transform: translate3d(-40px, 120px, 0) scale(0.95); }
}

@keyframes lava-morph-2 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-80px, -60px, 0) scale(1.15); }
  100% { transform: translate3d(-40px, -110px, 0) scale(0.9); }
}

@keyframes lava-morph-3 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(90px, -40px, 0) scale(1.08); }
  100% { transform: translate3d(50px, 60px, 0) scale(0.95); }
}

@keyframes lava-morph-4 {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-50px, 50px, 0) scale(1.12); }
  100% { transform: translate3d(70px, -30px, 0) scale(0.98); }
}

@keyframes lava-morph-5 {
  0% { transform: translate3d(0, 0, 0) scale(0.95); }
  50% { transform: translate3d(-60px, 70px, 0) scale(1.1); }
  100% { transform: translate3d(-30px, -40px, 0) scale(1); }
}

/* Mobile high-performance optimizations */
@media (max-width: 768px) {
  .lava-blob.blob-3,
  .lava-blob.blob-4,
  .lava-blob.blob-5 {
    display: none !important;
  }
  .lava-blob.blob-1,
  .lava-blob.blob-2 {
    width: 280px;
    height: 280px;
  }
  /* Повне відключення важких фільтрів розмиття скла на мобільних для 60-120 FPS */
  *,
  *::before,
  *::after {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .modal-overlay {
    background: rgba(5, 7, 15, 0.88) !important;
  }

  .user-profile-card,
  .shop-modal-card,
  .settings-modal-card,
  .friends-modal-card,
  .customize-modal-card,
  .custom-confirm-card,
  .admin-modal-card,
  .admin-modal-content,
  .leaderboard-modal,
  .catalog-toolbar-panel,
  .catalog-bottom-nav,
  .bottom-toolbar,
  .app-header,
  .song-card,
  .song-search-box,
  .shop-item-card,
  .profile-favorite-track-box {
    background: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
  }

  body[data-theme=light] .user-profile-card,
  body[data-theme=light] .shop-modal-card,
  body[data-theme=light] .settings-modal-card,
  body[data-theme=light] .friends-modal-card,
  body[data-theme=light] .customize-modal-card,
  body[data-theme=light] .custom-confirm-card,
  body[data-theme=light] .admin-modal-card,
  body[data-theme=light] .catalog-toolbar-panel,
  body[data-theme=light] .catalog-bottom-nav,
  body[data-theme=light] .bottom-toolbar,
  body[data-theme=light] .app-header,
  body[data-theme=light] .song-card,
  body[data-theme=light] .song-search-box,
  body[data-theme=light] .shop-item-card,
  body[data-theme=light] .profile-favorite-track-box {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12) !important;
  }

  /* Апаратне прискорення та плавний сенсорний скрол без затримок */
  #song-list,
  .lb-scroll-area,
  #admin-track-list,
  .user-profile-card,
  .shop-modal-card,
  .shop-catalog-scroll,
  .settings-modal-card,
  .friends-modal-card,
  .customize-modal-card,
  .modal-scroll-body {
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
  }

  button, .action-btn, .nav-btn, .song-card, input, select, textarea {
    touch-action: manipulation;
  }
  .song-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  }
}

/* ==========================================
   TRACK BEST STATS & ADMIN URL STYLES
   ========================================== */
.track-best-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.78rem;
  margin-left: 6px;
}
.track-best-stat.not-played {
  opacity: 0.7;
}
.track-record-label {
  color: #94a3b8;
  font-weight: 500;
}
.track-record-label b {
  color: #38bdf8;
  font-weight: 700;
}
.track-stars-visual {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
body[data-theme="light"] .track-best-stat {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .track-record-label {
  color: #64748b;
}
body[data-theme="light"] .track-record-label b {
  color: #0284c7;
}

.admin-hint-chip {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.admin-hint-chip a {
  color: #38bdf8;
  text-decoration: underline;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-all;
}
body[data-theme="light"] .admin-hint-chip {
  background: rgba(2, 132, 199, 0.06);
  border-color: rgba(2, 132, 199, 0.2);
  color: #475569;
}
.duration-feedback-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  margin-top: -8px;
  margin-bottom: 12px;
  color: #38bdf8;
  min-height: 18px;
}

/* Admin Spotify Autofill Component */
.admin-spotify-box {
  background: rgba(30, 215, 96, 0.08);
  border: 1px solid rgba(30, 215, 96, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  max-width: 100%;
  box-sizing: border-box;
}
.admin-spotify-box:focus-within {
  border-color: rgba(30, 215, 96, 0.6);
  box-shadow: 0 0 16px rgba(30, 215, 96, 0.18);
}
.admin-spotify-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.admin-spotify-label {
  font-size: 0.82rem;
  color: #1ed760;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
}
.admin-spotify-icon-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.admin-spotify-icon-container svg {
  vertical-align: middle;
}
.admin-spotify-status {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}
.admin-spotify-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}
.admin-spotify-input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  font-size: 0.84rem;
  padding: 8px 12px;
  border-color: rgba(30, 215, 96, 0.25);
}
.admin-spotify-input:focus {
  border-color: #1ed760;
  box-shadow: 0 0 10px rgba(30, 215, 96, 0.35);
}
.admin-spotify-btn {
  background: #1ed760;
  color: #06180e;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(30, 215, 96, 0.3);
}
.admin-spotify-btn:hover:not(:disabled) {
  background: #23f06b;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(30, 215, 96, 0.45);
}
.admin-spotify-btn:active:not(:disabled) {
  transform: translateY(0);
}
.admin-spotify-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.admin-spotify-feedback {
  font-size: 0.78rem;
  margin-top: 6px;
  min-height: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}
.admin-spotify-feedback.loading {
  color: #38bdf8;
}
.admin-spotify-feedback.success {
  color: #1ed760;
}
.admin-spotify-feedback.error {
  color: #f87171;
}
body[data-theme="light"] .admin-spotify-box {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.3);
}
body[data-theme="light"] .admin-spotify-label {
  color: #15803d;
}
body[data-theme="light"] .admin-spotify-icon-container svg {
  fill: #15803d;
}
body[data-theme="light"] .admin-spotify-btn {
  background: #16a34a;
  color: #ffffff;
}

@-webkit-keyframes drift {
  from {
    -webkit-transform: translate(0, 0);
            transform: translate(0, 0);
  }
  to {
    -webkit-transform: translate(30px, 50px);
            transform: translate(30px, 50px);
  }
}

@keyframes drift {
  from {
    -webkit-transform: translate(0, 0);
            transform: translate(0, 0);
  }
  to {
    -webkit-transform: translate(30px, 50px);
            transform: translate(30px, 50px);
  }
}
.controls {
  position: fixed;
  top: 25px;
  right: 25px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 12px;
  z-index: 100;
}

.sound-btn {
  font-size: 1.2rem;
}
.sound-btn.playing {
  border-color: var(--highlight);
  -webkit-box-shadow: 0 0 15px var(--accent-glow);
          box-shadow: 0 0 15px var(--accent-glow);
}

.lang-wrapper {
  position: relative;
}

.lang-dropdown {
  position: absolute;
  top: 60px;
  right: 0;
  display: none;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  background: rgba(15, 12, 41, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
.lang-dropdown button {
  background: transparent;
  border: none;
  color: white;
  padding: 10px;
  cursor: pointer;
}
.lang-dropdown button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lang-wrapper.open .lang-dropdown {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.main-container {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}

.view {
  position: absolute;
  width: 100%;
  height: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-transition: opacity 0.6s ease, -webkit-transform 0.6s ease;
  transition: opacity 0.6s ease, -webkit-transform 0.6s ease;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition: opacity 0.6s ease, transform 0.6s ease, -webkit-transform 0.6s ease;
}
.view.active {
  opacity: 1;
  pointer-events: all;
  -webkit-transform: scale(1);
      -ms-transform: scale(1);
          transform: scale(1);
  z-index: 10;
}
.view.hidden {
  opacity: 0;
  pointer-events: none;
  -webkit-transform: scale(1.2);
      -ms-transform: scale(1.2);
          transform: scale(1.2);
  z-index: 0;
}

.shimmer-text {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--text-color);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.2) 40%, rgb(255, 255, 255) 50%, rgba(255, 255, 255, 0.2) 60%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-animation: shimmer 3s linear infinite;
          animation: shimmer 3s linear infinite;
  will-change: background-position;
}

@-webkit-keyframes shimmer {
  to {
    background-position: 200% center;
  }
}

@keyframes shimmer {
  to {
    background-position: 200% center;
  }
}
@-webkit-keyframes pulse-block {
  0% {
    -webkit-box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.2);
            box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.2);
  }
  70% {
    -webkit-box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
            box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
  }
  100% {
    -webkit-box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
            box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}
@keyframes pulse-block {
  0% {
    -webkit-box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.2);
            box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.2);
  }
  70% {
    -webkit-box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
            box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
  }
  100% {
    -webkit-box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
            box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}
.carousel {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 600px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-perspective: 1000px;
          perspective: 1000px;
}

.glass-panel {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
          backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  -webkit-box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
          box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  border-radius: 24px;
  text-align: center;
}

.panel {
  position: absolute;
  width: 300px;
  height: 500px;
  -webkit-transition: all 0.6s var(--ease-smooth);
  transition: all 0.6s var(--ease-smooth);
}
.panel .panel-content {
  width: 100%;
  height: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.panel#panel-memes .panel-content {
  background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(15, 12, 41, 0.4)), to(rgba(15, 12, 41, 0.8))), url("../img/meme.gif");
  background-image: linear-gradient(to bottom, rgba(15, 12, 41, 0.4), rgba(15, 12, 41, 0.8)), url("../img/meme.gif");
}
.panel#panel-dance .panel-content {
  background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(15, 12, 41, 0.4)), to(rgba(15, 12, 41, 0.8))), url("../img/dance.gif");
  background-image: linear-gradient(to bottom, rgba(15, 12, 41, 0.4), rgba(15, 12, 41, 0.8)), url("../img/dance.gif");
}
.panel#panel-surprise .panel-content {
  background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(15, 12, 41, 0.4)), to(rgba(15, 12, 41, 0.8))), url("../img/secret.gif");
  background-image: linear-gradient(to bottom, rgba(15, 12, 41, 0.4), rgba(15, 12, 41, 0.8)), url("../img/secret.gif");
}
.panel.center {
  z-index: 10;
  -webkit-transform: translateX(0) scale(1);
      -ms-transform: translateX(0) scale(1);
          transform: translateX(0) scale(1);
  opacity: 1;
}
.panel.center .panel-content {
  border: 3px solid var(--highlight);
  -webkit-box-shadow: 0 0 35px var(--accent-glow), inset 0 0 10px var(--accent-glow);
          box-shadow: 0 0 35px var(--accent-glow), inset 0 0 10px var(--accent-glow);
}
.panel.left {
  z-index: 5;
  -webkit-transform: translateX(-340px) scale(0.85) rotateY(15deg);
          transform: translateX(-340px) scale(0.85) rotateY(15deg);
  opacity: 0.5;
  cursor: pointer;
}
.panel.left:hover {
  opacity: 0.8;
  -webkit-transform: translateX(-340px) scale(0.9) rotateY(10deg);
          transform: translateX(-340px) scale(0.9) rotateY(10deg);
}
.panel.right {
  z-index: 5;
  -webkit-transform: translateX(340px) scale(0.85) rotateY(-15deg);
          transform: translateX(340px) scale(0.85) rotateY(-15deg);
  opacity: 0.5;
  cursor: pointer;
}
.panel.right:hover {
  opacity: 0.8;
  -webkit-transform: translateX(340px) scale(0.9) rotateY(-10deg);
          transform: translateX(340px) scale(0.9) rotateY(-10deg);
}

.panel.left .action-btn,
.panel.right .action-btn {
  pointer-events: none;
  opacity: 0.5;
  cursor: default;
}

.panel.center .action-btn {
  pointer-events: auto;
  opacity: 1;
  cursor: pointer;
}

.sketch-layout {
  width: 100%;
  height: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  gap: 20px;
  position: relative;
}

.top-hud {
  width: 90%;
  max-width: 800px;
  height: 100px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-box-align: start;
      -ms-flex-align: start;
          align-items: flex-start;
  padding: 0;
  position: relative;
  background: transparent;
}
.top-hud .hud-line {
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  margin: 0 15%;
}
.top-hud .hud-arrow {
  position: absolute;
  top: -10px;
  left: 50%;
  -webkit-transform: translateX(-50%);
      -ms-transform: translateX(-50%);
          transform: translateX(-50%);
  font-size: 2rem;
  color: #fff;
  text-shadow: 0 0 10px #fff;
}

.center-console {
  background: #000;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 40px;
  padding: 40px 60px;
  width: 400px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 30px;
  -webkit-box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
          box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
          backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  -webkit-box-shadow: var(--glass-shadow);
          box-shadow: var(--glass-shadow);
  position: relative;
  z-index: 50;
  -webkit-transform: translateZ(0);
          transform: translateZ(0);
}
.center-console .console-text {
  text-align: center;
  color: white;
}
.center-console .console-text h2 {
  font-size: 1.2rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--highlight);
  text-shadow: 0 0 10px var(--accent-glow);
}
.center-console .console-text p {
  font-size: 0.9rem;
  opacity: 0.6;
  margin: 5px 0 0 0;
}

.sketch-layout {
  width: 100%;
  height: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  gap: 40px;
  position: relative;
}

.horizontal-slot {
  width: 90%;
  max-width: 800px;
  height: 120px;
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-animation: slideDown 0.5s ease-out;
          animation: slideDown 0.5s ease-out;
}
.horizontal-slot.hidden {
  display: none;
}

@-webkit-keyframes slideDown {
  from {
    opacity: 0;
    -webkit-transform: translateY(-20px);
            transform: translateY(-20px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    -webkit-transform: translateY(-20px);
            transform: translateY(-20px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }
}
.pointer-arrow {
  position: absolute;
  top: -10px;
  left: 50%;
  -webkit-transform: translateX(-50%);
      -ms-transform: translateX(-50%);
          transform: translateX(-50%);
  font-size: 2rem;
  color: #fff;
  z-index: 20;
  text-shadow: 0 0 10px #fff;
}

.slot-window-horizontal {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
}

.strip-horizontal {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
      -ms-flex-direction: row;
          flex-direction: row;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  height: 100%;
  will-change: transform;
}

.slot-item-text {
  min-width: 320px;
  height: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  font-family: "Comic Sans MS", sans-serif;
  font-weight: 900;
  font-size: 1rem;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: center;
  padding: 0 15px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
  white-space: normal;
  letter-spacing: 1px;
  -webkit-animation: neonPulse 2s infinite alternate;
          animation: neonPulse 2s infinite alternate;
}

@-webkit-keyframes neonPulse {
  0%, 100% {
    opacity: 1;
    -webkit-filter: brightness(100%);
            filter: brightness(100%);
  }
  50% {
    opacity: 0.8;
    -webkit-filter: brightness(130%);
            filter: brightness(130%);
  }
}

@keyframes neonPulse {
  0%, 100% {
    opacity: 1;
    -webkit-filter: brightness(100%);
            filter: brightness(100%);
  }
  50% {
    opacity: 0.8;
    -webkit-filter: brightness(130%);
            filter: brightness(130%);
  }
}
.common {
  color: #fff;
  text-shadow: 0 0 5px #0f0, 0 0 10px #0f0, 0 0 20px #0f0, 0 0 40px #00ff00;
}

.rare {
  color: #fff;
  text-shadow: 0 0 5px #00e6e6, 0 0 10px #00e6e6, 0 0 20px #00e6e6, 0 0 40px #00ffff;
}

.epic {
  color: #fff;
  text-shadow: 0 0 5px #d400ff, 0 0 10px #d400ff, 0 0 20px #d400ff, 0 0 40px #ff00ff;
}

.legendary {
  color: #fff;
  text-shadow: 0 0 5px #ff8800, 0 0 10px #ff8800, 0 0 20px #ff8800, 0 0 40px #ff0000;
  -webkit-animation: neonPulse 0.5s infinite alternate;
          animation: neonPulse 0.5s infinite alternate;
}

.shadow-left, .shadow-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 10;
  pointer-events: none;
}

.shadow-left {
  left: 0;
  background: -webkit-gradient(linear, left top, right top, from(#0f0c29), to(transparent));
  background: linear-gradient(to right, #0f0c29 0%, transparent 100%);
}

.shadow-right {
  right: 0;
  background: -webkit-gradient(linear, right top, left top, from(#0f0c29), to(transparent));
  background: linear-gradient(to left, #0f0c29 0%, transparent 100%);
}

.ptr-container {
  position: fixed;
  top: -80px;
  left: 0;
  width: 100%;
  height: 80px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  z-index: 9999;
  pointer-events: none;
  -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: -webkit-transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), -webkit-transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.ptr-container.loading {
  -webkit-transform: translateY(80px) !important;
      -ms-transform: translateY(80px) !important;
          transform: translateY(80px) !important;
}

.ptr-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--highlight);
  -webkit-box-shadow: 0 0 15px var(--accent-glow);
          box-shadow: 0 0 15px var(--accent-glow);
  -webkit-transition: -webkit-transform 0.3s;
  transition: -webkit-transform 0.3s;
  transition: transform 0.3s;
  transition: transform 0.3s, -webkit-transform 0.3s;
}

.ptr-container.loading .ptr-spinner {
  -webkit-animation: ptr-spin 0.6s linear infinite;
          animation: ptr-spin 0.6s linear infinite;
}

@-webkit-keyframes ptr-spin {
  to {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}

@keyframes ptr-spin {
  to {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}
.battle-container {
  width: 100%;
  height: 100vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  position: relative;
  z-index: 10;
  padding: 20px;
}

.battle-header {
  text-align: center;
  margin-bottom: 30px;
}
.battle-header h1 {
  font-size: 2.5rem;
  margin: 0;
}
.battle-header p {
  color: var(--text-color);
  opacity: 0.7;
}

.arena {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  gap: 40px;
  width: 100%;
  max-width: 1000px;
  position: relative;
}

.fighter-card {
  width: 45%;
  max-width: 350px;
  height: 60vh;
  background: #000;
  border: 2px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  -webkit-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  -webkit-box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
          box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}
.fighter-card:hover {
  -webkit-transform: scale(1.03);
      -ms-transform: scale(1.03);
          transform: scale(1.03);
  border-color: var(--highlight);
  -webkit-box-shadow: 0 0 25px var(--accent-glow);
          box-shadow: 0 0 25px var(--accent-glow);
}
.fighter-card:active {
  -webkit-transform: scale(0.95);
      -ms-transform: scale(0.95);
          transform: scale(0.95);
}
.fighter-card .img-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}
.fighter-card .img-wrapper img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
}

.vote-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 255, 128, 0.3);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  font-size: 3rem;
  color: #fff;
  font-weight: bold;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  opacity: 0;
  -webkit-transition: 0.2s;
  transition: 0.2s;
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
}

.fighter-card.winner .vote-overlay {
  opacity: 1;
}

.fighter-card.loser {
  opacity: 0;
  -webkit-transform: scale(0.8) translateY(50px);
      -ms-transform: scale(0.8) translateY(50px);
          transform: scale(0.8) translateY(50px);
  pointer-events: none;
}

.vs-badge {
  font-size: 2.5rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  position: absolute;
  z-index: 20;
  -webkit-box-shadow: 0 0 20px rgba(255, 75, 43, 0.6);
          box-shadow: 0 0 20px rgba(255, 75, 43, 0.6);
  border: 3px solid #fff;
}

.stats-panel {
  margin-top: 30px;
  padding: 10px 30px;
  color: var(--text-color);
  font-weight: bold;
}

.archive-link {
  margin-top: -10px;
  font-size: 1rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--text-color);
  padding: 10px 25px;
  border: 1px solid var(--highlight);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.2);
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
}
.archive-link:hover {
  background: var(--highlight);
  color: var(--bg-color);
  -webkit-box-shadow: 0 0 15px var(--accent-glow);
          box-shadow: 0 0 15px var(--accent-glow);
  -webkit-transform: scale(1.05);
      -ms-transform: scale(1.05);
          transform: scale(1.05);
}

@-webkit-keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@-webkit-keyframes scaleIn {
  from {
    -webkit-transform: scale(0.5);
            transform: scale(0.5);
    opacity: 0;
  }
  to {
    -webkit-transform: scale(1);
            transform: scale(1);
    opacity: 1;
  }
}
@keyframes scaleIn {
  from {
    -webkit-transform: scale(0.5);
            transform: scale(0.5);
    opacity: 0;
  }
  to {
    -webkit-transform: scale(1);
            transform: scale(1);
    opacity: 1;
  }
}
.leaderboard-list {
  width: 100%;
  min-width: 300px;
  overflow-y: auto;
  max-height: 60vh;
  margin: 15px 0;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border: 1px solid var(--glass-border);
}

.leader-item {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  padding: 10px;
  margin-bottom: 8px;
  background: var(--glass-bg);
  border-radius: 10px;
  border: 1px solid transparent;
  -webkit-transition: 0.2s;
  transition: 0.2s;
}
.leader-item:hover {
  border-color: var(--highlight);
  background: rgba(255, 255, 255, 0.1);
}

.rank-num {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--highlight);
  width: 30px;
}

.mini-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  -o-object-fit: cover;
     object-fit: cover;
  cursor: -webkit-zoom-in;
  cursor: zoom-in;
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-transition: -webkit-transform 0.2s;
  transition: -webkit-transform 0.2s;
  transition: transform 0.2s;
  transition: transform 0.2s, -webkit-transform 0.2s;
}
.mini-thumb:hover {
  -webkit-transform: scale(1.1);
      -ms-transform: scale(1.1);
          transform: scale(1.1);
  border-color: #fff;
}

.vote-count {
  font-weight: bold;
  color: #fff;
  font-size: 0.9rem;
  margin-left: auto;
  padding-left: 10px;
}

/* ==========================================
   💃 СТИЛІ DANCE GAME
   ========================================== */
/* Клас для приховування екранів */
.hidden {
  display: none !important;
}

/* Екран вибору пісні */
.song-selection {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 76px;
  padding-bottom: 20px;
  box-sizing: border-box;
  z-index: 10;
  position: relative;
  overflow-y: auto;
}

.song-list-container {
  width: 90%;
  max-width: 500px;
  height: 60vh;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 10px;
  /* Гарний скролбар */
  scrollbar-width: thin;
  scrollbar-color: var(--highlight) transparent;
}

.song-card {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  background: var(--glass-bg);
  margin-bottom: 10px;
  padding: 15px 20px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  -webkit-transition: 0.2s;
  transition: 0.2s;
}

.song-card:hover {
  border-color: var(--highlight);
  background: rgba(255, 255, 255, 0.1);
  -webkit-transform: scale(1.02);
      -ms-transform: scale(1.02);
          transform: scale(1.02);
}

.song-info h3 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

.song-info p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--highlight);
}

/* Канвас гри */
#game-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 50;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}

/* ==========================================
   🎹 PIANO TILES STYLE UPDATE
   ========================================== */
/* Глобальні кнопки поверх усього */
.controls-layer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 10px;
}

/* Контейнер гри: На ПК вузький, на мобільному - 100% */
#game-container {
  width: 100%;
  max-width: 500px; /* Ширина як у планшета/телефона */
  height: 100vh;
  margin: 0 auto; /* Центрування */
  position: relative;
  background: #060919;
  background: radial-gradient(ellipse at 50% 25%, #182452 0%, #0d1533 52%, #050818 100%);
  overflow: hidden;
  -webkit-box-shadow: 0 0 80px rgba(0, 0, 0, 0.85), 0 0 35px rgba(56, 189, 248, 0.22);
          box-shadow: 0 0 80px rgba(0, 0, 0, 0.85), 0 0 35px rgba(56, 189, 248, 0.22);
  border-left: 1px solid rgba(56, 189, 248, 0.35);
  border-right: 1px solid rgba(56, 189, 248, 0.35);
  -webkit-transform: translateZ(0);
          transform: translateZ(0);
  will-change: border-color, box-shadow;
  contain: strict;
  -ms-touch-action: none;
      touch-action: none;
}

/* Канвас на весь контейнер */
canvas#rhythmCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 10;
  -ms-touch-action: none;
      touch-action: none;
}

canvas#pixiCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 11;
  pointer-events: none;
  -ms-touch-action: none;
      touch-action: none;
}

/* Меню вибору пісень - центруємо по екрану, а не по контейнеру */
.song-selection {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-color); /* Колір теми */
  z-index: 50;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}

.song-list-container {
  max-height: 70vh;
  overflow-y: auto;
  width: 90%;
  max-width: 500px;
}

/* Лінія старту (hit line) - замінена на 4 адаптивні неонові струни на Canvas */
.hit-line {
  display: none !important;
}

/* Контейнер ефектів довгих нот - ВАЖЛИВО, він перекривав кліки */
#hold-effects-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25;
  /* Тут теж ізоляція, бо це важкі ефекти */
  contain: strict;
}

.long-note-hold-effect {
  position: absolute;
  bottom: 0;
  width: 25%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  /* Зміни для "менш помітного" вигляду та оптимізації */
  opacity: 0.25; /* Було 1.0, тепер напівпрозорий */
  mix-blend-mode: screen; /* М'яке накладання світла */
  -webkit-transition: background 0.2s ease, opacity 0.2s ease;
  transition: background 0.2s ease, opacity 0.2s ease;
  will-change: background, opacity;
}

/* Ефекти натискання (Спаркли) */
.click-effect {
  position: absolute;
  width: 100%; /* Ширина доріжки */
  height: 100px;
  background: -webkit-gradient(linear, left bottom, left top, from(rgba(255, 255, 255, 0.8)), to(transparent));
  background: linear-gradient(to top, rgba(255, 255, 255, 0.8), transparent);
  pointer-events: none;
  -webkit-animation: fadeOut 0.3s forwards;
          animation: fadeOut 0.3s forwards;
  z-index: 10;
}

@-webkit-keyframes fadeOut {
  to {
    opacity: 0;
    -webkit-transform: scaleY(1.5);
            transform: scaleY(1.5);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    -webkit-transform: scaleY(1.5);
            transform: scaleY(1.5);
  }
}
/* ==========================================
   ✨ PRO VISUALS (DANCE GAME)
   ========================================== */
/* Ефект світіння доріжки при натисканні (S D J K) */
.lane-active {
  background: -webkit-gradient(linear, left bottom, left top, from(rgba(102, 252, 241, 0.4)), to(transparent));
  background: linear-gradient(to top, rgba(102, 252, 241, 0.4) 0%, transparent 100%);
  -webkit-transition: background 0.1s;
  transition: background 0.1s;
}

/* Екран завантаження аналізу пісні (Кіберпанк Неон) */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 22, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  z-index: 200;
  contain: strict;
  padding: 20px;
  box-sizing: border-box;
}

.cyber-loader-card {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  background: rgba(12, 19, 44, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.35);
  -webkit-box-shadow: 0 0 35px rgba(56, 189, 248, 0.22), inset 0 0 20px rgba(168, 85, 247, 0.12);
          box-shadow: 0 0 35px rgba(56, 189, 248, 0.22), inset 0 0 20px rgba(168, 85, 247, 0.12);
  border-radius: 24px;
  padding: 32px 28px 26px 28px;
  max-width: 320px;
  width: 88%;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cyber-loader-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: -webkit-gradient(linear, left top, right top, from(transparent), color-stop(#38bdf8), color-stop(#a855f7), to(transparent));
  background: linear-gradient(90deg, transparent, #38bdf8, #a855f7, transparent);
}

.cyber-spinner-wrapper {
  position: relative;
  width: 70px;
  height: 70px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  margin-bottom: 20px;
}

.cyber-spinner-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: #38bdf8;
  border-right-color: rgba(56, 189, 248, 0.4);
  -webkit-animation: cyber-spin-cw 1.2s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
          animation: cyber-spin-cw 1.2s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
  -webkit-filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
          filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
}

.cyber-spinner-inner {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: #a855f7;
  border-left-color: rgba(168, 85, 247, 0.5);
  -webkit-animation: cyber-spin-ccw 0.9s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
          animation: cyber-spin-ccw 0.9s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
  -webkit-filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.7));
          filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.7));
}

.cyber-spinner-core {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  color: #38bdf8;
  -webkit-animation: cyber-pulse-core 1.6s ease-in-out infinite alternate;
          animation: cyber-pulse-core 1.6s ease-in-out infinite alternate;
  -webkit-filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.9));
          filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.9));
}

@-webkit-keyframes cyber-spin-cw {
  100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
@keyframes cyber-spin-cw {
  100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@-webkit-keyframes cyber-spin-ccw {
  100% { -webkit-transform: rotate(-360deg); transform: rotate(-360deg); }
}
@keyframes cyber-spin-ccw {
  100% { -webkit-transform: rotate(-360deg); transform: rotate(-360deg); }
}

@-webkit-keyframes cyber-pulse-core {
  0% { -webkit-transform: scale(0.88); transform: scale(0.88); opacity: 0.75; }
  100% { -webkit-transform: scale(1.1); transform: scale(1.1); opacity: 1; }
}
@keyframes cyber-pulse-core {
  0% { -webkit-transform: scale(0.88); transform: scale(0.88); opacity: 0.75; }
  100% { -webkit-transform: scale(1.1); transform: scale(1.1); opacity: 1; }
}

.cyber-loader-text {
  margin-bottom: 20px;
}

.cyber-loader-title {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #f8fafc;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
  margin: 0 0 6px 0;
}

.cyber-loader-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.cyber-loader-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.cyber-loader-bar-glow {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 45%;
  background: -webkit-gradient(linear, left top, right top, from(transparent), color-stop(#38bdf8), color-stop(#a855f7), to(transparent));
  background: linear-gradient(90deg, transparent, #38bdf8, #a855f7, transparent);
  border-radius: 3px;
  -webkit-animation: cyber-bar-slide 1.4s ease-in-out infinite;
          animation: cyber-bar-slide 1.4s ease-in-out infinite;
}

@-webkit-keyframes cyber-bar-slide {
  0% { left: -45%; }
  100% { left: 100%; }
}
@keyframes cyber-bar-slide {
  0% { left: -45%; }
  100% { left: 100%; }
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.1);
  border-top: 5px solid var(--highlight);
  border-radius: 50%;
  -webkit-animation: spin 1s linear infinite;
          animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@-webkit-keyframes spin {
  100% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}

@keyframes spin {
  100% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}
/* --- ШКАЛА ПРОГРЕСУ ТА ЗІРКИ --- */
.game-header {
  position: absolute;
  top: 20px; /* За замовчуванням (ПК) */
  left: 50%;
  -webkit-transform: translateX(-50%);
      -ms-transform: translateX(-50%);
          transform: translateX(-50%);
  width: 80%;
  max-width: 400px;
  z-index: 50;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-transition: top 0.3s;
  transition: top 0.3s;
  pointer-events: none;
}
.game-header * {
  pointer-events: auto;
}

.progress-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  position: relative;
  margin-top: 10px;
  overflow: visible; /* Щоб зірки виступали */
}

.progress-fill {
  height: 100%;
  background: -webkit-gradient(linear, left top, right top, from(var(--highlight)), to(#fff));
  background: linear-gradient(90deg, var(--highlight), #fff);
  width: 0%;
  border-radius: 10px;
  -webkit-transition: width 0.1s linear;
  transition: width 0.1s linear;
  -webkit-box-shadow: 0 0 10px var(--highlight);
          box-shadow: 0 0 10px var(--highlight);
  will-change: width;
}

.stars-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.star-marker,
.hud-star {
  position: absolute;
  top: -12px; /* Підняти над смужкою */
  width: 22px;
  height: 22px;
  margin-left: -11px; /* Точне центрування над відсотковою міткою прогресу */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b; /* Неактивна зірка */
  opacity: 0.35;
  text-shadow: 0 0 2px #000;
  -webkit-transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

#star-3,
#star-5,
.star-marker:last-child,
.hud-star:last-child {
  margin-left: -19px; /* Акуратне позиціонування біля правого краю (99.9%) без виходу за межі */
}

.star-marker.active,
.hud-star.active {
  opacity: 1;
  color: #FFD700; /* Золото */
  text-shadow: 0 0 15px #FFD700;
  -webkit-animation: starPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
          animation: starPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@-webkit-keyframes starPop {
  0% { -webkit-transform: scale(0.6); transform: scale(0.6); opacity: 0.4; }
  50% { -webkit-transform: scale(1.6); transform: scale(1.6); opacity: 1; }
  100% { -webkit-transform: scale(1.3); transform: scale(1.3); opacity: 1; }
}

@keyframes starPop {
  0% { transform: scale(0.6); opacity: 0.4; }
  50% { transform: scale(1.6); opacity: 1; }
  100% { transform: scale(1.3); opacity: 1; }
}

/* --- АНІМАЦІЇ --- */
@-webkit-keyframes shake {
  0% {
    -webkit-transform: translate(1px, 1px) rotate(0deg);
            transform: translate(1px, 1px) rotate(0deg);
  }
  10% {
    -webkit-transform: translate(-1px, -2px) rotate(-1deg);
            transform: translate(-1px, -2px) rotate(-1deg);
  }
  20% {
    -webkit-transform: translate(-3px, 0px) rotate(1deg);
            transform: translate(-3px, 0px) rotate(1deg);
  }
  30% {
    -webkit-transform: translate(3px, 2px) rotate(0deg);
            transform: translate(3px, 2px) rotate(0deg);
  }
  40% {
    -webkit-transform: translate(1px, -1px) rotate(1deg);
            transform: translate(1px, -1px) rotate(1deg);
  }
  50% {
    -webkit-transform: translate(-1px, 2px) rotate(-1deg);
            transform: translate(-1px, 2px) rotate(-1deg);
  }
  60% {
    -webkit-transform: translate(-3px, 1px) rotate(0deg);
            transform: translate(-3px, 1px) rotate(0deg);
  }
  70% {
    -webkit-transform: translate(3px, 1px) rotate(-1deg);
            transform: translate(3px, 1px) rotate(-1deg);
  }
  80% {
    -webkit-transform: translate(-1px, -1px) rotate(1deg);
            transform: translate(-1px, -1px) rotate(1deg);
  }
  90% {
    -webkit-transform: translate(1px, 2px) rotate(0deg);
            transform: translate(1px, 2px) rotate(0deg);
  }
  100% {
    -webkit-transform: translate(1px, -2px) rotate(-1deg);
            transform: translate(1px, -2px) rotate(-1deg);
  }
}
@keyframes shake {
  0% {
    -webkit-transform: translate(1px, 1px) rotate(0deg);
            transform: translate(1px, 1px) rotate(0deg);
  }
  10% {
    -webkit-transform: translate(-1px, -2px) rotate(-1deg);
            transform: translate(-1px, -2px) rotate(-1deg);
  }
  20% {
    -webkit-transform: translate(-3px, 0px) rotate(1deg);
            transform: translate(-3px, 0px) rotate(1deg);
  }
  30% {
    -webkit-transform: translate(3px, 2px) rotate(0deg);
            transform: translate(3px, 2px) rotate(0deg);
  }
  40% {
    -webkit-transform: translate(1px, -1px) rotate(1deg);
            transform: translate(1px, -1px) rotate(1deg);
  }
  50% {
    -webkit-transform: translate(-1px, 2px) rotate(-1deg);
            transform: translate(-1px, 2px) rotate(-1deg);
  }
  60% {
    -webkit-transform: translate(-3px, 1px) rotate(0deg);
            transform: translate(-3px, 1px) rotate(0deg);
  }
  70% {
    -webkit-transform: translate(3px, 1px) rotate(-1deg);
            transform: translate(3px, 1px) rotate(-1deg);
  }
  80% {
    -webkit-transform: translate(-1px, -1px) rotate(1deg);
            transform: translate(-1px, -1px) rotate(1deg);
  }
  90% {
    -webkit-transform: translate(1px, 2px) rotate(0deg);
            transform: translate(1px, 2px) rotate(0deg);
  }
  100% {
    -webkit-transform: translate(1px, -2px) rotate(-1deg);
            transform: translate(1px, -2px) rotate(-1deg);
  }
}
/* Промах тепер анімується на 100% апаратно в Canvas 2D (State.screenShake) та через оверлей #miss-flash-overlay */
#miss-flash-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  box-sizing: border-box;
  border: 3px solid rgba(239, 68, 68, 0.85);
  box-shadow: inset 0 0 35px rgba(239, 68, 68, 0.55);
  opacity: 0;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 30;
  will-change: opacity;
}

#miss-flash-overlay.active {
  opacity: 1;
  transition: none;
}

/* Підказка знизу меню */
.instruction-text {
  margin-top: 15px;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.7;
  text-align: center;
  font-family: monospace;
  z-index: 10;
}

/* --- ОНОВЛЕНИЙ СПИСОК ПІСЕНЬ --- */
.song-card {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  background: var(--glass-bg);
  margin-bottom: 12px;
  padding: 15px 20px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.song-info {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  gap: 5px;
}

.song-meta-row {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  width: 100%;
  margin-top: 5px;
}

.artist-name {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Стиль для рекорду в меню */
.score-badge {
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #FFD700; /* Золотий */
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  -webkit-box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
          box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}

.stars-display {
  color: #FFD700;
  letter-spacing: 1px;
  font-size: 1rem;
}

/* --- ТЕМА ДЛЯ ГРИ --- */
/* --- ТЕМА ДЛЯ ГРИ --- */
#game-container {
  /* Глибокий стильний неоновий кібер-хайвей замість суцільної темряви */
  background: #060919;
  background-image: radial-gradient(ellipse at 50% 25%, #182452 0%, #0d1533 52%, #050818 100%);
  transition: background 0.5s;
}

body[data-theme=light] #game-container {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  background-image: none;
}

/* ==========================================================================
   🎮 RHYTHM HIGHWAY & LANES (MODERN CYBERPUNK PLAYFIELD)
   ========================================================================== */

#lanes-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  pointer-events: none;
  z-index: 2;
}

.lane-col {
  flex: 1;
  height: 100%;
  position: relative;
  border-right: 1px solid rgba(56, 189, 248, 0.12);
  transition: background 0.08s ease-out, box-shadow 0.08s ease-out;
}

.lane-col:last-child {
  border-right: none;
}

/* Sleek cyber lane lighting */
.lane-col:nth-child(1) {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.035) 0%, rgba(56, 189, 248, 0.08) 100%);
}
.lane-col:nth-child(2) {
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.035) 0%, rgba(168, 85, 247, 0.08) 100%);
}
.lane-col:nth-child(3) {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.035) 0%, rgba(56, 189, 248, 0.08) 100%);
}
.lane-col:nth-child(4) {
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.035) 0%, rgba(168, 85, 247, 0.08) 100%);
}

/* Sleek subtle neon divider gradient between columns */
.lane-col::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(56, 189, 248, 0.08) 0%,
    rgba(56, 189, 248, 0.3) 40%,
    rgba(168, 85, 247, 0.45) 80%,
    rgba(56, 189, 248, 0.15) 100%
  );
  pointer-events: none;
}

.lane-col:last-child::after {
  display: none;
}

/* Reactive Lane Lighting when player hits / holds lane */
.lane-col {
  position: relative;
  overflow: hidden;
}

.lane-col::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(56, 189, 248, 0.32) 0%,
    rgba(168, 85, 247, 0.15) 30%,
    rgba(56, 189, 248, 0.04) 65%,
    transparent 90%
  );
  box-shadow: inset 0 -40px 50px -10px rgba(56, 189, 248, 0.45),
              inset 0 0 20px rgba(168, 85, 247, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.05s ease-out;
  will-change: opacity;
}

.lane-col.active::before {
  opacity: 1;
}

/* Hit Target Baseline - замінена на 4 адаптивні неонові струни */
.hit-line {
  display: none !important;
}

/* Lane Key Hints (S D J K Cyber Keycaps) */
.lane-hints {
  position: absolute;
  bottom: 18px;
  left: 0;
  width: 100%;
  display: flex;
  pointer-events: none;
  z-index: 20;
  padding: 0 6px;
  box-sizing: border-box;
}

.lane-key {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  margin: 0 5px;
  font-family: 'Montserrat', 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  will-change: transform;
  transition: transform 0.06s ease-out;
}

.lane-key.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.85);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.65), inset 0 0 10px rgba(56, 189, 248, 0.35);
  transform: translateY(2px) scale(0.96);
}

/* Текст в грі */
.game-header h2 {
  color: white !important;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* Інші елементи інтерфейсу */
#game-progress-bar {
  box-shadow: 0 0 15px var(--highlight);
}

@media (max-width: 768px) {
  .arena {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
        -ms-flex-direction: row;
            flex-direction: row;
    gap: 10px;
  }
  .fighter-card {
    height: 50vh;
    width: 48%;
    aspect-ratio: auto;
  }
  .vs-badge {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-width: 2px;
  }
  .battle-header h1 {
    font-size: 1.5rem;
  }
  html, body {
    overflow: hidden !important;
    height: 100% !important;
  }
  .main-container {
    height: 100vh !important;
    padding: 0 !important;
    -webkit-box-pack: center !important;
        -ms-flex-pack: center !important;
            justify-content: center !important;
    overflow: hidden;
  }
  .carousel {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-align: center !important;
        -ms-flex-align: center !important;
            align-items: center !important;
    -webkit-box-pack: center !important;
        -ms-flex-pack: center !important;
            justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    -webkit-perspective: 600px !important;
            perspective: 600px !important;
    position: relative !important;
    margin-top: -50px;
  }
  .panel {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 65vw !important;
    height: 55vh !important;
    max-height: 400px !important;
    margin-left: -32.5vw !important;
    margin-top: -27.5vh !important;
    -webkit-transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5) !important;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5) !important;
    border-radius: 24px;
    overflow: hidden;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
  }
  .panel.center {
    -webkit-transform: translateZ(0) scale(1) !important;
            transform: translateZ(0) scale(1) !important;
    z-index: 10 !important;
    opacity: 1 !important;
  }
  .panel.left {
    -webkit-transform: translateX(-55%) scale(0.8) rotateY(10deg) !important;
            transform: translateX(-55%) scale(0.8) rotateY(10deg) !important;
    z-index: 5 !important;
    opacity: 0.6 !important;
  }
  .panel.right {
    -webkit-transform: translateX(55%) scale(0.8) rotateY(-10deg) !important;
            transform: translateX(55%) scale(0.8) rotateY(-10deg) !important;
    z-index: 5 !important;
    opacity: 0.6 !important;
  }
  .action-btn {
    padding: 12px 30px !important;
    font-size: 1.1rem !important;
  }
  .sketch-layout {
    -webkit-box-pack: center !important;
        -ms-flex-pack: center !important;
            justify-content: center !important;
    padding-top: 0 !important;
  }
  .horizontal-slot {
    width: 95% !important;
  }
  .center-console {
    width: 90% !important;
    padding: 20px !important;
  }
  /* --- 🔥 ВИПРАВЛЕННЯ ДЛЯ ГРИ --- */
  /* На мобільному прибираємо ліву крайню смугу та скидаємо зміщення */
  #game-container {
    margin-left: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
  /* 1. Опускаємо шкалу прогресу нижче кнопок меню */
  .game-header {
    top: 85px !important;
    width: 90% !important;
    -webkit-transform: translateX(-50%) scale(0.85) !important;
        -ms-transform: translateX(-50%) scale(0.85) !important;
            transform: translateX(-50%) scale(0.85) !important;
  }
  /* 2. Зручніша кнопка "Назад" */
  #global-back-btn {
    top: 15px !important;
    left: 15px !important;
    padding: 10px 20px !important;
    font-size: 1rem !important;
  }
  /* 3. Кнопка паузи */
  .pause-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    top: 85px !important; /* На рівні з прогресом */
    left: 10px !important;
  }
  /* 4. Приховуємо зайві підказки на телефоні */
  .lane-key {
    height: 32px;
    font-size: 0.85rem;
    opacity: 0.6;
  }
  /* 5. ФІКС КЛІКІВ: Заборона скролу і зуму */
  #game-container, canvas#rhythmCanvas, canvas#pixiCanvas {
    -ms-touch-action: none !important;
        touch-action: none !important;
  }
  /* Гарантуємо, що кліки проходять крізь оверлеї */
  #hold-effects-container, .hit-line, .lane-hints {
    pointer-events: none !important;
  }
  #song-search-input {
    font-size: 16px !important; /* Запобігає авто-зуму в iOS при натисканні */
  }
}
/* --- Анімація веселкової рамки для секретної пісні --- */
@-webkit-keyframes rainbow-border {
  0% {
    border-color: #ff0000;
    -webkit-box-shadow: 0 0 10px #ff0000;
            box-shadow: 0 0 10px #ff0000;
  }
  20% {
    border-color: #ffff00;
    -webkit-box-shadow: 0 0 10px #ffff00;
            box-shadow: 0 0 10px #ffff00;
  }
  40% {
    border-color: #00ff00;
    -webkit-box-shadow: 0 0 10px #00ff00;
            box-shadow: 0 0 10px #00ff00;
  }
  60% {
    border-color: #00ffff;
    -webkit-box-shadow: 0 0 10px #00ffff;
            box-shadow: 0 0 10px #00ffff;
  }
  80% {
    border-color: #ff00ff;
    -webkit-box-shadow: 0 0 10px #ff00ff;
            box-shadow: 0 0 10px #ff00ff;
  }
  100% {
    border-color: #ff0000;
    -webkit-box-shadow: 0 0 10px #ff0000;
            box-shadow: 0 0 10px #ff0000;
  }
}
@keyframes rainbow-border {
  0% {
    border-color: #ff0000;
    -webkit-box-shadow: 0 0 10px #ff0000;
            box-shadow: 0 0 10px #ff0000;
  }
  20% {
    border-color: #ffff00;
    -webkit-box-shadow: 0 0 10px #ffff00;
            box-shadow: 0 0 10px #ffff00;
  }
  40% {
    border-color: #00ff00;
    -webkit-box-shadow: 0 0 10px #00ff00;
            box-shadow: 0 0 10px #00ff00;
  }
  60% {
    border-color: #00ffff;
    -webkit-box-shadow: 0 0 10px #00ffff;
            box-shadow: 0 0 10px #00ffff;
  }
  80% {
    border-color: #ff00ff;
    -webkit-box-shadow: 0 0 10px #ff00ff;
            box-shadow: 0 0 10px #ff00ff;
  }
  100% {
    border-color: #ff0000;
    -webkit-box-shadow: 0 0 10px #ff0000;
            box-shadow: 0 0 10px #ff0000;
  }
}
.secret-song-card {
  border: 3px solid transparent;
  background: rgba(0, 0, 0, 0.6) !important;
  -webkit-animation: rainbow-border 2s linear infinite;
          animation: rainbow-border 2s linear infinite;
  will-change: border-color;
}

/* Заблокована пісня */
.song-locked {
  position: relative;
  opacity: 0.5;
  -webkit-filter: grayscale(100%);
          filter: grayscale(100%);
  pointer-events: auto !important;
  cursor: not-allowed; /* Візуально показуємо, що дія заборонена, але клік проходить */
}
.song-locked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
      -ms-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background-color: var(--text-color);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ==========================================
   🌊 GAME CONTAINER & COMBO EFFECTS (UNIVERSAL)
   ========================================== */
/* --- ОПТИМІЗОВАНІ АНІМАЦІЇ (GPU ONLY) --- */
/* Замість зміни box-shadow, ми змінюємо тільки opacity */
@-webkit-keyframes pulse-opacity {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}
@keyframes pulse-opacity {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}
/* Базовий клас для контейнера (без анімацій) */
#game-container {
  /* ... твої існуючі стилі ... */
  position: relative;
  z-index: 0;
}

/* Псевдо-елемент, який буде світитися */
#game-container::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  -webkit-transition: opacity 0.5s;
  transition: opacity 0.5s;
  will-change: opacity;
}

/* --- КОНКРЕТНІ ЕФЕКТИ --- */
/* 🔥 ВИДАЛЕНО: .container-ripple-gold, .container-ripple-cosmic, .container-legendary та їхні правила ::after */
/* ==========================================
   ⚡ GOD MODE: PLATINUM & ELECTRICITY (800+)
   ========================================== */
/* --- 1. АНІМАЦІЇ --- */
@-webkit-keyframes vignette-pulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
}
@keyframes vignette-pulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
}
/* ==========================================
   🎄 CHRISTMAS & GOLD SONGS STYLES
   ========================================== */
/* --- Анімація для НОВОРІЧНИХ пісень --- */
@-webkit-keyframes xmas-border {
  0% {
    border-color: #ff0000;
    -webkit-box-shadow: 0 0 10px #ff0000, inset 0 0 10px #ff0000;
            box-shadow: 0 0 10px #ff0000, inset 0 0 10px #ff0000;
  }
  33% {
    border-color: #00ff00;
    -webkit-box-shadow: 0 0 10px #00ff00, inset 0 0 10px #00ff00;
            box-shadow: 0 0 10px #00ff00, inset 0 0 10px #00ff00;
  }
  66% {
    border-color: #ffd700;
    -webkit-box-shadow: 0 0 10px #ffd700, inset 0 0 10px #ffd700;
            box-shadow: 0 0 10px #ffd700, inset 0 0 10px #ffd700;
  }
  100% {
    border-color: #ff0000;
    -webkit-box-shadow: 0 0 10px #ff0000, inset 0 0 10px #ff0000;
            box-shadow: 0 0 10px #ff0000, inset 0 0 10px #ff0000;
  }
}
@keyframes xmas-border {
  0% {
    border-color: #ff0000;
    -webkit-box-shadow: 0 0 10px #ff0000, inset 0 0 10px #ff0000;
            box-shadow: 0 0 10px #ff0000, inset 0 0 10px #ff0000;
  }
  33% {
    border-color: #00ff00;
    -webkit-box-shadow: 0 0 10px #00ff00, inset 0 0 10px #00ff00;
            box-shadow: 0 0 10px #00ff00, inset 0 0 10px #00ff00;
  }
  66% {
    border-color: #ffd700;
    -webkit-box-shadow: 0 0 10px #ffd700, inset 0 0 10px #ffd700;
            box-shadow: 0 0 10px #ffd700, inset 0 0 10px #ffd700;
  }
  100% {
    border-color: #ff0000;
    -webkit-box-shadow: 0 0 10px #ff0000, inset 0 0 10px #ff0000;
            box-shadow: 0 0 10px #ff0000, inset 0 0 10px #ff0000;
  }
}
.song-card.song-xmas {
  background: -webkit-gradient(linear, left top, right top, from(rgba(20, 0, 0, 0.8)), to(rgba(0, 20, 0, 0.8)));
  background: linear-gradient(to right, rgba(20, 0, 0, 0.8), rgba(0, 20, 0, 0.8));
  border: 2px solid transparent;
  -webkit-animation: xmas-border 3s linear infinite;
          animation: xmas-border 3s linear infinite;
  will-change: border-color;
}

.song-card.song-xmas h3::before {
  content: "";
}

/* --- Анімація для ЗОЛОТИХ пісень --- */
@-webkit-keyframes gold-shimmer-border {
  0% {
    border-color: #b8860b;
    -webkit-box-shadow: 0 0 5px #b8860b;
            box-shadow: 0 0 5px #b8860b;
  }
  50% {
    border-color: #ffd700;
    -webkit-box-shadow: 0 0 15px #ffd700;
            box-shadow: 0 0 15px #ffd700;
  }
  100% {
    border-color: #b8860b;
    -webkit-box-shadow: 0 0 5px #b8860b;
            box-shadow: 0 0 5px #b8860b;
  }
}
@keyframes gold-shimmer-border {
  0% {
    border-color: #b8860b;
    -webkit-box-shadow: 0 0 5px #b8860b;
            box-shadow: 0 0 5px #b8860b;
  }
  50% {
    border-color: #ffd700;
    -webkit-box-shadow: 0 0 15px #ffd700;
            box-shadow: 0 0 15px #ffd700;
  }
  100% {
    border-color: #b8860b;
    -webkit-box-shadow: 0 0 5px #b8860b;
            box-shadow: 0 0 5px #b8860b;
  }
}
.song-card.song-gold {
  border: 1px solid #ffd700;
  background: rgba(40, 30, 10, 0.6); /* Легкий золотий відтінок фону */
  -webkit-animation: gold-shimmer-border 2s ease-in-out infinite;
          animation: gold-shimmer-border 2s ease-in-out infinite;
  will-change: border-color;
}

/* --- Стиль для тривалості пісні (Час) --- */
.song-duration {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================
   🔍 SEARCH BAR STYLES (FIXED CLICKS)
   ========================================== */
.search-container {
  width: 100%;
  position: relative;
  z-index: 5;
}

#song-search-input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 42px !important;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
  text-align: left !important;
  box-sizing: border-box;
}

#song-search-input:focus {
  border-color: var(--highlight);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

#song-search-input::placeholder {
  color: var(--text-muted);
  font-style: normal;
}
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}
#song-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}
#song-search-input:focus {
  background: var(--glass-bg);
  border-color: var(--highlight);
  -webkit-box-shadow: 0 0 20px var(--accent-glow);
          box-shadow: 0 0 20px var(--accent-glow);
  -webkit-transform: scale(1.02);
      -ms-transform: scale(1.02);
          transform: scale(1.02);
}

.song-list-container {
  position: relative;
  z-index: 10;
  pointer-events: auto !important;
}

.song-card {
  position: relative;
  z-index: 11;
  pointer-events: auto !important;
}

/* Фікс для iOS (запобігає зуму) */
@media (max-width: 768px) {
  #song-search-input {
    font-size: 16px !important;
  }
}
/* ==========================================
   🔥 FINAL MOBILE FIXES (NO LAGS + STATIC EFFECTS)
   ========================================== */
@media (max-width: 768px) {
  /* 1. Блокуємо системні дії */
  html, body, #game-container, canvas#rhythmCanvas, canvas#pixiCanvas {
    overflow: hidden !important;
    -ms-touch-action: none !important;
        touch-action: none !important;
  }
  /* 2. ТУНЕЛЬ ТЕПЕР ПРАЦЮЄ */
  #legendary-border-overlay.active {
    display: block !important;
    -webkit-animation: vignette-pulse 3s infinite ease-in-out !important;
            animation: vignette-pulse 3s infinite ease-in-out !important;
    will-change: opacity;
  }
  /* 3. ОПТИМІЗАЦІЯ КОНТЕЙНЕРА */
  #game-container {
    margin-left: 0 !important;
    border-left: none !important;
    border-right: none !important;
    -webkit-transform: translateZ(0);
            transform: translateZ(0);
    will-change: border-color, box-shadow;
    -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
    -webkit-perspective: 1000px;
            perspective: 1000px;
    contain: strict;
  }
  /* =========================================
       4. АНІМОВАНІ ЕФЕКТИ (OPTIMIZED INSET)
       ========================================= */
  /* REMOVED: mobile-gold-pulse, mobile-cosmic-pulse, mobile-legendary-pulse keyframes
     and the rules for #game-container.container-ripple-gold / container-ripple-cosmic / container-legendary
     (they were deleted because JS більше не додає відповідні класи) */
  /* 6. ФІКС ПРОМАХУ: 0 reflow і 0 лагів від поворотів контейнера */
  #miss-flash-overlay {
    border-width: 4px;
    box-shadow: inset 0 0 32px rgba(239, 68, 68, 0.7);
  }
  /* 7. UI Адаптація */
  #game-container .game-header {
    top: 50px !important;
    width: 90% !important;
    left: 50% !important;
    -webkit-transform: translateX(-50%) scale(0.9) !important;
        -ms-transform: translateX(-50%) scale(0.9) !important;
            transform: translateX(-50%) scale(0.9) !important;
  }
  .pause-btn {
    top: 120px !important;
    left: 10px !important;
  }
  #global-back-btn {
    top: 15px !important;
    left: 15px !important;
  }
  .controls-layer {
    top: 15px !important;
    right: 15px !important;
  }
  /* Пропускаємо кліки */
  #hold-effects-container, .hit-line, .lane-hints, .click-effect, #legendary-border-overlay, #miss-flash-overlay {
    pointer-events: none !important;
  }
}
/* ==========================================
   🏆 LEADERBOARD MODAL (STABLE WIDTH FIX - LEGACY)
   ========================================== */
.leaderboard-modal-legacy-380 {
  position: fixed;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
      -ms-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  z-index: 100;
  /* 🔥 ФІКС: Робимо ширину стабільною, а не "гумовою" */
  width: 95%; /* На мобільному майже на весь екран */
  max-width: 380px; /* На ПК фіксована ширина (як у Global таблиці) */
  height: 550px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  -webkit-box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
          box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border-radius: 24px;
  padding: 20px;
  color: var(--text-color);
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  -webkit-animation: modalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
          animation: modalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Заголовок (з фіксом від налізання) */
.lb-title {
  font-size: 1.2rem; /* 📉 Трохи менший шрифт, щоб влазив довгий текст */
  font-weight: 900;
  color: var(--highlight);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-right: 15px; /* 🔥 Відступ від хрестика */
  white-space: nowrap; /* Заборона переносу рядків */
  overflow: hidden; /* Якщо текст ну дуууже довгий, обріжемо */
  text-overflow: ellipsis;
}

/* Кнопка закриття */
.lb-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-color);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-transition: 0.2s;
  transition: 0.2s;
  -ms-flex-negative: 0;
      flex-shrink: 0; /* 🔥 Кнопка ніколи не стиснеться */
}

/* Таблиця розтягується на всю ширину контейнера */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  /* table-layout: fixed; <--- Можна додати, якщо колонки будуть стрибати, але поки не треба */
}

.lb-close-btn:hover {
  background: #ff4444;
  color: white;
  -webkit-transform: rotate(90deg);
      -ms-transform: rotate(90deg);
          transform: rotate(90deg);
}

/* --- ВКЛАДКИ (TABS) --- */
.lb-tabs {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 15px;
  border: 1px solid var(--glass-border);
}

.lb-tab-btn {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-color);
  opacity: 0.6;
  font-weight: bold;
  cursor: pointer;
  border-radius: 8px;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  font-family: inherit;
}

.lb-tab-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
}

/* Активна вкладка */
.lb-tab-btn.active {
  background: var(--highlight); /* Колір теми (ціан/золото) */
  color: #000; /* Контрастний текст */
  opacity: 1;
  -webkit-box-shadow: 0 0 15px var(--accent-glow);
          box-shadow: 0 0 15px var(--accent-glow);
}

/* --- КОНТЕНТ (ТАБЛИЦЯ) --- */
.lb-content-wrapper {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1; /* Займає всю доступну висоту */
  overflow: hidden; /* Ховаємо зайве */
  position: relative;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.lb-scroll-area {
  height: 100%;
  overflow-y: auto;
  padding: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--highlight) transparent;
  opacity: 1;
  -webkit-transition: opacity 0.2s ease-in-out;
  transition: opacity 0.2s ease-in-out;
}

.lb-scroll-area.fading {
  opacity: 0;
}

/* Таблиця з мін шириною та nowrap щоб не ламати layout */
.lb-table {
  width: 100%;
  min-width: 300px; /* Мінімальна ширина самої таблиці */
  border-collapse: collapse;
  white-space: nowrap;
}

.lb-table th {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.5); /* Напівпрозорий заголовок */
  -webkit-backdrop-filter: blur(5px);
          backdrop-filter: blur(5px);
  color: var(--highlight);
  padding: 12px;
  font-size: 0.7rem;
  text-align: left;
  z-index: 2;
}

.lb-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
}

.lb-table tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

/* Номери рангів */
.rank-1 {
  color: #FFD700;
  text-shadow: 0 0 10px #FFD700;
  font-size: 1.2rem;
}

.rank-2 {
  color: #C0C0C0;
  text-shadow: 0 0 10px #C0C0C0;
  font-size: 1.1rem;
}

.rank-3 {
  color: #CD7F32;
  text-shadow: 0 0 10px #CD7F32;
  font-size: 1.1rem;
}

/* ... Existing SCSS ... */
/* ==========================================
   💎 DIAMOND STARS & DARKER NOTES
   ========================================== */
/* --- ДІАМАНТОВА ЗІРКА (В ГРІ) --- */
.star-marker.diamond,
.hud-star.diamond {
  color: #00f2ff !important; /* Яскравий ціан */
  text-shadow: 0 0 10px #00f2ff, 0 0 20px #00f2ff, 0 0 5px #ffffff;
  -webkit-transform: scale(1.5) rotate(15deg);
      -ms-transform: scale(1.5) rotate(15deg);
          transform: scale(1.5) rotate(15deg); /* Трохи більша і під нахилом */
  z-index: 10;
  -webkit-transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Анімація появи діаманта */
.star-marker.diamond.active,
.hud-star.diamond.active {
  -webkit-animation: diamondPop 0.6s ease-out forwards;
          animation: diamondPop 0.6s ease-out forwards;
}

@-webkit-keyframes diamondPop {
  0% {
    -webkit-transform: scale(0.5);
            transform: scale(0.5);
    opacity: 0;
  }
  50% {
    -webkit-transform: scale(1.8);
            transform: scale(1.8);
    opacity: 1;
  }
  100% {
    -webkit-transform: scale(1.5) rotate(15deg);
            transform: scale(1.5) rotate(15deg);
  }
}

@keyframes diamondPop {
  0% {
    -webkit-transform: scale(0.5);
            transform: scale(0.5);
    opacity: 0;
  }
  50% {
    -webkit-transform: scale(1.8);
            transform: scale(1.8);
    opacity: 1;
  }
  100% {
    -webkit-transform: scale(1.5) rotate(15deg);
            transform: scale(1.5) rotate(15deg);
  }
}
/* --- ДІАМАНТОВА ЗІРКА (В МЕНЮ/РЕЗУЛЬТАТАХ) --- */
.star-diamond {
  color: #00f2ff;
  text-shadow: 0 0 8px rgba(0, 242, 255, 0.8);
  display: inline-block;
}

/* --- ЗІРКИ НА ЕКРАНІ РЕЗУЛЬТАТІВ --- */
.result-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.result-star.diamond svg {
  filter: drop-shadow(0 0 8px #00f2ff) drop-shadow(0 0 16px rgba(0, 242, 255, 0.7));
  animation: resultStarPop 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.result-star.gold svg {
  filter: drop-shadow(0 0 8px #f59e0b) drop-shadow(0 0 14px rgba(245, 158, 11, 0.6));
  animation: resultStarPop 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.result-star.empty svg {
  opacity: 0.25;
}

@keyframes resultStarPop {
  0% { transform: scale(0.6); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* Щоб зірки в меню стояли рівно */
.stars-display {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  gap: 2px;
}

/*
    CHRONICLES ANASTAXIAN: AAA IMMERSIVE STYLES
    Updated for Mobile Scale & Video Integration
*/
body.book-theme {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  background-color: #0f0e0d;
  background: radial-gradient(circle at 50% 50%, #1a1816 0%, #0f0e0d 100%);
  overflow: hidden;
  color: #2b231e;
}

.scene {
  width: 100%;
  height: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-perspective: 2000px;
          perspective: 2000px;
  overflow: hidden;
}

.book {
  position: relative;
  width: 480px;
  height: 660px;
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  -webkit-transition: -webkit-transform 1.4s cubic-bezier(0.25, 1, 0.5, 1);
  transition: -webkit-transform 1.4s cubic-bezier(0.25, 1, 0.5, 1);
  transition: transform 1.4s cubic-bezier(0.25, 1, 0.5, 1);
  transition: transform 1.4s cubic-bezier(0.25, 1, 0.5, 1), -webkit-transform 1.4s cubic-bezier(0.25, 1, 0.5, 1);
  font-family: "Cormorant Garamond", serif;
}

.book-shadow {
  position: absolute;
  bottom: -20px;
  left: 5%;
  width: 90%;
  height: 40px;
  background: rgba(0, 0, 0, 0.6);
  -webkit-filter: blur(20px);
          filter: blur(20px);
  -webkit-transform: rotateX(90deg) translateZ(-40px);
          transform: rotateX(90deg) translateZ(-40px);
  -webkit-transition: all 1.4s ease;
  transition: all 1.4s ease;
}

.book-spine {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 100%;
  background: #2a1d15;
  -webkit-transform: rotateY(90deg) translateZ(-20px);
          transform: rotateY(90deg) translateZ(-20px);
  -webkit-transform-origin: left;
      -ms-transform-origin: left;
          transform-origin: left;
  background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.6)), color-stop(40%, transparent), color-stop(60%, transparent), to(rgba(0, 0, 0, 0.6)));
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.6), transparent 40%, transparent 60%, rgba(0, 0, 0, 0.6));
}

.page {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  -webkit-transform-origin: left center;
      -ms-transform-origin: left center;
          transform-origin: left center;
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  -webkit-transition: -webkit-transform 1.4s cubic-bezier(0.25, 1, 0.5, 1);
  transition: -webkit-transform 1.4s cubic-bezier(0.25, 1, 0.5, 1);
  transition: transform 1.4s cubic-bezier(0.25, 1, 0.5, 1);
  transition: transform 1.4s cubic-bezier(0.25, 1, 0.5, 1), -webkit-transform 1.4s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: -webkit-grab;
  cursor: grab;
}
.page:active {
  cursor: -webkit-grabbing;
  cursor: grabbing;
}
.page.flipped {
  -webkit-transform: rotateY(-180deg);
          transform: rotateY(-180deg);
}
.page.flipped .layer-lighting {
  opacity: 1;
}

.page__face {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  overflow: hidden;
  background-color: #e6dccf;
  border-radius: 0 4px 4px 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.page__face--front {
  -webkit-transform: rotateY(0deg) translateZ(1px);
          transform: rotateY(0deg) translateZ(1px);
}
.page__face--back {
  -webkit-transform: rotateY(180deg) translateZ(1px);
          transform: rotateY(180deg) translateZ(1px);
  border-radius: 4px 0 0 4px;
}
.page__face--back .layer-lighting {
  background: -webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.2)), color-stop(20%, transparent));
  background: linear-gradient(to left, rgba(0, 0, 0, 0.2) 0%, transparent 20%);
}

.layer-base {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e6dccf;
}

.layer-texture {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e6dccf;
  -webkit-filter: url("#paper-grain") sepia(20%);
          filter: url("#paper-grain") sepia(20%);
  background-image: radial-gradient(circle at center, transparent 40%, rgba(42, 29, 21, 0.1) 100%);
  opacity: 0.8;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.layer-lighting {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.25)), color-stop(12%, transparent), color-stop(95%, transparent), to(rgba(0, 0, 0, 0.05)));
  background: linear-gradient(to right, rgba(0, 0, 0, 0.25) 0%, transparent 12%, transparent 95%, rgba(0, 0, 0, 0.05) 100%);
  -webkit-transition: opacity 0.5s ease;
  transition: opacity 0.5s ease;
  z-index: 10;
}

.cover-texture {
  background-color: #2a1d15;
  background-image: radial-gradient(circle at 30% 30%, rgba(74, 59, 50, 0.5), transparent 40%);
  -webkit-box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9);
          box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9);
  color: #c5a059;
  border: 3px solid black;
}
.cover-texture:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 12px;
  border: 2px solid #c5a059;
  outline: 1px solid rgba(0, 0, 0, 0.5);
  outline-offset: -4px;
  pointer-events: none;
}

.cover--back {
  -webkit-transform: translateZ(-40px) rotateY(180deg) !important;
          transform: translateZ(-40px) rotateY(180deg) !important;
  border-radius: 4px 0 0 4px;
  -webkit-box-shadow: -5px 5px 20px rgba(0, 0, 0, 0.5);
          box-shadow: -5px 5px 20px rgba(0, 0, 0, 0.5);
}

.content-wrapper {
  position: relative;
  height: 100%;
  padding: 50px 40px;
  z-index: 5;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}
.content-wrapper.flex-center {
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
}
.content-wrapper.flex-bottom {
  -webkit-box-pack: end;
      -ms-flex-pack: end;
          justify-content: flex-end;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  padding-bottom: 40px;
}

.book h1, .book h2, .book h3 {
  font-family: "Cinzel Decorative", cursive;
  font-weight: 700;
  margin: 0;
  text-align: center;
  color: #2b231e;
  line-height: 1.2;
}
.book h3 {
  font-size: 2rem;
  border-bottom: 1px solid rgba(197, 160, 89, 0.5);
  padding-bottom: 10px;
  margin-bottom: 5px;
}
.book .chapter-ornament {
  display: block;
  text-align: center;
  font-family: "Cinzel Decorative", cursive;
  color: #c5a059;
  font-size: 1.5rem;
  margin-bottom: 20px;
}
.book p {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  text-align: justify;
  text-indent: 1.5rem;
}
.book p.drop-cap-text {
  text-indent: 0;
}
.book p.caption {
  font-size: 0.9rem;
  text-align: center;
  font-style: italic;
  color: #5c4d42;
  text-indent: 0;
  margin-top: 10px;
}
.book .drop-cap {
  float: left;
  font-family: "Cinzel Decorative", cursive;
  font-size: 3.5rem;
  line-height: 0.8;
  color: #2a1d15;
  margin-right: 8px;
  margin-top: 4px;
}
.book .mt-auto {
  margin-top: auto;
}

.video-frame {
  position: relative;
  width: 100%;
  margin: 15px 0;
  overflow: hidden;
  background: #000;
  -webkit-transition: -webkit-transform 0.3s ease;
  transition: -webkit-transform 0.3s ease;
  transition: transform 0.3s ease;
  transition: transform 0.3s ease, -webkit-transform 0.3s ease;
  cursor: pointer;
}
.video-frame video {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  display: block;
  -webkit-transition: -webkit-filter 0.5s ease;
  transition: -webkit-filter 0.5s ease;
  transition: filter 0.5s ease;
  transition: filter 0.5s ease, -webkit-filter 0.5s ease;
}
.video-frame.ink-style {
  border-radius: 2px;
  -webkit-box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
          box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.video-frame.ink-style video {
  -webkit-filter: sepia(0.5) contrast(1.1) brightness(0.9) grayscale(0.2);
          filter: sepia(0.5) contrast(1.1) brightness(0.9) grayscale(0.2);
}
.video-frame.ink-style:hover video {
  -webkit-filter: sepia(0.1) contrast(1) brightness(1) grayscale(0);
          filter: sepia(0.1) contrast(1) brightness(1) grayscale(0);
}
.video-frame.large-frame {
  height: 280px;
  border: 4px double #5c4d42;
}
.video-frame.full-fill {
  height: 100%;
}
.video-frame.circle-frame {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  margin: 20px auto;
  border: 4px solid #c5a059;
  -webkit-box-shadow: 0 0 15px rgba(197, 160, 89, 0.3);
          box-shadow: 0 0 15px rgba(197, 160, 89, 0.3);
}
.video-frame .video-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  color: #fff;
  font-size: 14px;
  opacity: 0.7;
  -webkit-transition: opacity 0.3s;
  transition: opacity 0.3s;
  pointer-events: none;
}
.video-frame.playing .video-overlay {
  opacity: 0;
}
.video-frame:hover .video-overlay {
  opacity: 1;
}

.cover-content {
  height: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  z-index: 5;
  -webkit-transform: translateZ(2px);
          transform: translateZ(2px);
}

.emboss-frame {
  border: 2px solid #c5a059;
  padding: 40px 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
          box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
  position: relative;
  width: 70%;
}
.emboss-frame h1 {
  color: #c5a059;
  background: linear-gradient(135deg, #c5a059 0%, #f0e68c 50%, #c5a059 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  font-size: 2rem;
  letter-spacing: 2px;
  margin: 20px 0;
  text-transform: uppercase;
  line-height: 1;
}
.emboss-frame .subtitle {
  color: rgba(197, 160, 89, 0.9);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.emboss-frame .main-symbol {
  font-size: 3.5rem;
  color: #c5a059;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.corner-ornament {
  position: absolute;
  width: 50px;
  height: 50px;
  opacity: 0.8;
  background-image: url("data:image/svg+xml,%3Csvg width='50' height='50' viewBox='0 0 50 50' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2H20C35 2 48 15 48 30V48' stroke='%23c5a059' stroke-width='2'/%3E%3Cpath d='M6 6H18C28 6 38 16 38 28V44' stroke='%23c5a059' stroke-width='1'/%3E%3C/svg%3E");
  background-size: contain;
}
.corner-ornament.top-left {
  top: 15px;
  left: 15px;
}
.corner-ornament.top-right {
  top: 15px;
  right: 15px;
  -webkit-transform: rotate(90deg);
      -ms-transform: rotate(90deg);
          transform: rotate(90deg);
}
.corner-ornament.bottom-right {
  bottom: 15px;
  right: 15px;
  -webkit-transform: rotate(180deg);
      -ms-transform: rotate(180deg);
          transform: rotate(180deg);
}
.corner-ornament.bottom-left {
  bottom: 15px;
  left: 15px;
  -webkit-transform: rotate(-90deg);
      -ms-transform: rotate(-90deg);
          transform: rotate(-90deg);
}

.divider-ornament {
  text-align: center;
  color: #c5a059;
  font-family: "Cinzel Decorative", cursive;
  margin: 30px 0;
  font-size: 1.2rem;
  opacity: 0.7;
}

.page-number {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: "Cinzel Decorative", cursive;
  color: rgba(43, 35, 30, 0.5);
  font-size: 0.9rem;
}
.page-number:before, .page-number:after {
  content: "—";
  margin: 0 8px;
  color: #c5a059;
}

.illuminated-border {
  border: 1px solid rgba(197, 160, 89, 0.4);
  padding: 20px;
  height: 100%;
  position: relative;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}
.illuminated-border:before {
  content: "⚜";
  position: absolute;
  top: -12px;
  left: 50%;
  -webkit-transform: translateX(-50%);
      -ms-transform: translateX(-50%);
          transform: translateX(-50%);
  background: #e6dccf;
  padding: 0 10px;
  color: #c5a059;
}

.magic-back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 2000;
  text-decoration: none;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 8px;
  color: #c5a059;
  font-family: "Cinzel Decorative", cursive;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: 20px;
  -webkit-transition: 0.3s;
  transition: 0.3s;
}
.magic-back-btn:hover {
  background: rgba(197, 160, 89, 0.2);
  -webkit-box-shadow: 0 0 10px rgba(197, 160, 89, 0.3);
          box-shadow: 0 0 10px rgba(197, 160, 89, 0.3);
}

.orientation-lock {
  display: none;
}

@media (max-width: 900px) {
  .magic-back-btn .btn-text {
    display: none;
  }
  .book p {
    font-size: 1rem;
    line-height: 1.4;
  }
  .emboss-frame h1 {
    font-size: 2.2rem;
  }
}
@media screen and (orientation: portrait) and (max-width: 600px) {
  .orientation-lock {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex; /* Було none, стало flex */
    /* Це змусить користувача перевернути телефон, де дві сторінки влізуть ідеально */
  }
  .scene {
    display: none; /* Ховаємо книгу, поки не переверне */
  }
}
/* --- LANGUAGE SWITCHER --- */
.lang-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  padding: 5px;
  border-radius: 20px;
  border: 1px solid rgba(197, 160, 89, 0.3);
}
.lang-switcher .lang-btn {
  background: transparent;
  border: none;
  color: rgba(197, 160, 89, 0.6);
  font-family: "Cinzel Decorative", cursive;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 5px 10px;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  border-radius: 15px;
}
.lang-switcher .lang-btn:hover {
  color: #c5a059;
  text-shadow: 0 0 5px #c5a059;
}
.lang-switcher .lang-btn.active {
  color: #0f0e0d;
  background: #c5a059;
  font-weight: bold;
  -webkit-box-shadow: 0 0 10px rgba(197, 160, 89, 0.5);
          box-shadow: 0 0 10px rgba(197, 160, 89, 0.5);
}

@media (max-width: 900px) {
  .lang-switcher {
    top: 15px;
    right: 15px;
  }
  .lang-switcher .lang-btn {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
}

/* ==========================================
   NEON PIANO: PROFESSIONAL UI SYSTEM
   Clean, Calm, Accessible (Dark & Light)
   ========================================== */

/* Icons */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  pointer-events: none;
}

/* App Header Navigation */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--surface-border);
  background: rgba(11, 15, 25, 0.85);
  box-sizing: border-box;
}

body[data-theme=light] .app-header {
  background: rgba(248, 250, 252, 0.9);
  border-bottom-color: #e2e8f0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  color: var(--text-primary);
  user-select: none;
}

.logo-badge .icon {
  color: var(--highlight);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--surface-border);
  margin: 0 4px;
}

/* Base Nav Button */
.nav-btn {
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--surface-color);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.nav-btn:hover {
  background: var(--surface-hover);
  border-color: var(--surface-border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.nav-btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
}

.nav-btn-primary {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--highlight);
}

.nav-btn-primary:hover {
  background: var(--highlight);
  border-color: var(--highlight);
  color: #fff;
}

.nav-btn-admin {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

.nav-btn-admin:hover {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #000;
}

.nav-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.nav-btn-danger:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.user-badge-pill {
  height: 38px;
  padding: 0 14px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: var(--surface-color);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  box-sizing: border-box;
}

.icon-user-container {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  max-width: 24px;
  max-height: 24px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  background: rgba(255, 255, 255, 0.08);
}

.icon-user-container img,
.icon-user-container .avatar-photo {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  display: block !important;
}

.icon-user-container .avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--highlight);
  background: rgba(56, 189, 248, 0.15);
  border-radius: 50%;
}

.icon-user-container svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

body[data-theme=light] .user-badge-pill {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}

/* Language Switcher */
.lang-wrapper {
  position: relative;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 135px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 2000;
}

body[data-theme=light] .lang-dropdown {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

.lang-dropdown.show-dropdown {
  display: flex !important;
}

.lang-dropdown button {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-dropdown button:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* Search bar styling */
.search-container {
  width: 90%;
  max-width: 520px;
  margin-bottom: 16px;
  position: relative;
  z-index: 10;
}

.search-container input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: var(--surface-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s ease;
}

.search-container input:focus {
  border-color: var(--highlight);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

body[data-theme=light] .search-container input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.search-icon-inside {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Song list container */
.song-list-container {
  width: 90%;
  max-width: 520px;
  height: 60vh;
  max-height: 540px;
  overflow-y: auto;
  background: var(--glass-bg);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 12px;
  box-sizing: border-box;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  scrollbar-width: thin;
  scrollbar-color: var(--highlight) transparent;
}

body[data-theme=light] .song-list-container {
  background: rgba(255, 255, 255, 0.85);
  border-color: #e2e8f0;
}

/* Leaderboard Button */
.btn-leaderboard {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 12px 0 !important;
  padding: 10px 18px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.15)) !important;
  color: var(--text-primary) !important;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none !important;
  text-shadow: none !important;
}

.btn-leaderboard:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(99, 102, 241, 0.25)) !important;
  border-color: var(--highlight) !important;
  transform: translateY(-1px);
}

body[data-theme=light] .btn-leaderboard {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(79, 70, 229, 0.08)) !important;
  border-color: rgba(2, 132, 199, 0.3) !important;
  color: #0284c7 !important;
}

/* Song Card */
.song-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  margin-bottom: 8px;
  padding: 14px 18px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.song-card:hover {
  background: var(--surface-hover);
  border-color: var(--surface-border-hover);
  transform: translateY(-1px);
}

body[data-theme=light] .song-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

body[data-theme=light] .song-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.song-info h3 {
  margin: 0 0 6px 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.song-duration {
  font-size: 0.8rem;
  font-weight: normal;
  color: var(--text-muted);
}

.song-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.artist-name {
  color: var(--text-secondary);
}

.song-play-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  color: var(--highlight);
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 12px;
}

.song-card:hover .song-play-icon {
  background: var(--highlight);
  color: #fff;
  transform: scale(1.08);
}

body[data-theme=light] .song-play-icon {
  background: rgba(2, 132, 199, 0.08);
  color: #0284c7;
}

body[data-theme=light] .song-card:hover .song-play-icon {
  background: #0284c7;
  color: #ffffff;
}

/* Modals Modernization */
.leaderboard-modal, .name-input-modal, .pause-overlay {
  background: rgba(0, 0, 0, 0.7) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.admin-modal-content {
  position: relative;
  width: 95vw !important;
  max-width: 1040px !important;
  max-height: 90vh !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid var(--surface-border-hover) !important;
  border-radius: 20px !important;
  background: var(--surface-color) !important;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7) !important;
  overflow: hidden !important;
  color: var(--text-color) !important;
  text-align: left !important;
  box-sizing: border-box !important;
}

body[data-theme=light] .admin-modal-content {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15) !important;
  color: #0f172a !important;
}

/* ==========================================
   ADMIN FIXED HEADER & ALWAYS-VISIBLE CLOSE BUTTON
   ========================================== */
.admin-sticky-header {
  position: relative !important;
  top: 0 !important;
  margin: 0 !important;
  padding: 16px 24px 14px 24px !important;
  background: rgba(15, 23, 42, 0.98) !important;
  z-index: 1000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  flex-shrink: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body[data-theme="light"] .admin-sticky-header {
  background: rgba(255, 255, 255, 0.98) !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

.admin-modal-scroll-area {
  flex: 1 1 auto;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 18px 22px !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.admin-header-title-wrap {
  flex: 1;
  min-width: 0;
}

.admin-header-title {
  color: var(--highlight, #38bdf8);
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-header-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 3px;
  margin-bottom: 0;
  line-height: 1.35;
}

.admin-sticky-close-btn {
  position: static !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 50% !important;
  background: rgba(239, 68, 68, 0.18) !important;
  border: 2px solid rgba(239, 68, 68, 0.55) !important;
  color: #ef4444 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  flex-shrink: 0 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25) !important;
}

.admin-sticky-close-btn:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6) !important;
}

.admin-sticky-close-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.5;
  pointer-events: none;
}

@media (max-width: 640px) {
  .admin-sticky-header {
    top: 0 !important;
    margin: 0 !important;
    padding: 12px 16px 10px 16px !important;
  }
  .admin-header-title {
    font-size: 1.15rem;
  }
  .admin-header-subtitle {
    font-size: 0.72rem;
  }
  .admin-sticky-close-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
  }
  .admin-sticky-close-btn svg {
    width: 18px;
    height: 18px;
  }
}

.name-input-content, .leaderboard-content {
  background: var(--surface-color) !important;
  border: 1px solid var(--surface-border) !important;
  border-radius: 18px !important;
  color: var(--text-color) !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6) !important;
}

body[data-theme=light] .name-input-content,
body[data-theme=light] .leaderboard-content {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.1) !important;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 200;
  padding: 0;
}

.modal-close-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  transform: scale(1.08);
}

/* ==========================================
   ADMIN AUTO-BOT / AUTO-PLAY CONTROLS
   ========================================== */
.admin-autobot-banner {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  transition: all 0.3s ease;
}

body[data-theme=light] .admin-autobot-banner {
  background: rgba(14, 165, 233, 0.06);
  border-color: rgba(14, 165, 233, 0.25);
}

.admin-autobot-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.admin-bot-icon-container {
  color: var(--highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  flex-shrink: 0;
}

.admin-autobot-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.admin-autobot-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.admin-bot-btn {
  min-width: 130px;
  height: 38px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  transition: all 0.25s ease;
}

.admin-bot-btn .bot-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  transition: all 0.25s ease;
}

.admin-bot-btn.active-bot {
  background: rgba(34, 197, 94, 0.15) !important;
  border-color: rgba(34, 197, 94, 0.5) !important;
  color: #22c55e !important;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

.admin-bot-btn.active-bot .bot-status-dot {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

/* In-game badge when auto-bot is running */
.game-bot-pill {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  border-radius: 20px;
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  z-index: 100;
  pointer-events: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
  animation: botPulse 2s infinite ease-in-out;
}

@keyframes botPulse {
  0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.04); }
}

.game-bot-pill .bot-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
}

/* ==========================================
   ADMIN PANEL TABS & SCORES EDITOR STYLES
   ========================================== */
.admin-tab-btn {
  padding: 8px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.admin-tab-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.admin-tab-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* ==========================================
   AUTH MODAL TABS (LOGIN / REGISTER)
   ========================================== */
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  background: rgba(15, 23, 42, 0.4);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  outline: none;
}

.auth-tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.06);
}

.auth-tab-btn.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.admin-star-toggle {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-star-toggle:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

.admin-star-toggle.gold {
  background: rgba(234, 179, 8, 0.15);
  border-color: #eab308;
}

.admin-star-toggle.diamond {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.admin-level-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.admin-level-row:hover {
  background: rgba(56, 189, 248, 0.1) !important;
}

.admin-level-row.selected {
  background: rgba(56, 189, 248, 0.2) !important;
  border-left: 3px solid #38bdf8;
}

.admin-btn-danger {
  border-color: #ef4444 !important;
  color: #f87171 !important;
  transition: all 0.2s ease;
}

.admin-btn-danger:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #f87171 !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.admin-row-delete-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: 6px;
  padding: 5px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.admin-row-delete-btn:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  transform: scale(1.1);
}

/* Leaderboard Limit Selector */
.lb-limit-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.lb-limit-btn {
  padding: 3px 10px;
  font-size: 0.76rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lb-limit-btn:hover {
  border-color: var(--highlight);
  color: #fff;
}

.lb-limit-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
}

/* ==========================================
   GAMEPLAY SCREEN FIX: HIDE HEADER IN-GAME
   ========================================== */
body.in-game .app-header {
  display: none !important;
}

@media (max-width: 680px) {
  .app-header {
    padding: 0 8px;
    height: 52px;
  }

  .settings-group {
    display: flex !important;
    gap: 3px !important;
  }

  .header-divider {
    display: block !important;
    margin: 0 3px !important;
    height: 20px !important;
    opacity: 0.25 !important;
  }

  .header-left {
    gap: 6px;
    flex-shrink: 0;
  }

  .logo-badge {
    font-size: 0.92rem;
    letter-spacing: 0.5px;
    gap: 6px;
  }

  .header-right {
    gap: 3px;
    flex-shrink: 0;
  }

  .header-group {
    gap: 3px !important;
  }

  .nav-btn-primary {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
    justify-content: center;
  }

  .nav-btn-primary span[data-i18n="login"] {
    display: none !important;
  }

  .nav-btn-admin {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
    justify-content: center;
  }

  .nav-btn-admin span[data-i18n="adminPanel"] {
    display: none !important;
  }

  .nav-btn-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
  }

  .lang-wrapper button#langToggle {
    height: 32px !important;
    padding: 0 5px !important;
    font-size: 0.72rem !important;
  }

  .lang-wrapper button#langToggle .icon-globe-container {
    display: none !important;
  }

  .user-badge-pill {
    height: 32px;
    padding: 0 6px;
    font-size: 0.76rem;
    max-width: 85px;
    gap: 4px;
  }

  .user-badge-pill #username-span {
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .logo-badge .logo-title {
    display: none !important;
  }
  .user-badge-pill #username-span {
    display: none !important;
  }
  .user-badge-pill {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    padding: 0 !important;
    justify-content: center;
  }
  .user-badge-pill .icon-user-container {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
  }
  .nav-btn-icon, .nav-btn-admin, .nav-btn-primary {
    width: 29px !important;
    height: 29px !important;
    min-width: 29px !important;
  }
  .lang-wrapper button#langToggle {
    height: 29px !important;
    font-size: 0.68rem !important;
    padding: 0 3px !important;
  }
}

@media (max-width: 420px) {
  .app-header {
    padding: 0 4px;
  }

  .logo-badge {
    gap: 0;
  }

  .nav-btn-icon, .nav-btn-admin, .nav-btn-primary {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
  }

  .lang-wrapper button#langToggle {
    height: 28px !important;
    font-size: 0.65rem !important;
    padding: 0 2px !important;
  }
}

/* ==========================================
   LEADERBOARD TOP 3 PODIUM STYLES
   ========================================== */
.lb-table tr.rank-podium-1 {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.03) 100%) !important;
  border-left: 4px solid #f59e0b;
}

.lb-table tr.rank-podium-2 {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.18) 0%, rgba(148, 163, 184, 0.03) 100%) !important;
  border-left: 4px solid #94a3b8;
}

.lb-table tr.rank-podium-3 {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.18) 0%, rgba(217, 119, 6, 0.03) 100%) !important;
  border-left: 4px solid #d97706;
}

.podium-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.9rem;
}

.podium-badge.gold {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.podium-badge.silver {
  background: rgba(148, 163, 184, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #e2e8f0;
  box-shadow: 0 0 10px rgba(148, 163, 184, 0.25);
}

.podium-badge.bronze {
  background: rgba(217, 119, 6, 0.2);
  border: 1px solid rgba(217, 119, 6, 0.5);
  color: #f59e0b;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.25);
}

/* User Badge Hover Effect (Clickable to open profile) */
.user-badge-pill {
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.user-badge-pill:hover {
  border-color: var(--highlight) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

/* ==========================================
   MODAL: PLAYER PROFILE STATS CARD
   ========================================== */
.profile-modal-card {
  position: relative;
  width: 90vw !important;
  max-width: 460px !important;
  max-height: 85vh !important;
  padding: 28px !important;
  border: 1px solid var(--surface-border-hover) !important;
  border-radius: 20px !important;
  background: var(--surface-color) !important;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7) !important;
  overflow-y: auto !important;
  color: var(--text-color) !important;
  text-align: center;
  box-sizing: border-box !important;
}

body[data-theme=light] .profile-modal-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15) !important;
  color: #0f172a !important;
}

.profile-header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.profile-avatar-pill {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(129, 140, 248, 0.2));
  border: 2px solid var(--highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--highlight);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}

.profile-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  word-break: break-all;
}

.profile-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}

@media (max-width: 480px) {
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }
}

.profile-stat-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: border-color 0.2s;
}

body[data-theme=light] .profile-stat-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.profile-stat-box:hover {
  border-color: var(--surface-border-hover);
}

.stat-box-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.stat-icon-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.stat-icon-gold { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.stat-icon-cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }

.stat-box-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-box-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-box-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ==========================================
   MODAL: SETTINGS & ACCOUNT
   ========================================== */
.settings-modal-card {
  position: relative;
  width: 92vw !important;
  max-width: 480px !important;
  max-height: 85vh !important;
  padding: 26px !important;
  border: 1px solid var(--surface-border-hover) !important;
  border-radius: 20px !important;
  background: #0b1324 !important;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  color: var(--text-color) !important;
  text-align: left;
  box-sizing: border-box !important;
}

body[data-theme=light] .settings-modal-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15) !important;
  color: #0f172a !important;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--surface-border);
}

.settings-header .modal-close-btn {
  position: static !important;
  margin: 0 !important;
  flex-shrink: 0;
}

.settings-section {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--surface-border);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--highlight);
  font-weight: 700;
  margin: 0 0 14px 0;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 500;
}

.settings-lang-pills {
  display: flex;
  gap: 6px;
}

.lang-pill {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  background: var(--surface-color);
  color: var(--text-color);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.lang-pill.active {
  background: var(--highlight) !important;
  color: #fff !important;
  border-color: var(--highlight) !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.settings-form-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.input-with-button {
  display: flex !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.input-with-button .name-input-field {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.form-feedback-msg {
  font-size: 0.82rem;
  margin-top: 6px;
  min-height: 18px;
}

.form-feedback-msg.error {
  color: #ef4444;
}

.form-feedback-msg.success {
  color: #10b981;
}

.settings-danger-zone {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 14px;
  padding: 16px;
  margin-top: 18px;
}

.danger-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ef4444;
  font-weight: 700;
  font-size: 0.95rem;
}

.action-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #f87171;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.action-btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

/* ==========================================
   MODIFIERS & LAUNCH MODAL STYLES
   ========================================== */
.launch-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: launchFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.launch-modal-backdrop.closing {
  animation: launchFadeOut 0.18s ease forwards;
}

@keyframes launchFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes launchFadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.96); }
}

.launch-modal-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(150deg, rgba(22, 28, 48, 0.96), rgba(12, 16, 32, 0.98));
  border: 1px solid rgba(102, 252, 241, 0.25);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 30px rgba(102, 252, 241, 0.12);
  color: #fff;
}

.launch-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.launch-track-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(102, 252, 241, 0.12);
  border: 1px solid rgba(102, 252, 241, 0.3);
  color: var(--highlight, #66FCF1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.launch-track-details {
  flex: 1;
  min-width: 0;
}

.launch-track-title {
  margin: 0 0 4px 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.launch-track-artist {
  margin: 0;
  font-size: 0.85rem;
  color: #8892b0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.launch-track-dur {
  color: #a8b2d1;
}

.launch-section {
  margin-bottom: 18px;
}

.launch-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a8b2d1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.launch-label-icon {
  color: #38bdf8;
  display: inline-flex;
}

.launch-speed-pills {
  display: flex;
  gap: 10px;
}

.launch-speed-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.launch-speed-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.launch-speed-btn.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.28);
}

.launch-speed-btn .speed-val {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.launch-speed-btn .speed-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
}

.launch-speed-btn.active .speed-sub {
  color: #7dd3fc;
  font-weight: 600;
}

.launch-hardcore-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.launch-hardcore-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.launch-hardcore-row.active {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.6);
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.25);
}

.launch-hardcore-info {
  flex: 1;
}

.launch-hardcore-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
}

.launch-hardcore-row.active .launch-hardcore-title {
  color: #fda4af;
}

.launch-hardcore-icon {
  color: #f43f5e;
  display: inline-flex;
}

.launch-hardcore-badge {
  font-size: 0.7rem;
  padding: 1px 7px;
  background: rgba(244, 63, 94, 0.25);
  color: #f43f5e;
  border-radius: 8px;
  font-weight: 700;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.launch-hardcore-desc {
  font-size: 0.78rem;
  color: #8892b0;
  margin-top: 3px;
}

.launch-hardcore-row.active .launch-hardcore-desc {
  color: #fca5a5;
}

.launch-switch {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  position: relative;
  transition: all 0.25s ease;
  flex-shrink: 0;
  margin-left: 12px;
}

.launch-switch.checked {
  background: #f43f5e;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
}

.launch-switch-thumb {
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.launch-switch.checked .launch-switch-thumb {
  transform: translateX(20px);
}

.launch-summary-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.launch-summary-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.launch-sum-label {
  font-size: 0.82rem;
  color: #8892b0;
}

.launch-sum-bonus {
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.launch-sum-diff {
  font-size: 0.95rem;
}

.launch-modal-actions {
  display: flex;
  gap: 12px;
}

.launch-btn-cancel {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.launch-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.launch-btn-start {
  flex: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #00d2ff, #0077ff);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 18px rgba(0, 150, 255, 0.35);
  font-family: inherit;
}

.launch-btn-start:hover {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  box-shadow: 0 6px 24px rgba(0, 150, 255, 0.5);
  transform: translateY(-1px);
}

/* In-game HUD Modifier Pills */
.game-mod-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  z-index: 10;
  pointer-events: none;
}

.game-mod-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.9);
}

.game-mod-pill.speed {
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.game-mod-pill.hardcore {
  border: 1px solid rgba(244, 63, 94, 0.55);
  color: #fda4af;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.3);
  animation: hardcorePillPulse 1.5s infinite ease-in-out;
}

@keyframes hardcorePillPulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.game-mod-pill.mult {
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #fde047;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.2);
}

/* In-game HUD Combo Pill (Directly underneath modifiers) */
.game-combo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  z-index: 10;
  pointer-events: none;
}

.game-combo-pill {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 6px 12px;
  border-radius: 14px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
  animation: comboGlowBreath 2s infinite ease-in-out;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

.game-combo-pill .combo-icon {
  display: inline-flex;
  align-items: center;
  color: inherit;
  transform-origin: center center;
  will-change: transform;
}

.game-combo-pill .combo-value {
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  transform-origin: center center;
  will-change: transform;
}

.game-combo-pill .combo-title {
  font-size: 0.68rem;
  opacity: 0.85;
  font-weight: 700;
}

.game-combo-pill .combo-mult-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  margin-left: 2px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: inherit;
  transform-origin: center center;
  will-change: transform;
  transition: all 0.2s ease;
}

/* Динамічна шкала росту комбо до наступного множника */
.combo-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
  overflow: hidden;
}

.combo-progress-fill {
  height: 100%;
  width: 0%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  transition: width 0.08s ease-out;
  border-radius: 999px;
}

.game-combo-pill.tier-50 {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(45, 212, 191, 0.7);
  color: #5eead4;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.35);
  animation: comboPulse50 1.4s infinite ease-in-out;
}

.game-combo-pill.tier-50 .combo-mult-badge {
  background: rgba(45, 212, 191, 0.35);
  border-color: rgba(45, 212, 191, 0.7);
  color: #ffffff;
  text-shadow: 0 0 8px rgba(45, 212, 191, 0.7);
}

.game-combo-pill.tier-50 .combo-progress-fill {
  background: #5eead4;
  box-shadow: 0 0 8px #5eead4;
}

.game-combo-pill.tier-100 {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(250, 204, 21, 0.8);
  color: #fde047;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.45);
  animation: comboPulse100 1.1s infinite ease-in-out;
}

.game-combo-pill.tier-100 .combo-mult-badge {
  background: rgba(250, 204, 21, 0.4);
  border-color: rgba(250, 204, 21, 0.85);
  color: #ffffff;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.8);
}

.game-combo-pill.tier-100 .combo-progress-fill {
  background: #fde047;
  box-shadow: 0 0 8px #fde047;
}

.game-combo-pill.tier-200 {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(217, 70, 239, 0.85);
  color: #f0abfc;
  box-shadow: 0 0 24px rgba(217, 70, 239, 0.5);
  animation: comboPulse200 0.9s infinite ease-in-out;
}

.game-combo-pill.tier-200 .combo-mult-badge {
  background: rgba(217, 70, 239, 0.45);
  border-color: rgba(217, 70, 239, 0.9);
  color: #ffffff;
  text-shadow: 0 0 12px rgba(217, 70, 239, 0.9);
}

.game-combo-pill.tier-200 .combo-progress-fill {
  background: #f0abfc;
  box-shadow: 0 0 8px #f0abfc;
}

.game-combo-pill.tier-400 {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(244, 63, 94, 0.9);
  color: #fda4af;
  box-shadow: 0 0 28px rgba(244, 63, 94, 0.6);
  animation: comboPulse400 0.75s infinite ease-in-out;
}

.game-combo-pill.tier-400 .combo-mult-badge {
  background: rgba(244, 63, 94, 0.5);
  border-color: rgba(244, 63, 94, 1);
  color: #ffffff;
  text-shadow: 0 0 14px rgba(244, 63, 94, 1);
}

.game-combo-pill.tier-400 .combo-progress-fill {
  background: #fda4af;
  box-shadow: 0 0 8px #fda4af;
}

.game-combo-pill.tier-800 {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(35, 15, 55, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: #ffffff;
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.7), 0 0 18px rgba(255, 0, 128, 0.6), inset 0 0 14px rgba(255, 255, 255, 0.4);
  animation: comboPulse800 0.6s infinite ease-in-out;
}

.game-combo-pill.tier-800 .combo-mult-badge {
  background: linear-gradient(135deg, #ff007f, #7928ca, #00f2fe);
  background-size: 200% 200%;
  animation: comboRainbowShift 1.5s linear infinite;
  border: 1px solid #ffffff;
  color: #ffffff;
  text-shadow: 0 0 10px #ffffff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.7);
}

.game-combo-pill.tier-800 .combo-progress-fill {
  background: linear-gradient(90deg, #ff007f, #7928ca, #00f2fe, #fde047);
  background-size: 200% 100%;
  animation: comboRainbowShift 1.5s linear infinite;
  box-shadow: 0 0 10px #ffffff;
}

@keyframes comboGlowBreath {
  0%, 100% { box-shadow: 0 0 12px rgba(56, 189, 248, 0.2); }
  50% { box-shadow: 0 0 18px rgba(56, 189, 248, 0.4); }
}

@keyframes comboPulse50 {
  0%, 100% { transform: scale(1); box-shadow: 0 0 14px rgba(45, 212, 191, 0.35); }
  50% { transform: scale(1.03); box-shadow: 0 0 22px rgba(45, 212, 191, 0.55); }
}

@keyframes comboPulse100 {
  0%, 100% { transform: scale(1); box-shadow: 0 0 18px rgba(250, 204, 21, 0.4); }
  50% { transform: scale(1.04); box-shadow: 0 0 26px rgba(250, 204, 21, 0.65); }
}

@keyframes comboPulse200 {
  0%, 100% { transform: scale(1); box-shadow: 0 0 22px rgba(217, 70, 239, 0.45); }
  50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(217, 70, 239, 0.75); }
}

@keyframes comboPulse400 {
  0%, 100% { transform: scale(1); box-shadow: 0 0 24px rgba(244, 63, 94, 0.5); }
  50% { transform: scale(1.06); box-shadow: 0 0 34px rgba(244, 63, 94, 0.85); }
}

@keyframes comboPulse800 {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.07); filter: brightness(1.25); }
}

@keyframes comboRainbowShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Mobile optimizations */
@media (max-width: 480px) {
  .launch-modal-card {
    padding: 18px 16px;
  }
  .launch-speed-pills {
    gap: 6px;
  }
  .launch-speed-btn {
    padding: 8px 4px;
  }
  .launch-speed-btn .speed-val {
    font-size: 0.95rem;
  }
  .launch-modal-actions {
    gap: 8px;
  }
}

/* =======================================================
   ADMIN & SETTINGS UNIFIED BUTTONS & CARDS
   ======================================================= */
.admin-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 20px;
  color: var(--text-color);
  box-sizing: border-box;
}

body[data-theme=light] .admin-card {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

.admin-card-title {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-theme=light] .admin-card-title {
  color: #0f172a;
}

.admin-grid-tracks {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 18px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.admin-grid-tracks > * {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 992px) {
  .admin-grid-tracks {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

.admin-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.admin-hardcore-toggle-card {
  display: block;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  width: 100%;
}

.admin-hardcore-toggle-card:hover {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.55);
}

.admin-hardcore-label-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  width: 100%;
  margin: 0;
}

.admin-hardcore-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-hardcore-icon {
  font-size: 1.3rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.5));
}

.admin-hardcore-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f43f5e;
  line-height: 1.2;
}

.admin-hardcore-desc {
  font-size: 0.74rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 2px;
  line-height: 1.25;
}

.admin-hardcore-checkbox-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.admin-hardcore-checkbox {
  width: 20px;
  height: 20px;
  accent-color: #f43f5e;
  cursor: pointer;
}

.admin-table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.admin-action-btn,
.admin-btn-primary,
.admin-btn-secondary,
.admin-btn-danger,
.admin-btn-warning,
.admin-btn-save {
  height: 42px;
  min-height: 42px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  white-space: nowrap;
}

.admin-action-btn:hover,
.admin-btn-primary:hover,
.admin-btn-secondary:hover,
.admin-btn-danger:hover,
.admin-btn-warning:hover,
.admin-btn-save:hover {
  transform: translateY(-1px);
}

.admin-btn-primary,
.admin-btn-save {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border: 1px solid #38bdf8;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.admin-btn-primary:hover,
.admin-btn-save:hover {
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.admin-btn-secondary {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-color);
}

body[data-theme=light] .admin-btn-secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.admin-btn-danger {
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
}

.admin-btn-danger:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.admin-btn-warning {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  color: #fbbf24 !important;
}

.admin-btn-warning:hover {
  background: #f59e0b !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.admin-btn-sm {
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.82rem;
  border-radius: 8px;
}

#admin-track-list {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
}

/* Admin Track List Item */
.admin-track-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--surface-color);
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  transition: all 0.2s ease;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
}

.admin-track-item:hover {
  border-color: var(--surface-border-hover);
  background: var(--surface-hover);
}

body[data-theme=light] .admin-track-item {
  background: #ffffff;
  border-color: #e2e8f0;
}

body[data-theme=light] .admin-track-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.admin-track-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

body[data-theme=light] .admin-track-item-title {
  color: #0f172a;
}

.admin-track-item-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  margin-top: 2px;
}

/* Settings Form Standard Heights */
.settings-form .input-with-button {
  display: flex !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  align-items: center !important;
}

.settings-form .name-input-field,
.settings-form .input-with-button .name-input-field {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  height: 38px !important;
  font-size: 0.88rem !important;
  padding: 6px 12px !important;
  border-radius: 9px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  text-align: left !important;
}

.settings-form .input-with-button .action-btn {
  flex-shrink: 0 !important;
  height: 38px !important;
  padding: 0 16px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  border-radius: 9px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

/* Mobile Responsiveness for Admin & Settings */
@media (max-width: 768px) {
  .admin-modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 0 !important;
    max-height: 92vh !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  .admin-modal-scroll-area {
    padding: 14px 12px 24px 12px !important;
    overflow-x: hidden !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .admin-grid,
  .admin-grid-tracks {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .admin-grid-2col,
  .admin-grid-3col {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .user-profile-admin-bar {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    align-items: stretch !important;
  }
  .user-profile-admin-bar button {
    width: 100% !important;
    justify-content: center !important;
    white-space: normal !important;
    text-align: center !important;
    min-height: 42px !important;
  }
  .settings-modal-card {
    width: 95vw !important;
    padding: 20px 14px !important;
  }
}

/* =======================================================
   🏆 REDESIGNED LEADERBOARD MODAL & TOP-3 PODIUM
   ======================================================= */
.leaderboard-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5000;
  width: 95vw !important;
  max-width: 740px !important;
  max-height: 92vh !important;
  display: flex;
  flex-direction: column;
  background: var(--surface-color) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--surface-border-hover) !important;
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.7) !important;
  border-radius: 24px !important;
  padding: 24px !important;
  color: var(--text-color) !important;
  box-sizing: border-box;
  animation: modalPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.lb-scroll-area {
  max-height: 440px !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--highlight) transparent;
}

body[data-theme=light] .leaderboard-modal {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.18) !important;
  color: #0f172a !important;
}

.lb-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.lb-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--highlight);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Top-3 Podium Container */
.lb-podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 18px 0;
  padding: 10px 6px;
}

.podium-card {
  flex: 1;
  max-width: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px;
  border-radius: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.22s ease;
  position: relative;
}

.podium-card:hover {
  transform: translateY(-4px) scale(1.02);
}

/* 1st Place - Gold */
.podium-card.podium-rank-1 {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.05) 100%);
  border-color: #f59e0b;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
  transform: translateY(-8px);
}

.podium-card.podium-rank-1:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.4);
}

/* 2nd Place - Silver */
.podium-card.podium-rank-2 {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.18) 0%, rgba(148, 163, 184, 0.04) 100%);
  border-color: #94a3b8;
  box-shadow: 0 6px 18px rgba(148, 163, 184, 0.2);
}

/* 3rd Place - Bronze */
.podium-card.podium-rank-3 {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.18) 0%, rgba(217, 119, 6, 0.04) 100%);
  border-color: #d97706;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.2);
}

.podium-crown-icon {
  margin-bottom: 4px;
}

.podium-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.podium-rank-1 .podium-avatar {
  background: #f59e0b;
  color: #0b0f19;
  border: 2px solid #fbbf24;
}

.podium-rank-2 .podium-avatar {
  background: #94a3b8;
  color: #0b0f19;
  border: 2px solid #cbd5e1;
}

.podium-rank-3 .podium-avatar {
  background: #d97706;
  color: #0b0f19;
  border: 2px solid #f59e0b;
}

.podium-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

body[data-theme=light] .podium-name {
  color: #0f172a;
}

.podium-title-wrap {
  margin-top: 3px;
  margin-bottom: 2px;
  max-width: 100%;
  display: flex;
  justify-content: center;
}

.podium-title-badge {
  font-size: 0.65rem;
  padding: 1px 7px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 105px;
  display: inline-block;
}

body[data-theme="light"] .podium-title-badge {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

.podium-score {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--highlight);
  margin-top: 2px;
}

.podium-levels {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Leaderboard Interactive Table Rows */
.lb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
}

.lb-table th {
  padding: 8px 12px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--surface-border);
  text-align: left;
}

.lb-table tr.lb-player-row {
  cursor: pointer;
  transition: all 0.18s ease;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.lb-table tr.lb-player-row:hover {
  background: rgba(56, 189, 248, 0.12) !important;
  transform: translateX(3px);
}

body[data-theme=light] .lb-table tr.lb-player-row {
  background: #f8fafc;
}

body[data-theme=light] .lb-table tr.lb-player-row:hover {
  background: #f1f5f9 !important;
}

.lb-table td {
  padding: 10px 12px;
  font-size: 0.88rem;
  border: none;
}

.lb-table td:first-child {
  border-radius: 10px 0 0 10px;
}

.lb-table td:last-child {
  border-radius: 0 10px 10px 0;
}

.lb-player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lb-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.lb-player-name {
  font-weight: 600;
  color: var(--text-primary);
}

body[data-theme=light] .lb-player-name {
  color: #0f172a;
}

.lb-score-val {
  font-weight: 700;
  color: var(--highlight);
}

/* =======================================================
   👤 USER PROFILE MODAL
   ======================================================= */
.user-profile-card {
  position: relative;
  width: 92vw;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface-color);
  border: 1px solid var(--surface-border-hover);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.75);
  color: var(--text-color);
  box-sizing: border-box;
  animation: modalPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-theme=light] .user-profile-card {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15);
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  padding-right: 48px;
  position: relative;
  border-bottom: 1px solid var(--surface-border);
}

.user-profile-card .modal-close-btn {
  top: 16px;
  right: 16px;
  z-index: 300 !important;
}

.user-profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.user-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.2));
  border: 2px solid var(--highlight);
  color: var(--highlight);
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--accent-glow);
}

.user-profile-rank-badge {
  position: absolute;
  bottom: -4px;
  left: -4px;
  right: auto;
  background: #f59e0b;
  color: #0b0f19;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid #ffffff;
  z-index: 4;
}

.user-profile-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  word-break: break-word;
}

body[data-theme=light] .user-profile-name {
  color: #0f172a;
}

.user-profile-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-tier-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--highlight);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.user-id-snippet {
  font-size: 0.74rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.user-id-snippet:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.45);
  color: var(--highlight);
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.25);
}

.user-id-snippet.copied-glow {
  background: rgba(0, 255, 136, 0.22) !important;
  border-color: rgba(0, 255, 136, 0.7) !important;
  color: #00ff88 !important;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.45) !important;
}

#user-profile-modal {
  z-index: 6000 !important;
}

.user-profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.profile-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-stat-box.stat-box-wide {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}

.profile-stat-box.stat-box-wide .stat-box-val {
  margin: 0;
  font-size: 1.15rem;
}

body[data-theme=light] .profile-stat-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.profile-stat-box .stat-box-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 4px 0 2px 0;
}

body[data-theme=light] .profile-stat-box .stat-box-val {
  color: #0f172a;
}

.profile-stat-box .stat-box-lbl {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.user-profile-admin-bar {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--surface-border);
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* =======================================================
   🎵 REDESIGNED SONG CATALOG: FILTERS, SORT & GRID
   ======================================================= */
.song-catalog-container {
  width: 95%;
  max-width: 1040px;
  margin: 0 auto;
  box-sizing: border-box;
}

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.catalog-stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--surface-border);
}

body[data-theme=light] .catalog-stats-badge {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}

.catalog-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-shop-toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 !important;
  padding: 8px 16px !important;
  border-radius: 20px !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(217, 119, 6, 0.22)) !important;
  color: #fef08a !important;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-shop-toolbar:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(217, 119, 6, 0.35)) !important;
  border-color: #f59e0b !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
}

.btn-shop-toolbar .shop-coins-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.85rem;
  color: #fef08a;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

body[data-theme=light] .btn-shop-toolbar {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(180, 83, 9, 0.16)) !important;
  border-color: rgba(217, 119, 6, 0.4) !important;
  color: #b45309 !important;
}

body[data-theme=light] .btn-shop-toolbar:hover {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.2), rgba(180, 83, 9, 0.25)) !important;
  border-color: #b45309 !important;
}

body[data-theme=light] .btn-shop-toolbar .shop-coins-pill {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(217, 119, 6, 0.35);
  color: #92400e;
}

/* Filter Chips Bar */
.catalog-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.catalog-filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 8px 18px;
  border-radius: 500px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.filter-chip.active {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

body[data-theme=light] .filter-chip {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1e293b;
}

body[data-theme=light] .filter-chip.active {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
}

/* Search and Sort Row */
.catalog-controls-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.catalog-controls-row .search-container {
  flex: 1;
  min-width: 240px;
  margin: 0 !important;
}

.catalog-sort-select {
  height: 44px;
  border-radius: 12px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-color);
  padding: 0 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
}

body[data-theme=light] .catalog-sort-select {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Song Grid Layout */
.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  max-height: 56vh;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--highlight) transparent;
}

@media (max-width: 768px) {
  .song-catalog-container {
    width: 96% !important;
    padding: 0 4px !important;
  }

  .catalog-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .catalog-stats-badge {
    font-size: 0.76rem !important;
    padding: 6px 12px !important;
    gap: 6px !important;
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  .catalog-toolbar-actions {
    display: flex !important;
    width: 100% !important;
    gap: 8px !important;
    justify-content: space-between !important;
  }

  .btn-shop-toolbar,
  #btn-open-leaderboard {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 0.8rem !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
  }

  .catalog-filter-bar {
    display: flex !important;
    gap: 6px !important;
    margin-bottom: 8px !important;
    padding-bottom: 6px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .filter-chip {
    padding: 6px 12px !important;
    font-size: 0.78rem !important;
    border-radius: 16px !important;
    flex-shrink: 0 !important;
  }

  .catalog-controls-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .catalog-controls-row .search-container {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .catalog-controls-row .search-container input {
    height: 38px !important;
    font-size: 0.86rem !important;
    padding-left: 36px !important;
  }

  .catalog-sort-select {
    width: 100% !important;
    height: 40px !important;
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
  }

  .song-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 6px 2px 110px 2px !important;
    max-height: calc(100vh - 270px) !important;
    scroll-padding-bottom: 90px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .song-grid::after {
    content: "";
    display: block;
    grid-column: 1 / -1;
    height: 50px;
    pointer-events: none;
  }

  .song-card {
    padding: 10px !important;
    border-radius: 8px !important;
  }

  .spotify-play-btn {
    opacity: 1 !important;
    transform: translateY(0) !important;
    width: 36px !important;
    height: 36px !important;
    bottom: 6px !important;
    right: 6px !important;
  }

  .spotify-track-title {
    font-size: 0.88rem !important;
  }

  .spotify-track-artist {
    font-size: 0.74rem !important;
  }
}

/* =======================================================
   🎵 SPOTIFY-STYLE TRACK CATALOG & CARDS
   ======================================================= */
.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 18px;
  max-height: calc(100vh - 270px);
  overflow-y: auto;
  padding: 8px 6px 36px 6px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.song-card {
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 14px;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  box-sizing: border-box;
  user-select: none;
}

.song-card:hover {
  background: #282828;
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

body[data-theme=light] .song-card {
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

body[data-theme=light] .song-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

/* Square Cover Art Container */
.spotify-cover-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  box-sizing: border-box;
}

.spotify-cover-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.spotify-cover-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spotify-lock-pill {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(244, 63, 94, 0.85);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.spotify-cover-art {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  z-index: 1;
}

.spotify-vinyl-disc {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(0, 0, 0, 0.6) 75%);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.5s ease;
}

.song-card:hover .spotify-vinyl-disc {
  transform: rotate(45deg) scale(1.08);
}

.spotify-vinyl-disc.locked {
  background: rgba(0, 0, 0, 0.65);
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.4);
}

body[data-theme="light"] .spotify-cover-wrap {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08) !important;
  border: 1px solid rgba(0, 0, 0, 0.07) !important;
}

body[data-theme="light"] .spotify-cover-badge {
  background: rgba(255, 255, 255, 0.85) !important;
  color: #0f172a !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

body[data-theme="light"] .spotify-vinyl-disc {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(226, 232, 240, 0.9) 60%, rgba(203, 213, 225, 0.95) 100%) !important;
  border-color: rgba(148, 163, 184, 0.6) !important;
  color: #1e293b !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

body[data-theme="light"] .spotify-vinyl-disc svg {
  fill: #1e293b !important;
}

/* Floating Green Play Button */
.spotify-play-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1ed760;
  border: none;
  cursor: pointer;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s cubic-bezier(0.3, 0, 0, 1);
  z-index: 4;
}

.song-card:hover .spotify-play-btn {
  opacity: 1;
  transform: translateY(0);
}

.spotify-play-btn:hover {
  background: #1fdf64 !important;
  transform: scale(1.08) !important;
}

/* Card Content Details */
.spotify-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.spotify-track-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.spotify-track-title {
  flex: 1 1 auto;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.track-phonk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 4px;
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(244, 114, 182, 0.35);
  box-shadow: 0 0 6px rgba(236, 72, 153, 0.2);
  flex-shrink: 0;
  line-height: 1.2;
  user-select: none;
}

body[data-theme=light] .track-phonk-badge {
  background: rgba(219, 39, 119, 0.12);
  color: #db2777;
  border-color: rgba(219, 39, 119, 0.3);
  box-shadow: 0 0 6px rgba(219, 39, 119, 0.15);
}

.admin-track-phonk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  user-select: none;
  transition: all 0.15s ease;
}

.admin-track-phonk-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.admin-track-phonk-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #ec4899;
  margin: 0;
}

body[data-theme=light] .admin-track-phonk-toggle {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

body[data-theme=light] .admin-track-phonk-toggle:hover {
  background: #e2e8f0;
}

body[data-theme=light] .spotify-track-title {
  color: #0f172a;
}

.spotify-track-artist {
  font-size: 0.8rem;
  color: #a7a7a7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-theme=light] .spotify-track-artist {
  color: #64748b;
}

.spotify-track-footer {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.spotify-track-footer .track-best-stat {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 3px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 4px 6px !important;
  border-radius: 8px !important;
  font-size: 0.72rem !important;
  margin-left: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.spotify-track-footer .track-best-stat .stat-main-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  min-width: 0 !important;
  gap: 2px !important;
}

.spotify-track-footer .track-best-stat .stat-badge-row {
  display: flex !important;
  align-items: center !important;
  margin-top: 2px !important;
}

.spotify-track-footer .track-record-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  white-space: nowrap !important;
  font-size: 0.72rem !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
  flex-shrink: 1 !important;
}

.spotify-track-footer .track-stars-visual {
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

.secret-song-card {
  border-color: rgba(192, 132, 252, 0.3) !important;
}

.secret-song-card:hover {
  border-color: rgba(192, 132, 252, 0.6) !important;
  box-shadow: 0 12px 26px rgba(168, 85, 247, 0.25) !important;
}

/* =======================================================
   ✨ MODERNISM DESIGN SYSTEM: GLOBAL MODAL OVERLAY
   ======================================================= */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 5000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(4, 7, 15, 0.78) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  animation: fadeInOverlay 0.22s ease-out !important;
}

.modal-overlay.hidden {
  display: none !important;
}

/* Solid background and scrollbars for all modal dialog cards */
.settings-modal-card,
.profile-modal-card,
.user-profile-card,
.friends-modal-card,
.admin-modal-content,
.leaderboard-modal,
.name-input-content {
  background: #0b1324 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 24px 64px -10px rgba(0, 0, 0, 0.85) !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent !important;
}

body[data-theme=light] .settings-modal-card,
body[data-theme=light] .profile-modal-card,
body[data-theme=light] .user-profile-card,
body[data-theme=light] .friends-modal-card,
body[data-theme=light] .admin-modal-content,
body[data-theme=light] .leaderboard-modal,
body[data-theme=light] .name-input-content {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 48px -10px rgba(15, 23, 42, 0.15) !important;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent !important;
}

/* Custom Webkit scrollbar for sleek modernism */
.settings-modal-card::-webkit-scrollbar,
.profile-modal-card::-webkit-scrollbar,
.friends-modal-card::-webkit-scrollbar,
.admin-modal-content::-webkit-scrollbar,
.lb-scroll-area::-webkit-scrollbar,
.friends-scroll-area::-webkit-scrollbar {
  width: 6px !important;
}

.settings-modal-card::-webkit-scrollbar-track,
.profile-modal-card::-webkit-scrollbar-track,
.friends-modal-card::-webkit-scrollbar-track,
.admin-modal-content::-webkit-scrollbar-track,
.lb-scroll-area::-webkit-scrollbar-track,
.friends-scroll-area::-webkit-scrollbar-track {
  background: transparent !important;
}

.settings-modal-card::-webkit-scrollbar-thumb,
.profile-modal-card::-webkit-scrollbar-thumb,
.friends-modal-card::-webkit-scrollbar-thumb,
.admin-modal-content::-webkit-scrollbar-thumb,
.lb-scroll-area::-webkit-scrollbar-thumb,
.friends-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18) !important;
  border-radius: 4px !important;
}

body[data-theme=light] .settings-modal-card::-webkit-scrollbar-thumb,
body[data-theme=light] .profile-modal-card::-webkit-scrollbar-thumb,
body[data-theme=light] .friends-modal-card::-webkit-scrollbar-thumb,
body[data-theme=light] .admin-modal-content::-webkit-scrollbar-thumb,
body[data-theme=light] .lb-scroll-area::-webkit-scrollbar-thumb,
body[data-theme=light] .friends-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18) !important;
}

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

/* =======================================================
   ✨ MODERNISM DESIGN SYSTEM: COMPACT INPUTS & BUTTONS
   ======================================================= */
.modern-input,
.modern-select,
select {
  height: 38px !important;
  box-sizing: border-box !important;
  padding: 6px 14px !important;
  border-radius: 10px !important;
  border: 1px solid var(--surface-border) !important;
  background-color: var(--surface-color) !important;
  color: var(--text-primary) !important;
  font-size: 0.88rem !important;
  font-family: inherit !important;
  outline: none !important;
  transition: all 0.2s ease !important;
  text-align: left !important;
  margin: 4px 0 10px 0 !important;
  width: 100% !important;
}

.modern-select,
select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 12px) center !important;
  background-size: 16px 16px !important;
  padding-right: 36px !important;
  cursor: pointer !important;
}

select option,
.modern-select option {
  background-color: #0b132b !important;
  color: #f8fafc !important;
  padding: 10px !important;
}

.modern-input:focus,
.modern-select:focus,
select:focus {
  border-color: var(--highlight) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

body[data-theme=light] .modern-input,
body[data-theme=light] .modern-select,
body[data-theme=light] select {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

body[data-theme=light] select option,
body[data-theme=light] .modern-select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

.modern-btn {
  height: 36px !important;
  box-sizing: border-box !important;
  padding: 0 14px !important;
  border-radius: 9px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  border: 1px solid transparent !important;
  white-space: nowrap !important;
  text-decoration: none !important;
}

.modern-btn-primary {
  background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3) !important;
}

.modern-btn-primary:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45) !important;
}

.modern-btn-secondary {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--surface-border) !important;
  color: var(--text-primary) !important;
}

.modern-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: var(--surface-border-hover) !important;
}

.modern-btn-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #ef4444 !important;
}

.modern-btn-danger:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.modern-btn-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #f59e0b !important;
}

.modern-btn-warning:hover {
  background: #f59e0b !important;
  color: #0b0f19 !important;
}

.modern-btn-success {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #10b981 !important;
}

.modern-btn-success:hover {
  background: #10b981 !important;
  color: #ffffff !important;
}

/* =======================================================
   👥 FRIENDS MODAL & SYSTEM STYLES
   ======================================================= */
.friends-modal-card {
  position: relative;
  width: 92vw;
  max-width: 520px;
  max-height: 85vh;
  background: var(--surface-color);
  border: 1px solid var(--surface-border-hover);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.75);
  color: var(--text-color);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  animation: modalPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-theme=light] .friends-modal-card {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.15);
}

.friends-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--surface-border);
}

.friends-tabs-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.friends-tab-btn {
  flex: 1;
  height: 36px;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.friends-tab-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.friends-tab-btn.active {
  background: var(--surface-color);
  color: var(--highlight);
  border-color: var(--surface-border-hover);
  box-shadow: 0 0 10px var(--accent-glow);
}

body[data-theme=light] .friends-tab-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

body[data-theme=light] .friends-tab-btn.active {
  background: #ffffff;
  color: #0284c7;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.tab-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.tab-badge.alert {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.friends-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--highlight);
  display: flex;
  align-items: center;
  gap: 8px;
}

#btn-open-friends {
  position: relative !important;
  overflow: visible !important;
}

#btn-open-friends .friends-badge-count {
  position: absolute !important;
  top: -4px !important;
  right: -6px !important;
  margin: 0 !important;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 4px !important;
  border-radius: 999px !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  line-height: 18px !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7) !important;
  pointer-events: none !important;
  z-index: 15 !important;
}

#btn-open-friends .friends-badge-count.visible {
  display: inline-flex !important;
}

#btn-open-friends .friends-badge-count[style*="display: none"] {
  display: none !important;
}

#btn-open-friends .friends-badge-count.alert {
  background: #f43f5e !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.8) !important;
}

.friends-badge-count {
  background: var(--highlight);
  color: #0b0f19;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
}

.friends-add-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.friends-add-bar input {
  flex: 1;
  margin: 0 !important;
}

.friends-list {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--highlight) transparent;
}

.friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 10px 14px;
  transition: all 0.18s ease;
}

.friend-row:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--surface-border-hover);
}

body[data-theme=light] .friend-row {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body[data-theme=light] .friend-row:hover {
  background: #f1f5f9;
}

.friend-info {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.friend-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.2));
  border: 1px solid var(--highlight);
  color: var(--highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.friend-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.friend-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-theme=light] .friend-name {
  color: #0f172a;
}

.friend-stats-snippet {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.friend-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.friends-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.friend-request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  gap: 12px;
}

body[data-theme=light] .friend-request-row {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.friend-request-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.friend-req-subtitle {
  font-size: 0.74rem;
  color: var(--highlight);
  margin-top: 1px;
}

.friend-request-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

/* =======================================================
   ✨ MODERNISM PODIUM SPECIFICITY OVERRIDES
   ======================================================= */
.lb-podium-container {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 14px !important;
  margin: 12px 0 16px 0 !important;
  padding: 6px 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.podium-card {
  flex: 1 !important;
  max-width: 190px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  padding: 14px 10px !important;
  border-radius: 18px !important;
  cursor: pointer !important;
  transition: all 0.22s ease !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.podium-card.podium-rank-1 {
  order: 2 !important;
  min-height: 138px !important;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.22) 0%, rgba(245, 158, 11, 0.05) 100%) !important;
  border: 1px solid #f59e0b !important;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25) !important;
}

.podium-card.podium-rank-2 {
  order: 1 !important;
  min-height: 118px !important;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.2) 0%, rgba(148, 163, 184, 0.04) 100%) !important;
  border: 1px solid #94a3b8 !important;
  box-shadow: 0 6px 18px rgba(148, 163, 184, 0.2) !important;
}

.podium-card.podium-rank-3 {
  order: 3 !important;
  min-height: 108px !important;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.2) 0%, rgba(217, 119, 6, 0.04) 100%) !important;
  border: 1px solid #d97706 !important;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.2) !important;
}

/* =======================================================
   ✨ MODERNISM FILTER CHIPS OVERRIDES
   ======================================================= */
.filter-chip {
  padding: 6px 14px !important;
  border-radius: 20px !important;
  border: 1px solid var(--surface-border) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text-secondary) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-sizing: border-box !important;
}

.filter-chip:hover {
  border-color: var(--surface-border-hover) !important;
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.filter-chip.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4) !important;
}

body[data-theme=light] .filter-chip {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

body[data-theme=light] .filter-chip:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

body[data-theme=light] .filter-chip.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

/* =======================================================
   📱 COMPREHENSIVE MOBILE RESPONSIVENESS & COMPONENT SIZING
   ======================================================= */
@media (max-width: 640px) {
  /* Song Selection Layout */
  .song-selection {
    padding-top: max(82px, env(safe-area-inset-top, 82px)) !important;
    padding-bottom: 75px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .song-selection h1.shimmer-text {
    font-size: 1.5rem !important;
    margin: 6px 0 10px 0 !important;
  }
  .instruction-text {
    font-size: 0.76rem !important;
    margin-top: 10px !important;
    padding: 0 10px !important;
    text-align: center !important;
  }

  /* Shop Modal on Mobile */
  .shop-modal-card {
    padding: 16px !important;
  }
  .shop-header-row {
    top: -16px !important;
    margin: -16px -16px 0 -16px !important;
    padding: 14px 16px 12px 16px !important;
  }

  /* Leaderboard Modal on Mobile */
  .leaderboard-modal {
    width: 95vw !important;
    max-height: 92vh !important;
    padding: 14px 10px !important;
    border-radius: 18px !important;
  }
  .lb-header-row {
    margin-bottom: 8px !important;
  }
  .lb-title {
    font-size: 1.05rem !important;
  }
  .lb-limit-bar {
    gap: 4px !important;
    margin: 6px 0 !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }
  .lb-limit-btn {
    padding: 3px 8px !important;
    font-size: 0.72rem !important;
    border-radius: 12px !important;
  }
  .lb-podium-container {
    gap: 6px !important;
    margin: 8px 0 12px 0 !important;
    padding: 2px 0 !important;
  }
  .podium-card {
    padding: 8px 4px !important;
    border-radius: 12px !important;
  }
  .podium-card.podium-rank-1 {
    min-height: 110px !important;
  }
  .podium-card.podium-rank-2 {
    min-height: 96px !important;
  }
  .podium-card.podium-rank-3 {
    min-height: 88px !important;
  }
  .podium-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.8rem !important;
    margin-bottom: 4px !important;
  }
  .podium-name {
    font-size: 0.72rem !important;
    max-width: 75px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .podium-score {
    font-size: 0.68rem !important;
  }
  .podium-levels {
    font-size: 0.62rem !important;
  }
  .lb-scroll-area {
    max-height: 220px !important;
  }
  .lb-table th, .lb-table td {
    padding: 6px 4px !important;
    font-size: 0.75rem !important;
  }
  .lb-player-cell {
    gap: 6px !important;
  }
  .lb-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.72rem !important;
  }
  .lb-player-name {
    font-size: 0.75rem !important;
    max-width: 90px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* User Profile Modal on Mobile */
  .user-profile-card {
    width: 95vw !important;
    padding: 16px 14px !important;
    border-radius: 18px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }
  .user-profile-header {
    gap: 12px !important;
    margin-bottom: 14px !important;
    padding-bottom: 12px !important;
    padding-right: 46px !important;
    position: relative !important;
  }
  .user-profile-card .modal-close-btn {
    top: 14px !important;
    right: 14px !important;
    z-index: 300 !important;
  }
  .user-profile-avatar {
    width: 52px !important;
    height: 52px !important;
    font-size: 1.3rem !important;
  }
  .user-profile-name {
    font-size: 1.1rem !important;
  }
  .user-profile-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  .profile-stat-box {
    padding: 10px 8px !important;
    border-radius: 12px !important;
  }
  .stat-box-val {
    font-size: 1.1rem !important;
  }
  .stat-box-lbl {
    font-size: 0.7rem !important;
  }
  .user-profile-admin-bar {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    align-items: stretch !important;
  }
  .user-profile-admin-bar button {
    width: 100% !important;
    justify-content: center !important;
    white-space: normal !important;
    text-align: center !important;
    min-height: 42px !important;
  }

  /* Friends Modal on Mobile */
  .friends-modal-card {
    width: 95vw !important;
    max-height: 90vh !important;
    padding: 16px 12px !important;
    border-radius: 18px !important;
  }
  .friends-header-row {
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
  }
  .friends-title {
    font-size: 1.05rem !important;
  }
  .friends-add-bar {
    gap: 6px !important;
    margin-bottom: 12px !important;
  }
  .friends-add-bar input {
    height: 36px !important;
    font-size: 0.84rem !important;
  }
  .friends-add-bar button {
    height: 36px !important;
    padding: 0 12px !important;
    font-size: 0.82rem !important;
  }
  .friend-row {
    padding: 8px 10px !important;
    gap: 8px !important;
  }
  .friend-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.82rem !important;
  }
  .friend-name {
    font-size: 0.84rem !important;
  }
  .friend-stats-snippet {
    font-size: 0.7rem !important;
  }

  /* Admin Modal on Mobile */
  .admin-modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 0 !important;
    max-height: 92vh !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  .admin-modal-scroll-area {
    padding: 12px 10px 24px 10px !important;
    overflow-x: hidden !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .admin-sticky-header {
    padding: 12px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .admin-tabs {
    flex-direction: row !important;
    gap: 6px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    width: 100% !important;
  }
  .admin-tab-btn {
    padding: 8px 12px !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  .admin-grid,
  .admin-grid-tracks,
  .admin-grid-2col,
  .admin-grid-3col {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .admin-card {
    padding: 14px 10px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .admin-spotify-box {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 10px !important;
  }
  .admin-spotify-input-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .admin-spotify-input {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .admin-spotify-btn {
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  .admin-hint-chip {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }
  .admin-modal-content input,
  .admin-modal-content select,
  .admin-modal-content textarea {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Settings Modal on Mobile - Fixed Scrolling & Safe Area for Android Bottom Bar */
  .settings-modal-card {
    width: 95vw !important;
    padding: 20px 14px !important;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 24px)) !important;
    max-height: 85dvh !important;
    border-radius: 18px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }
  .settings-danger-zone {
    margin-bottom: calc(44px + env(safe-area-inset-bottom, 24px)) !important;
  }
}

/* =======================================================
   ⏸️ MODERNISM PAUSE MODAL
   ======================================================= */
.pause-modal-card {
  position: relative;
  width: 90vw;
  max-width: 420px;
  background: rgba(11, 19, 36, 0.88) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 24px !important;
  padding: 32px 24px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.1) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body[data-theme=light] .pause-modal-card {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.2) !important;
}

.pause-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.pause-icon-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.pause-header h2 {
  margin: 0 0 6px 0 !important;
  font-size: 1.6rem !important;
  font-weight: 800 !important;
  letter-spacing: 2px !important;
  color: var(--text-primary) !important;
}

.pause-song-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pause-stats-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 24px;
}

body[data-theme=light] .pause-stats-row {
  background: rgba(241, 245, 249, 0.85);
  border-color: #e2e8f0;
}

.pause-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pause-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-weight: 600;
}

.pause-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--highlight);
}

.pause-stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
}

body[data-theme=light] .pause-stat-divider {
  background: #cbd5e1;
}

.pause-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pause-actions .action-btn {
  width: 100% !important;
  margin: 0 !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  border-radius: 14px !important;
}

/* =======================================================
   🏆 MODERNISM RESULTS MODAL
   ======================================================= */
.results-modal-card {
  position: relative;
  width: 92vw;
  max-width: 480px;
  background: rgba(11, 19, 36, 0.92) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 28px !important;
  padding: 30px 22px 24px 22px !important;
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.85), 0 0 40px rgba(56, 189, 248, 0.12) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  animation: modal-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body[data-theme=light] .results-modal-card {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 30px 60px -15px rgba(15, 23, 42, 0.25) !important;
}

.results-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 18px;
}

/* Grade Badges */
.res-grade-badge {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  font-weight: 900;
  font-family: inherit;
  margin-bottom: 12px;
  user-select: none;
  transition: transform 0.25s ease;
}

.res-grade-badge:hover {
  transform: scale(1.06);
}

.res-grade-badge.grade-s {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: #ffffff;
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.65), inset 0 0 12px rgba(255, 255, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.res-grade-badge.grade-a {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #ffffff;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.55), inset 0 0 10px rgba(255, 255, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.res-grade-badge.grade-b {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: #ffffff;
  box-shadow: 0 0 22px rgba(59, 130, 246, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.res-grade-badge.grade-c {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5), inset 0 0 8px rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.res-grade-badge.grade-d {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5), inset 0 0 8px rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.results-header h1 {
  margin: 0 0 4px 0 !important;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  letter-spacing: 1px !important;
}

.res-track-title {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.res-difficulty-pill {
  margin-bottom: 8px;
}

.res-stars-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.res-stars-summary {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fde047;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
  margin-bottom: 14px;
  text-align: center;
}

.res-stars-summary.diamond {
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

/* 4-Stat Box Grid */
.res-stats-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.res-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
}

body[data-theme=light] .res-stat-card {
  background: rgba(241, 245, 249, 0.9);
  border-color: #e2e8f0;
}

.res-stat-icon {
  color: var(--highlight);
  opacity: 0.85;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.res-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 2px;
}

.res-stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Actions Row */
.res-actions-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.res-actions-row .action-btn {
  flex: 1;
  margin: 0 !important;
  height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  border-radius: 14px !important;
  padding: 0 12px !important;
}

@media (max-width: 440px) {
  .results-modal-card {
    padding: 22px 14px 18px 14px !important;
    border-radius: 22px !important;
  }
  .res-grade-badge {
    width: 60px;
    height: 60px;
    font-size: 2.3rem;
    border-radius: 16px;
  }
  .res-stats-grid {
    gap: 8px;
    margin-bottom: 16px;
  }
  .res-stat-card {
    padding: 10px 8px;
  }
  .res-stat-value {
    font-size: 1.1rem;
  }
  .res-actions-row {
    gap: 6px;
  }
  .res-actions-row .action-btn {
    font-size: 0.8rem !important;
    padding: 0 6px !important;
    height: 40px !important;
  }
}

/* ==========================================
   COSMETICS SYSTEM: AVATARS, FRAMES, TITLES & BIO
   ========================================== */

/* Universal Avatar Image Display */
.user-profile-avatar img,
.podium-avatar img,
.lb-avatar-mini img,
.friend-avatar img,
.user-badge-pill img,
.profile-avatar-pill img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Avatar Action Buttons (Edit & Reset) */
.avatar-action-btn {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.2s ease;
}

.avatar-action-btn:hover {
  transform: scale(1.12);
}

.avatar-action-btn:active {
  transform: scale(0.95);
}

.edit-avatar-btn {
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  background: var(--highlight, #00d2ff);
  color: #0b0f19;
  box-shadow: 0 2px 10px rgba(0, 210, 255, 0.5);
}

.reset-avatar-btn {
  top: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  background: #f43f5e;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.4);
}

/* ------------------------------------------
   6 NEON ANIMATED AVATAR FRAMES
   ------------------------------------------ */

/* 1. Neon Start: Cyan Pulse */
.frame-neon-start {
  border: 2.5px solid #00d2ff !important;
  box-shadow: 0 0 10px #00d2ff, 0 0 22px rgba(0, 210, 255, 0.6), inset 0 0 8px rgba(0, 210, 255, 0.4) !important;
  animation: neon-frame-pulse 2.2s infinite ease-in-out !important;
}

@keyframes neon-frame-pulse {
  0%, 100% {
    box-shadow: 0 0 8px #00d2ff, 0 0 18px rgba(0, 210, 255, 0.5), inset 0 0 6px rgba(0, 210, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 16px #00d2ff, 0 0 32px rgba(0, 210, 255, 0.85), inset 0 0 10px rgba(0, 210, 255, 0.5);
  }
}

/* 2. Gold Prestige: Pulsing Golden Aura */
.frame-gold-prestige {
  border: 2.5px solid #fbbf24 !important;
  box-shadow: 0 0 12px #fbbf24, 0 0 26px rgba(251, 191, 36, 0.65), inset 0 0 8px rgba(245, 158, 11, 0.5) !important;
  animation: gold-frame-breathe 2.5s infinite ease-in-out !important;
}

@keyframes gold-frame-breathe {
  0%, 100% {
    box-shadow: 0 0 9px #fbbf24, 0 0 20px rgba(251, 191, 36, 0.5), inset 0 0 6px rgba(245, 158, 11, 0.3);
  }
  50% {
    box-shadow: 0 0 18px #fbbf24, 0 0 36px rgba(251, 191, 36, 0.9), inset 0 0 12px rgba(245, 158, 11, 0.65);
  }
}

/* 3. Crimson Fire: Flaming Crimson/Orange */
.frame-crimson-fire {
  border: 2.5px solid #f43f5e !important;
  box-shadow: 0 0 14px #f43f5e, 0 0 28px rgba(239, 68, 68, 0.8), inset 0 0 9px rgba(249, 115, 22, 0.6) !important;
  animation: crimson-frame-flicker 1.8s infinite alternate ease-in-out !important;
}

@keyframes crimson-frame-flicker {
  0% {
    box-shadow: 0 0 10px #f43f5e, 0 0 22px rgba(239, 68, 68, 0.6), inset 0 0 6px rgba(244, 63, 94, 0.4);
    border-color: #f43f5e;
  }
  50% {
    box-shadow: 0 0 18px #ef4444, 0 0 36px rgba(249, 115, 22, 0.85), inset 0 0 12px rgba(249, 115, 22, 0.65);
    border-color: #fb923c;
  }
  100% {
    box-shadow: 0 0 13px #f97316, 0 0 26px rgba(239, 68, 68, 0.75), inset 0 0 8px rgba(244, 63, 94, 0.5);
    border-color: #f43f5e;
  }
}

/* 4. Cosmic Nebula: Spinning Purple/Magenta Gradient */
.frame-cosmic-nebula {
  border: 2.5px solid #c084fc !important;
  box-shadow: 0 0 14px #a855f7, 0 0 28px rgba(168, 85, 247, 0.7), 0 0 42px rgba(56, 189, 248, 0.45), inset 0 0 9px rgba(168, 85, 247, 0.5) !important;
  animation: cosmic-frame-pulse 3s infinite ease-in-out !important;
}

@keyframes cosmic-frame-pulse {
  0%, 100% {
    box-shadow: 0 0 11px #a855f7, 0 0 22px rgba(168, 85, 247, 0.5), 0 0 34px rgba(56, 189, 248, 0.35);
    border-color: #a855f7;
  }
  50% {
    box-shadow: 0 0 20px #c084fc, 0 0 38px rgba(168, 85, 247, 0.85), 0 0 50px rgba(56, 189, 248, 0.7);
    border-color: #38bdf8;
  }
}

/* 5. Cyber Glitch: Chromatic Aberration & Jitter */
.frame-cyber-glitch {
  border: 2.5px solid #00ffff !important;
  box-shadow: 2.5px 0 12px #ff007f, -2.5px 0 12px #00f0ff, inset 0 0 8px rgba(0, 240, 255, 0.5) !important;
  animation: cyber-frame-glitch 2s infinite steps(2, start) !important;
}

@keyframes cyber-frame-glitch {
  0%, 100% {
    box-shadow: 2px 0 10px #ff007f, -2px 0 10px #00f0ff;
    transform: translate(0, 0);
  }
  48% {
    box-shadow: 2px 0 10px #ff007f, -2px 0 10px #00f0ff;
    transform: translate(0, 0);
  }
  50% {
    box-shadow: -3px 0 14px #ff007f, 3px 0 14px #00f0ff;
    transform: translate(-1px, 1px);
  }
  52% {
    box-shadow: 3px 0 14px #00f0ff, -3px 0 14px #ff007f;
    transform: translate(1px, -1px);
  }
}

/* 6. Prismatic Legend: Rainbow Holographic Cycle */
.frame-prismatic {
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 0 16px #38bdf8, 0 0 32px #ec4899, inset 0 0 9px rgba(255, 255, 255, 0.8) !important;
  animation: prismatic-frame-cycle 4s linear infinite !important;
}

@keyframes prismatic-frame-cycle {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

/* ------------------------------------------
   7 TANGIBLE PHYSICAL FRAMES (NON-NEON)
   Tangible textures: titanium, gold molding, ice crystals,
   chrome/rubber, gothic wrought-iron, brass chrono & urushi lacquer
   ------------------------------------------ */

/* Static material frames share the existing avatar classes and preserve the portrait. */
:is(.frame-cyber-alloy, .frame-baroque-gold, .frame-frostbound, .frame-street-drift, .frame-gothic-thorn, .frame-steampunk-chrono, .frame-sakura-urushi) {
  position: relative;
  isolation: isolate;
  overflow: visible !important;
  border: 1px solid var(--frame-edge, #80766b) !important;
  border-radius: var(--frame-radius, 20%) !important;
  box-shadow: 0 3px 6px #0008, inset 0 1px 2px #fff5 !important;
  animation: none !important;
}
:is(.frame-cyber-alloy, .frame-baroque-gold, .frame-frostbound, .frame-street-drift, .frame-gothic-thorn, .frame-steampunk-chrono, .frame-sakura-urushi)::before {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 2;
  inset: -5px;
  padding: 6px;
  border-radius: inherit;
  background: var(--frame-material);
  /* Hollow construction: the material never paints over the avatar. */
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}
:is(.frame-cyber-alloy, .frame-baroque-gold, .frame-frostbound, .frame-street-drift, .frame-gothic-thorn, .frame-steampunk-chrono, .frame-sakura-urushi)::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 3;
  inset: -7px;
  background: var(--frame-ornament) left top / 12px 12px no-repeat,
              var(--frame-ornament) right top / 12px 12px no-repeat,
              var(--frame-ornament) left bottom / 12px 12px no-repeat,
              var(--frame-ornament) right bottom / 12px 12px no-repeat;
  filter: drop-shadow(0 1px 1px #0009);
}
:is(.frame-cyber-alloy, .frame-baroque-gold, .frame-frostbound, .frame-street-drift, .frame-gothic-thorn, .frame-steampunk-chrono, .frame-sakura-urushi) > .avatar-photo {
  border-radius: inherit;
}
body[data-theme="light"] :is(.frame-cyber-alloy, .frame-baroque-gold, .frame-frostbound, .frame-street-drift, .frame-gothic-thorn, .frame-steampunk-chrono, .frame-sakura-urushi) {
  box-shadow: 0 3px 7px #17202d50, inset 0 1px 2px #fff8 !important;
}

/* Machined titanium, woven carbon side panels, slotted steel fasteners. */
.frame-cyber-alloy {
  --frame-radius: 12%;
  --frame-edge: #899398;
  --frame-material: repeating-linear-gradient(90deg, #13191b 0 1px, transparent 1px 3px) 50% 100% / 35% 4px no-repeat,
    linear-gradient(90deg, transparent 14%, #6d767b 15%, #a6adb0 48%, #4b555a 52%, #293237 85%, transparent 86%),
    repeating-linear-gradient(45deg, #101619 0 2px, #3c454a 2px 4px, #202a2f 4px 6px);
  --frame-ornament: radial-gradient(circle, #e5e8e8 0 16%, #a6b1b6 19% 27%, #273236 29% 38%, transparent 40%);
}
.frame-cyber-alloy::before { clip-path: polygon(10% 0,90% 0,100% 10%,100% 90%,90% 100%,10% 100%,0 90%,0 10%); }
/* Gilded molding with curled acanthus relief and ruby cabochons. */
.frame-baroque-gold {
  --frame-radius: 25%;
  --frame-edge: #ddbc60;
  --frame-material: repeating-radial-gradient(ellipse at 50% 50%, transparent 0 3px, #4f3119aa 4px, #f7dc8588 5px, transparent 6px 9px),
    linear-gradient(135deg, #5b3519, #efd797 16%, #a57c31 25%, #f6d47b 40%, #6d481e 53%, #ba8d3d 75%, #f0d58d 87%, #57341c);
  --frame-ornament: radial-gradient(ellipse, #f5a1a0 0 6%, #901d35 10% 23%, #380d16 25% 29%, #f4d890 31% 39%, #7c521c 41% 48%, transparent 51%),
    repeating-conic-gradient(from 20deg, #ddbb67 0 22deg, #654421 23deg 40deg, transparent 41deg 60deg);
}
.frame-baroque-gold::after { border-radius: 24%; }
/* Silver support and transparent splintered quartz, extending beyond the case. */
.frame-frostbound {
  --frame-radius: 18%;
  --frame-edge: #bfdae0;
  --frame-material: repeating-linear-gradient(126deg, transparent 0 9px, #f4ffffc9 10px, transparent 11px 19px),
    repeating-conic-gradient(from 35deg, #e8faffdd 0 30deg, #8db6c8bb 31deg 68deg, #f6ffffee 69deg 88deg, #678da488 89deg 110deg);
  --frame-ornament: conic-gradient(from 20deg, #e9ffffdd, #6792ac99, #fff, #add8e3aa, #f7ffffee, #8fadbacc);
}
.frame-frostbound::after {
  inset: -9px;
  clip-path: polygon(0 0,19% 5%,12% 18%,5% 24%,0 12%,0 0,100% 0,97% 20%,85% 13%,91% 4%,100% 0,100% 100%,80% 96%,91% 82%,99% 91%,100% 100%,0 100%,4% 81%,17% 91%,8% 99%);
}
/* Chrome bumper rails, tire tread sides, a stamped badge and red tow ring. */
.frame-street-drift {
  --frame-radius: 10%;
  --frame-edge: #b7c1c4;
  --frame-material: linear-gradient(180deg, #e9f0f0, #78838b 18%, #202d35 38%, #fff 49%, #a5b0b5 58%, #39414a 83%, #e4e9e8) top / 100% 7px no-repeat,
    linear-gradient(180deg, #edf4f5, #7b858b 20%, #151f26 44%, #eef4f7 52%, #8d979c 76%, #222d31) bottom / 100% 7px no-repeat,
    repeating-linear-gradient(135deg, #111618 0 3px, #4a4c4c 3px 4px, #252a2c 4px 7px);
}
.frame-street-drift::after {
  content: 'ドリフト';
  inset: auto 8% -7px auto;
  padding: 1px 2px;
  background: linear-gradient(#e4e5e2, #949da1);
  border: 1px solid #4c555c;
  border-radius: 1px;
  color: #1c2429;
  font: 700 5px/1.2 sans-serif;
  letter-spacing: .3px;
  box-shadow: -10px 0 0 -1px #971d2b, -10px 0 0 1px #bd5560;
}
/* Forged briars surround black onyx; narrow crimson mineral veins. */
.frame-gothic-thorn {
  --frame-radius: 38% 38% 14% 14%;
  --frame-edge: #59555d;
  --frame-material: repeating-linear-gradient(127deg, transparent 0 13px, #651e30 14px, #210d18 15px, transparent 16px 24px),
    linear-gradient(120deg, #100f13, #727079 18%, #25232b 24%, #0b0b10 50%, #48404a 71%, #0d0d12 83%, #69626c);
  --frame-ornament: radial-gradient(ellipse at 50% 72%, #9e6673 0 5%, #290f1c 12% 23%, #050509 27% 34%, #747079 37% 42%, #222028 44% 51%, transparent 53%);
}
.frame-gothic-thorn::after {
  inset: -10px;
  background-size: 15px 19px;
  clip-path: polygon(0 0,17% 8%,10% 28%,4% 20%,0 0,100% 0,96% 20%,90% 28%,83% 8%,100% 0,100% 100%,80% 97%,92% 80%,100% 100%,0 100%,8% 80%,20% 97%,0 100%);
}
/* Watch-case brass and copper, engraved ticks and stationary toothed gears. */
.frame-steampunk-chrono {
  --frame-radius: 30%;
  --frame-edge: #c49a5d;
  --frame-material: repeating-conic-gradient(#392918 0 2deg, transparent 3deg 14deg),
    linear-gradient(145deg, #51341e, #e9cd89 20%, #8c6335 38%, #c98959 58%, #64422a 70%, #ecd99a 85%, #98643c);
  --frame-ornament: radial-gradient(circle, #1d2322 0 12%, #e4bd76 14% 21%, #8c5d32 23% 35%, transparent 37%),
    repeating-conic-gradient(#ba8950 0 19deg, #382a1e 20deg 27deg, #d9b57a 28deg 40deg, transparent 41deg 45deg);
}
.frame-steampunk-chrono::after { border-radius: 18%; background-size: 13px 13px; }
/* Black-cherry lacquer with fine gold repairs and nacre flower inlays. */
.frame-sakura-urushi {
  --frame-radius: 22%;
  --frame-edge: #8b635d;
  --frame-material: linear-gradient(117deg, transparent 21%, #bfa058 22% 23%, transparent 24% 72%, #ead49b 73% 74%, transparent 75%),
    linear-gradient(36deg, transparent 35%, #c2a360 36% 37%, transparent 38%),
    linear-gradient(160deg, #100a11, #662a3d 16%, #e4b7aa 19%, #3d1526 23%, #130910 52%, #3b1725 76%, #0c0910);
  --frame-ornament: radial-gradient(ellipse at 50% 27%, #fff3ec 0 16%, transparent 18%),
    radial-gradient(ellipse at 28% 47%, #d2bdce 0 16%, transparent 18%),
    radial-gradient(ellipse at 72% 47%, #ffe9e2 0 16%, transparent 18%),
    radial-gradient(ellipse at 36% 72%, #f7e0ee 0 16%, transparent 18%),
    radial-gradient(ellipse at 65% 72%, #c6cbdc 0 16%, transparent 18%),
    radial-gradient(circle, #ba9955 0 20%, transparent 22%);
}

/* Profile Identity Enhancements */
.user-profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.user-title-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(234, 88, 12, 0.18));
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.user-profile-status-wrap {
  margin-bottom: 6px;
}

.user-profile-bio {
  font-size: 0.82rem;
  color: var(--text-secondary, #94a3b8);
  font-style: italic;
  word-break: break-word;
  line-height: 1.35;
  min-height: 18px;
}

.user-bio-edit-box {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}

.up-bio-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.82rem;
  height: 32px;
  border-radius: 8px;
  min-width: 0;
  margin: 0 !important;
}

.bio-counter {
  font-size: 0.68rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.up-bio-save-btn {
  height: 32px;
  width: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
}

/* Favorite Track Showcase */
.profile-favorite-track-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 14px;
}

.favorite-track-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}

.fav-label {
  color: var(--text-secondary, #94a3b8);
  font-weight: 600;
}

.fav-title {
  color: var(--highlight, #00d2ff);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Customization Section */
.up-customization-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}

.customization-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cust-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
}

.customization-tabs {
  display: flex;
  gap: 6px;
}

.cust-tab-btn {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.1));
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cust-tab-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.cust-tab-btn.active {
  background: var(--highlight, #00d2ff);
  color: #0b0f19;
  border-color: var(--highlight, #00d2ff);
  font-weight: 700;
}

.cust-panel {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

#cust-panel-frames,
#cust-panel-titles {
  grid-template-columns: 1fr;
}

.cust-tab-pane .cust-panel {
  max-height: none;
  overflow-y: visible;
}

.cust-collection-heading {
  grid-column: 1 / -1;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--highlight, #00d2ff);
  padding: 10px 4px 4px 4px;
  margin: 8px 0 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cust-collection-heading:first-child {
  margin-top: 0;
  padding-top: 2px;
}

body[data-theme="light"] .cust-collection-heading {
  color: #0284c7;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.cosmetic-item-card {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.cosmetic-item-card:hover:not(.locked) {
  border-color: var(--highlight, #00d2ff);
  background: rgba(56, 189, 248, 0.08);
}

.cosmetic-item-card.equipped {
  border-color: var(--highlight, #00d2ff);
  background: rgba(56, 189, 248, 0.14);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.cosmetic-item-card.locked {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.cust-frame-preview {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.cust-item-info {
  min-width: 0;
  flex: 1;
}

.cust-item-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cust-item-desc {
  font-size: 0.68rem;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.25;
}

.cust-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

.cust-status-badge.equipped {
  background: var(--highlight, #00d2ff);
  color: #0b0f19;
}

.cust-status-badge.locked {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #64748b);
}

.cust-status-badge.unlocked {
  background: rgba(74, 222, 128, 0.18);
  color: #4ade80;
}

/* ------------------------------------------
   LIGHT THEME ADAPTATION (body[data-theme="light"])
   ------------------------------------------ */
body[data-theme="light"] .user-profile-card {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.16) !important;
}

body[data-theme="light"] .user-profile-avatar {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(99, 102, 241, 0.12)) !important;
  color: #0284c7 !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 14px rgba(2, 132, 199, 0.25) !important;
}

body[data-theme="light"] .profile-stat-box {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

body[data-theme="light"] .stat-box-val {
  color: #0f172a !important;
}

body[data-theme="light"] .stat-box-lbl {
  color: #64748b !important;
}

body[data-theme="light"] .profile-favorite-track-box,
body[data-theme="light"] .up-customization-section {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

body[data-theme="light"] .cust-title {
  color: #0f172a !important;
}

body[data-theme="light"] .cust-tab-btn {
  border-color: #cbd5e1 !important;
  color: #64748b !important;
}

body[data-theme="light"] .cust-tab-btn:hover {
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

body[data-theme="light"] .cust-tab-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

body[data-theme="light"] .cosmetic-item-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

body[data-theme="light"] .cosmetic-item-card:hover:not(.locked) {
  border-color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.05) !important;
}

body[data-theme="light"] .cosmetic-item-card.equipped {
  border-color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.1) !important;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.2) !important;
}

body[data-theme="light"] .cust-item-name {
  color: #0f172a !important;
}

body[data-theme="light"] .cust-item-desc {
  color: #64748b !important;
}

body[data-theme="light"] .user-profile-bio {
  color: #475569 !important;
}

body[data-theme="light"] .user-title-badge {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fde68a !important;
}

body[data-theme="light"] .cust-status-badge.equipped {
  background: #0284c7 !important;
  color: #ffffff !important;
}

body[data-theme="light"] .cust-status-badge.locked {
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
}

body[data-theme="light"] .cust-status-badge.unlocked {
  background: #dcfce7 !important;
  color: #16a34a !important;
}

/* Light Theme Frames: enhanced contrast edges */
body[data-theme="light"] .frame-neon-start {
  border: 2.5px solid #0284c7 !important;
  box-shadow: 0 0 8px #0284c7, 0 0 18px rgba(2, 132, 199, 0.45) !important;
}

body[data-theme="light"] .frame-gold-prestige {
  border: 2.5px solid #d97706 !important;
  box-shadow: 0 0 10px #d97706, 0 0 20px rgba(217, 119, 6, 0.45) !important;
}

body[data-theme="light"] .frame-crimson-fire {
  border: 2.5px solid #e11d48 !important;
  box-shadow: 0 0 10px #e11d48, 0 0 22px rgba(225, 29, 72, 0.45) !important;
}

body[data-theme="light"] .frame-cosmic-nebula {
  border: 2.5px solid #9333ea !important;
  box-shadow: 0 0 10px #9333ea, 0 0 22px rgba(147, 51, 234, 0.45) !important;
}

body[data-theme="light"] .frame-cyber-glitch {
  border: 2.5px solid #0284c7 !important;
  box-shadow: 2px 0 8px #e11d48, -2px 0 8px #0284c7 !important;
}

body[data-theme="light"] .frame-prismatic {
  border: 2.5px solid #0284c7 !important;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.5), 0 0 24px rgba(219, 39, 119, 0.4) !important;
}

/* ==========================================
   CUSTOM CONFIRMATION MODAL & AUTH NOTICES
   ========================================== */
#custom-confirm-modal {
  z-index: 9999 !important;
}

.custom-confirm-box {
  background: var(--surface-bg, rgba(16, 18, 30, 0.95));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border, rgba(0, 242, 254, 0.25));
  border-radius: 18px;
  padding: 24px 22px;
  max-width: 440px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 242, 254, 0.15);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: confirmPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes confirmPop {
  0% { transform: scale(0.88); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.custom-confirm-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.custom-confirm-icon-wrap {
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 170, 0, 0.15);
  border: 1px solid rgba(255, 170, 0, 0.35);
}

.custom-confirm-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
}

.custom-confirm-body {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-secondary, #a0aec0);
  word-break: break-word;
}

.custom-confirm-body p {
  margin: 4px 0;
}

.custom-confirm-options {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
}

.custom-confirm-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-secondary, #cbd5e1);
  cursor: pointer;
  user-select: none;
}

.custom-confirm-checkbox-label input[type="checkbox"] {
  accent-color: #00f2fe;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.custom-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.custom-confirm-actions button {
  min-width: 95px;
  padding: 8px 16px;
  font-size: 0.9rem;
}

.auth-error-msg {
  background: rgba(255, 68, 68, 0.14);
  border: 1px solid rgba(255, 68, 68, 0.55);
  color: #ff5e5e;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.86rem;
  line-height: 1.35;
  margin-bottom: 14px;
  text-align: center;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.2);
  animation: shakeError 0.35s ease-in-out;
}

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

/* Light Theme Adaptations */
body[data-theme="light"] .custom-confirm-box {
  background: rgba(255, 255, 255, 0.97) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2), 0 0 15px rgba(2, 132, 199, 0.2) !important;
}

body[data-theme="light"] .custom-confirm-title {
  color: #0f172a !important;
}

body[data-theme="light"] .custom-confirm-body {
  color: #475569 !important;
}

body[data-theme="light"] .custom-confirm-options {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

body[data-theme="light"] .custom-confirm-checkbox-label {
  color: #334155 !important;
}

body[data-theme="light"] .auth-error-msg {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
}

/* ==========================================
   FIELD THEMES SHOP & COINS SYSTEM
   ========================================== */
.nav-btn-shop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25));
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fef08a;
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.85rem;
}

.nav-btn-shop:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(217, 119, 6, 0.4));
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.shop-coins-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.8rem;
  color: #fde047;
  font-weight: 700;
}

.shop-modal-card {
  background: #0f172a;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  padding: 24px;
  width: 95%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 35px rgba(56, 189, 248, 0.15);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.shop-header-row {
  position: sticky;
  top: -24px;
  margin: -24px -24px 0 -24px;
  padding: 18px 24px 14px 24px;
  background: #0f172a;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

body[data-theme="light"] .shop-header-row {
  background: #ffffff;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.shop-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-title-text {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fef08a, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.shop-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 2px;
}

.shop-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-header-right .modal-close-btn {
  position: static !important;
  margin: 0 !important;
  flex-shrink: 0;
}

.shop-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.35));
  border: 1px solid rgba(245, 158, 11, 0.5);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fef08a;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.shop-info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #bae6fd;
}

/* Shop Controls Bar: Search & Sort */
.shop-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.shop-search-box {
  position: relative;
  flex: 1 1 200px;
  display: flex;
  align-items: center;
}

.shop-search-icon {
  position: absolute;
  left: 12px;
  font-size: 0.9rem;
  pointer-events: none;
  opacity: 0.7;
}

.shop-search-input {
  width: 100%;
  padding: 8px 32px 8px 36px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.shop-search-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  background: rgba(15, 23, 42, 0.85);
}

.shop-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.shop-search-clear:hover {
  color: #f8fafc;
}

.shop-sort-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.shop-sort-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
}

.shop-sort-select {
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.shop-sort-select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.shop-empty-msg {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.95rem;
  font-weight: 600;
}

body[data-theme="light"] .shop-search-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

body[data-theme="light"] .shop-search-input:focus {
  border-color: #b45309;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.2);
}

body[data-theme="light"] .shop-sort-select {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

body[data-theme="light"] .shop-sort-select:focus {
  border-color: #b45309;
}

.shop-themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.shop-theme-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
}

.shop-theme-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.shop-theme-card.active-theme {
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.theme-card-preview {
  height: 110px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.theme-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  opacity: 0.85;
  transition: transform 0.3s ease;
}

.shop-theme-card:hover .theme-card-img {
  transform: scale(1.05);
}

.theme-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.theme-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.theme-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-card-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
  flex: 1;
}

.theme-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-card-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fde047;
  display: flex;
  align-items: center;
  gap: 4px;
}

.theme-action-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-theme-buy {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-theme-buy:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.btn-theme-equip {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
}

.btn-theme-equip:hover {
  background: rgba(56, 189, 248, 0.3);
}

.btn-theme-equipped {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #4ade80;
  cursor: default;
}

/* Light Theme Adaptations for Shop */
body[data-theme="light"] .shop-modal-card {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
}

body[data-theme="light"] .shop-header-row {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .shop-title-text {
  background: linear-gradient(135deg, #d97706, #b45309);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body[data-theme="light"] .shop-theme-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body[data-theme="light"] .theme-card-title {
  color: #0f172a;
}

body[data-theme="light"] .theme-card-desc {
  color: #475569;
}

body[data-theme="light"] .shop-info-banner {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}

/* =======================================================
   ✨ CUSTOMIZATION & INVENTORY MODAL STYLES
   ======================================================= */
.customization-modal-card {
  width: 92%;
  max-width: 680px;
  max-height: 88vh;
  background: rgba(11, 19, 43, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75), 0 0 24px rgba(56, 189, 248, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  box-sizing: border-box;
  animation: modalIn 0.22s ease-out;
}

.cust-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cust-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cust-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #38bdf8;
}

.customization-nav-tabs {
  display: flex;
  gap: 6px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 14px;
}

.cust-main-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cust-main-tab:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.cust-main-tab.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.16);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.cust-tab-pane {
  flex: 1;
  overflow-y: auto;
  max-height: calc(88vh - 190px);
  padding-right: 4px;
}

.cust-tab-pane.hidden {
  display: none !important;
}

.btn-theme-preview {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  padding: 6px 12px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.18s ease !important;
}

.btn-theme-preview:hover {
  background: rgba(56, 189, 248, 0.24) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35) !important;
}

/* Light Theme Customization Modal */
body[data-theme="light"] .customization-modal-card {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
}

body[data-theme="light"] .cust-modal-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .customization-nav-tabs {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

body[data-theme="light"] .cust-main-tab {
  color: #64748b;
}

body[data-theme="light"] .cust-main-tab.active {
  color: #0284c7;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* =======================================================
   ✨ THEME PREVIEW CHOOSER & IN-GAME HUD BANNER
   ======================================================= */
.theme-preview-card {
  width: 90%;
  max-width: 420px;
  background: rgba(11, 19, 43, 0.97);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  padding: 22px;
  box-sizing: border-box;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75), 0 0 24px rgba(56, 189, 248, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: modalIn 0.2s ease-out;
}

.theme-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.theme-preview-hud {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.65), 0 0 16px rgba(56, 189, 248, 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 7px 16px;
  border-radius: 999px;
  animation: slideDownFade 0.25s ease-out;
  pointer-events: auto;
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.preview-hud-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-hud-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: pulseDot 1.2s infinite alternate ease-in-out;
}

@keyframes pulseDot {
  from { transform: scale(0.85); opacity: 0.6; }
  to { transform: scale(1.25); opacity: 1; }
}

.preview-hud-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.3px;
  white-space: nowrap !important;
}

.preview-hud-timer {
  font-size: 0.84rem;
  font-weight: 800;
  color: #facc15;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.preview-hud-exit-btn {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.45);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.preview-hud-exit-btn:hover {
  background: rgba(244, 63, 94, 0.38);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

/* =======================================================
   ✨ TOOLBAR ACTIONS & MOBILE OPTIMIZATIONS
   ======================================================= */
#btn-open-customization {
  border-color: rgba(56, 189, 248, 0.45) !important;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(14, 165, 233, 0.22)) !important;
  color: #38bdf8 !important;
}

#btn-open-customization:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(14, 165, 233, 0.35)) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.28);
}

@media (max-width: 768px) {
  select,
  .modern-select,
  .catalog-sort-select,
  .shop-sort-select {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
    height: 42px !important;
  }

  .catalog-toolbar-actions {
    display: flex !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .catalog-toolbar-actions .btn-shop-toolbar,
  .catalog-toolbar-actions #btn-open-leaderboard {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 8px 6px !important;
    font-size: 0.78rem !important;
    justify-content: center !important;
  }
}

/* =======================================================
   🎨 ADMIN THEME MANAGEMENT & SHOP DISCOUNTS
   ======================================================= */
.admin-themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .admin-themes-grid {
    grid-template-columns: 1fr !important;
  }
}

.admin-theme-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

.admin-theme-card:hover {
  border-color: var(--surface-border-hover);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

body[data-theme="light"] .admin-theme-card {
  background: #ffffff;
  border-color: #cbd5e1;
}

.admin-theme-accent-strip {
  height: 4px;
  width: 100%;
  border-radius: 2px;
  margin-bottom: 2px;
}

.admin-theme-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-theme-id-tag {
  font-size: 0.72rem;
  font-family: monospace;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.admin-theme-discount-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body[data-theme="light"] .admin-theme-discount-box {
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.35);
}

.admin-discount-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fbbf24;
}

.admin-discount-preview-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(245, 158, 11, 0.4);
}

/* Shop Discount Badges & Strike-through Price */
.theme-price-original {
  text-decoration: line-through;
  opacity: 0.5;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-right: 6px;
}

.theme-price-discounted {
  color: #4ade80 !important;
  font-weight: 800;
}

.theme-card-badge.theme-badge-sale {
  left: 8px;
  right: auto;
  background: linear-gradient(135deg, #ef4444, #f97316) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5) !important;
  animation: pulseSaleBadge 2s infinite ease-in-out;
}

@keyframes pulseSaleBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
/* Accessible controls and readable mobile menus. Gameplay retains direct touch input. */
html, body {
  touch-action: auto !important;
}

button, a, [role="button"] {
  touch-action: manipulation;
}

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--highlight) !important;
  outline-offset: 4px !important;
}

:where(input, textarea) {
  user-select: text;
  -webkit-user-select: text;
}

:root {
  --text-muted: #94a3b8;
}

body[data-theme=light] {
  --text-muted: #64748b;
}

.catalog-filter-bar {
  scroll-padding-inline: 8px;
  padding-top: 5px;
  padding-bottom: 6px;
}

.filter-chip {
  flex-shrink: 0;
  min-height: 40px;
}

.song-card:focus-within {
  border-color: var(--highlight) !important;
}

.song-card:focus-within .spotify-play-btn {
  opacity: 1;
  transform: translateY(0);
}

@media (pointer: coarse) {
  .nav-btn, .filter-chip, .modal-close-btn, .lb-close-btn,
  .shop-search-clear, .btn-shop-toolbar, .friends-tab-btn,
  .auth-tab-btn, .cust-main-tab {
    min-width: 44px;
    min-height: 44px;
  }

  .spotify-play-btn {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }

  .modal-overlay input, .modal-overlay select, .modal-overlay textarea {
    font-size: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =======================================================
   SIMULATED FULLSCREEN MODE (iOS Safari / Mobile Fallback)
   ======================================================= */
html.simulated-fullscreen,
body.simulated-fullscreen {
  width: 100vw !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 99999 !important;
}

body.simulated-fullscreen .app-header {
  display: none !important;
}

body.simulated-fullscreen #game-container {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0) !important;
  z-index: 100000 !important;
  border: none !important;
  box-shadow: none !important;
}

body.simulated-fullscreen canvas#rhythmCanvas,
body.simulated-fullscreen canvas#pixiCanvas {
  width: 100% !important;
  height: 100% !important;
}


.frame-cyber-alloy::after { background: radial-gradient(circle, #e5e8e8 0 16%, #a6b1b6 19% 27%, #273236 29% 38%, transparent 40%) left top / 12px 12px no-repeat,
    radial-gradient(circle, #e5e8e8 0 16%, #a6b1b6 19% 27%, #273236 29% 38%, transparent 40%) right top / 12px 12px no-repeat,
    radial-gradient(circle, #e5e8e8 0 16%, #a6b1b6 19% 27%, #273236 29% 38%, transparent 40%) left bottom / 12px 12px no-repeat,
    radial-gradient(circle, #e5e8e8 0 16%, #a6b1b6 19% 27%, #273236 29% 38%, transparent 40%) right bottom / 12px 12px no-repeat; }

.frame-baroque-gold::after { background: radial-gradient(ellipse, #f5a1a0 0 6%, #901d35 10% 23%, #380d16 25% 29%, #f4d890 31% 39%, #7c521c 41% 48%, transparent 51%) left top / 12px 12px no-repeat,
    repeating-conic-gradient(from 20deg, #ddbb67 0 22deg, #654421 23deg 40deg, transparent 41deg 60deg) left top / 12px 12px no-repeat,
    radial-gradient(ellipse, #f5a1a0 0 6%, #901d35 10% 23%, #380d16 25% 29%, #f4d890 31% 39%, #7c521c 41% 48%, transparent 51%) right top / 12px 12px no-repeat,
    repeating-conic-gradient(from 20deg, #ddbb67 0 22deg, #654421 23deg 40deg, transparent 41deg 60deg) right top / 12px 12px no-repeat,
    radial-gradient(ellipse, #f5a1a0 0 6%, #901d35 10% 23%, #380d16 25% 29%, #f4d890 31% 39%, #7c521c 41% 48%, transparent 51%) left bottom / 12px 12px no-repeat,
    repeating-conic-gradient(from 20deg, #ddbb67 0 22deg, #654421 23deg 40deg, transparent 41deg 60deg) left bottom / 12px 12px no-repeat,
    radial-gradient(ellipse, #f5a1a0 0 6%, #901d35 10% 23%, #380d16 25% 29%, #f4d890 31% 39%, #7c521c 41% 48%, transparent 51%) right bottom / 12px 12px no-repeat,
    repeating-conic-gradient(from 20deg, #ddbb67 0 22deg, #654421 23deg 40deg, transparent 41deg 60deg) right bottom / 12px 12px no-repeat; }

.frame-frostbound::after { background: conic-gradient(from 20deg, #e9ffffdd, #6792ac99, #fff, #add8e3aa, #f7ffffee, #8fadbacc) left top / 12px 12px no-repeat,
    conic-gradient(from 20deg, #e9ffffdd, #6792ac99, #fff, #add8e3aa, #f7ffffee, #8fadbacc) right top / 12px 12px no-repeat,
    conic-gradient(from 20deg, #e9ffffdd, #6792ac99, #fff, #add8e3aa, #f7ffffee, #8fadbacc) left bottom / 12px 12px no-repeat,
    conic-gradient(from 20deg, #e9ffffdd, #6792ac99, #fff, #add8e3aa, #f7ffffee, #8fadbacc) right bottom / 12px 12px no-repeat; }

.frame-street-drift::after { background: radial-gradient(ellipse at 50% 72%, #9e6673 0 5%, #290f1c 12% 23%, #050509 27% 34%, #747079 37% 42%, #222028 44% 51%, transparent 53%) left top / 12px 12px no-repeat,
    radial-gradient(ellipse at 50% 72%, #9e6673 0 5%, #290f1c 12% 23%, #050509 27% 34%, #747079 37% 42%, #222028 44% 51%, transparent 53%) right top / 12px 12px no-repeat,
    radial-gradient(ellipse at 50% 72%, #9e6673 0 5%, #290f1c 12% 23%, #050509 27% 34%, #747079 37% 42%, #222028 44% 51%, transparent 53%) left bottom / 12px 12px no-repeat,
    radial-gradient(ellipse at 50% 72%, #9e6673 0 5%, #290f1c 12% 23%, #050509 27% 34%, #747079 37% 42%, #222028 44% 51%, transparent 53%) right bottom / 12px 12px no-repeat; }

.frame-steampunk-chrono::after { background: radial-gradient(circle, #1d2322 0 12%, #e4bd76 14% 21%, #8c5d32 23% 35%, transparent 37%) left top / 12px 12px no-repeat,
    repeating-conic-gradient(#ba8950 0 19deg, #382a1e 20deg 27deg, #d9b57a 28deg 40deg, transparent 41deg 45deg) left top / 12px 12px no-repeat,
    radial-gradient(circle, #1d2322 0 12%, #e4bd76 14% 21%, #8c5d32 23% 35%, transparent 37%) right top / 12px 12px no-repeat,
    repeating-conic-gradient(#ba8950 0 19deg, #382a1e 20deg 27deg, #d9b57a 28deg 40deg, transparent 41deg 45deg) right top / 12px 12px no-repeat,
    radial-gradient(circle, #1d2322 0 12%, #e4bd76 14% 21%, #8c5d32 23% 35%, transparent 37%) left bottom / 12px 12px no-repeat,
    repeating-conic-gradient(#ba8950 0 19deg, #382a1e 20deg 27deg, #d9b57a 28deg 40deg, transparent 41deg 45deg) left bottom / 12px 12px no-repeat,
    radial-gradient(circle, #1d2322 0 12%, #e4bd76 14% 21%, #8c5d32 23% 35%, transparent 37%) right bottom / 12px 12px no-repeat,
    repeating-conic-gradient(#ba8950 0 19deg, #382a1e 20deg 27deg, #d9b57a 28deg 40deg, transparent 41deg 45deg) right bottom / 12px 12px no-repeat; }

.frame-sakura-urushi::after { background: radial-gradient(ellipse at 50% 27%, #fff3ec 0 16%, transparent 18%) left top / 12px 12px no-repeat,
    radial-gradient(ellipse at 28% 47%, #d2bdce 0 16%, transparent 18%) left top / 12px 12px no-repeat,
    radial-gradient(ellipse at 72% 47%, #ffe9e2 0 16%, transparent 18%) left top / 12px 12px no-repeat,
    radial-gradient(ellipse at 36% 72%, #f7e0ee 0 16%, transparent 18%) left top / 12px 12px no-repeat,
    radial-gradient(ellipse at 65% 72%, #c6cbdc 0 16%, transparent 18%) left top / 12px 12px no-repeat,
    radial-gradient(circle, #ba9955 0 20%, transparent 22%) left top / 12px 12px no-repeat,
    radial-gradient(ellipse at 50% 27%, #fff3ec 0 16%, transparent 18%) right top / 12px 12px no-repeat,
    radial-gradient(ellipse at 28% 47%, #d2bdce 0 16%, transparent 18%) right top / 12px 12px no-repeat,
    radial-gradient(ellipse at 72% 47%, #ffe9e2 0 16%, transparent 18%) right top / 12px 12px no-repeat,
    radial-gradient(ellipse at 36% 72%, #f7e0ee 0 16%, transparent 18%) right top / 12px 12px no-repeat,
    radial-gradient(ellipse at 65% 72%, #c6cbdc 0 16%, transparent 18%) right top / 12px 12px no-repeat,
    radial-gradient(circle, #ba9955 0 20%, transparent 22%) right top / 12px 12px no-repeat,
    radial-gradient(ellipse at 50% 27%, #fff3ec 0 16%, transparent 18%) left bottom / 12px 12px no-repeat,
    radial-gradient(ellipse at 28% 47%, #d2bdce 0 16%, transparent 18%) left bottom / 12px 12px no-repeat,
    radial-gradient(ellipse at 72% 47%, #ffe9e2 0 16%, transparent 18%) left bottom / 12px 12px no-repeat,
    radial-gradient(ellipse at 36% 72%, #f7e0ee 0 16%, transparent 18%) left bottom / 12px 12px no-repeat,
    radial-gradient(ellipse at 65% 72%, #c6cbdc 0 16%, transparent 18%) left bottom / 12px 12px no-repeat,
    radial-gradient(circle, #ba9955 0 20%, transparent 22%) left bottom / 12px 12px no-repeat,
    radial-gradient(ellipse at 50% 27%, #fff3ec 0 16%, transparent 18%) right bottom / 12px 12px no-repeat,
    radial-gradient(ellipse at 28% 47%, #d2bdce 0 16%, transparent 18%) right bottom / 12px 12px no-repeat,
    radial-gradient(ellipse at 72% 47%, #ffe9e2 0 16%, transparent 18%) right bottom / 12px 12px no-repeat,
    radial-gradient(ellipse at 36% 72%, #f7e0ee 0 16%, transparent 18%) right bottom / 12px 12px no-repeat,
    radial-gradient(ellipse at 65% 72%, #c6cbdc 0 16%, transparent 18%) right bottom / 12px 12px no-repeat,
    radial-gradient(circle, #ba9955 0 20%, transparent 22%) right bottom / 12px 12px no-repeat; }

/* ------------------------------------------
   10 THEMED COLLECTION AVATAR FRAMES
   Sanhua/Hiyuki, Cosmic, Phonk/Drift, Prestige
   ------------------------------------------ */
.frame-collection {
  position: relative;
  isolation: isolate;
  overflow: visible !important;
  border-radius: var(--frame-radius, 50%) !important;
  transition: all 0.25s ease;
}

.frame-collection > .avatar-photo,
.frame-collection > img {
  border-radius: inherit;
}

/* 1. Moon Rime: Pale Lunar Hoarfrost & Cyan Shimmer */
.frame-moon-rime {
  border: 2px solid #a5f3fc !important;
  box-shadow: 0 0 10px rgba(165, 243, 252, 0.75), 0 0 22px rgba(56, 189, 248, 0.45), inset 0 0 8px rgba(224, 242, 254, 0.6) !important;
  animation: frame-moon-rime-shimmer 3s infinite ease-in-out !important;
}

@keyframes frame-moon-rime-shimmer {
  0%, 100% {
    box-shadow: 0 0 8px rgba(165, 243, 252, 0.6), 0 0 18px rgba(56, 189, 248, 0.35), inset 0 0 6px rgba(224, 242, 254, 0.5);
    border-color: #a5f3fc;
  }
  50% {
    box-shadow: 0 0 16px rgba(165, 243, 252, 0.95), 0 0 30px rgba(56, 189, 248, 0.7), inset 0 0 10px rgba(224, 242, 254, 0.85);
    border-color: #ffffff;
  }
}

/* 2. Crimson Dawn: Blood Moon Obsidian & Vermilion Aura */
.frame-crimson-dawn {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 0 12px #dc2626, 0 0 26px rgba(185, 28, 28, 0.8), inset 0 0 9px rgba(239, 68, 68, 0.5) !important;
  animation: frame-crimson-dawn-glow 2s infinite alternate ease-in-out !important;
}

@keyframes frame-crimson-dawn-glow {
  0% {
    box-shadow: 0 0 10px #dc2626, 0 0 20px rgba(185, 28, 28, 0.6), inset 0 0 6px rgba(239, 68, 68, 0.4);
    border-color: #dc2626;
  }
  100% {
    box-shadow: 0 0 18px #ef4444, 0 0 34px rgba(248, 113, 113, 0.85), inset 0 0 12px rgba(239, 68, 68, 0.7);
    border-color: #f87171;
  }
}

/* 3. Ice Moon Throne: Royal Sapphire Crystal & Diamond Spark */
.frame-ice-moon-throne {
  border: 2.5px solid #38bdf8 !important;
  box-shadow: 0 0 14px #0284c7, 0 0 28px rgba(56, 189, 248, 0.65), inset 0 0 9px #e0f2fe !important;
  animation: frame-ice-moon-throne-pulse 2.8s infinite ease-in-out !important;
}

@keyframes frame-ice-moon-throne-pulse {
  0%, 100% {
    box-shadow: 0 0 10px #0284c7, 0 0 22px rgba(56, 189, 248, 0.5), inset 0 0 7px #bae6fd;
    border-color: #38bdf8;
  }
  50% {
    box-shadow: 0 0 20px #38bdf8, 0 0 40px rgba(14, 165, 233, 0.85), inset 0 0 12px #f0f9ff;
    border-color: #bae6fd;
  }
}

/* 4. Blades of Silence: Razor Titanium Edge & Silver Gleam */
.frame-silence-blades {
  border: 2px solid #cbd5e1 !important;
  box-shadow: 0 0 10px rgba(226, 232, 240, 0.8), 0 0 22px rgba(148, 163, 184, 0.5), inset 0 0 7px rgba(248, 250, 252, 0.7) !important;
  animation: frame-silence-blades-gleam 2.4s infinite ease-in-out !important;
}

@keyframes frame-silence-blades-gleam {
  0%, 100% {
    box-shadow: 0 0 8px rgba(203, 213, 225, 0.6), 0 0 18px rgba(148, 163, 184, 0.4), inset 0 0 5px rgba(241, 245, 249, 0.5);
    border-color: #94a3b8;
  }
  50% {
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.95), 0 0 30px rgba(203, 213, 225, 0.8), inset 0 0 10px #ffffff;
    border-color: #ffffff;
  }
}

/* 5. Blossom Charm: Frozen Cherry Blossom & Petal Frost */
.frame-blossom-charm {
  border: 2px solid #f472b6 !important;
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.75), 0 0 24px rgba(251, 207, 232, 0.45), inset 0 0 8px rgba(244, 114, 182, 0.45) !important;
  animation: frame-blossom-charm-breathe 3.2s infinite ease-in-out !important;
}

@keyframes frame-blossom-charm-breathe {
  0%, 100% {
    box-shadow: 0 0 9px rgba(244, 114, 182, 0.6), 0 0 18px rgba(244, 114, 182, 0.35), inset 0 0 6px rgba(251, 207, 232, 0.3);
    border-color: #f472b6;
  }
  50% {
    box-shadow: 0 0 18px rgba(244, 114, 182, 0.9), 0 0 32px rgba(251, 207, 232, 0.7), inset 0 0 11px rgba(253, 242, 248, 0.8);
    border-color: #fbcfe8;
  }
}

/* 6. Abyss Portal: Cosmic Event Horizon & Pulsing Void Vortex */
.frame-abyss-portal {
  border: 2.5px solid #a855f7 !important;
  box-shadow: 0 0 16px #7c3aed, 0 0 32px rgba(124, 58, 237, 0.8), 0 0 46px rgba(6, 182, 212, 0.45), inset 0 0 10px rgba(168, 85, 247, 0.65) !important;
  animation: frame-abyss-portal-vortex 3.5s infinite ease-in-out !important;
}

@keyframes frame-abyss-portal-vortex {
  0%, 100% {
    box-shadow: 0 0 12px #7c3aed, 0 0 24px rgba(124, 58, 237, 0.6), 0 0 38px rgba(6, 182, 212, 0.35), inset 0 0 8px rgba(168, 85, 247, 0.5);
    border-color: #a855f7;
  }
  50% {
    box-shadow: 0 0 22px #c084fc, 0 0 42px rgba(124, 58, 237, 0.95), 0 0 54px rgba(6, 182, 212, 0.7), inset 0 0 14px rgba(192, 132, 252, 0.85);
    border-color: #38bdf8;
  }
}

/* 7. Cassette 808: Street Drift Synthwave & 808 Punch */
.frame-cassette-808 {
  border: 2px solid #ec4899 !important;
  box-shadow: 0 0 12px #ec4899, 0 0 26px rgba(234, 179, 8, 0.7), inset 0 0 8px rgba(236, 72, 153, 0.5) !important;
  animation: frame-cassette-808-beat 1.6s infinite ease-in-out !important;
}

@keyframes frame-cassette-808-beat {
  0%, 100% {
    box-shadow: 0 0 9px #ec4899, 0 0 20px rgba(234, 179, 8, 0.5), inset 0 0 6px rgba(236, 72, 153, 0.35);
    border-color: #ec4899;
  }
  50% {
    box-shadow: 0 0 18px #f43f5e, 0 0 34px rgba(234, 179, 8, 0.9), inset 0 0 12px rgba(250, 204, 21, 0.7);
    border-color: #eab308;
  }
}

/* 9. Neon Archive: Cyber Matrix Data Grid & Emerald Scan */
.frame-neon-archive {
  border: 2.5px solid #10b981 !important;
  box-shadow: 0 0 12px #10b981, 0 0 26px rgba(6, 182, 212, 0.65), inset 0 0 8px rgba(16, 185, 129, 0.45) !important;
  animation: frame-neon-archive-scan 2.2s infinite ease-in-out !important;
}

@keyframes frame-neon-archive-scan {
  0%, 100% {
    box-shadow: 0 0 9px #10b981, 0 0 20px rgba(6, 182, 212, 0.45), inset 0 0 6px rgba(16, 185, 129, 0.35);
    border-color: #10b981;
  }
  50% {
    box-shadow: 0 0 18px #06b6d4, 0 0 34px rgba(16, 185, 129, 0.85), inset 0 0 12px rgba(6, 182, 212, 0.65);
    border-color: #06b6d4;
  }
}

/* 10. Star Forge: Celestial Diamond Hypernova & Stellar Coronal Flares */
.frame-star-forge {
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 0 16px #38bdf8, 0 0 32px rgba(245, 158, 11, 0.7), 0 0 48px rgba(56, 189, 248, 0.75), inset 0 0 10px #ffffff !important;
  animation: frame-star-forge-flare 2.5s infinite ease-in-out !important;
}

@keyframes frame-star-forge-flare {
  0%, 100% {
    box-shadow: 0 0 12px #38bdf8, 0 0 24px rgba(245, 158, 11, 0.5), 0 0 36px rgba(56, 189, 248, 0.55), inset 0 0 7px #e0f2fe;
    border-color: #ffffff;
  }
  50% {
    box-shadow: 0 0 24px #38bdf8, 0 0 46px rgba(245, 158, 11, 0.9), 0 0 60px rgba(56, 189, 248, 0.95), inset 0 0 14px #ffffff;
    border-color: #fef08a;
  }
}

/* Light Mode Overrides for Collection Frames */
body[data-theme="light"] :is(.frame-moon-rime, .frame-crimson-dawn, .frame-ice-moon-throne, .frame-silence-blades, .frame-blossom-charm, .frame-abyss-portal, .frame-cassette-808, .frame-neon-archive, .frame-star-forge) {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18), inset 0 1px 2px rgba(255, 255, 255, 0.6) !important;
}

body[data-theme="light"] .frame-moon-rime { border-color: #0284c7 !important; }
body[data-theme="light"] .frame-crimson-dawn { border-color: #dc2626 !important; }
body[data-theme="light"] .frame-ice-moon-throne { border-color: #0284c7 !important; }
body[data-theme="light"] .frame-silence-blades { border-color: #475569 !important; }
body[data-theme="light"] .frame-blossom-charm { border-color: #db2777 !important; }
body[data-theme="light"] .frame-abyss-portal { border-color: #7c3aed !important; }
body[data-theme="light"] .frame-cassette-808 { border-color: #db2777 !important; }
body[data-theme="light"] .frame-neon-archive { border-color: #059669 !important; }
body[data-theme="light"] .frame-star-forge { border-color: #0284c7 !important; }

/* Circular material rings. Shared construction, individually authored inlays. */
:is(.frame-neon-start,.frame-gold-prestige,.frame-crimson-fire,.frame-cosmic-nebula,.frame-cyber-glitch,.frame-prismatic,.frame-cyber-alloy,.frame-baroque-gold,.frame-frostbound,.frame-street-drift,.frame-gothic-thorn,.frame-steampunk-chrono,.frame-sakura-urushi,.frame-moon-rime,.frame-crimson-dawn,.frame-ice-moon-throne,.frame-silence-blades,.frame-blossom-charm,.frame-abyss-portal,.frame-cassette-808,.frame-neon-archive,.frame-star-forge) {
  position: relative; isolation: isolate; overflow: visible !important;
  border: 0 !important; border-radius: 50% !important;
  background-clip: padding-box; animation: none !important;
  filter: none !important; outline: none !important;
  box-shadow: inset 0 0 0 1px var(--ring-shadow), 0 2px 4px #0005 !important;
}
:is(.frame-neon-start,.frame-gold-prestige,.frame-crimson-fire,.frame-cosmic-nebula,.frame-cyber-glitch,.frame-prismatic,.frame-cyber-alloy,.frame-baroque-gold,.frame-frostbound,.frame-street-drift,.frame-gothic-thorn,.frame-steampunk-chrono,.frame-sakura-urushi,.frame-moon-rime,.frame-crimson-dawn,.frame-ice-moon-throne,.frame-silence-blades,.frame-blossom-charm,.frame-abyss-portal,.frame-cassette-808,.frame-neon-archive,.frame-star-forge) > :is(.avatar-photo, .avatar-letter) { border-radius: 50%; }
:is(.frame-neon-start,.frame-gold-prestige,.frame-crimson-fire,.frame-cosmic-nebula,.frame-cyber-glitch,.frame-prismatic,.frame-cyber-alloy,.frame-baroque-gold,.frame-frostbound,.frame-street-drift,.frame-gothic-thorn,.frame-steampunk-chrono,.frame-sakura-urushi,.frame-moon-rime,.frame-crimson-dawn,.frame-ice-moon-throne,.frame-silence-blades,.frame-blossom-charm,.frame-abyss-portal,.frame-cassette-808,.frame-neon-archive,.frame-star-forge)::before,
:is(.frame-neon-start,.frame-gold-prestige,.frame-crimson-fire,.frame-cosmic-nebula,.frame-cyber-glitch,.frame-prismatic,.frame-cyber-alloy,.frame-baroque-gold,.frame-frostbound,.frame-street-drift,.frame-gothic-thorn,.frame-steampunk-chrono,.frame-sakura-urushi,.frame-moon-rime,.frame-crimson-dawn,.frame-ice-moon-throne,.frame-silence-blades,.frame-blossom-charm,.frame-abyss-portal,.frame-cassette-808,.frame-neon-archive,.frame-star-forge)::after {
  content: ''; position: absolute; pointer-events: none; box-sizing: border-box;
  border-radius: 50% !important; clip-path: none !important;
  animation: none !important; filter: none !important; transform: none !important;
  opacity: 1; width: auto; height: auto; margin: 0;
}
:is(.frame-neon-start,.frame-gold-prestige,.frame-crimson-fire,.frame-cosmic-nebula,.frame-cyber-glitch,.frame-prismatic,.frame-cyber-alloy,.frame-baroque-gold,.frame-frostbound,.frame-street-drift,.frame-gothic-thorn,.frame-steampunk-chrono,.frame-sakura-urushi,.frame-moon-rime,.frame-crimson-dawn,.frame-ice-moon-throne,.frame-silence-blades,.frame-blossom-charm,.frame-abyss-portal,.frame-cassette-808,.frame-neon-archive,.frame-star-forge)::before {
  inset: -5px; padding: 5px; z-index: 2; border: 1px solid var(--ring-shadow);
  background: var(--ring-inlay), conic-gradient(from 145deg, var(--ring-shadow), var(--ring-metal) 12%, var(--ring-light) 26%, var(--ring-metal) 38%, var(--ring-shadow) 53%, var(--ring-metal) 70%, var(--ring-light) 78%, var(--ring-shadow));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  box-shadow: inset 0 1px 1px var(--ring-light), inset 0 -1px 2px var(--ring-shadow);
}
:is(.frame-neon-start,.frame-gold-prestige,.frame-crimson-fire,.frame-cosmic-nebula,.frame-cyber-glitch,.frame-prismatic,.frame-cyber-alloy,.frame-baroque-gold,.frame-frostbound,.frame-street-drift,.frame-gothic-thorn,.frame-steampunk-chrono,.frame-sakura-urushi,.frame-moon-rime,.frame-crimson-dawn,.frame-ice-moon-throne,.frame-silence-blades,.frame-blossom-charm,.frame-abyss-portal,.frame-cassette-808,.frame-neon-archive,.frame-star-forge)::after {
  inset: -6px; z-index: 3; border: 1px solid var(--ring-metal);
  background: none; padding: 0; -webkit-mask: none; mask: none;
  box-shadow: inset 0 1px 0 var(--ring-light), 0 1px 2px #0006;
}
.frame-neon-start { --ring-metal:#6be4d8; --ring-shadow:#143d47; --ring-light:#d6ffff; --ring-inlay:repeating-conic-gradient(#061c29 0deg 4deg, transparent 4deg 45deg); }
.frame-gold-prestige { --ring-metal:#e9b852; --ring-shadow:#543416; --ring-light:#fff0bc; --ring-inlay:repeating-conic-gradient(#71421199 0deg 2deg, transparent 2deg 12deg); }
.frame-crimson-fire { --ring-metal:#d94b28; --ring-shadow:#390e13; --ring-light:#ffc28a; --ring-inlay:conic-gradient(from 30deg, transparent, #ffb85b 18%, transparent 25%, #711823 52%, transparent 60%, #ffcf8b 85%, transparent); }
.frame-cosmic-nebula { --ring-metal:#7468a5; --ring-shadow:#181827; --ring-light:#ced5ff; --ring-inlay:radial-gradient(circle at 50% 2%, #fff 0 2%, transparent 3%), conic-gradient(#31345e, #9985c9, #101529, #476884, #31345e); }
.frame-cyber-glitch { --ring-metal:#76b99a; --ring-shadow:#24302e; --ring-light:#ddf8e8; --ring-inlay:repeating-conic-gradient(from 12deg, #102b26 0deg 6deg, transparent 6deg 40deg, #abe9ca 40deg 43deg, transparent 43deg 60deg); }
.frame-prismatic { --ring-metal:#d7c6d4; --ring-shadow:#65556d; --ring-light:#fff7f0; --ring-inlay:conic-gradient(#efb9b8, #e5d69b, #b6d6cb, #a6b7dc, #ccb4dd, #efb9b8); }
.frame-cyber-alloy { --ring-metal:#a0b6be; --ring-shadow:#27363e; --ring-light:#edf8fa; --ring-inlay:repeating-conic-gradient(#263e4899 0deg 2deg, transparent 2deg 30deg, #e7f3f6 30deg 32deg, transparent 32deg 60deg); }
.frame-baroque-gold { --ring-metal:#d7a34c; --ring-shadow:#58351a; --ring-light:#fff2c6; --ring-inlay:repeating-conic-gradient(from 9deg, #5c351999 0deg 3deg, #e4bd75 3deg 6deg, transparent 6deg 18deg); }
.frame-frostbound { --ring-metal:#a6d8e5; --ring-shadow:#486880; --ring-light:#f4ffff; --ring-inlay:repeating-conic-gradient(from 15deg, #ffffffbb 0deg 2deg, #6288a966 2deg 12deg, transparent 12deg 30deg); }
.frame-street-drift { --ring-metal:#8f959b; --ring-shadow:#17191e; --ring-light:#e2e5e8; --ring-inlay:repeating-conic-gradient(from 8deg, #080b10 0deg 7deg, #69717b 7deg 10deg, #222731 10deg 20deg); }
.frame-gothic-thorn { --ring-metal:#977b83; --ring-shadow:#261b27; --ring-light:#e5cbd1; --ring-inlay:repeating-conic-gradient(from 15deg, #1d1727 0deg 3deg, #b3959e 3deg 5deg, transparent 5deg 30deg); }
.frame-steampunk-chrono { --ring-metal:#b99052; --ring-shadow:#493324; --ring-light:#ffe2a0; --ring-inlay:repeating-conic-gradient(#241e17 0deg 2deg, transparent 2deg 30deg, #fff1b8 30deg 33deg, transparent 33deg 36deg); }
.frame-sakura-urushi { --ring-metal:#ba8b81; --ring-shadow:#391623; --ring-light:#f6ddca; --ring-inlay:conic-gradient(from 120deg, #441a2c, #ab625f 28%, #f2cf8b 29%, #5e293a 30%, #211b29 70%, #f2cf8b 71%, #441a2c 72%); }
.frame-moon-rime { --ring-metal:#cfdae4; --ring-shadow:#526179; --ring-light:#f8ffff; --ring-inlay:conic-gradient(from 220deg, #35445d, #9aafc9 45%, #fff 70%, #becfe0 85%, #35445d); }
.frame-crimson-dawn { --ring-metal:#c37883; --ring-shadow:#371d32; --ring-light:#ffdacb; --ring-inlay:conic-gradient(from 90deg, #311c30, #773e58, #edb09a, #b86072, #311c30); }
.frame-ice-moon-throne { --ring-metal:#c3c5e7; --ring-shadow:#484066; --ring-light:#fff7ff; --ring-inlay:repeating-conic-gradient(from 18deg, #faf1ff 0deg 2deg, #746495 2deg 12deg, transparent 12deg 36deg); }
.frame-silence-blades { --ring-metal:#bbc7ce; --ring-shadow:#2e3548; --ring-light:#ffffff; --ring-inlay:repeating-conic-gradient(from 45deg, #1e2637 0deg 20deg, #cbdde4 20deg 42deg, #fff 42deg 45deg, #778999 45deg 90deg); }
.frame-blossom-charm { --ring-metal:#e7b5c1; --ring-shadow:#805666; --ring-light:#fff2e8; --ring-inlay:repeating-conic-gradient(from 18deg, #f9e3de 0deg 7deg, #b88097 7deg 12deg, transparent 12deg 72deg); }
.frame-abyss-portal { --ring-metal:#6e608b; --ring-shadow:#171622; --ring-light:#d1b4e0; --ring-inlay:repeating-conic-gradient(from 30deg, #0e1323 0deg 28deg, #b5a4c6 28deg 30deg, #40384f 30deg 60deg); }
.frame-cassette-808 { --ring-metal:#a2a7af; --ring-shadow:#26222a; --ring-light:#eeeeef; --ring-inlay:repeating-conic-gradient(#18171c 0deg 6deg, #b4b9bf 6deg 8deg, #34303b 8deg 30deg); }
.frame-neon-archive { --ring-metal:#75a797; --ring-shadow:#263c39; --ring-light:#daf3da; --ring-inlay:repeating-conic-gradient(from 5deg, #122d2d 0deg 3deg, transparent 3deg 10deg, #dbeab6 10deg 12deg, transparent 12deg 45deg); }
.frame-star-forge { --ring-metal:#d7baa0; --ring-shadow:#504454; --ring-light:#fff3d9; --ring-inlay:repeating-conic-gradient(from 22deg, #fbeedc 0deg 2deg, #827188 2deg 20deg, transparent 20deg 45deg); }
.frame-baroque-gold::after { background: radial-gradient(ellipse at 50% 4%, #fff7 0 1%, #a62542 2% 4%, var(--ring-shadow) 5%, transparent 6%); }
.frame-gothic-thorn::after { background: radial-gradient(ellipse at 50% 4%, #fff7 0 1%, #86273e 2% 4%, var(--ring-shadow) 5%, transparent 6%); }
.frame-ice-moon-throne::after { background: radial-gradient(ellipse at 50% 4%, #fff7 0 1%, #babbea 2% 4%, var(--ring-shadow) 5%, transparent 6%); }
.frame-sakura-urushi::after { background: radial-gradient(ellipse at 50% 4%, #fff7 0 1%, #f5b9bc 2% 4%, var(--ring-shadow) 5%, transparent 6%); }
.frame-cassette-808::after { background: radial-gradient(ellipse at 50% 4%, #fff7 0 1%, #c84753 2% 4%, var(--ring-shadow) 5%, transparent 6%); }
.frame-neon-archive::after { background: radial-gradient(ellipse at 50% 4%, #fff7 0 1%, #b6d990 2% 4%, var(--ring-shadow) 5%, transparent 6%); }
@media (prefers-reduced-motion: reduce) { .frame-collection { animation: none !important; } }

body[data-theme] :is(.frame-neon-start,.frame-gold-prestige,.frame-crimson-fire,.frame-cosmic-nebula,.frame-cyber-glitch,.frame-prismatic,.frame-cyber-alloy,.frame-baroque-gold,.frame-frostbound,.frame-street-drift,.frame-gothic-thorn,.frame-steampunk-chrono,.frame-sakura-urushi,.frame-moon-rime,.frame-crimson-dawn,.frame-ice-moon-throne,.frame-silence-blades,.frame-blossom-charm,.frame-abyss-portal,.frame-cassette-808,.frame-neon-archive,.frame-star-forge) { box-shadow: inset 0 0 0 1px var(--ring-shadow), 0 2px 4px #0005 !important; }
.icon-user-container { width:24px; height:24px; flex:0 0 24px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; }

/* A second, secondary badge; the original difficulty badge retains its styling. */
.track-diff-badge.hardcore-modifier {
  display:inline-flex; align-items:center; vertical-align:middle;
  margin-inline-start:5px; padding:2px 7px; border-radius:4px;
  font-size:.7rem; font-weight:700; line-height:1.4;
  color:#fda4af; background:#9f123922; border:1px solid #fb718566;
}
body[data-theme="light"] .track-diff-badge.hardcore-modifier { color:#9f1239; background:#ffe4e6; border-color:#e9a9b5; }

/* ==========================================
   SVG AVATAR FRAMES (Champion Crown, Leader Crown, Silver Crown, Eared Melon)
   Rendered as unclipped overlays on top of the avatar with full wings
   ========================================== */
:is(.frame-champion-crown, .frame-leader-crown, .frame-silver-crown, .frame-eared-melon) {
  position: relative !important;
  isolation: isolate !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 50% !important;
  animation: none !important;
  filter: none !important;
  box-shadow: none !important;
  background-clip: padding-box !important;
}

/* Base avatar containers override any local overflow:hidden when equipped with wings */
:is(.icon-user-container, .profile-avatar-pill, .user-profile-avatar, .podium-avatar, .lb-avatar-mini, .cust-frame-preview):is(.frame-champion-crown, .frame-leader-crown, .frame-silver-crown, .frame-eared-melon) {
  overflow: visible !important;
}

/* Avatar photo/letter sits cleanly behind the frame overlay and stays rounded */
:is(.frame-champion-crown, .frame-leader-crown, .frame-silver-crown, .frame-eared-melon) > :is(.avatar-photo, .avatar-letter, img, svg) {
  position: relative !important;
  z-index: 1 !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  display: block !important;
}

/* Customization preview items: keep content behind frame overlay */
.cust-frame-preview:is(.frame-champion-crown, .frame-leader-crown, .frame-silver-crown, .frame-eared-melon) {
  position: relative !important;
  z-index: 1 !important;
  margin: 4px 10px;
  overflow: visible !important;
}

.cust-frame-preview.frame-champion-crown {
  margin: 6px 14px !important;
}

/* Frame overlay sits ON TOP of the avatar (z-index: 10) with full unclipped wings */
:is(.frame-champion-crown, .frame-leader-crown, .frame-silver-crown, .frame-eared-melon)::before {
  content: '' !important;
  position: absolute !important;
  inset: -35% !important;
  z-index: 10 !important;
  pointer-events: none !important;
  box-sizing: border-box !important;
  border: 0 !important;
  border-radius: 0 !important;
  clip-path: none !important;
  -webkit-mask: none !important;
  mask: none !important;
  animation: none !important;
  filter: none !important;
  transform: none !important;
  opacity: 1 !important;
  background-position: center !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}

:is(.frame-champion-crown, .frame-leader-crown, .frame-silver-crown, .frame-eared-melon)::after {
  content: none !important;
  display: none !important;
}

/* 1. Champion's Crown (Rank 1): Grand Diamond Wings & Radiant Crystal Diadem */
.frame-champion-crown::before {
  inset: -92% !important;
  background-image: url('../assets/frames/champion-crown.svg') !important;
}

/* 2. Silver Crown (Rank 1-2): Dual Wing Silver & Obsidian Wreath with Ruby Gem */
.frame-silver-crown::before {
  background-image: url('../assets/frames/silver-crown.svg') !important;
}

/* 3. Leader's Crown (Rank 1-3): Imperial Gold Crown with radiant wings */
.frame-leader-crown::before {
  background-image: url('../assets/frames/leader-crown.svg') !important;
}

/* 4. Eared Melon: Feline Ears & Silver Charms */
.frame-eared-melon::before {
  inset: -25% !important;
  background-image: url('../assets/frames/eared-melon.svg') !important;
}
