/* =========================================================
   Eurovision 2026 Fan Vote — redesign
   Dark Vienna-inspired theme with gradient accents
   ========================================================= */

:root {
  --bg: #0a0118;
  --bg-2: #120a24;
  --bg-3: #1a0e33;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-3: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.16);
  --border-3: rgba(255, 255, 255, 0.24);

  --ink: #f5f0ff;
  --muted: #a89cc4;
  --dim: #7a6f95;

  --pink: #ff1b6b;
  --magenta: #d62f9a;
  --purple: #a024c7;
  --violet: #7a35ff;
  --blue: #3d7eff;
  --cyan: #00d3ff;
  --gold: #ffd84d;
  --green: #2ee59d;

  --grad: linear-gradient(135deg, #ff1b6b 0%, #a024c7 50%, #3d7eff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 27, 107, 0.22), rgba(160, 36, 199, 0.22), rgba(61, 126, 255, 0.22));
  --grad-soft-2: linear-gradient(135deg, rgba(255, 27, 107, 0.12), rgba(61, 126, 255, 0.12));

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.28);
  --shadow-glow: 0 8px 32px rgba(255, 27, 107, 0.32);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-pill: 999px;

  --line: var(--border);
  --paper: var(--bg-2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Display font for headings, logo, scores */
.logo-word,
.logo-subtitle,
.hero-center h1,
.section-head h2,
.podium-card h3,
.entry-title,
.auth-panel h1,
.finalists-hero h1,
.participants-hero h1,
.user-score-chip,
.score-pill,
.badge,
.participant-score,
.podium-rank {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
}

a { color: var(--pink); }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

/* Ambient orbs — strong purple on the right, soft pink on top,
   subtle violet at bottom-left; center stays dark. */
.stage-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* Wider radii + farther transparent stops = smoother falloff with no
     visible edges around news cards or other content. */
  background:
    radial-gradient(ellipse 80rem 70rem at 110% 50%, rgba(160, 36, 199, 0.36), transparent 90%),
    radial-gradient(ellipse 60rem 50rem at -10% 85%, rgba(122, 53, 255, 0.24), transparent 90%),
    radial-gradient(circle 40rem at 50% -10%, rgba(255, 27, 107, 0.16), transparent 90%);
}
header.hero, main, .site-footer { position: relative; z-index: 1; }

.topbar, .hero-grid, main > section, .site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

/* Header */
header.hero {
  position: relative;
  padding-bottom: 60px;
  overflow: visible;
}
.topbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 22px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.heart {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad);
  color: white;
  font-size: 1.05rem;
  box-shadow: 0 6px 24px rgba(255, 27, 107, 0.45);
}
/* Site logo (centered) — refined typography + tag-line with side rules */
.site-logo {
  justify-self: center;
  display: inline-grid;
  justify-items: center;
  line-height: 1;
  gap: 8px;
}
.logo-word {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.45rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  background: var(--grad);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.logo-word > span:not(.logo-heart) { font-family: inherit; }

/* Heart — sized up, dropped to the optical centre of the wordmark */
.logo-heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  margin: 0 0.06em;
  font-family: inherit;
  font-size: 1em;
  line-height: 1;
  color: #ff1b6b;
  -webkit-text-fill-color: #ff1b6b;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  filter: drop-shadow(0 0 12px rgba(255, 27, 107, 0.8));
  transform: translateY(0.1em);
  animation: heart-beat 2.6s ease-in-out infinite;
}
@keyframes heart-beat {
  0%, 100% { transform: translateY(0.1em) scale(1); }
  45% { transform: translateY(0.1em) scale(1.1); }
  60% { transform: translateY(0.1em) scale(1); }
}

/* Tag-line "fan club" — small caps with side-rules */
.logo-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  background: none;
  background-clip: initial;
  -webkit-background-clip: initial;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  font-family: Inter, sans-serif;
  font-size: clamp(0.58rem, 0.85vw, 0.7rem);
  font-weight: 700;
  letter-spacing: 0.42em;
  text-indent: 0.42em; /* compensate trailing letter-spacing for visual centring */
  text-transform: uppercase;
  text-shadow: none;
}
.logo-subtitle::before,
.logo-subtitle::after {
  content: "";
  display: block;
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 156, 196, 0.55), transparent);
  flex-shrink: 0;
}

.user-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  justify-self: end;
  max-width: 560px;
}
.login-form { display: flex; align-items: center; gap: 8px; }
.login-form input {
  width: 190px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.login-form input::placeholder { color: var(--muted); }
.login-form input:focus { border-color: var(--pink); background: var(--surface-2); }

.login-form button, .submit-vote, .switch-user, .auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-md);
  color: white;
  background: var(--grad);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 22px rgba(255, 27, 107, 0.32);
}
.login-form button:hover, .submit-vote:hover, .switch-user:hover, .auth-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(255, 27, 107, 0.45);
}
/* Submit-vote inside country card needs height auto to accommodate touch targets */
.submit-vote { height: 44px; }
.switch-user { background: var(--surface-2); box-shadow: none; padding: 0 14px; }
.switch-user:hover { background: var(--surface-3); box-shadow: none; }

.current-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--ink);
  background: var(--surface);
  font-weight: 700;
}
.current-user .avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.profile-menu-wrap { position: relative; }
.profile-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  left: 0;
  display: grid;
  gap: 8px;
  width: 320px;
  max-width: min(86vw, 320px);
  padding: 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  background: rgba(18, 10, 36, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}
.profile-menu[hidden] { display: none; }
/* Profile-menu items: transparent fill, gradient outline, white text */
.profile-menu button, .profile-menu > .admin-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-md);
  color: #ffffff;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.profile-menu button::before, .profile-menu > .admin-link::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: var(--grad);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.profile-menu button:hover, .profile-menu > .admin-link:hover {
  background: rgba(255, 27, 107, 0.1);
  color: #ffffff;
}
.profile-menu button:active, .profile-menu > .admin-link:active {
  transform: scale(0.98);
}
.admin-panel {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-2);
  color: var(--muted);
}
.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: var(--r-md);
  background: var(--gold);
  color: var(--bg);
  font-weight: 800;
  text-decoration: none;
}
.admin-link:hover { filter: brightness(1.1); }
.admin-panel > strong { color: var(--ink); font-size: 0.9rem; }
.admin-panel > span { color: var(--dim); font-size: 0.78rem; font-weight: 700; }
.admin-users { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.admin-users p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.admin-user {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.admin-user .avatar { width: 30px; height: 30px; font-size: 0.72rem; }
.admin-user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 700;
}
.admin-user button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  color: white;
  background: rgba(255, 27, 107, 0.88);
  font-size: 0.74rem;
  font-weight: 700;
}
.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  color: white;
  font-weight: 800;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
}
.lang-toggle:hover { background: var(--surface-2); }

/* Hero — centered single column */
.hero-grid {
  position: relative;
  z-index: 1;
  display: block;
  padding: 60px 0 80px;
  text-align: center;
}
.hero-center {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  margin: 0 0 28px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 12px var(--pink);
  flex-shrink: 0;
}
h1, h2, p { margin-top: 0; }
.hero-center h1 {
  margin: 0 0 24px;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  background: linear-gradient(135deg, #ffffff 0%, #f5e6ff 50%, #c7a8ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.hero-center h1 .grad {
  background: var(--grad);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.hero-intro {
  max-width: 580px;
  margin: 0 0 32px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.6;
}
.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 32px;
  padding: 10px 22px;
  border-radius: var(--r-pill);
  background:
    linear-gradient(95deg,
      rgba(160, 36, 199, 0.45) 0%,
      rgba(122, 53, 255, 0.25) 45%,
      rgba(18, 10, 36, 0.7) 100%);
  border: 1px solid var(--border-2);
  box-shadow: 0 6px 24px rgba(160, 36, 199, 0.18);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}
.hero-meta strong { font-weight: 700; }
.hero-meta .dot-sep { opacity: 0.4; }
.hero-archive-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.4);
  padding-bottom: 1px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.hero-archive-link:hover { border-color: #fff; color: #fff; }

/* Disabled CTA — used when voting/predictions aren't available yet. */
.btn.btn-disabled,
.btn.btn-disabled:hover {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: auto;     /* receives clicks so we can preventDefault */
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
  filter: grayscale(0.5);
  text-decoration: none;
  box-shadow: none;
}

/* When there's only one stage — the eyebrow inside .list-head doubles as
   the "stage badge" since the whole tabs row is hidden. Style as a pill. */
.list-section .section-head.list-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--r-pill);
  background: linear-gradient(95deg, rgba(255, 47, 146, 0.22), rgba(122, 53, 255, 0.25));
  border: 1px solid rgba(255, 47, 146, 0.4);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(15px, 1.8vw, 20px);
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0;
  box-shadow: 0 6px 24px rgba(255, 47, 146, 0.18);
}
.list-section .section-head.list-head .eyebrow::before {
  content: "🎤";
  font-size: 1.1em;
}

/* =====================================================================
   Countdown — без фона и рамок, только текст и цифры
   ===================================================================== */
.countdown {
  margin: 20px auto 28px;
  padding: 0;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 760px;
}
.countdown[hidden] { display: none !important; }
.countdown-label {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  text-transform: none;
}
.countdown-grid {
  display: flex;
  gap: clamp(16px, 4vw, 44px);
  align-items: baseline;
  justify-content: center;
  flex-wrap: nowrap;
}
.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.countdown-num {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(40px, 6.5vw, 80px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff 0%, #e0d4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.countdown-name {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(10px, 1.1vw, 12px);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}
@media (max-width: 540px) {
  .countdown { gap: 6px; }
  .countdown-grid { gap: 14px; }
}

.archive-badge {
  background: linear-gradient(95deg, rgba(255, 47, 146, 0.35), rgba(122, 53, 255, 0.3)) !important;
}

.empty-contest-state {
  padding: 64px 32px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 28px;
}
.empty-contest-state h3 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
}
.empty-contest-state p {
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.65);
  font-size: 15px;
  line-height: 1.5;
  max-width: 560px;
}

/* Winner spotlight — shown above the table when status="finished" */
.winner-spotlight {
  margin: 0 auto 40px;
  max-width: 760px;
  padding: 40px 32px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 47, 146, 0.25), transparent 60%),
    radial-gradient(circle at 50% 100%, rgba(122, 53, 255, 0.2), transparent 60%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 47, 146, 0.35);
  border-radius: 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.winner-spotlight::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 28px;
  padding: 2px;
  background: linear-gradient(135deg, #ff2f92, #7a35ff, #ff2f92);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}
.winner-spotlight-inner { position: relative; z-index: 1; }
.winner-eyebrow {
  margin: 0 0 18px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}
.winner-flag-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.winner-flag-big {
  display: block;
  width: 140px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.winner-flag-big img.flag-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.winner-country {
  margin: 0 0 8px;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(95deg, #ff2f92, #7a35ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.winner-artist {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}
.winner-song {
  margin: 0 0 16px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}
.winner-contest-name {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}

/* =====================================================================
   "My picks" — favourite + winner cards (own section under the table)
   ===================================================================== */
.my-picks-section {
  margin: 48px auto 32px;
  max-width: 1180px;
  padding: 0 4px;
}
.my-picks-section .section-head {
  text-align: center;
  margin-bottom: 22px;
}
.my-picks-section .section-head .eyebrow {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.my-picks-section .section-head h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.my-picks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.pick-card {
  position: relative;
  /* overflow stays visible so the flag-select dropdown can spill out
     of the card. The radial-gradient backgrounds get clipped by
     border-radius naturally because they live on `background`, not
     in a child element. */
  overflow: visible;
  padding: 22px 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
/* Open dropdown raises the card so the menu floats above siblings */
.pick-card:has(.flag-select-menu:not([hidden])) {
  z-index: 50;
}
/* Make the menu inside the card visibly pop out: solid background + shadow */
.pick-card .flag-select-menu {
  z-index: 1000;
  background: rgba(20, 12, 40, 0.98);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 47, 146, 0.25);
  border-radius: 14px;
  margin-top: 6px;
}
.my-picks-section {
  position: relative;
  z-index: 5;
}
.pick-card:hover { transform: translateY(-2px); }
.pick-card.favorite-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 47, 146, 0.16), transparent 60%),
    rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 47, 146, 0.3);
}
.pick-card.winner-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 200, 0, 0.14), transparent 60%),
    rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 200, 0, 0.3);
}
.pick-card header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.pick-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 22px;
  flex-shrink: 0;
}
.favorite-card .pick-card-icon {
  background: linear-gradient(135deg, #ff2f92, #b21bff);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.winner-card .pick-card-icon {
  background: linear-gradient(135deg, #ffd83a, #ff7a00);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.pick-card header div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pick-card-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.pick-card-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}
.pick-card .flag-select {
  width: 100%;
}
.pick-card .flag-select-button {
  width: 100%;
  justify-content: flex-start;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
}
.pick-card .flag-select-menu {
  width: 100%;
  max-height: 260px;
}
@media (max-width: 720px) {
  .my-picks-grid { grid-template-columns: 1fr; }
  .my-picks-section .section-head h2 { font-size: 22px; }
}

/* =====================================================================
   Horizontal screens slider — Contest / News / Gallery
   ===================================================================== */
/* Each screen takes the FULL viewport width and only one is shown at a time.
   Switching is animated with a slide-in. Body still scrolls vertically inside
   the active screen. */
.screens-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
.screen {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 50vh;
  display: none !important;
  animation: screenSlideIn 0.4s ease both;
}
.screen.screen-active { display: block !important; }
.screen[hidden] { display: none !important; }
.screen-gallery.screen-active { display: block !important; }

/* Standalone topbar — закреплён вверху окна, не двигается при прокрутке.
   Прозрачный фон сливается с тем экраном, что под ним.
   !important перебивает любые конфликтующие правила .topbar выше. */
.site-topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  z-index: 60;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
  /* keep the 3-column grid inside a 1180px-wide area centered in the viewport */
  padding-left: max(16px, calc((100vw - 1180px) / 2)) !important;
  padding-right: max(16px, calc((100vw - 1180px) / 2)) !important;
  box-sizing: border-box;
}
.site-topbar > * { pointer-events: auto; }
body main { padding-top: 84px; }
body:has(.screen-gallery.screen-active) main { padding-top: 0; }

@keyframes screenSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
.screen.screen-active.screen-slide-prev {
  animation: screenSlideInLeft 0.4s ease both;
}
@keyframes screenSlideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Contest screen children — keep narrow for readability.
   News & gallery screens go full-width on purpose. */
.screen-contest > * {
  max-width: min(1200px, 100%);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Side arrows */
.screen-arrow {
  position: fixed;
  top: 50vh;
  transform: translateY(-50%);
  z-index: 70;       /* выше gallery (50) и topbar (60), чтобы оставались кликабельными */
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(20, 12, 40, 0.7);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 32px;
  line-height: 1;
  cursor: pointer !important;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  backdrop-filter: blur(8px);
  /* Hidden by default — JS shows them only when there's a 2nd screen. */
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease;
}
/* Avoid I-beam caret showing on the inner caret characters by treating any
   child element as a non-pointer so the button itself is what receives the
   click & cursor. */
.screen-arrow * {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.screen-arrow:hover {
  background: linear-gradient(135deg, #ff2f92, #7a35ff);
  transform: translateY(-50%) scale(1.06);
}
.screen-arrow:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}
.screen-arrow-prev { left: 16px; }
.screen-arrow-next { right: 16px; }

/* Dots indicator */
.screen-dots {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;        /* выше gallery (50) и topbar (60) */
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(20, 12, 40, 0.65);
  border-radius: var(--r-pill);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.screen-dots[hidden] { display: none !important; }
.screen-dots:empty { display: none !important; }
.screen-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.18s ease, width 0.25s ease, transform 0.18s ease;
}
.screen-dot:hover { background: rgba(255, 255, 255, 0.55); transform: scale(1.15); }
.screen-dot.active {
  width: 30px;
  border-radius: 5px;
  background: linear-gradient(95deg, #ff2f92, #7a35ff);
}
.screen-dot-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.85);
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.screen-dot:hover .screen-dot-label { opacity: 1; }

/* =====================================================================
   News screen — fullscreen layout, big editorial cards
   ===================================================================== */
.screen-news {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 47, 146, 0.08), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(122, 53, 255, 0.08), transparent 50%);
  padding: 0;
}
.screen-news .news-section {
  margin: 0;
  padding: 60px 6vw 80px;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
.screen-news .section-head.screen-head {
  text-align: center;
  margin-bottom: 36px;
}
.screen-news .screen-head h2 {
  font-size: clamp(28px, 5vw, 48px) !important;
  margin: 0;
}
.screen-news .news-list {
  display: grid;
  gap: 22px;
  max-width: 1400px;
  margin: 0 auto;
}
.screen-news .news-card {
  grid-template-columns: minmax(320px, 40%) 1fr;
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  overflow: hidden;
}
.screen-news .news-card.no-image {
  grid-template-columns: 1fr;
  padding: 32px 36px;
}
.screen-news .news-card-image {
  width: 100%;
  height: 100%;
  min-height: 240px;
  border-radius: 0;
  object-fit: cover;
}
.screen-news .news-card-body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.screen-news .news-card-body strong {
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.25;
  margin-bottom: 10px;
}
.screen-news .news-card-body p {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}
.screen-news .news-card-date {
  margin-top: 16px;
  font-size: 12px;
}

/* =====================================================================
   Gallery screen — fixed fullscreen, картинка не масштабируется
   ===================================================================== */
.screen-gallery {
  background: #000;
  padding: 0;
  min-height: 100vh;
  position: relative;
}
/* When gallery is active — pin the whole gallery to viewport corners so it
   covers the topbar area too. Stage-glow hidden, body background ignored. */
.screen-gallery.screen-active {
  position: fixed !important;
  inset: 0 !important;
  z-index: 50;
  margin: 0 !important;
}
body:has(.screen-gallery.screen-active) .stage-glow { display: none !important; }
body:has(.screen-gallery.screen-active) { background: #000 !important; }

.screen-gallery .gallery-section {
  margin: 0;
  padding: 0;
  max-width: none;
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
}
.screen-gallery .section-head.screen-head { display: none; }
.screen-gallery .gallery-carousel {
  border-radius: 0;
  background: #000;
  border: none;
  margin: 0;
  max-width: none;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}
.screen-gallery .gallery-track {
  padding: 0;
  gap: 0;
  width: 100vw;
  height: 100vh;
  scroll-snap-type: x mandatory;
}
.screen-gallery .gallery-slide {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  flex: 0 0 100vw;
  scroll-snap-align: start;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Картинка заполняет весь viewport, при необходимости обрезается по краям.
   Hover-zoom отключён ниже — изображение остаётся статичным. */
.screen-gallery .gallery-slide img {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Тёмно-фиолетовый градиент сверху чтобы топбар был читаем над любой картинкой. */
.screen-gallery .gallery-slide::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 140px;
  background: linear-gradient(180deg, rgba(18, 10, 36, 0.85) 0%, rgba(18, 10, 36, 0.55) 50%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}
/* Не масштабировать картинку при hover внутри fullscreen gallery */
.screen-gallery .gallery-slide:hover img {
  transform: none !important;
}
.screen-gallery .gallery-slide .gallery-caption {
  font-size: 18px;
  padding: 24px 32px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  font-weight: 600;
  z-index: 2;
}

/* Текст-оверлей слева поверх gallery-картинки */
.gallery-overlay {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: clamp(320px, 50vw, 760px);
  padding: 0 clamp(28px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.45) 60%, transparent 100%);
}
.gallery-overlay-heading {
  margin: 0 0 16px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(36px, 6.5vw, 92px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
}
.gallery-overlay-heading .hl-pink {
  background: linear-gradient(95deg, #ff2f92 0%, #ff5fbf 50%, #b21bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gallery-overlay-subtext {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(15px, 1.5vw, 20px);
  font-weight: 500;
  color: #fff;
  line-height: 1.45;
  max-width: 540px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
@media (max-width: 720px) {
  .gallery-overlay {
    width: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.45) 50%, transparent 100%);
    justify-content: flex-start;
    padding-top: 90px;
  }
}
/* Внутренние стрелки галереи скрыты — внешние screen-arrows их заменяют.
   Если в галерее несколько картинок — переключение через свайп или ту же
   стрелку внешней навигации (она циклически проходит контест → фото → ...). */
.screen-gallery .gallery-arrow {
  display: none !important;
}

/* Generic screen-head fallback */
.screen-head h2 { font-size: 36px; }

@media (max-width: 720px) {
  .screen-arrow {
    width: 42px;
    height: 42px;
    font-size: 26px;
  }
  .screen-arrow-prev { left: 8px; }
  .screen-arrow-next { right: 8px; }
  .screen-news .news-card {
    grid-template-columns: 1fr;
  }
  .screen-news .news-card-image { width: 100%; height: 200px; }
  .screen-gallery .gallery-slide { width: clamp(260px, 80vw, 360px); }
}

/* =====================================================================
   News + Gallery (editorial blocks on homepage)
   ===================================================================== */
.news-section, .gallery-section {
  margin: 48px auto;
  max-width: 1180px;
  padding: 0 4px;
}
.news-section .section-head,
.gallery-section .section-head {
  text-align: center;
  margin-bottom: 22px;
}
.news-section .section-head .eyebrow,
.gallery-section .section-head .eyebrow {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.news-section .section-head h2,
.gallery-section .section-head h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.news-list {
  display: grid;
  gap: 14px;
}
.news-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.news-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 47, 146, 0.3);
}
.news-card.no-image {
  grid-template-columns: 1fr;
}
.news-card-image {
  width: 160px;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}
.news-card-body strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
  font-weight: 700;
}
.news-card-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.75);
}
.news-card-date {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
}

/* Gallery carousel */
.gallery-carousel {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.gallery-track {
  display: flex;
  gap: 14px;
  padding: 18px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 47, 146, 0.4) transparent;
}
.gallery-track::-webkit-scrollbar { height: 8px; }
.gallery-track::-webkit-scrollbar-thumb {
  background: rgba(255, 47, 146, 0.4);
  border-radius: 8px;
}
.gallery-slide {
  flex: 0 0 auto;
  width: clamp(220px, 32vw, 380px);
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  background: rgba(255, 255, 255, 0.04);
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gallery-slide:hover img { transform: scale(1.04); }
.gallery-slide .gallery-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20, 12, 40, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.gallery-arrow:hover { background: rgba(255, 47, 146, 0.85); }
.gallery-arrow-prev { left: 10px; }
.gallery-arrow-next { right: 10px; }

@media (max-width: 720px) {
  .news-card { grid-template-columns: 1fr; }
  .news-card-image { width: 100%; height: 200px; }
  .news-section .section-head h2,
  .gallery-section .section-head h2 { font-size: 22px; }
  .gallery-slide { width: clamp(220px, 78vw, 320px); }
}

/* CTA buttons row */
.cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary {
  background: var(--grad);
  color: white;
  box-shadow: 0 8px 32px rgba(255, 27, 107, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(255, 27, 107, 0.5);
  color: white;
}
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* Variant 3 — Compact stack with pill picks (hero lineup) */
.registered-users {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  justify-content: center;
  gap: 14px;
  margin: 40px auto 0;
  max-width: 1180px;
  width: 100%;
  padding: 0 16px;
}
.registered-user {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 18px 14px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  justify-items: center;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.registered-user:hover,
.registered-user:focus-visible {
  border-color: rgba(255, 27, 107, 0.4);
  background: linear-gradient(180deg, rgba(255, 27, 107, 0.08), rgba(160, 36, 199, 0.04));
  transform: translateY(-2px);
}
.profile-avatar {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--grad);
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 3px rgba(255, 255, 255, 0.14),
    0 8px 18px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.18s, transform 0.18s;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-card-link { color: var(--ink); text-decoration: none; }
.profile-card-link:hover .profile-avatar,
.profile-card-link:focus-visible .profile-avatar {
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 4px rgba(255, 27, 107, 0.6),
    0 12px 28px rgba(0, 0, 0, 0.4);
}
/* Bigger avatar + name inside the wider hero cards */
.registered-user .profile-avatar {
  width: 84px;
  height: 84px;
  font-size: 1.7rem;
  margin-bottom: 12px;
}
.registered-user .profile-name {
  font-size: 0.98rem;
  margin-bottom: 10px;
}
.profile-name {
  display: block;
  margin-bottom: 8px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-picks {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.pick-badge {
  display: grid;
  grid-template-columns: 24px 14px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  font-weight: 600;
  text-align: left;
  min-width: 0;
}
.pick-badge .pick-country { display: none; }
.pick-badge.empty {
  visibility: visible;
  background: transparent;
  border-style: dashed;
  color: var(--dim);
}
.pick-ic {
  font-size: 0.78rem;
  line-height: 1;
  text-align: center;
  opacity: 0.7;
}
.pick-badge.winner .pick-ic { color: var(--gold); }
.pick-badge.favorite .pick-ic { color: var(--pink); }
.pick-badge.empty .pick-ic { opacity: 0.45; }
.pick-country {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}
.pick-badge.empty .pick-country { color: var(--dim); }
.mini-flag, .pick-flag {
  display: inline-flex;
  overflow: hidden;
  width: 24px;
  height: 17px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.pick-flag-empty {
  background: var(--surface-3);
  border: 1px dashed var(--border-2);
  box-shadow: none;
}

.flag-select { position: relative; width: 190px; }
.flag-select-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--ink);
  background: var(--surface);
  font-weight: 700;
}
.flag-select-button:hover { background: var(--surface-2); border-color: var(--border-3); }
.flag-select-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag-select-button[disabled] { opacity: 0.6; cursor: not-allowed; }
.flag-select-menu {
  position: absolute;
  z-index: 999;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  gap: 4px;
  width: 240px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  background: rgba(18, 10, 36, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}
.flag-select-menu[hidden] { display: none; }
.flag-select-menu button {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 700;
  font-size: 0.9rem;
}
.flag-select-menu button:hover { background: var(--surface-2); }

/* Odds */
.odds-stack { display: grid; align-self: start; gap: 12px; }
.participants-odds-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: var(--r-md);
  color: white;
  background: var(--grad);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-glow);
}
.participants-odds-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(255, 27, 107, 0.5);
  color: white;
}
.odds-panel {
  display: grid;
  padding: 18px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.odds-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 0 14px;
  border-radius: var(--r-md);
  color: var(--bg);
  background: var(--gold);
  font-weight: 800;
  text-decoration: none;
}
.odds-link:hover { filter: brightness(1.1); transform: translateY(-1px); color: var(--bg); }
.odds-panel .eyebrow { align-self: start; margin-bottom: 10px; }
.odds-panel ol {
  display: grid;
  gap: 6px;
  max-height: 220px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.odds-panel li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-weight: 700;
}
.odds-country {
  display: grid;
  grid-template-columns: 18px 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.odds-country > strong { color: var(--muted); font-size: 0.82rem; }
.odds-country b { color: var(--ink); font-size: 0.88rem; font-weight: 800; }
.odds-country small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--dim);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.odds-flag {
  display: inline-flex;
  overflow: hidden;
  width: 30px;
  height: 21px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.odds-numbers { display: grid; gap: 2px; justify-items: end; min-width: 48px; }
.odds-numbers strong { color: var(--ink); font-size: 0.86rem; }
.odds-numbers small { color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.odds-panel > small { margin-top: 10px; color: var(--dim); font-size: 0.7rem; }

/* Main */
main { padding-bottom: 64px; }

.controls-band {
  position: relative;
  z-index: 30;                  /* поверх hero и других слоёв */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px auto 12px;       /* опущена ниже, по центру */
  padding: 14px 16px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  background: rgba(18, 10, 36, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  isolation: isolate;           /* свой stacking-context, чтобы blur родителей не съедал края */
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  flex: 1 1 auto;
}
.tab {
  flex: 1 1 auto;
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--r-pill);
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.005em;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: white;
  background: var(--grad);
  box-shadow: 0 4px 18px rgba(255, 27, 107, 0.35);
}
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-box, .sort-box, .pick-box, .comment-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.search-box input, .sort-box select, .comment-field textarea {
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--ink);
  background: var(--surface);
  outline: none;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}
.search-box input:focus, .sort-box select:focus, .comment-field textarea:focus {
  border-color: var(--pink);
  background: var(--surface-2);
}
.search-box input { width: 240px; padding: 10px 14px; }

/* Sort — pill segmented control */
.sort-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-pill);
  background: var(--surface);
}
.sort-pill {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-pill);
  color: var(--muted);
  background: transparent;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.sort-pill:hover { color: var(--ink); }
.sort-pill.active {
  color: white;
  background: var(--grad);
  box-shadow: 0 4px 16px rgba(255, 27, 107, 0.35);
}

/* Sort placed inside the list section head (right-aligned with the eyebrow) */
.list-sort {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.list-sort .sort-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.list-section .section-head {
  align-items: center;
  flex-wrap: wrap;
  row-gap: 12px;
}
.list-section .section-head .eyebrow { margin: 0; }

.pink-star { color: var(--pink); opacity: 0.7; }
.cup-icon { color: var(--gold); opacity: 0.7; }

.top-section, .list-section, .sources { padding-top: 44px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}
.top-section .section-head { justify-content: flex-start; }
.list-section .section-head { justify-content: space-between; }
.section-head h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* Podium */
.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.podium-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 168px;
  padding: 20px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  color: white;
  background: linear-gradient(140deg, rgba(255, 27, 107, 0.32), rgba(160, 36, 199, 0.18) 50%, rgba(61, 126, 255, 0.32)), var(--bg-2);
  box-shadow: var(--shadow);
}
.podium-card p:last-child { margin-top: auto; padding-top: 10px; }
.podium-card:nth-child(2) {
  background: linear-gradient(140deg, rgba(160, 36, 199, 0.32), rgba(122, 53, 255, 0.2) 50%, rgba(0, 211, 255, 0.32)), var(--bg-2);
}
.podium-card:nth-child(3) {
  background: linear-gradient(140deg, rgba(46, 229, 157, 0.28), rgba(160, 36, 199, 0.2) 60%, rgba(255, 216, 77, 0.32)), var(--bg-2);
}
.podium-rank {
  position: absolute;
  top: 14px;
  right: 18px;
  color: rgba(255, 255, 255, 0.2);
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
}
.podium-flag, .country-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 56px;
  height: 40px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.country-flag { width: 48px; height: 34px; }
.flag-img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-flag { color: var(--muted); font-size: 1.2rem; font-weight: 800; }
.podium-card h3 {
  position: relative;
  margin: 10px 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.podium-card p { position: relative; margin: 0; color: rgba(255, 255, 255, 0.84); }
.podium-card p strong { color: white; font-weight: 800; }
/* Reserve a fixed 2-line slot for artist — song so cards stay the same height
   across tabs (SF1 / SF2 / Final) regardless of how long the title is. */
.podium-card p:not(:last-child) {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
  line-height: 1.4;
}

/* User profile Top 3 — compact podium cards on the right side of the
   participant-head. Number 1/2/3 sits in the top-left corner.
   The country flag fills the full card height on the RIGHT side,
   keeping its natural proportions (aspect-ratio: 3/2). */
.user-top3 {
  margin-left: auto !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 70%;
}
.user-top3 .section-head { display: none !important; }
.user-top3 .podium {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  grid-template-columns: none !important;
}
.user-top3 .podium-card {
  position: relative;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  min-height: 92px !important;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  overflow: hidden;
}
.user-top3 .podium-rank {
  top: 4px !important;
  left: 10px !important;
  right: auto !important;
  font-size: 2rem !important;
  line-height: 1;
  z-index: 1;
}
/* Flag: occupies the full height on the right, proportional 3:2 width.
   align-self auto + absolute positioning keeps it out of the column flow. */
.user-top3 .podium-flag {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  height: auto !important;
  aspect-ratio: 3 / 2;
  align-self: auto !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.user-top3 .podium-flag .flag-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Text content sits to the LEFT of the flag — reserve room via padding-right.
   Flag width ≈ card-height × 1.5 (3:2 aspect). For ~92px height → ~138px. */
.user-top3 .podium-card h3,
.user-top3 .podium-card p {
  position: relative;
  z-index: 1;
  padding-right: 50%;
}
.user-top3 .podium-card h3 {
  margin: 22px 0 2px !important;
  font-size: 0.92rem !important;
  font-weight: 800;
  line-height: 1.15;
  color: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-top3 .podium-card p {
  margin: 0 !important;
  font-size: 0.7rem !important;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.78);
  padding-top: 0 !important;
}
.user-top3 .podium-card p:not(:last-child) {
  -webkit-line-clamp: 1 !important;
  min-height: 0 !important;
}

/* On narrower viewports cards drop below the head instead of squeezing */
@media (max-width: 720px) {
  .user-top3 {
    width: 100%;
    max-width: none !important;
    margin-left: 0 !important;
    margin-top: 10px !important;
    order: 1;
  }
  .participant-head { flex-wrap: wrap; }
  .user-top3 .podium { gap: 6px !important; }
}

/* Country list */
.country-table { display: grid; gap: 12px; }
.country-row {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.country-row:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.country-row.open { border-color: var(--border-3); background: var(--surface-2); }
.country-row.is-finalist {
  border-color: rgba(46, 229, 157, 0.4);
  background: linear-gradient(90deg, rgba(46, 229, 157, 0.1), rgba(255, 255, 255, 0.045) 36%);
}
.country-row.is-finalist .running { color: var(--green); }
.country-summary {
  display: grid;
  grid-template-columns: 72px 42px minmax(260px, 1fr) auto auto auto auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 84px;
  padding: 14px 18px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}
.running {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.user-score-chip {
  display: inline-flex;
  width: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: white;
  background: var(--grad);
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(255, 27, 107, 0.35);
}
.user-score-chip.empty { visibility: hidden; }
.entry-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.entry-title {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.entry-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}
.badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 96px;
  justify-content: center;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-2);
}
.badge.green {
  background: rgba(46, 229, 157, 0.12);
  color: var(--green);
  border-color: rgba(46, 229, 157, 0.22);
}
.badge .badge-star {
  color: #ffd76b;
  font-size: 1em;
  line-height: 1;
  opacity: 0.7;
}
.badge .medal-icon {
  font-size: 1.15em;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
  opacity: 0.7;
}
.badge.badge-winner {
  background: linear-gradient(135deg, rgba(255, 200, 87, 0.16), rgba(255, 27, 107, 0.16));
  border-color: rgba(255, 200, 87, 0.32);
}
.average-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.history-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  color: var(--ink);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}
.details {
  display: none;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: start;
  padding: 0 18px 22px 102px;
}
.country-row.open .details { display: grid; }
.country-row.open .history { align-self: start; }
.country-row.open .review { align-self: start; }
.vote-form { display: grid; gap: 12px; align-self: start; }
.rating-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.rating-grid label {
  position: relative;
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}
.rating-grid label:hover { transform: scale(1.06); border-color: var(--border-3); }
.rating-grid input { position: absolute; opacity: 0; pointer-events: none; }
.rating-grid label:has(input:checked) {
  border-color: transparent;
  color: white;
  background: var(--grad);
  box-shadow: 0 4px 16px rgba(255, 27, 107, 0.4);
}
.rating-grid label.score-disabled {
  color: var(--dim);
  background: var(--surface-2);
  cursor: not-allowed;
  opacity: 0.6;
}
.comment-field textarea {
  width: 100%;
  resize: vertical;
  padding: 10px 14px;
  min-height: 80px;
  background: var(--surface);
}
.comment-field textarea::placeholder { color: var(--dim); }
.submit-vote { min-height: 44px; }
.history { display: grid; gap: 10px; }
.history-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.review {
  display: grid;
  grid-template-columns: 38px minmax(110px, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.review strong { display: block; margin-bottom: 3px; color: var(--ink); }
.review div { min-width: 0; }
.review p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}
.score-pill {
  position: relative;
  min-width: 42px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: white;
  background: var(--grad);
  text-align: center;
  font-weight: 800;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 14px rgba(255, 27, 107, 0.32);
  overflow: visible;
}
.score-delta {
  position: absolute;
  top: -9px;
  right: -10px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: score-delta-pop 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.score-delta.up {
  background: rgba(46, 229, 157, 0.22);
  border: 1px solid rgba(46, 229, 157, 0.5);
  color: var(--green);
}
.score-delta.down {
  background: rgba(255, 75, 130, 0.22);
  border: 1px solid rgba(255, 75, 130, 0.5);
  color: #ff96b6;
}
@keyframes score-delta-pop {
  0% { transform: translateY(-4px) scale(0.6); opacity: 0; }
  60% { transform: translateY(0) scale(1.08); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* === Arrival animation for new votes — intensity scales with --boost (0..1) ====== */
.review.review-arrive {
  --boost: 0.5;
  /* ease-out (smooth deceleration, no overshoot) — one clean entrance,
     no "double bounce" from the back-out elastic curve. */
  animation: review-burst 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  z-index: 1;
}
.review.review-arrive .score-pill {
  animation: score-pop 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow:
    0 0 0 0 rgba(255, 27, 107, 0.6),
    0 4px 14px rgba(255, 27, 107, 0.32);
}

/* Pure 0% → 100% transitions. No intermediate keyframes, so the easing
   curve is applied across the whole animation — one continuous motion. */
@keyframes review-burst {
  0% {
    transform: translateY(calc(24px + var(--boost) * 26px)) scale(calc(0.6 - var(--boost) * 0.22));
    opacity: 0;
    box-shadow:
      0 0 calc(30px + var(--boost) * 28px) rgba(255, 27, 107, calc(0.5 + var(--boost) * 0.3)),
      0 0 16px rgba(160, 36, 199, 0.4);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0);
  }
}

@keyframes score-pop {
  0% {
    transform: scale(calc(0.3 - var(--boost) * 0.08)) rotate(calc(-22deg - var(--boost) * 18deg));
    filter: brightness(calc(1.8 + var(--boost))) saturate(1.5);
  }
  100% {
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }
}

/* Flying heart particles spawned from the score-pill */
.confetti-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 1rem;
  line-height: 1;
  color: #ff1b6b;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 27, 107, 0.9));
  animation: heart-fly 1.3s ease-out forwards;
  will-change: transform, opacity;
  z-index: 2;
}
@keyframes heart-fly {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(0);
    opacity: 0;
  }
  18% {
    transform: translate(calc(-50% + var(--dx) * 0.35), calc(-50% + var(--dy) * 0.35)) scale(1.1) rotate(calc(var(--rot) * 0.5));
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.4) rotate(var(--rot));
    opacity: 0;
  }
}
.locked {
  padding: 16px;
  border: 1px dashed var(--border-2);
  border-radius: var(--r-md);
  color: var(--muted);
  background: var(--surface);
  text-align: center;
  font-size: 0.92rem;
}

/* Sources & footer */
.sources { color: var(--dim); font-size: 0.82rem; line-height: 1.7; }
.sources h2 { color: var(--ink); font-size: 1rem; margin-bottom: 10px; }
.sources a { color: var(--pink); }
.sources a:hover { color: white; }
.seo-tags { color: var(--muted); font-weight: 700; }
.site-footer {
  margin: 40px auto 0;
  padding: 22px 0;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}
.footer-grad {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #a024c7 0%, #7a35ff 35%, #4a2a8a 70%, #1a0e33 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(122, 53, 255, 0.25));
}
.footer-grad a {
  background: inherit;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  transition: filter 0.2s;
}
.footer-grad a:hover {
  filter: brightness(1.3);
}

/* Auth */
.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--bg);
  position: relative;
}
.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60rem 50rem at 100% 50%, rgba(160, 36, 199, 0.42), transparent 70%),
    radial-gradient(ellipse 42rem 36rem at 0% 78%, rgba(122, 53, 255, 0.28), transparent 70%),
    radial-gradient(circle 28rem at 50% 4%, rgba(255, 27, 107, 0.18), transparent 70%);
}
.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(460px, calc(100% - 32px));
  gap: 18px;
}
.auth-brand { width: max-content; }
.auth-panel {
  padding: 30px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  color: var(--ink);
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}
.auth-panel h1 {
  margin-bottom: 22px;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #c7a8ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.auth-form { display: grid; gap: 14px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
}
.auth-tab {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-pill);
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.active {
  color: white;
  background: var(--grad);
  box-shadow: 0 4px 14px rgba(255, 27, 107, 0.3);
}
.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.auth-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--ink);
  background: var(--surface-2);
  outline: none;
}
.auth-form input::placeholder { color: transparent; }
.auth-form input:focus { border-color: var(--pink); background: var(--surface-3); }
.auth-help { margin: 0; color: var(--dim); font-size: 0.8rem; line-height: 1.5; }
.auth-message { min-height: 20px; color: var(--muted); font-size: 0.84rem; font-weight: 700; }
.auth-message.error { color: #ffb6c8; }
.auth-form button {
  min-height: 46px;
  border: 0;
  border-radius: var(--r-md);
  color: white;
  background: var(--grad);
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}
.auth-form button:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(255, 27, 107, 0.45); }
.auth-form button:disabled { cursor: wait; opacity: 0.65; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}
.back-link:hover { color: var(--ink); }

.nav-links {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.nav-links .back-link {
  margin-top: 0;
}

/* Finalists / Participants pages */
.finalists-page, .participants-page {
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  position: relative;
}
.finalists-page::before, .participants-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60rem 50rem at 100% 50%, rgba(160, 36, 199, 0.42), transparent 70%),
    radial-gradient(ellipse 42rem 36rem at 0% 78%, rgba(122, 53, 255, 0.28), transparent 70%),
    radial-gradient(circle 28rem at 50% 4%, rgba(255, 27, 107, 0.18), transparent 70%);
}
.finalists-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 64px;
}
.finalists-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}
.finalists-top .brand { color: var(--ink); }
.participants-page .finalists-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  margin-bottom: 14px;
  padding: 0 24px;
}
.participants-page .finalists-top .brand { grid-column: 1; justify-self: start; }
.participants-page .finalists-top .back-link { grid-column: 3; justify-self: end; margin-top: 0; }
.participants-logo {
  grid-column: 2;
  justify-self: center;
  align-self: center;
  display: grid;
  justify-items: center;
  margin: 0;
  transform: none;
  line-height: 1;
}
.participants-logo .logo-word {
  font-size: clamp(1.05rem, 2.4vw, 1.55rem);
  letter-spacing: -0.03em;
}
.participants-logo .logo-subtitle {
  margin-top: 2px;
  gap: 6px;
  font-size: clamp(0.5rem, 0.7vw, 0.58rem);
  letter-spacing: 0.32em;
  text-indent: 0.32em;
}
.participants-logo .logo-subtitle::before,
.participants-logo .logo-subtitle::after {
  width: 12px;
}
.participants-footer {
  margin: 40px 24px 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}
.finalists-hero { margin-bottom: 28px; }
.finalists-hero h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, #fff 0%, #c7a8ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.finalists-hero p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}
.finalists-form { display: grid; gap: 24px; }
.finalist-section h2 {
  margin-bottom: 12px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.finalist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.finalist-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--ink);
  background: var(--surface);
}
.finalist-card:hover { border-color: var(--border-3); background: var(--surface-2); }
.finalist-card.selected {
  border-color: rgba(255, 27, 107, 0.5);
  background: var(--grad-soft-2);
}
.finalist-check {
  display: grid;
  grid-template-columns: 20px 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.finalist-check input { width: 18px; height: 18px; accent-color: var(--pink); }
.finalist-check strong { color: var(--ink); }
.finalist-check small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.position-field {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.position-field select {
  min-height: 38px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--ink);
  background-color: var(--surface-2);
  font-weight: 700;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a89cc4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
}

/* ============================================================
   PROFILE PAGE (/profile.html)
   ============================================================ */
.profile-page {
  background: linear-gradient(160deg, #0c0420 0%, #1a0d3a 45%, #240a4a 100%);
  min-height: 100vh;
}
.profile-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 110px 28px 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.profile-loading {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  padding: 60px 20px;
  font-size: 16px;
}
.profile-hero-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  padding: 28px 32px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 47, 146, 0.12), rgba(122, 53, 255, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}
.profile-hero-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}
.profile-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-letter {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; font-weight: 800; color: #fff; font-family: "Space Grotesk", sans-serif;
}
.profile-eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 6px;
}
.profile-you {
  background: linear-gradient(90deg, #ff2f92, #7a35ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.profile-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
  line-height: 1.1;
}
.profile-handle {
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 14px;
  font-size: 15px;
}
.profile-stats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.profile-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-stats strong {
  font-size: 22px;
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}
.profile-stats span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.profile-actions .btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 999px;
}
.is-copied { background: linear-gradient(90deg, #0fab78, #00a7c7) !important; color: #fff !important; }
.profile-tabs-wrap {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0;
}
.profile-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  overflow-x: auto;
}
.profile-contest-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 18px;
  border-radius: 12px 12px 0 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.profile-contest-tab:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.profile-contest-tab.active {
  background: linear-gradient(135deg, rgba(255, 47, 146, 0.18), rgba(122, 53, 255, 0.18));
  color: #fff;
  border-color: rgba(255, 47, 146, 0.4);
}
.profile-contest-tab-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  min-width: 22px;
  text-align: center;
}
.profile-contest-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px 28px;
}
.profile-contest-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.profile-contest-id {
  display: flex;
  gap: 14px;
  align-items: center;
}
.profile-contest-id h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
}
.profile-contest-id p {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}
.profile-flag {
  width: 32px !important;
  height: auto !important;
  max-width: none !important;
  aspect-ratio: 3 / 2;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  vertical-align: middle;
  display: inline-block !important;
  flex-shrink: 0;
}
.profile-flag-lg {
  width: 56px !important;
  height: auto !important;
  border-radius: 6px;
}
.profile-contest-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.status-active { background: rgba(15, 171, 120, 0.2); color: #4fd9a4; border: 1px solid rgba(15, 171, 120, 0.35); }
.status-announced { background: rgba(255, 47, 146, 0.18); color: #ff7eb6; border: 1px solid rgba(255, 47, 146, 0.35); }
.status-finished { background: rgba(122, 53, 255, 0.2); color: #b48bff; border: 1px solid rgba(122, 53, 255, 0.35); }
.status-archived { background: rgba(160, 160, 180, 0.18); color: rgba(255, 255, 255, 0.65); border: 1px solid rgba(160, 160, 180, 0.3); }
.profile-picks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.profile-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.profile-pick-icon { font-size: 20px; }
.profile-pick-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.5);
}
.profile-pick-country {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}
.profile-show {
  margin: 22px 0 0;
}
.profile-show h3 {
  margin: 0 0 12px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 700;
}
.profile-show-count {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}
.profile-empty {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  text-align: center;
  padding: 24px 0;
}
.profile-empty-sm {
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  font-style: italic;
  margin: 4px 0 0;
}
.profile-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.profile-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.profile-table th, .profile-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #fff;
}
.profile-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
}
.profile-table tbody tr:last-child td { border-bottom: none; }
.profile-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.profile-cell-flag {
  width: 56px;
  padding-left: 14px !important;
  padding-right: 4px !important;
}
.profile-cell-country small {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  margin-top: 2px;
}
.profile-cell-score {
  font-weight: 800;
  font-family: "Space Grotesk", sans-serif;
  background: linear-gradient(90deg, #ff2f92, #7a35ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 17px;
  width: 60px;
  text-align: center;
}
.profile-cell-place {
  font-weight: 800;
  font-family: "Space Grotesk", sans-serif;
  color: #fff;
  font-size: 17px;
  width: 50px;
  text-align: center;
}
.profile-cell-place-small {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  width: 80px;
  text-align: center;
}
.profile-row-correct {
  background: rgba(15, 171, 120, 0.12) !important;
}
.profile-row-correct .profile-cell-place {
  color: #4fd9a4;
}
.profile-edit {
  margin-top: 14px;
}
.profile-edit-head h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  margin: 0 0 6px;
  color: #fff;
}
.profile-edit-sub {
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 18px;
  font-size: 13px;
}
.profile-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.profile-edit-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 22px 24px;
}
.profile-edit-card h3 {
  margin: 0 0 16px;
  font-size: 16px;
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}
.profile-readonly-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}
.profile-readonly-list > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 10px;
}
.profile-readonly-list dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  margin: 0;
}
.profile-readonly-list dd {
  margin: 0;
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  word-break: break-all;
  text-align: right;
}
.profile-password-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-password-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-password-form label span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}
.profile-password-form input {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.profile-password-form input:focus {
  border-color: rgba(255, 47, 146, 0.55);
}
.profile-password-help {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
  line-height: 1.4;
}
.profile-password-form button {
  margin-top: 8px;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(90deg, #ff2f92, #7a35ff);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.profile-password-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 47, 146, 0.35);
}
.profile-password-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.profile-message {
  font-size: 13px;
  padding: 8px 0;
  min-height: 18px;
}
.profile-message.error { color: #ff7a8e; }
.profile-message.ok { color: #4fd9a4; }

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease;
}
.user-pill:hover { background: rgba(255, 255, 255, 0.12); }
.user-pill-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 13px;
}
.user-pill-logout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
  font-weight: 600;
}
.user-pill-logout:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }

.participant-name-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s;
}
.participant-name-link:hover { border-color: rgba(255, 47, 146, 0.6); }

.register-only[hidden] { display: none !important; }

@media (max-width: 720px) {
  .profile-shell { padding: 100px 16px 60px; }
  .profile-hero-card { grid-template-columns: 1fr; text-align: center; }
  .profile-hero-avatar { margin: 0 auto; }
  .profile-stats { justify-content: center; }
  .profile-actions { justify-content: center; }
  .profile-name { font-size: 28px; }
  .profile-contest-head { flex-direction: column; }
}

/* profile name-edit form */
.profile-name-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.profile-edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-edit-field > span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}
.profile-edit-field input {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.profile-edit-field input:focus { border-color: rgba(255, 47, 146, 0.55); }
.profile-edit-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}
.profile-name-form button {
  align-self: flex-start;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s ease;
}
.profile-name-form button:hover { background: rgba(255, 47, 146, 0.2); border-color: rgba(255, 47, 146, 0.4); }
.profile-edit-locked {
  margin: 14px 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.4;
}

/* ============================================================
   EUROFANS CATALOG (/participants.html)
   Reuses .profile-page background + topbar.
   ============================================================ */
.eurofans-shell {
  max-width: 1180px;
  gap: 22px;
}
.eurofans-hero {
  padding: 26px 30px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 47, 146, 0.12), rgba(122, 53, 255, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}
.eurofans-sub {
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 18px;
  font-size: 14px;
  max-width: 640px;
}
.eurofans-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 480px;
}
.eurofans-search-icon {
  position: absolute;
  left: 14px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  display: flex;
}
.eurofans-search input {
  width: 100%;
  padding: 13px 44px 13px 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.eurofans-search input::placeholder { color: rgba(255, 255, 255, 0.4); }
.eurofans-search input:focus {
  border-color: rgba(255, 47, 146, 0.5);
  background: rgba(0, 0, 0, 0.45);
}
.eurofans-clear {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.eurofans-clear:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.eurofans-count {
  margin: 12px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.eurofans-table-wrap {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
}
.eurofans-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.eurofans-table thead th {
  text-align: left;
  padding: 14px 18px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ef-col-avatar { width: 56px; }
.ef-col-stat { width: 110px; text-align: right !important; }
.ef-col-arrow { width: 36px; text-align: right !important; color: rgba(255, 255, 255, 0.3); }
.eurofans-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.12s ease;
}
.eurofans-table tbody tr:last-child { border-bottom: none; }
.eurofans-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(255, 47, 146, 0.08), rgba(122, 53, 255, 0.06));
}
.eurofans-table tbody tr:focus-visible {
  outline: 2px solid rgba(255, 47, 146, 0.5);
  outline-offset: -2px;
}
.eurofans-table tbody td {
  padding: 14px 18px;
  color: #fff;
  vertical-align: middle;
}
.ef-cell-avatar { padding-right: 0 !important; }
.ef-avatar-img, .ef-avatar-letter {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
}
.ef-avatar-letter {
  color: #fff;
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
}
.ef-cell-name { font-weight: 600; }
.ef-cell-link {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s ease;
}
.ef-cell-link:hover { border-color: rgba(255, 47, 146, 0.6); }
.ef-cell-login {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}
.ef-cell-stat {
  text-align: right;
  color: rgba(255, 255, 255, 0.75);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.ef-cell-arrow {
  text-align: right;
  color: rgba(255, 255, 255, 0.3);
  font-size: 22px;
  font-weight: 300;
}
.eurofans-table tbody tr:hover .ef-cell-arrow {
  color: #ff7eb6;
}
.ef-row-me { background: rgba(255, 47, 146, 0.08); }
.ef-row-me:hover { background: rgba(255, 47, 146, 0.14) !important; }
.ef-you-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2f92, #7a35ff);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  vertical-align: middle;
}
.eurofans-empty, .eurofans-loading {
  text-align: center;
  padding: 60px 20px !important;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

@media (max-width: 720px) {
  .eurofans-hero { padding: 22px; }
  .ef-col-since, .ef-cell-stat:last-of-type { display: none; }
  .eurofans-table thead th { padding: 12px 14px; }
  .eurofans-table tbody td { padding: 12px 14px; }
}
  .eurofans-table thead th { padding: 12px 14px; }
  .eurofans-table tbody td { padding: 12px 14px; }
}

/* User-panel: unified pill style on every page (matches profile-page) */
.user-panel {
  flex-wrap: wrap;
  row-gap: 6px;
  justify-content: flex-end;
}
.user-pill-lang {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.user-pill-lang:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}
.user-pill-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
/* Profile menu (dropdown) anchor — keep pill as its trigger but stay above background */
.profile-menu-wrap { position: relative; }
.profile-menu-wrap .user-pill { cursor: pointer; font-family: inherit; }
.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: linear-gradient(180deg, rgba(36, 12, 64, 0.98), rgba(20, 6, 40, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-menu[hidden] { display: none; }
.profile-menu a, .profile-menu button {
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  font-family: inherit;
}
.profile-menu a:hover, .profile-menu button:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ============================================================
   UNIFIED PILL DIMENSIONS — all pills in topbar same height (40px)
   Fixed circular avatar that doesn't get squished by flex.
   ============================================================ */
.user-pill,
.user-pill-logout,
.user-pill-lang,
.user-pill-ghost {
  height: 40px;
  box-sizing: border-box;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 600;
  white-space: nowrap;
}
.user-pill {
  padding: 0 16px 0 6px !important;
  gap: 10px;
  font-size: 13px;
}
.user-pill-logout,
.user-pill-lang {
  padding: 0 16px !important;
  font-size: 12px;
  margin-left: 0;
}
.user-pill-avatar {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
/* Inner span (initial letter) must fill the avatar so the colored disc looks round */
.user-pill-avatar > span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.user-pill-avatar > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.user-panel { gap: 10px; }

/* ============================================================
   PROFILE — Top 3 podium inside contest card
   ============================================================ */
.profile-top3 {
  margin: 22px 0 0;
}
.profile-top3-title {
  margin: 0 0 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 700;
}
.profile-top3-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.profile-top3-card {
  display: grid;
  grid-template-columns: 36px 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.profile-top3-card.place-1 {
  background: linear-gradient(135deg, rgba(255, 195, 0, 0.18), rgba(255, 47, 146, 0.12));
  border-color: rgba(255, 195, 0, 0.4);
}
.profile-top3-card.place-2 {
  background: linear-gradient(135deg, rgba(180, 180, 220, 0.16), rgba(122, 53, 255, 0.12));
  border-color: rgba(180, 180, 220, 0.32);
}
.profile-top3-card.place-3 {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.18), rgba(122, 53, 255, 0.1));
  border-color: rgba(205, 127, 50, 0.32);
}
.profile-top3-rank {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
}
.profile-top3-card.place-1 .profile-top3-rank {
  background: linear-gradient(135deg, #ffd84a, #ff8a00);
  color: #1a0d3a;
}
.profile-top3-card.place-2 .profile-top3-rank {
  background: linear-gradient(135deg, #e2e2ee, #9d9dc3);
  color: #1a0d3a;
}
.profile-top3-card.place-3 .profile-top3-rank {
  background: linear-gradient(135deg, #e0a06a, #a05823);
  color: #1a0d3a;
}
.profile-top3-flag {
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-top3-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-top3-meta strong {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-top3-meta small {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-top3-score {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: 24px;
  background: linear-gradient(135deg, #ff2f92, #7a35ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex-shrink: 0;
}

/* Align topbar inner content with card content on pages that have
   .profile-shell / .eurofans-shell (those add 28px of horizontal padding
   inside the 1180px container). Without this, the brand and the right-side
   pills sit ~28px past the visible card edges below. */
body.profile-page .site-topbar,
body.eurofans-page .site-topbar {
  padding-left: max(28px, calc((100vw - 1180px) / 2 + 28px)) !important;
  padding-right: max(28px, calc((100vw - 1180px) / 2 + 28px)) !important;
}

/* ============================================================
   HIDE-ON-SCROLL ANIMATION FOR TOPBAR
   When the user scrolls down, .topbar-hidden is added → slides up out
   of view. Scroll up → class removed → slides back down.
   ============================================================ */
.site-topbar {
  transition: transform 0.28s ease, opacity 0.2s ease;
}
.site-topbar.topbar-hidden {
  transform: translateY(-110%) !important;
  opacity: 0;
  pointer-events: none;
}
opbar.topbar-hidden {
  transform: translateY(-110%) !important;
  opacity: 0;
  pointer-events: none;
}

/* Highlight admin link in profile dropdown */
.admin-link-strong {
  background: linear-gradient(90deg, rgba(255, 47, 146, 0.18), rgba(122, 53, 255, 0.18)) !important;
  color: #fff !important;
  font-weight: 700 !important;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-link-strong:hover {
  background: linear-gradient(90deg, rgba(255, 47, 146, 0.32), rgba(122, 53, 255, 0.32)) !important;
}

/* Winner ranking — direct place picker via dropdown (replaces 25-button grid) */
.winner-place-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.winner-place-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}
.winner-place-select {
  padding: 12px 36px 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, rgba(255, 47, 146, 0.16), rgba(122, 53, 255, 0.16)),
              rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: "Space Grotesk", inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(135deg, rgba(255, 47, 146, 0.16), rgba(122, 53, 255, 0.16)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, right 12px center;
  background-size: auto, 14px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.winner-place-select:hover { border-color: rgba(255, 47, 146, 0.55); }
.winner-place-select:focus {
  border-color: rgba(255, 47, 146, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 47, 146, 0.18);
}
.winner-place-select option {
  background: #1a0d3a !important;
  color: #fff !important;
}
.winner-place-select option:disabled {
  color: rgba(255, 255, 255, 0.3) !important;
  background: #14082c !important;
}

/* Profile pick — editable variant (own profile only) */
.profile-pick-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.profile-pick-empty {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  font-weight: 400;
}
.profile-pick-select {
  margin-top: 6px;
  padding: 6px 26px 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 10px;
  max-width: 200px;
}
.profile-pick-select:focus,
.profile-pick-select:hover {
  border-color: rgba(255, 47, 146, 0.55);
}
.profile-pick-select option {
  background: #1a0d3a !important;
  color: #fff !important;
}

.profile-pick-select-error {
  border-color: #ff7a8e !important;
  box-shadow: 0 0 0 2px rgba(255, 122, 142, 0.3) !important;
}

/* ==========================================================================
   NEWS ARTICLE PAGE (/news.html?id=...)
   Two-column layout on desktop: thin sidebar (date/country/share) + main.
   Single column on mobile.
   ========================================================================== */
.news-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 110px 28px 80px;
}
.news-loading {
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  padding: 80px 20px;
}
.news-article {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  align-items: start;
}
.news-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px;
}
.news-side-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.news-side-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}
.news-side-value {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 600;
}
.news-side-country {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 47, 146, 0.16);
  border: 1px solid rgba(255, 47, 146, 0.35);
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  width: fit-content;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.news-side-flag {
  width: 22px;
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: 3px;
  object-fit: cover;
}
.news-share {
  display: flex;
  gap: 6px;
}
.news-share-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s;
}
.news-share-btn:hover { background: rgba(255, 47, 146, 0.3); }

.news-main { min-width: 0; }
.news-breadcrumb {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.news-breadcrumb a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
}
.news-breadcrumb a:hover { color: #fff; }
.news-breadcrumb-sep { opacity: 0.4; }
.news-breadcrumb-cur { color: rgba(255, 255, 255, 0.85); }
.news-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  margin: 0 0 22px;
}
.news-cover {
  margin: 0 0 26px;
}
.news-cover img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}
.news-cover figcaption {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 8px;
  font-style: italic;
}
.news-subtitle {
  font-size: 19px;
  line-height: 1.45;
  color: #ff7eb6;
  font-weight: 700;
  margin: 0 0 26px;
}
.news-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.news-block-paragraph {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
}
.news-block-paragraph strong { color: #fff; }
.news-block-paragraph em { color: #ff7eb6; font-style: italic; }
.news-block-image,
.news-block-video {
  margin: 6px 0;
}
.news-block-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
}
.news-block-image figcaption,
.news-block-video figcaption {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 8px;
  font-style: italic;
}
.news-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
.news-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.news-block-error {
  color: #ff7a8e;
  font-size: 13px;
  font-style: italic;
}
.news-not-found {
  text-align: center;
  padding: 80px 20px;
  color: rgba(255, 255, 255, 0.7);
}
.news-back-link {
  color: #ff7eb6;
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 880px) {
  .news-article {
    grid-template-columns: 1fr;
  }
  .news-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px 20px;
  }
  .news-title { font-size: 28px; }
}

/* ==========================================================================
   NEWS CARDS — main page carousel (replaces simple <ul> news list)
   ========================================================================== */
.news-card-deck {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  /* Generous padding lets the soft drop-shadow of each card extend fully
     instead of getting clipped at the container edge. */
  padding: 30px 14px 40px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 47, 146, 0.4) transparent;
}
.news-card-deck::-webkit-scrollbar { height: 8px; }
.news-card-deck::-webkit-scrollbar-thumb { background: rgba(255, 47, 146, 0.4); border-radius: 4px; }
.news-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
  position: relative;
  height: 460px;
  border-radius: 22px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: #1a0d3a;
  /* No box-shadow on the card itself — instead use a CSS drop-shadow on the
     wrapper which respects the rounded silhouette without rectangular edges. */
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.35));
  transition: transform 0.25s ease, filter 0.35s ease;
  display: block;
}
.news-card:hover {
  transform: translateY(-4px);
  filter: drop-shadow(0 12px 28px rgba(122, 53, 255, 0.32)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}
.news-card-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.news-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 35%, rgba(0, 0, 0, 0.85) 100%);
}
.news-card-flag {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a0d3a;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}
.news-card-flag img {
  width: 20px;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 3px;
}
.news-card-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 22px 24px;
  z-index: 2;
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.news-card-empty {
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  padding: 40px 12px;
  text-align: center;
  font-style: italic;
  width: 100%;
}
.news-card-nav {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}
.news-card-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.news-card-nav-btn:hover { background: rgba(255, 47, 146, 0.2); color: #fff; }
.news-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.news-section-head h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 48px;
  font-weight: 800;
  margin: 0;
  line-height: 1;
}
.news-section-head h2 .grad {
  background: linear-gradient(90deg, #ff2f92, #7a35ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.news-section-head .news-view-all {
  background: #fff;
  color: #1a0d3a;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}

.news-block-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.news-section-subhead {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  color: #ff7eb6;
  margin: 4px 0 0;
}

/* Language picker — dropdown with country flags (GB / RU) */
.lang-picker { position: relative; }
.lang-picker-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  padding: 0 12px !important;
  height: 40px;
  cursor: pointer;
  white-space: nowrap;
}
.lang-picker-flag {
  width: 18px !important;
  height: auto !important;
  aspect-ratio: 3 / 2;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}
.lang-picker-caret {
  font-size: 9px;
  opacity: 0.6;
  margin-left: 2px;
}
.lang-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: linear-gradient(180deg, rgba(36, 12, 64, 0.98), rgba(20, 6, 40, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-picker-menu[hidden] { display: none; }
.lang-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  color: #fff;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  font-family: inherit;
  width: 100%;
}
.lang-picker-option:hover { background: rgba(255, 255, 255, 0.06); }
.lang-picker-option.is-current {
  background: rgba(255, 47, 146, 0.15);
  color: #ff7eb6;
}

/* ============================================================
   FIX news screen on main page — no vertical scroll, solid bg,
   no left-side stage-glow leaking onto the cards.
   ============================================================ */
body:has(.screen-news.screen-active) .stage-glow {
  /* Hide only the bottom-left purple glow (the one that leaked onto the
     news card edges). Keep the right side magenta + top crimson glow. */
  background:
    radial-gradient(ellipse 80rem 70rem at 110% 50%, rgba(160, 36, 199, 0.36), transparent 90%),
    radial-gradient(circle 40rem at 50% -10%, rgba(255, 27, 107, 0.16), transparent 90%) !important;
}

/* Truly transparent so the body bg + stage-glow show through both the
   topbar area AND the news content — no horizontal seam where the screen
   starts. !important beats the earlier .screen-news background rule. */
.screen-news {
  background: transparent !important;
  min-height: 100vh;
  overflow: hidden; /* no vertical scroll on the news screen itself */
}
.screen-news .news-section {
  padding: 100px 28px 60px;
  max-width: 1180px;
  margin: 0 auto;
  background: transparent;
}
.screen-news .news-card-deck {
  /* allow horizontal swipe scroll, lock vertical */
  overflow-y: hidden;
  background: transparent;
}

/* =====================================================================
   Friends — profile section + eurofans table button
   ===================================================================== */
.profile-friends {
  margin: 36px auto;
  max-width: 1180px;
  padding: 0 28px;
}
.profile-friends-head { margin-bottom: 18px; }
.profile-friends-head h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px;
  background: linear-gradient(90deg, #ff2f92, #7a35ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.profile-friends-sub {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}
.profile-friends-empty {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
}
.profile-friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.friend-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  transition: background 0.15s, border-color 0.15s;
}
.friend-card:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 47, 146, 0.3); }
.friend-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  text-decoration: none;
}
.friend-card-avatar img,
.friend-card-avatar .profile-avatar-img,
.friend-card-avatar .profile-avatar-letter {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  border-radius: 50%;
}
.friend-card-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.friend-card-name {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friend-card-name:hover { color: #ff7eb6; }
.friend-card-handle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friend-card-remove {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: 1px solid rgba(255, 85, 102, 0.4);
  color: #ff8090;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.friend-card-remove:hover {
  background: rgba(255, 85, 102, 0.15);
  color: #fff;
}
.profile-friends-cta {
  margin-top: 18px;
  text-align: center;
}

/* Eurofans table: friend toggle button column */
.ef-col-friend, .ef-cell-friend {
  width: 1%;
  white-space: nowrap;
  padding-right: 8px !important;
}
.ef-friend-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(255, 47, 146, 0.12);
  color: #ff7eb6;
  border: 1px solid rgba(255, 47, 146, 0.4);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.ef-friend-btn:hover {
  background: rgba(255, 47, 146, 0.22);
  color: #fff;
}
.ef-friend-btn.is-friend {
  background: rgba(79, 209, 133, 0.12);
  color: #4fd185;
  border-color: rgba(79, 209, 133, 0.4);
}
.ef-friend-btn.is-friend:hover {
  background: rgba(255, 85, 102, 0.18);
  color: #ff8090;
  border-color: rgba(255, 85, 102, 0.5);
}
.ef-friend-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Vote filter (Все / Только друзья) — sits next to the sort pills */
.vote-filter-pills {
  display: inline-flex;
  gap: 6px;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.vote-filter-pills[hidden] { display: none !important; }
.vote-filter-pill {
  /* inherits .sort-pill — only add color when active in friends mode */
}
.vote-filter-pill[data-vote-filter="friends"].active {
  background: linear-gradient(90deg, rgba(79, 209, 133, 0.25), rgba(122, 53, 255, 0.25)) !important;
  border-color: rgba(79, 209, 133, 0.45) !important;
  color: #b8ffd1 !important;
}
@media (max-width: 720px) {
  .vote-filter-pills {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    width: 100%;
    margin-top: 8px;
  }
}

/* ============================================================
   MOBILE OPTIMIZATIONS (≤720px and ≤480px)
   ============================================================ */
@media (max-width: 720px) {
  /* Topbar: ужать брэнд и логотип, чтобы влезали аватар + лога */
  .site-topbar {
    padding: 8px 12px !important;
    gap: 6px;
  }
  .site-topbar .brand span:last-child { display: none; }   /* только сердечко */
  .site-logo { transform: scale(0.78); transform-origin: center; }
  .user-pill { padding: 0 8px !important; height: 36px; font-size: 12px; }
  .user-pill-avatar { width: 28px !important; height: 28px !important; }
  .user-pill-logout { font-size: 11px; padding: 0 10px; height: 36px; }
  .lang-picker-btn { padding: 0 8px !important; height: 36px; font-size: 12px; }
  .lang-picker-flag { width: 16px !important; }

  /* News carousel — карточки уже */
  .news-card { flex: 0 0 240px; height: 360px; }
  .news-card-title { font-size: 15px; padding: 14px 14px 16px; }
  .news-section-head h2 { font-size: 28px !important; }

  /* Профильный hero */
  .profile-hero-card {
    grid-template-columns: 1fr !important;
    text-align: center;
    padding: 24px 18px;
  }
  .profile-hero-avatar { margin: 0 auto 8px; }
  .profile-stats {
    justify-content: center;
    gap: 18px !important;
    flex-wrap: wrap;
  }
  .profile-stats > div { min-width: 70px; }
  .profile-stats strong { font-size: 22px; }
  .profile-stats span { font-size: 11px; }
  .profile-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .profile-actions .btn { font-size: 12px; padding: 8px 14px; }

  /* Hero на главной */
  .hero-grid h1 { font-size: 28px !important; }
  .hero-intro { font-size: 14px !important; }

  /* Таймер */
  .countdown-block { padding: 14px 12px; }
  .countdown-numbers { gap: 8px; }
  .countdown-numbers > div strong { font-size: 24px; }
  .countdown-numbers > div span { font-size: 10px; }

  /* Карточки стран в голосовании */
  .country-card { padding: 12px; }
  .country-summary { gap: 10px; }
  .country-summary .country-name { font-size: 14px; }
  .rating-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }
  .rating-grid label { font-size: 13px; padding: 6px 0; }

  /* Таблица еврофанов */
  .eurofans-table thead { display: none; }
  .eurofans-table tbody tr {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 10px;
    padding: 10px 12px;
    align-items: center;
  }
  .eurofans-table tbody td {
    padding: 0 !important;
    border: none !important;
  }
  .ef-cell-avatar { grid-row: span 2; }
  .ef-cell-name { font-size: 14px; }
  .ef-cell-login { font-size: 11px; color: rgba(255,255,255,0.55); grid-column: 2; }
  .ef-cell-stat:not(.ef-cell-stat:first-of-type) { display: none; }  /* прячем второй stat (member since) */
  .ef-cell-arrow { display: none; }
  .ef-friend-btn { font-size: 10px; padding: 5px 8px; }

  /* Friends в профиле */
  .profile-friends-grid {
    grid-template-columns: 1fr !important;
  }

  /* Админка */
  .admin-shell { padding: 12px !important; }
}

@media (max-width: 480px) {
  /* Ещё компактнее на телефонах */
  .site-topbar { padding: 6px 8px !important; }
  .site-logo { display: none; }    /* убираем средний логотип, оставляем брэнд + user pill */
  .user-pill span:nth-child(2) { max-width: 80px; text-overflow: ellipsis; overflow: hidden; }
  .user-pill-logout span { display: none; }

  .news-card { flex: 0 0 88vw; height: 320px; }
  .hero-grid h1 { font-size: 24px !important; }

  .profile-stats { gap: 12px !important; }
  .profile-stats strong { font-size: 18px; }

  .rating-grid { grid-template-columns: repeat(4, 1fr) !important; }
}
