:root {
  --bg-main: #060814;
  --bg-card: #111827;
  --bg-card-hover: #1f2937;
  --accent-pink: #ec4899;
  --accent-purple: #8b5cf6;
  --text-light: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: #374151;
  --success: #10b981;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
}

body {
  background: var(--bg-main);
  color: var(--text-light);
  padding: 30px 20px;
  min-height: 100vh;
  background-image:
    radial-gradient(
      circle at 15% 50%,
      rgba(139, 92, 246, 0.1),
      transparent 25%
    ),
    radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.1), transparent 25%);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1,
h2 {
  text-align: center;
  margin-bottom: 24px;
  font-weight: 800;
}

h1 {
  font-size: 32px;
  background: linear-gradient(
    to right,
    var(--accent-purple),
    var(--accent-pink)
  );
  -webkit-background-clip: text;
  color: transparent;
}

/* Auth Screen */
#auth-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80vh;
}

.auth-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: 100%;
}

.auth-card p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 14px;
}

.auth-card input {
  width: 100%;
  background: #1f2937;
  border: 1px solid var(--border-color);
  color: white;
  padding: 16px;
  font-size: 24px;
  text-align: center;
  border-radius: 12px;
  margin-bottom: 20px;
  outline: none;
  letter-spacing: 4px;
  transition: border 0.3s;
}

.auth-card input:focus {
  border-color: var(--accent-purple);
}

button {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: white;
  border: none;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition:
    opacity 0.3s,
    transform 0.2s;
  width: 100%;
}

button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}
button:active {
  transform: translateY(0);
}
button:disabled {
  background: #374151;
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

/* Main App */
.tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}
.tab {
  background: var(--bg-card);
  color: var(--text-light);
  border: 1px solid var(--border-color);
  width: auto;
}
.tab.active {
  background: #1f2937;
  border-color: var(--accent-purple);
  color: white;
}

.table-container {
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: 24px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  max-height: 70vh;
  overflow-y: auto;
}

/* --- КАСТОМНЫЙ СКРОЛЛБАР ДЛЯ ТАБЛИЦЫ --- */
.table-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.table-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  margin: 10px 0; /* Отступы сверху и снизу */
}
.table-container::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4); /* Мягкий фиолетовый */
  border-radius: 10px;
}
.table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(236, 72, 153, 0.8); /* При наведении розовый */
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1000px;
}
th {
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}
td {
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.country-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: white;
  font-size: 16px;
  text-align: left;
}
.country-cell img {
  width: 32px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.country-num {
  color: var(--text-muted);
  font-size: 14px;
  width: 20px;
}

.score-input {
  width: 54px;
  height: 44px;
  background: #030712;
  border: 1px solid var(--border-color);
  color: white;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  outline: none;
  transition: 0.2s;
}

.score-input:focus {
  border-color: var(--accent-pink);
  background: #111827;
}
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.total-score {
  font-size: 20px;
  font-weight: 800;
  color: white;
}

.btn-save-row {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  font-size: 13px;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* ФИКСЫ ТУТ: */
  white-space: nowrap; /* Запрещает перенос текста и галочки */
  min-width: 130px; /* Задает кнопке стабильную ширину */
  flex-shrink: 0;
}

.btn-save-row:hover {
  background: #374151;
}
.btn-save-row.saved {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--success);
  color: var(--success);
}

.final-actions {
  text-align: center;
  margin-top: 40px;
}
/* Строгий стиль для фінальної кнопки */
.final-actions {
  margin-top: 50px;
  display: flex;
  justify-content: center;
  padding-bottom: 60px;
}

.btn-finish {
  background: #1f2937; /* Колір картки, без кричущих градієнтів */
  color: white;
  border: 1px solid var(--border-color);
  padding: 16px 36px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px; /* Строга геометрія замість круглої капсули */
  cursor: pointer;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: auto;
}

/* Ефекти при наведенні */
.btn-finish:hover {
  background: #2563eb; /* Стриманий акцентний синій (або постав var(--accent-purple)) */
  border-color: #3b82f6;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
  transform: translateY(-2px);
}

.btn-finish:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Анімація стрілочки всередині кнопки */
.btn-finish svg {
  transition: transform 0.25s ease;
}

.btn-finish:hover svg {
  transform: translateX(4px); /* Стрілка витончено зсувається праворуч */
}

/* Results Screen */
#results-screen {
  display: none;
}
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 30px;
}

@media (max-width: 768px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}

.tier-list {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid var(--border-color);
}
.tier-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: #1f2937;
  border-left: 4px solid var(--border-color);
  transition: transform 0.2s;
}

.tier-item:hover {
  transform: translateX(5px);
}
.tier-item img {
  width: 28px;
  border-radius: 3px;
  margin-right: 12px;
}
.tier-item .left-side {
  display: flex;
  align-items: center;
  font-weight: 600;
}
.qualifier {
  border-left-color: var(--success);
}
.non-qualifier {
  border-left-color: var(--danger);
  opacity: 0.7;
}
.rank-num {
  font-size: 18px;
  margin-right: 16px;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
  font-weight: 800;
}
.result-score {
  font-size: 18px;
  font-weight: 800;
}
/* --- LIVE WIDGET --- */
#live-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
  z-index: 998;
  width: auto;
  border-radius: 50px;
  animation: pulse 2s infinite;
  padding: 12px 24px;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

#live-widget {
  position: fixed;
  top: 0;
  right: -360px; /* Спрятан за экраном */
  width: 340px;
  height: 100vh;
  background: rgba(17, 24, 39, 0.98);
  backdrop-filter: blur(10px);
  border-left: 1px solid var(--border-color);
  padding: 24px 20px;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  box-shadow: -10px 0 25px rgba(0, 0, 0, 0.5);
}

#live-widget.open {
  right: 0;
}

.live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.live-header h3 {
  font-size: 20px;
  margin: 0;
  color: white;
  text-align: left;
}
.close-live {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  width: auto;
  padding: 0;
  margin: 0;
  box-shadow: none;
  cursor: pointer;
}
.close-live:hover {
  color: white;
  transform: scale(1.2);
}

.live-list {
  position: relative;
  height: calc(100% - 60px);
  overflow-y: auto; /* Включаем прокрутку по вертикали */
  overflow-x: hidden; /* Прячем горизонтальный скролл на всякий случай */
  padding-right: 10px; /* Отступ, чтобы скроллбар не наезжал на карточки */
}

/* Этот невидимый блок искусственно растягивает контейнер, чтобы появился скролл */
.live-list::after {
  content: "";
  display: block;
  height: 950px; /* 15 стран по 60px + немного места снизу */
}

/* Красивый скроллбар в стиле нашего дизайна (работает в Chrome, Safari, Edge) */
.live-list::-webkit-scrollbar {
  width: 6px;
}
.live-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}
.live-list::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent-purple), var(--accent-pink));
  border-radius: 10px;
}
.live-item {
  position: absolute;
  left: 0;
  right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1f2937;
  border-radius: 12px;
  padding: 0 15px;
  /* ИМЕННО ЭТО ДЕЛАЕТ ПЛАВНУЮ АНИМАЦИЮ ПЕРЕМЕЩЕНИЯ */
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 4px solid var(--border-color);
}

.live-item.top-10 {
  border-left-color: var(--success);
}
.live-item img {
  width: 24px;
  border-radius: 3px;
  margin: 0 10px;
}
.live-rank {
  font-weight: 800;
  color: var(--text-muted);
  width: 20px;
  font-size: 14px;
}
.live-score {
  font-weight: 800;
  color: var(--success);
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.header-container h1 {
  margin-bottom: 0;
  text-align: left;
}

.btn-logout {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 14px;
  width: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}
.btn-logout:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* Фикс для мобилок, чтобы заголовок не наезжал на кнопку */
@media (max-width: 600px) {
  .header-container {
    flex-direction: column;
    gap: 15px;
  }
}
/* --- SVG ИКОНКИ И АНИМАЦИИ --- */

/* Кнопка выхода */
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-logout {
  width: 18px;
  height: 18px;
  transition: transform 0.3s;
}

/* Анимация стрелочки выхода */
.icon-logout polyline,
.icon-logout line {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-logout:hover .icon-logout polyline,
.btn-logout:hover .icon-logout line {
  transform: translateX(4px); /* Стрелочка выезжает вправо */
}

/* LIVE контент */
.live-btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

/* Иконка LIVE */
.icon-live {
  width: 22px;
  height: 22px;
  overflow: visible;
}

/* Расходящееся кольцо */
.pulse-ring {
  animation: pulse-ring-anim 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  transform-origin: center;
}

/* Пульсирующая точка (сердцебиение) */
.pulse-dot {
  animation: pulse-dot-anim 1.5s infinite alternate;
}

@keyframes pulse-ring-anim {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

@keyframes pulse-dot-anim {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}
/* --- НОВЫЕ ПРАВИЛА: ПЛАВАЮЩАЯ ШАПКА, ЗВЕЗДОЧКИ И ПЛАШКИ --- */

/* Делаем таблицу скроллируемой по вертикали и приклеиваем шапку */
.table-container {
  max-height: 70vh; /* Высота таблицы до появления скролла */
  overflow-y: auto;
}

th {
  position: sticky;
  top: 0;
  background: #111827; /* Жесткий цвет, чтобы прозрачность не мешала */
  z-index: 10;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5); /* Тень под шапкой */
}

/* Звезда фаворита */
/* Звезда фаворита */
.fav-star {
  font-size: 22px;
  color: #4b5563;
  cursor: pointer;
  transition: 0.2s;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-top: -2px; /* Оптическая компенсация центра */
}

.fav-star:hover {
  transform: scale(1.2);
}

.fav-star.active {
  color: #f59e0b;
  text-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}

.fav-star:hover {
  transform: scale(1.2);
}

.fav-star.active {
  color: #f59e0b; /* Золотой цвет */
  text-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}

/* Плашка "В ФИНАЛ" */
/* Плашка "GRAND FINAL" */
.badge-qualifier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15); /* Полупрозрачный фон */
  color: #34d399; /* Яркий неоновый текст */
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 20px; /* Форма капсулы */
  margin-left: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.badge-qualifier svg {
  width: 12px;
  height: 12px;
  fill: #34d399;
}

/* --- ПЛАШКИ РЕАЛЬНЫХ РЕЗУЛЬТАТОВ ЕВРОВИДЕНИЯ --- */

.badge-real-pass,
.badge-real-fail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 20px;
  margin-left: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Реально прошел (Зеленый) */
.badge-real-pass {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}
.badge-real-pass svg {
  width: 12px;
  height: 12px;
  fill: #34d399;
}

/* В реальности вылетел (Красный) */
.badge-real-fail {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}
.badge-real-fail svg {
  width: 12px;
  height: 12px;
  fill: #f87171;
}
/* --- КНОПКИ АДМІНА У LIVE ВІДЖЕТІ --- */
.admin-controls {
  display: flex;
  gap: 4px;
  z-index: 10;
}
.btn-admin {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  padding: 3px 5px;
  transition: 0.2s;
}
.btn-admin:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}
/* --- СТИЛИ ДЛЯ ЭКСПОРТА КАРТОЧКИ ТОП-10 (ПОСИЛЕНИЙ ГЛАССМОРФІЗМ) --- */
.share-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  /* --- ЕФЕКТ СКЛА (ГЛАССМОРФІЗМ) --- */
  background: rgba(255, 255, 255, 0.07); /* Трохи більше непрозорості */
  backdrop-filter: blur(15px); /* Посилили розмиття фону */
  -webkit-backdrop-filter: blur(15px); /* Для підтримки у Safari */
  border: 1px solid rgba(255, 255, 255, 0.25); /* Чіткий білий контур скла */
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3); /* Тінь для об'єму */

  padding: 12px 24px;
  border-radius: 14px;
}

/* Решта стилів залишається без змін */
.share-left {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 20px;
  font-weight: 700;
}
.share-rank {
  font-weight: 800;
  color: #8b5cf6;
  font-size: 22px;
  width: 30px;
}
.share-flag {
  width: 38px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.share-score {
  font-size: 22px;
  font-weight: 800;
  color: #10b981;
}
/* Компактна кнопка "Назад" */
.btn-back {
  width: auto !important; /* Скасовуємо стандартну ширину 100% */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05); /* Ледь помітний фон */
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap; /* ЗАБОРОНА ПЕРЕНОСУ */
  transition: all 0.3s ease;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: var(--accent-purple);
  transform: translateX(-3px); /* Легкий ефект руху назад */
}

.btn-back svg {
  transition: transform 0.3s ease;
}

.btn-back:hover svg {
  transform: translateX(-4px); /* Стрілочка рухається ліворуч при наведенні */
}
/* --- ДИЗАЙН КІМНАТ --- */
.room-banner {
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.15),
    rgba(236, 72, 153, 0.15)
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.room-banner h3 {
  margin-bottom: 10px;
  color: white;
  font-size: 22px;
}

.room-banner p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 14px;
}

.room-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  max-width: 450px;
  margin: 0 auto;
}

.room-form input {
  flex-grow: 1;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(17, 24, 39, 0.8);
  color: white;
  font-size: 16px;
  outline: none;
  transition: 0.3s;
}

.room-form input:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.2);
}

.room-form button {
  width: auto;
  padding: 14px 28px;
  white-space: nowrap;
}

.active-room-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.room-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 15px;
}

.room-title {
  font-size: 20px;
  color: var(--accent-pink);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-title span {
  color: white;
}

.btn-leave-room {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
  width: auto;
  cursor: pointer;
}

.btn-leave-room:hover {
  background: var(--danger);
  color: white;
}
/* Стиль для рекламного логотипу */
.footer-branding {
  margin-top: 50px;
  padding-bottom: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.powered-link {
  display: inline-block;
  transition: all 0.3s ease;
  opacity: 0.4; /* Напівпрозорий у спокійному стані */
}

.powered-link:hover {
  opacity: 1; /* Стає чітким при наведенні */
  transform: translateY(-2px);
}

.powered-logo {
  height: 35px; /* Оптимальний розмір для "powered by" */
  width: auto;
  display: block;
}

/* Окремо для екрана авторизації, щоб лого було всередині картки */
.auth-card .footer-branding {
  margin-top: 25px;
  padding-bottom: 0;
}
/* --- DONATION MODAL --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none; /* Сховано за замовчуванням */
  justify-content: center;
  align-items: center;
  z-index: 3000;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  max-width: 450px;
  width: 100%;
  padding: 40px;
  text-align: center;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-img {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  border-radius: 50%;
  border: 2px solid var(--accent-purple);
}

.modal-content h3 {
  font-size: 24px;
  margin-bottom: 15px;
  color: white;
}

.modal-content p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.btn-monobank {
  background: #ff4e4e; /* Колір моно */
  color: white;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: 0.3s;
  width: 100%;
  justify-content: center;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 1px;
}

.btn-monobank:hover {
  background: #e33e3e;
  transform: translateY(-2px);
}

.close-modal-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  width: auto;
  padding: 5px;
}

.close-modal-btn:hover {
  color: white;
}
/* Кнопка-тригер модалки в шапці */
.btn-support-trigger {
  background: rgba(236, 72, 153, 0.1); /* Легкий відтінок рожевого */
  color: var(--accent-pink);
  border: 1px solid rgba(236, 72, 153, 0.3);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  width: auto;
  margin-right: 10px;
}

.btn-support-trigger:hover {
  background: var(--accent-pink);
  color: white;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.3);
  transform: translateY(-1px);
}
/* Ранговые плашки */
.badge-winner,
.badge-top5,
.badge-top10,
.badge-fail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 20px;
  margin-left: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* #1 Winner (Золото) */
.badge-winner {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

/* #2-5 Top 5 (Серебро/Синий) */
.badge-top5 {
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

/* #6-10 Top 10 (Бронза/Зеленый) */
.badge-top10 {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Остальные (Красный) */
.badge-fail {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
/* --- ФІКС ВИРІВНЮВАННЯ НАЗВ ТА ПЛАШОК --- */

.name-badge-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0; /* Обов'язково для роботи обрізання тексту */
  flex: 1; /* Займає весь вільний простір */
}

.country-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
}

/* Прибираємо старий відступ, бо тепер працює gap, і забороняємо плашкам стискатись */
.badge-winner,
.badge-top5,
.badge-top10,
.badge-fail,
.badge-real-pass,
.badge-real-fail {
  margin-left: 0 !important;
  flex-shrink: 0 !important;
}

/* Дозволяємо лівій частині стискатися, щоб працювало обрізання */
.tier-item .left-side {
  display: flex;
  align-items: center;
  font-weight: 600;
  min-width: 0;
  flex: 1;
  padding-right: 15px;
}

/* --- ВИРІВНЮВАННЯ ШАПКИ --- */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Дозволяє перенесення на дрібних екранах */
  gap: 15px;
  margin-bottom: 25px;
}

.user-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* Рятує від "кособокості" при довгих текстах */
  gap: 12px;
  position: relative;
  z-index: 10;
}

/* Перемикач мов */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px;
  border-radius: 8px;
  position: static !important; /* ОЧИЩАЄМО АБСОЛЮТНЕ ПОЗИЦІОНУВАННЯ, ЯКЕ ЛАМАЛО КНОПКУ ДОНАТУ! */
}

.lang-switcher a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.lang-switcher a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.lang-switcher a:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
/* Десктоп (Комп'ютер) */
.mobile-grid-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* МОБІЛЬНИЙ (Телефон до 600px) */
@media (max-width: 600px) {
  .mobile-grid-nav {
    display: grid !important;
    grid-template-columns: 1fr auto; /* Назад забере максимум місця, Мова - мінімум */
    grid-template-areas:
      "back lang"
      "donate donate";
    gap: 10px;
    width: 100%;
  }

  .nav-back {
    grid-area: back;
    width: 100%;
  }

  .nav-lang {
    grid-area: lang;
    margin: 0 !important;
  }

  .nav-donate {
    grid-area: donate;
    width: 100% !important;
    margin: 0 !important;
    justify-content: center;
  }

  /* Щоб заголовок не заважав на маленькому екрані */
  .header-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
/* --- БІЖУЧИЙ РЯДОК (СПОЩІВЕННЯ) --- */
/* --- ГЛАЗОМОРФІЗМ ДЛЯ БІЖУЧОГО РЯДКА --- */
.ticker-wrap {
  position: fixed;
  top: 15px; /* Трохи відступимо від самого верху */
  left: 5%;
  width: 90%; /* Не на всю ширину, щоб було видно краї */
  background: rgba(255, 255, 255, 0.05); /* Напівпрозорий білий */
  backdrop-filter: blur(12px); /* Ефект розмиття */
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  z-index: 10000;
  padding: 12px 0;
  display: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.ticker-text {
  display: inline-block;
  white-space: nowrap;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
/* --- ГЛАЗОМОРФІЗМ + АНІМАЦІЯ --- */
.ticker-wrap {
  position: fixed;
  top: 15px;
  left: 5%;
  width: 90%;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  z-index: 10000;
  padding: 12px 0;
  display: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden; /* Щоб текст не вилазив за межі "скла" */
}

.ticker-text {
  display: inline-block;
  white-space: nowrap;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);

  /* ЦЕ ВАЖЛИВО: Текст починається за правим краєм контейнера */
  padding-left: 100%;
  will-change: transform; /* Оптимізація для плавності */
}

/* Правило анімації */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}
/* --- FOOTER & SOCIAL LINKS --- */
.footer-branding {
  margin-top: 50px;
  padding-bottom: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px; /* Відступ між лого, роздільником та іконками */
  flex-wrap: wrap; /* Для красивого переносу на телефонах */
}

.powered-link {
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
  opacity: 0.4;
}

.powered-link:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.powered-logo {
  height: 35px;
  width: auto;
  display: block;
}

/* Вертикальна лінія-роздільник */
.footer-divider {
  width: 1px;
  height: 35px;
  background: rgba(255, 255, 255, 0.15);
}

/* Контейнер для кнопок соцмереж */
.footer-socials {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Дизайн круглих кнопок (глассморфізм) */
.social-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.social-icon svg {
  width: 18px;
  height: 18px;
  transition: all 0.3s ease;
}

/* Ефекти при наведенні (Hover) */
.social-icon:hover {
  color: white;
  transform: translateY(-4px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

/* Фірмові кольори брендів при наведенні */
.social-icon.instagram:hover {
  background: radial-gradient(
    circle at 30% 107%,
    #fdf497 0%,
    #fdf497 5%,
    #fd5949 45%,
    #d6249f 60%,
    #285aeb 90%
  );
  border-color: transparent;
}

.social-icon.telegram:hover {
  background: #2aabee;
  border-color: #2aabee;
}

.social-icon.linkedin:hover {
  background: #0077b5;
  border-color: #0077b5;
}

/* Окремо для екрана авторизації */
.auth-card .footer-branding {
  margin-top: 25px;
  padding-bottom: 0;
}

/* Адаптація під мобільні екрани (роздільник зникає, лого і кнопки стають в колонку) */
@media (max-width: 600px) {
  .footer-branding {
    flex-direction: column;
    gap: 15px;
  }
  .footer-divider {
    display: none;
  }
}
