/* ============================================================
   World Cup 2026 — Workplace Sweepstake Leaderboard
   Premium Dark-Mode Glassmorphism Design System
   ============================================================ */

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
  /* Background */
  --bg-gradient: linear-gradient(135deg, #0a0e1a 0%, #1a0a2e 50%, #0d1b2a 100%);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 24px;
  --glass-bg-hover: rgba(255, 255, 255, 0.07);

  /* Accent */
  --accent: #00d4ff;
  --accent-rgb: 0, 212, 255;
  --secondary: #7c3aed;
  --secondary-rgb: 124, 58, 237;

  /* Medals */
  --gold: #ffd700;
  --gold-dark: #b8960f;
  --silver: #c0c0c0;
  --silver-dark: #8a8a8a;
  --bronze: #cd7f32;
  --bronze-dark: #8b5a1b;

  /* Text */
  --text-primary: #e8eaed;
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-dimmed: rgba(255, 255, 255, 0.3);

  /* Semantic */
  --success: #10b981;
  --success-rgb: 16, 185, 129;
  --live: #ef4444;
  --live-rgb: 239, 68, 68;
  --warning: #f59e0b;

  /* Surface */
  --surface: rgba(255, 255, 255, 0.03);
  --surface-raised: rgba(255, 255, 255, 0.06);

  /* Layout */
  --container-max: 1200px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select {
  font-family: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ── Custom Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* ── Utility Classes ────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ── Animations / Keyframes ─────────────────────────────────── */
@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(80px, -60px) scale(1.1); }
  50%      { transform: translate(-40px, -120px) scale(0.95); }
  75%      { transform: translate(-80px, -30px) scale(1.05); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(-100px, 50px) scale(1.08); }
  50%      { transform: translate(60px, 100px) scale(0.92); }
  75%      { transform: translate(90px, -40px) scale(1.04); }
}

@keyframes float3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(70px, 80px) scale(1.12); }
  66%      { transform: translate(-90px, -50px) scale(0.9); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}

@keyframes pulseLive {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--live-rgb), 0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(var(--live-rgb), 0); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Background Orbs ────────────────────────────────────────── */
.bg-effects {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  will-change: transform;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -10%;
  left: -5%;
  animation: float1 25s ease-in-out infinite;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
  bottom: -10%;
  right: -5%;
  animation: float2 30s ease-in-out infinite;
}

.orb-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #a855f7 0%, var(--accent) 50%, transparent 70%);
  top: 40%;
  left: 50%;
  animation: float3 22s ease-in-out infinite;
}

/* ── Glass Card ─────────────────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.trophy-icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.4));
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.logo-text .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Live Indicator */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(var(--success-rgb), 0.12);
  border: 1px solid rgba(var(--success-rgb), 0.25);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.live-indicator.has-live {
  background: rgba(var(--live-rgb), 0.12);
  border-color: rgba(var(--live-rgb), 0.3);
  color: var(--live);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

.live-indicator.has-live .pulse-dot {
  background: var(--live);
}

.live-text {
  line-height: 1;
}

/* Admin Button */
.admin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: all 0.25s ease;
  background: var(--surface);
  border: 1px solid transparent;
}

.admin-btn:hover {
  color: var(--text-primary);
  background: var(--surface-raised);
  border-color: var(--glass-border);
}

/* Back Button */
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: all 0.25s ease;
  background: var(--surface);
  border: 1px solid transparent;
}

.back-btn:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.2);
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  padding: 2rem 0 4rem;
  min-height: calc(100vh - var(--header-height) - 60px);
}

/* ── Section Labels ─────────────────────────────────────────── */
.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ── Match Ticker ───────────────────────────────────────────── */
.ticker-section {
  margin-bottom: 2.5rem;
  animation: fadeIn 0.6s ease;
}

.ticker-wrapper {
  overflow-x: auto;
  margin: 0 -1.5rem;
  padding: 0 1.5rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.ticker-wrapper::-webkit-scrollbar {
  display: none;
}

.ticker-scroll {
  display: flex;
  gap: 0.75rem;
  padding: 0.25rem 0;
  width: max-content;
}

.ticker-match {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  white-space: nowrap;
  transition: all 0.25s ease;
  min-width: 220px;
  justify-content: center;
}

.ticker-match:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.ticker-match.is-live {
  border-color: rgba(var(--live-rgb), 0.3);
  background: rgba(var(--live-rgb), 0.06);
  animation: pulseLive 2s ease-in-out infinite;
}

.match-team {
  font-weight: 500;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.match-score {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  padding: 0.15rem 0.5rem;
  background: var(--surface-raised);
  border-radius: var(--radius-sm);
  min-width: 50px;
  text-align: center;
}

.ticker-match.is-live .match-score {
  color: var(--live);
  background: rgba(var(--live-rgb), 0.12);
}

.match-status-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.ticker-match.is-finished .match-status-badge {
  background: rgba(var(--success-rgb), 0.15);
  color: var(--success);
}

.ticker-match.is-live .match-status-badge {
  background: rgba(var(--live-rgb), 0.18);
  color: var(--live);
  animation: pulse 1.5s ease-in-out infinite;
}

.ticker-match.is-upcoming .match-status-badge {
  background: var(--surface-raised);
  color: var(--text-muted);
}

/* ── Leaderboard ────────────────────────────────────────────── */
.leaderboard-section {
  animation: fadeIn 0.5s ease;
}

.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.stats {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stats .stats-badge {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.72rem;
}

/* ── Loading State ──────────────────────────────────────────── */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  gap: 1.5rem;
}

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--surface-raised);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  gap: 1rem;
  text-align: center;
}

.empty-icon {
  font-size: 3.5rem;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 320px;
}

/* ── Leaderboard Grid ───────────────────────────────────────── */
.leaderboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .leaderboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .leaderboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Player Card ────────────────────────────────────────────── */
.player-card {
  position: relative;
  padding: 1.6rem 1.4rem 1.3rem;
  opacity: 0;
  animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  overflow: hidden;
}

.player-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(var(--accent-rgb), 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.player-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(var(--accent-rgb), 0.08), 0 0 0 1px rgba(var(--accent-rgb), 0.12);
}

.player-card:hover::before {
  opacity: 1;
}

/* Gold shimmer for rank 1 */
.player-card.rank-1-card {
  border-color: rgba(255, 215, 0, 0.2);
}

.player-card.rank-1-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 215, 0, 0.05),
    rgba(255, 215, 0, 0.08),
    rgba(255, 215, 0, 0.05),
    transparent
  );
  animation: shimmer 4s ease-in-out infinite;
  pointer-events: none;
}

.player-card.rank-1-card:hover {
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.1), 0 0 0 1px rgba(255, 215, 0, 0.2);
}

/* ── Rank Badge ─────────────────────────────────────────────── */
.rank-badge {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 0 0 var(--radius-md) 0;
  border-bottom-left-radius: 0;
  border-top-left-radius: var(--radius-lg);
  z-index: 2;
}

/* Keep the top-left aligned with the card's border-radius */
.rank-badge {
  border-radius: calc(var(--radius-lg) - 1px) 0 var(--radius-md) 0;
}

.rank-1 {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #1a1a00;
  box-shadow: 0 2px 12px rgba(255, 215, 0, 0.35);
}

.rank-2 {
  background: linear-gradient(135deg, var(--silver) 0%, var(--silver-dark) 100%);
  color: #1a1a1a;
  box-shadow: 0 2px 12px rgba(192, 192, 192, 0.25);
}

.rank-3 {
  background: linear-gradient(135deg, var(--bronze) 0%, var(--bronze-dark) 100%);
  color: #1a1000;
  box-shadow: 0 2px 12px rgba(205, 127, 50, 0.25);
}

.rank-default {
  background: var(--surface-raised);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  border-top: none;
  border-left: none;
}

/* ── Player Info ────────────────────────────────────────────── */
.player-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  padding-left: 2.2rem;
}

.player-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.3;
}

.player-points {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

.points-number {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.points-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Team Pills ─────────────────────────────────────────────── */
.player-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.team-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  background: var(--surface-raised);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.team-pill:hover {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.2);
}

.team-flag {
  font-size: 0.85rem;
  line-height: 1;
}

.team-name {
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.team-points {
  font-weight: 700;
  font-size: 0.65rem;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-full);
  line-height: 1.2;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-dimmed);
  font-size: 0.72rem;
  font-weight: 400;
  border-top: 1px solid var(--glass-border);
}

/* ================================================================
   ADMIN PAGE STYLES
   ================================================================ */

/* ── PIN Section ────────────────────────────────────────────── */
.pin-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-height) - 120px);
  padding: 2rem 0;
}

.pin-card {
  width: 100%;
  max-width: 360px;
  padding: 2.5rem 2rem;
  text-align: center;
  animation: scaleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.pin-card.shake {
  animation: shake 0.5s ease;
}

.pin-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), 0.3));
}

.pin-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.pin-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* PIN Dots */
.pin-display {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.4);
}

/* PIN Error */
.pin-error {
  color: var(--live);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 1rem;
  animation: fadeIn 0.3s ease;
}

/* Keypad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  max-width: 270px;
  margin: 0 auto;
}

.key-btn {
  height: 54px;
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  font-weight: 600;
  background: var(--surface-raised);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.key-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.key-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.12);
}

.key-clear {
  color: var(--text-muted);
  font-size: 1.4rem;
}

.key-submit {
  background: rgba(var(--success-rgb), 0.15);
  border-color: rgba(var(--success-rgb), 0.25);
  color: var(--success);
  font-size: 1.3rem;
}

.key-submit:hover {
  background: rgba(var(--success-rgb), 0.25);
}

/* ── Assignments Section ────────────────────────────────────── */
.assignments-section {
  animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.assignments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.assignments-actions {
  display: flex;
  gap: 0.75rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.btn-save {
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.25);
}

.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(var(--accent-rgb), 0.35);
}

.btn-save:active {
  transform: translateY(0);
}

.btn-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Assignments Grid ───────────────────────────────────────── */
.assignments-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .assignments-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .assignments-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Assignment Card ────────────────────────────────────────── */
.assignment-card {
  padding: 1.4rem;
  opacity: 0;
  animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.person-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.person-name::before {
  content: '👤';
  font-size: 1.1rem;
}

/* Assigned Teams */
.assigned-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  min-height: 32px;
}

.assigned-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.2rem 0.3rem 0.55rem;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 500;
  animation: scaleIn 0.2s ease;
}

.assigned-pill .pill-flag {
  font-size: 0.9rem;
}

.assigned-pill .pill-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-pill {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(var(--live-rgb), 0.15);
  color: var(--live);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  line-height: 1;
  padding: 0;
}

.remove-pill:hover {
  background: rgba(var(--live-rgb), 0.3);
}

/* Team Selector */
.team-selector {
  position: relative;
  margin-bottom: 0.75rem;
}

.search-input-wrapper {
  position: relative;
}

.team-search {
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.25s ease;
}

.team-search::placeholder {
  color: var(--text-dimmed);
}

.team-search:focus {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.04);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.08);
}

.team-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(15, 18, 32, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  z-index: 50;
  padding: 0.35rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.team-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
}

.team-option:hover {
  background: rgba(var(--accent-rgb), 0.1);
}

.team-option.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.team-option .option-flag {
  font-size: 1rem;
}

.team-option .option-assigned {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Team Count */
.team-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: right;
}

.team-count.full {
  color: var(--success);
}

/* ── Toast Notifications ────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 1rem);
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid;
  min-width: 280px;
  max-width: 420px;
  pointer-events: auto;
  animation: slideInRight 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.toast.toast-exit {
  animation: slideOutRight 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.toast-success {
  background: rgba(var(--success-rgb), 0.12);
  border-color: rgba(var(--success-rgb), 0.25);
  color: var(--success);
}

.toast-error {
  background: rgba(var(--live-rgb), 0.12);
  border-color: rgba(var(--live-rgb), 0.25);
  color: var(--live);
}

.toast-icon {
  font-size: 1.1rem;
}

/* ── Responsive Adjustments ─────────────────────────────────── */
@media (max-width: 639px) {
  :root {
    --header-height: 64px;
  }

  .trophy-icon {
    font-size: 2rem;
  }

  .logo-text h1 {
    font-size: 1.05rem;
  }

  .logo-text .subtitle {
    font-size: 0.65rem;
  }

  .main-content {
    padding: 1.5rem 0 3rem;
  }

  .container {
    padding: 0 1rem;
  }

  .player-card {
    padding: 1.3rem 1.1rem 1.1rem;
  }

  .player-name {
    font-size: 1.05rem;
  }

  .points-number {
    font-size: 1.5rem;
  }

  .pin-card {
    padding: 2rem 1.5rem;
    margin: 0 0.5rem;
  }

  .orb-1 { width: 350px; height: 350px; }
  .orb-2 { width: 300px; height: 300px; }
  .orb-3 { width: 280px; height: 280px; }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .player-card {
    padding: 1.4rem 1.2rem 1.2rem;
  }
}

/* ── Selection Color ────────────────────────────────────────── */
::selection {
  background: rgba(var(--accent-rgb), 0.25);
  color: #fff;
}

/* ── Focus Visible ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
