/* ms-wc-styles.css — Shared visual polish for /matchscan/world-cup* pages
 * High-fidelity flag-icons (lipis/flag-icons CDN) rendered as glowing circular badges,
 * entrance animations, and small utility classes used by all 4 WC pages.
 * The page-level <style> blocks still own page-specific layout — this file is additive. */

/* ---------- FLAG GLOW SYSTEM ---------- */
.flag-glow {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.18), 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
    background: #0a0f1a;
    vertical-align: middle;
}
.flag-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%);
    pointer-events: none;
    z-index: 2;
}
.flag-glow .flag-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    /* slight desaturation prevents loud flags from competing with cyan accents */
    filter: saturate(1.05) contrast(1.04);
}
.flag-glow:hover {
    transform: scale(1.06);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.6), 0 0 20px rgba(0, 229, 255, 0.5);
}
/* size variants */
.flag-glow.sm { width: 22px; height: 22px; box-shadow: 0 0 0 1.5px rgba(0,229,255,0.18), 0 1px 4px rgba(0,0,0,0.4); }
.flag-glow.md { width: 32px; height: 32px; }
.flag-glow.lg { width: 44px; height: 44px; }
.flag-glow.xl { width: 64px; height: 64px; box-shadow: 0 0 0 2.5px rgba(0,229,255,0.22), 0 4px 14px rgba(0,0,0,0.5); }

/* state variants — set by parent containers via `.<state> .flag-glow` or directly */
.flag-glow.selected,
.team.selected .flag-glow,
.roster-slot.filled .flag-glow {
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.7), 0 0 18px rgba(0, 229, 255, 0.45);
}
.flag-glow.won,
.md-card .pick.won .flag-glow,
.flag-glow[data-state="won"] {
    box-shadow: 0 0 0 2px rgba(0, 255, 159, 0.7), 0 0 18px rgba(0, 255, 159, 0.45);
}
.flag-glow.lost,
.md-card .pick.lost .flag-glow,
.flag-glow[data-state="lost"] {
    box-shadow: 0 0 0 2px rgba(255, 77, 109, 0.65), 0 0 16px rgba(255, 77, 109, 0.4);
    filter: saturate(0.7);
}
.flag-glow.gold {
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.7), 0 0 18px rgba(255, 215, 0, 0.4);
}

/* ---------- ENTRANCE ANIMATIONS ---------- */
@keyframes ms-fade-up {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes ms-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
.ms-fade-up { animation: ms-fade-up 0.4s ease both; }
.ms-fade-in { animation: ms-fade-in 0.35s ease both; }

/* stagger helpers — apply via inline style="animation-delay: Xms" or these classes */
.ms-stagger > *      { animation: ms-fade-up 0.35s ease both; }
.ms-stagger > *:nth-child(1)  { animation-delay: 0ms; }
.ms-stagger > *:nth-child(2)  { animation-delay: 30ms; }
.ms-stagger > *:nth-child(3)  { animation-delay: 60ms; }
.ms-stagger > *:nth-child(4)  { animation-delay: 90ms; }
.ms-stagger > *:nth-child(5)  { animation-delay: 120ms; }
.ms-stagger > *:nth-child(6)  { animation-delay: 150ms; }
.ms-stagger > *:nth-child(7)  { animation-delay: 180ms; }
.ms-stagger > *:nth-child(8)  { animation-delay: 210ms; }
.ms-stagger > *:nth-child(9)  { animation-delay: 240ms; }
.ms-stagger > *:nth-child(10) { animation-delay: 270ms; }
.ms-stagger > *:nth-child(11) { animation-delay: 300ms; }
.ms-stagger > *:nth-child(12) { animation-delay: 330ms; }

@media (prefers-reduced-motion: reduce) {
    .ms-fade-up, .ms-fade-in, .ms-stagger > * { animation: none !important; }
    .flag-glow { transition: none; }
}

/* ---------- COUNTDOWN TIMER ---------- */
.ms-countdown {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--cyan, #00E5FF);
    letter-spacing: 0.5px;
}
.ms-countdown .colon {
    display: inline-block;
    animation: ms-colon-pulse 1s steps(2, end) infinite;
}
@keyframes ms-colon-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* ---------- DEMO MODE (anonymous /me dashboard) ---------- */
.demo-banner {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.10), rgba(0, 229, 255, 0.04));
    border: 1px solid #FFD700;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.demo-banner::before {
    content: 'DEMO';
    position: absolute;
    top: -10px;
    left: 16px;
    background: #FFD700;
    color: #0a0f1a;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 2px;
    padding: 3px 10px;
    border-radius: 4px;
}
.demo-banner-text { flex: 1; min-width: 220px; }
.demo-banner-title { color: #fff; font-weight: 700; margin-bottom: 4px; font-size: 15px; }
.demo-banner-sub { color: #9ca3af; font-size: 13px; }
.demo-banner .cta {
    padding: 10px 22px;
    background: linear-gradient(135deg, #00E5FF 0%, #00FF9F 100%);
    color: #0a0f1a;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    transition: transform 0.2s ease;
    border: none;
    cursor: pointer;
}
.demo-banner .cta:hover { transform: translateY(-2px); }

/* watermark on demo cards */
.demo-watermark {
    position: relative;
}
.demo-watermark::after {
    content: 'DEMO';
    position: absolute;
    top: 8px;
    right: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: rgba(255, 215, 0, 0.6);
    letter-spacing: 2px;
    pointer-events: none;
    z-index: 5;
}

/* ---------- CONSISTENT RADIUS / TRANSITION POLISH ---------- */
/* These classes are opt-in — apply where the page-level rules use harsher radii. */
.ms-radius-soft { border-radius: 14px; }
.ms-transition  { transition: all 0.2s ease; }

/* ---------- STICKY TOPBAR (picks page) ---------- */
.ms-sticky-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 229, 255, 0.12);
}

/* ---------- ACCESSIBLE FOCUS ---------- */
.team:focus-visible,
.md-card:focus-visible,
.group-chip:focus-visible {
    outline: 2px solid var(--cyan, #00E5FF);
    outline-offset: 2px;
}
