@import url('https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --fb-bg: #0a0a0b;
    --fb-bg-el: #141416;
    --fb-bg-card: #1a1a1d;
    --fb-line: rgba(255,255,255,0.07);
    --fb-line-strong: rgba(255,255,255,0.12);
    --fb-text: #f5f5f7;
    --fb-dim: rgba(245,245,247,0.62);
    --fb-faint: rgba(245,245,247,0.38);
    --fb-gold: #FFD46A;
    --fb-gold-deep: #C99A2E;
    --fb-green: #36D399;
    --fb-red: #ef4444;
}

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

body {
    margin: 0;
    padding: 0;
    background: var(--fb-bg);
    color: var(--fb-text);
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-display { font-family: 'Anton', 'Bebas Neue', 'Oswald', system-ui, sans-serif; }
.font-body { font-family: 'Inter', -apple-system, system-ui, sans-serif; }

/* Noise overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Animations */
@keyframes fbPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

@keyframes fbSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes fbFall {
    0%   { transform: translateY(-20px) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    100% { transform: translateY(900px) rotate(720deg); opacity: 0.7; }
}

@keyframes counterFlash {
    0% { color: var(--fb-green); transform: translateY(-2px); }
    100% { color: inherit; transform: translateY(0); }
}

.animate-pulse-live {
    animation: fbPulse 1.6s infinite;
}

.animate-slide-in {
    animation: fbSlideIn 0.4s ease;
}

.animate-slide-up {
    animation: fbSlideUp 0.5s ease;
}

.animate-fade-in {
    animation: fbFadeIn 0.3s ease;
}

.counter-flash {
    animation: counterFlash 0.7s ease;
}

/* Gold glow for top 3 */
.glow-gold {
    text-shadow: 0 0 14px rgba(255,212,106,0.4);
}
.glow-gold-strong {
    text-shadow: 0 0 30px rgba(255,212,106,0.4);
}

/* Card hover */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

/* Player row */
.player-row {
    transition: background 0.15s ease;
}
.player-row:hover {
    background: var(--fb-bg-el);
}

/* Gold gradient button */
.btn-gold {
    background: linear-gradient(180deg, var(--fb-gold), var(--fb-gold-deep)) !important;
    color: #0a0a0a !important;
    box-shadow: 0 10px 40px rgba(255,212,106,0.33), inset 0 1px 0 rgba(255,255,255,0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
}
.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 50px rgba(255,212,106,0.45), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-gold:active {
    transform: translateY(0);
}

/* Chip */
.chip {
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip-active {
    background: var(--fb-gold) !important;
    color: #0a0a0a !important;
    border-color: var(--fb-gold) !important;
}

/* Header blur */
.header-blur {
    background: rgba(10,10,11,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding-top: env(safe-area-inset-top);
}

/* Tab bar blur */
.tab-bar-blur {
    background: rgba(10,10,11,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Gradient fade at bottom */
.fade-bottom {
    background: linear-gradient(180deg, transparent, rgba(10,10,11,0.95) 30%);
}

/* Silhouette placeholder */
.silhouette {
    position: relative;
    overflow: hidden;
}
.silhouette svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Page transitions */
.page-enter {
    animation: fbFadeIn 0.25s ease;
}

/* Tabular numbers */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Rank change indicators */
.rank-up { color: var(--fb-green); }
.rank-down { color: var(--fb-red); }

/* Custom scrollbar hide for chip rows */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Vote modal backdrop */
.modal-backdrop {
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Confetti piece */
.confetti {
    position: absolute;
    animation: fbFall var(--dur, 3.5s) var(--delay, 0s) linear infinite;
    opacity: 0.8;
}
