/* ═══════════════════════════════════════
   TOKENS
═══════════════════════════════════════ */
:root {
    --c-bg:           #080e1c;
    --c-card:         #0f1829;
    --c-card-border:  rgba(255,255,255,0.07);
    --c-row-a:        rgba(255,255,255,0.03);
    --c-row-b:        rgba(255,255,255,0.015);
    --c-text:         #e8edf5;
    --c-muted:        #4a5568;
    --c-team:         #63a8f5;
    --c-green:        #22c55e;
    --c-gold:         #f59e0b;
    --c-red:          #ef4444;
    --c-blue:         #3b82f6;
    --c-purple:       #a855f7;
    --arc-circumference: 213.6px;
    --r-card:         1.25rem;
    --r-btn:          0.75rem;
    --f-display:      'Bebas Neue', sans-serif;
    --f-body:         'Outfit', sans-serif;
}

/* ═══════════════════════════════════════
   RESET
═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; overscroll-behavior: none; }

body {
    height: 100%;
    overflow: hidden;
    font-family: var(--f-body);
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════
   BACKGROUND
═══════════════════════════════════════ */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}
.bg-orb--1 {
    width: 360px; height: 360px;
    top: -100px; left: -80px;
    background: radial-gradient(circle, rgba(30,60,120,0.55) 0%, transparent 70%);
}
.bg-orb--2 {
    width: 300px; height: 300px;
    bottom: -80px; right: -60px;
    background: radial-gradient(circle, rgba(20,80,60,0.35) 0%, transparent 70%);
}
.pitch-grid {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ═══════════════════════════════════════
   UTILITY
═══════════════════════════════════════ */
.hidden { display: none !important; }

/* ═══════════════════════════════════════
   CONFETTI CANVAS
═══════════════════════════════════════ */
#confetti-canvas {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 500;
}

/* ═══════════════════════════════════════
   NAME SCREEN
═══════════════════════════════════════ */
.name-screen {
    position: fixed; inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--c-bg);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.info-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: transparent;
    border: none;
    color: var(--c-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    padding: 4px; /* Increases clickable area */
}

.info-btn:hover {
    color: var(--c-text);
    transform: scale(1.1);
}

.name-screen.exit {
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
}

.name-card {
    position: relative;
    background: var(--c-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1.5rem;
    padding: 40px 32px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6);
    animation: nameCardIn 0.5s cubic-bezier(0.19,1,0.22,1) both;
}

@keyframes nameCardIn {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

@keyframes rollSideToSide {
    0%, 100% { transform: translateX(-80px) rotate(-60deg); }
    50%      { transform: translateX(80px) rotate(60deg); }
}

.name-logo { 
    font-size: 3rem; 
    margin-top: 12px; 
    margin-bottom: 12px; 
    display: inline-block; /* Crucial: keeps the rotation tight around the ball */
    animation: rollSideToSide 3s ease-in-out infinite; 
}

.name-title {
    font-family: var(--f-display);
    font-size: 3rem;
    letter-spacing: 0.06em;
    color: var(--c-text);
    line-height: 1;
    margin-bottom: 10px;
}

.name-sub {
    font-size: 0.875rem;
    color: var(--c-muted);
    line-height: 1.6;
    margin-bottom: 28px;
}

.name-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.name-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.75rem;
    color: var(--c-text);
    font-family: var(--f-body);
    font-size: 1rem;
    font-weight: 500;
    padding: 13px 16px;
    outline: none;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    caret-color: var(--c-blue);
}
.name-input::placeholder { color: var(--c-muted); }
.name-input:focus {
    border-color: rgba(59,130,246,0.5);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* ═══════════════════════════════════════
   WELCOME STATS BADGE
═══════════════════════════════════════ */
.welcome-stats {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.1); /* Subtle gold background */
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--c-gold);
    padding: 6px 12px;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-badge b {
    font-family: var(--f-display);
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    margin-left: 2px;
}

.start-btn {
    background: var(--c-blue);
    border: none;
    border-radius: 0.75rem;
    color: #fff;
    font-family: var(--f-body);
    font-size: 1rem;
    font-weight: 700;
    padding: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: 0.02em;
}
.start-btn:hover  { background: #2563eb; transform: translateY(-1px); }
.start-btn:active { transform: scale(0.98); }

/* ═══════════════════════════════════════
   GAME SHELL
═══════════════════════════════════════ */
.shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    padding:
        max(env(safe-area-inset-top), 10px)
        16px
        max(env(safe-area-inset-bottom), 16px);
    gap: 10px;
}

/* ═══════════════════════════════════════
   HUD
═══════════════════════════════════════ */
.hud {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    flex-shrink: 0;
    padding: 0 4px;
}
.hud-side { display: flex; }
.hud-side--left  { justify-content: flex-start; }
.hud-side--right { justify-content: flex-end; }

.hud-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    position: relative;
}
#stat-lives i { color: var(--c-red);  font-size: 1.15rem; }
#stat-hints i { color: var(--c-blue); font-size: 1.15rem; }

.hud-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

/* ── Arc timer ── */
.streak-wrap {
    position: relative;
    width: 72px; height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arc-timer {
    position: absolute; inset: 0;
    transform: rotate(-90deg) rotateX(-180deg) ;
    width: 100%; height: 100%;
}
.arc-track {
    fill: none;
    stroke: rgba(255,255,255,0.06);
    stroke-width: 4;
}
.arc-fill {
    fill: none;
    stroke: var(--c-green);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: var(--arc-circumference);
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.4s ease;
    filter: drop-shadow(0 0 4px var(--c-green));
}

.streak-num {
    font-family: var(--f-display);
    font-size: 2.6rem;
    line-height: 1;
    color: var(--c-text);
    position: relative; z-index: 1;
    transition: color 0.4s ease;
    will-change: transform;
}
.streak-num.m5  { color: var(--c-gold);   }
.streak-num.m10 { color: #ff6b35;         }
.streak-num.m20 { color: var(--c-purple); }

.streak-label {
    font-family: var(--f-display);
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    color: var(--c-muted);
    margin-top: 10px;
}

/* ═══════════════════════════════════════
   CARD FLIP SCENE
═══════════════════════════════════════ */
.card-flip-scene {
    flex: 1;
    min-height: 0;
    perspective: 1200px;
}

.card-flipper {
    width: 100%; height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-flipper.flipping {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute; inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-back {
    transform: rotateY(180deg);
}

.card-back-inner {
    width: 100%; height: 100%;
    background: var(--c-card);
    border: 1px solid var(--c-card-border);
    border-radius: var(--r-card);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-back-logo { font-size: 3rem; opacity: 0.3; }

/* ═══════════════════════════════════════
   PLAYER CARD
═══════════════════════════════════════ */
.card {
    background: var(--c-card);
    border: 1px solid var(--c-card-border);
    border-radius: var(--r-card);
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 14px;
    gap: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative; /* for overlays */
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.card.card--urgent {
    border-color: rgba(239,68,68,0.4);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 24px rgba(239,68,68,0.12);
    animation: urgentPulse 0.8s infinite alternate ease-in-out;
}

@keyframes urgentPulse {
    from {
        border-color: rgba(239, 68, 68, 0.3);
        box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 16px rgba(239, 68, 68, 0.1);
    }
    to {
        border-color: rgba(239, 68, 68, 0.8);
        box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 32px rgba(239, 68, 68, 0.35);
    }
}

.card-label {
    font-family: var(--f-display);
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    color: var(--c-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Answer overlays ── */
.answer-overlay {
    position: absolute; inset: 0;
    border-radius: var(--r-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    -webkit-backdrop-filter: blur(2px); /* Added for iOS */
    backdrop-filter: blur(2px);
}

.answer-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.correct-overlay { background: rgba(22, 163, 74, 0.88); }
.wrong-overlay   { background: rgba(185, 28, 28, 0.88); }

.overlay-icon {
    font-size: 3.5rem;
    color: #fff;
    animation: overlayIconBounce 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes overlayIconBounce {
    from { transform: scale(0.3); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.overlay-name {
    font-family: var(--f-display);
    font-size: 1.8rem;
    letter-spacing: 0.06em;
    color: #fff;
    text-align: center;
    padding: 0 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: overlayNameIn 0.35s 0.1s ease both;
}

@keyframes overlayNameIn {
    from { transform: translateY(10px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

/* ═══════════════════════════════════════
   CAREER LIST
═══════════════════════════════════════ */
.career-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.career-list::-webkit-scrollbar       { width: 3px; }
.career-list::-webkit-scrollbar-track { background: transparent; }
.career-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 9px; }

.career-empty {
    color: var(--c-muted);
    text-align: center;
    padding: 24px 0;
    font-size: 0.875rem;
}

.career-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--c-row-a);
    gap: 8px;
    animation: rowIn 0.28s ease both;
}
.career-row:nth-child(even) { background: var(--c-row-b); }

@keyframes rowIn {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: none; }
}

.career-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.career-years {
    font-size: 0.7rem;
    color: var(--c-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.career-team {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--c-team);
    /* Remove nowrap and ellipsis properties, allow wrapping to new line */
    white-space: normal; 
    word-wrap: break-word;
    line-height: 1.2; 
}
.career-loan {
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: rgba(100,116,139,0.2);
    color: #64748b;
    border-radius: 4px;
    padding: 1px 5px;
    flex-shrink: 0;
}
.career-stats {
    font-size: 0.72rem;
    color: var(--c-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.career-stats b { color: var(--c-text); font-weight: 600; }

/* ═══════════════════════════════════════
   HINTS GRID
═══════════════════════════════════════ */
.hints-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex-shrink: 0;
}

.hint-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--r-btn);
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--c-muted);
    font-family: var(--f-body);
    font-size: 0.775rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
    text-align: left;
    width: 100%;
}
.hint-btn .hint-emoji { font-size: 0.95rem; flex-shrink: 0; }
.hint-btn .hint-lock  { margin-left: auto; font-size: 0.72rem; opacity: 0.3; flex-shrink: 0; }

.hint-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.16);
    color: var(--c-text);
    transform: translateY(-1px);
}
.hint-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.hint-btn.revealed {
    background: rgba(34,197,94,0.1);
    border-color: rgba(34,197,94,0.3);
    color: #4ade80;
}

.skip-btn {
    background: rgba(245,158,11,0.06);
    border-color: rgba(245,158,11,0.18);
    color: var(--c-gold);
}
.skip-btn:hover:not(:disabled) {
    background: rgba(245,158,11,0.13);
    border-color: rgba(245,158,11,0.35);
    color: var(--c-gold);
}
.skip-cost {
    margin-left: auto;
    font-size: 0.65rem;
    opacity: 0.55;
}

/* ═══════════════════════════════════════
   GUESS AREA
═══════════════════════════════════════ */
.guess-area {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    /* breathing room at bottom */
    margin-bottom: 4px;
}

/* Autocomplete — upward */
.autocomplete-list {
    list-style: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0; right: 0;
    background: #131f33;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--r-card);
    overflow: hidden;
    max-height: 224px;
    overflow-y: auto;
    z-index: 50;
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
}
.autocomplete-list.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.autocomplete-item {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--c-text);
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(59,130,246,0.15);
    color: #93c5fd;
}
.autocomplete-item .ac-icon { color: var(--c-muted); font-size: 0.85rem; flex-shrink: 0; }
.autocomplete-item mark { background: none; color: var(--c-blue); font-weight: 700; }

.guess-row { display: flex; gap: 8px; }

.guess-input {
    flex: 1;
    background: var(--c-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--r-btn);
    color: var(--c-text);
    font-family: var(--f-body);
    font-size: 1rem;
    font-weight: 500;
    padding: 13px 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    caret-color: var(--c-blue);
}
.guess-input::placeholder { color: var(--c-muted); }
.guess-input:focus {
    border-color: rgba(59,130,246,0.5);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.guess-input:disabled { opacity: 0.35; cursor: not-allowed; }

.guess-btn {
    background: var(--c-blue);
    border: none;
    border-radius: var(--r-btn);
    color: #fff;
    width: 52px;
    flex-shrink: 0;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}
.guess-btn:hover:not(:disabled)  { background: #2563eb; transform: scale(1.04); }
.guess-btn:active:not(:disabled) { transform: scale(0.97); }
.guess-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

/* ═══════════════════════════════════════
   FLOATING –1 INDICATOR
═══════════════════════════════════════ */
.float-minus, .float-minus-hint {
    position: absolute;
    top: 100%;
    left: 50%;
    margin-top: 4px;
    transform: translateX(-50%) translateY(0);
    font-size: 0.95rem;
    font-weight: 700;
    z-index: 400;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.float-minus { color: var(--c-red); }
.float-minus-hint { color: var(--c-blue); }

.float-minus.animate, .float-minus-hint.animate {
    animation: dropDownFade 1s ease forwards;
}

@keyframes dropDownFade {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(24px); }
}

/* ═══════════════════════════════════════
   MILESTONE TOAST
═══════════════════════════════════════ */
/* style.css */
.milestone-toast {
    position: fixed;
    top: 25%; /* Moved up from 50% to sit nicely between the HUD and the card */
    left: 50%;
    transform: translateX(-50%) scale(0.8); /* Removed the Y-axis translation */
    background: rgba(15,24,41,0.95);
    border: 1.5px solid var(--c-gold);
    border-radius: 1rem;
    padding: 16px 32px;
    font-family: var(--f-display);
    font-size: 2rem;
    letter-spacing: 0.06em;
    color: var(--c-gold);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    box-shadow: 0 0 60px rgba(245,158,11,0.25);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.milestone-toast.show {
    opacity: 1;
    transform: translateX(-50%) scale(1); /* Removed the Y-axis translation */
}

/* ═══════════════════════════════════════
   MODALS (Game Over & Rules)
═══════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    z-index: 600;
    display: flex;
    align-items: center; 
    justify-content: center;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 24px; 
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #111c2e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1.5rem; 
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 430px;
    text-align: center;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.19,1,0.22,1);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.modal-overlay.open .modal-card {
    transform: translateY(0) scale(1);
}

.modal-emoji { font-size: 2.8rem; }

.modal-title {
    font-family: var(--f-display);
    font-size: 2.2rem;
    letter-spacing: 0.06em;
    color: var(--c-text);
}

.modal-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.modal-actions .action-btn {
    flex: 1; /* Makes both buttons exactly the same width */
}

.modal-sub {
    font-size: 0.9rem;
    color: var(--c-muted);
}
.modal-player-name {
    color: var(--c-text);
    font-weight: 700;
    margin-right: 4px;
}

.modal-score-block {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}
.modal-score-num {
    font-family: var(--f-display);
    font-size: 5rem;
    line-height: 1;
    color: var(--c-gold);
}
.modal-score-label {
    font-family: var(--f-display);
    font-size: 1.4rem;
    color: var(--c-muted);
    letter-spacing: 0.1em;
}

.save-score-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.save-score-form input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.75rem;
    color: var(--c-text);
    font-family: var(--f-body);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 12px 16px;
    outline: none;
    text-align: center;
    transition: border-color 0.2s;
    caret-color: var(--c-blue);
}
.save-score-form input::placeholder { color: var(--c-muted); }
.save-score-form input:focus { border-color: rgba(59,130,246,0.5); }

.action-btn {
    width: 100%;
    border: none;
    border-radius: 0.75rem;
    font-family: var(--f-body);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, transform 0.1s, opacity 0.2s;
    letter-spacing: 0.02em;
}
.action-btn:hover  { transform: translateY(-1px); }
.action-btn:active { transform: scale(0.98); }
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.action-btn.primary {
    background: var(--c-blue);
    color: #fff;
}
.action-btn.primary:hover { background: #2563eb; }

.action-btn.secondary {
    background: rgba(255,255,255,0.06);
    color: var(--c-muted);
    border: 1px solid rgba(255,255,255,0.08);
}
.action-btn.secondary:hover { background: rgba(255,255,255,0.1); color: var(--c-text); }

/* ═══════════════════════════════════════
   ANIMATIONS (JS-triggered)
═══════════════════════════════════════ */
.shake { animation: shake 0.36s ease; }
@keyframes shake {
    0%,100% { transform: translate3d(0, 0, 0); }
    20%,60%  { transform: translate3d(-7px, 0, 0); }
    40%,80%  { transform: translate3d(7px, 0, 0); }
}

.lost-life { animation: lostLife 0.4s ease; }
@keyframes lostLife {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.55); }
}

.streak-bump { animation: streakBump 0.3s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes streakBump {
    0%,100% { transform: scale(1); }
    55%     { transform: scale(1.3); }
}

/* Milestone bg flash */
@keyframes bgFlash {
    0%   { background: var(--c-bg); }
    30%  { background: #1a1200; }
    100% { background: var(--c-bg); }
}
body.milestone-flash { animation: bgFlash 0.8s ease; }

/* ═══════════════════════════════════════
   SKELETON LOADING UI
═══════════════════════════════════════ */
.skeleton-row {
    pointer-events: none;
}

.skeleton-box {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    animation: skeletonPulse 1.2s infinite ease-in-out;
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1;   }
}

.skeleton-years { width: 45px; height: 12px; }
.skeleton-team  { height: 14px; }
.skeleton-stats { width: 55px; height: 12px; margin-left: auto; }

/* Rules Modal specific styling */
.rules-card {
    text-align: left;
    position: relative;
    padding-top: 40px; 
    max-height: 90dvh; /* Prevents the modal from exceeding the screen height */
}

.close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: transparent;
    border: none;
    color: var(--c-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--c-text);
}

.rules-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
    padding: 0;
    color: var(--c-text);
    font-size: 0.95rem;
    line-height: 1.5;
    
    /* Scrolling properties */
    overflow-y: auto;
    flex: 1;           /* Allows list to fill remaining modal space */
    min-height: 0;     /* Required for flexbox scrolling to work */
    padding-right: 4px; /* Small buffer so text doesn't touch the scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* Webkit scrollbar styling for the rules list */
.rules-list::-webkit-scrollbar { 
    width: 4px; 
}
.rules-list::-webkit-scrollbar-track { 
    background: transparent; 
}
.rules-list::-webkit-scrollbar-thumb { 
    background: rgba(255,255,255,0.1); 
    border-radius: 4px; 
}

.rules-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rules-list span {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1.1;
}

.rules-list b {
    color: var(--c-blue);
    margin-right: 4px;
    font-weight: 700;
}

/* ═══════════════════════════════════════
   STREAK SUMMARY GRID
═══════════════════════════════════════ */
.streak-summary-wrap {
    width: 100%;
    margin-top: 4px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.summary-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    width: 80%;
    margin: 0 auto;
}

.summary-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-muted);
    font-weight: 700;
    margin-bottom: -6px;
}

.summary-grid {
    display: grid;
    /* Auto-fits as many 45px circles as possible */
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 10px;
    max-height: 120px; /* Forces scrolling on massive streaks */
    overflow-y: auto;
    padding: 0 4px;
    scrollbar-width: none; /* Hides scrollbar for clean look */
}
.summary-grid::-webkit-scrollbar { display: none; }

.summary-player {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--c-card);
    border: 2px solid rgba(255,255,255,0.1);
    object-fit: cover;
    transition: transform 0.2s, border-color 0.2s;
}

.summary-player:hover {
    transform: scale(1.15);
    border-color: var(--c-gold);
    z-index: 2;
}

.summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 80px;
}

.summary-player-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.15);
}

.summary-player-name {
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    color: #fff;
    line-height: 1.2;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-player-nation {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.5);
    text-align: center;
}

.lb-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}

.lb-row--me {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.25);
}

.lb-rank {
    width: 28px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.lb-rank-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--c-muted);
}

.lb-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--c-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-score {
    font-family: var(--f-display);
    font-size: 1.4rem;
    color: var(--c-gold);
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.leaderboard-btn {
    position: absolute;
    top: 24px;
    left: 24px;
    background: transparent;
    border: none;
    color: var(--c-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    padding: 4px; /* Increases clickable area */
}

.leaderboard-btn:hover {
    color: var(--c-text);
    transform: scale(1.1);
}

.mute-btn-home {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    color: var(--c-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s, transform 0.2s;
}

.mute-btn-home:hover {
    color: var(--c-text);
    transform: translateX(-50%) scale(1.1);
}