/* ============================================================
   JGDOTA x STAKE — Shared Stylesheet
   Design System: "The Obsidian Architect"
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Manrope:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

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

:root {
    --surface:                  #131315;
    --surface-dim:              #131315;
    --surface-container-lowest: #0e0e10;
    --surface-container-low:    #1c1b1d;
    --surface-container:        #201f22;
    --surface-container-highest:#353437;
    --surface-bright:           #39393b;
    --on-surface:               #e5e1e4;
    --on-surface-variant:       #becab9;
    --primary:                  #78dc77;
    --on-primary:               #00390a;
    --secondary:                #ffb0c8;
    --error:                    #ffb4ab;
    --outline-variant:          #3f4a3c;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--surface);
    color: var(--on-surface);
    font-family: 'Manrope', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--primary); color: var(--on-primary); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--surface-container-lowest); }
::-webkit-scrollbar-thumb { background: var(--surface-container-highest); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Material Symbols ── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    line-height: 1;
}

/* ── Glassmorphism Card ── */
.liquid-glass {
    background: rgba(53, 52, 55, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top:  0.5px solid rgba(255, 255, 255, 0.10);
    border-left: 0.5px solid rgba(255, 255, 255, 0.10);
    position: relative;
    overflow: hidden;
}

/* Film grain on glass surfaces */
.liquid-glass::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}
.liquid-glass > * { position: relative; z-index: 1; }

/* ── Bento Grid Card Base ── */
.bento-card {
    background: linear-gradient(to bottom, var(--surface-container-low), var(--surface-container-lowest));
    border-radius: 0.75rem;
}

/* ── Mesh Gradient Hero Background ── */
.mesh-gradient {
    background:
        radial-gradient(at 0%   0%,   rgba(120, 220, 119, 0.12) 0, transparent 55%),
        radial-gradient(at 100% 100%, rgba(120, 220, 119, 0.04) 0, transparent 55%);
}

/* ── Film Grain Overlay (full page) ── */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.025;
}

/* ── Primary CTA Button ── */
.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), brightness 0.2s ease;
    box-shadow: 0 0 15px rgba(120, 220, 119, 0.2);
}
.btn-primary:hover  { transform: scale(1.02); filter: brightness(1.1); }
.btn-primary:active { transform: scale(0.96); }

/* ── Ghost Border ── */
.ghost-border { border: 0.5px solid rgba(63, 74, 60, 0.15); }

/* ── Ambient Shadow for premium cards ── */
.ambient-shadow {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 15px rgba(120, 220, 119, 0.05);
}

/* ── Live Pulse Dot ── */
.live-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse-green 2s cubic-bezier(0.4,0,0.6,1) infinite;
    box-shadow: 0 0 6px rgba(120, 220, 119, 0.6);
}
@keyframes pulse-green {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(0.85); }
}

/* ── Countdown Timer ── */
.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 3.5rem;
}
.countdown-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: var(--primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.countdown-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(229, 225, 228, 0.4);
    margin-top: 0.25rem;
}
.countdown-sep {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    color: var(--primary);
    opacity: 0.4;
    align-self: flex-start;
    margin-top: 0.1rem;
    padding: 0 0.15rem;
}

/* ── Leaderboard Podium ── */
.podium-card {
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}
.podium-card:hover { transform: translateY(-3px); }

.podium-card.rank-1 {
    background: linear-gradient(135deg, rgba(120,220,119,0.12) 0%, rgba(30,28,32,0.9) 60%);
    box-shadow: 0 0 30px rgba(120,220,119,0.08), inset 0 0.5px 0 rgba(120,220,119,0.3);
}
.podium-card.rank-2 {
    background: linear-gradient(135deg, rgba(190,202,188,0.08) 0%, rgba(30,28,32,0.9) 60%);
    box-shadow: 0 0 20px rgba(190,202,188,0.04), inset 0 0.5px 0 rgba(255,255,255,0.08);
}
.podium-card.rank-3 {
    background: linear-gradient(135deg, rgba(190,202,188,0.05) 0%, rgba(30,28,32,0.9) 60%);
    box-shadow: 0 0 20px rgba(190,202,188,0.03), inset 0 0.5px 0 rgba(255,255,255,0.06);
}

.rank-badge {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}
.rank-badge.gold   { background: rgba(120,220,119,0.15); color: var(--primary); border: 0.5px solid rgba(120,220,119,0.3); }
.rank-badge.silver { background: rgba(190,202,188,0.1);  color: #becab9;         border: 0.5px solid rgba(190,202,188,0.2); }
.rank-badge.bronze { background: rgba(190,202,188,0.06); color: #9aa099;         border: 0.5px solid rgba(190,202,188,0.15); }

/* ── Leaderboard List Row ── */
.lb-row {
    display: grid;
    grid-template-columns: 2.5rem 1fr 1fr 1fr;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
    gap: 0.5rem;
}
.lb-row:nth-child(even) { background: rgba(28,27,29,0.5); }
.lb-row:hover           { background: rgba(255,255,255,0.04); }

/* ── Copy Code Toast ── */
#copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(2rem);
    background: rgba(53,52,55,0.9);
    backdrop-filter: blur(20px);
    border-top:  0.5px solid rgba(255,255,255,0.12);
    border-left: 0.5px solid rgba(255,255,255,0.12);
    color: var(--primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.65rem 1.25rem;
    border-radius: 9999px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: none;
    z-index: 9998;
}
#copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Nav Links ── */
.nav-link {
    color: rgba(229,225,228,0.4);
}
.nav-link:hover {
    color: var(--on-surface);
}
.nav-link-active, .nav-link.nav-link-active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2px;
}

/* ── Status Badge ── */
.status-badge {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
}
.status-verified { background: rgba(120,220,119,0.1);  color: var(--primary);   border: 0.5px solid rgba(120,220,119,0.25); }
.status-pending  { background: rgba(255,176,200,0.1);  color: var(--secondary); border: 0.5px solid rgba(255,176,200,0.25); }

/* ── Scroll Reveal ───────────────────────────────────────── */
.reveal, .reveal-scale {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.reveal       { transform: translateY(20px); }
.reveal-scale { transform: translateY(12px) scale(0.98); }
.reveal.revealed, .reveal-scale.revealed {
    opacity: 1;
    transform: none;
}

/* ── Infinite Grid Background ─────────────────────────────── */
.infinite-grid-base {
    pointer-events: none;
    background-image:
        linear-gradient(rgba(120,220,119,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120,220,119,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: grid-drift 12s linear infinite;
}

.infinite-grid-reveal {
    pointer-events: none;
    background-image:
        linear-gradient(rgba(120,220,119,0.55) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120,220,119,0.55) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: grid-drift 12s linear infinite;
    opacity: 0;
    -webkit-mask-image: radial-gradient(circle 300px at -999px -999px, black, transparent);
    mask-image: radial-gradient(circle 300px at -999px -999px, black, transparent);
    transition: opacity 0.25s ease;
}

@keyframes grid-drift {
    0%   { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* ── Hero Right Image ─────────────────────────────────────── */
.hero-img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 0 60px rgba(120,220,119,0.18)) drop-shadow(0 24px 48px rgba(0,0,0,0.45));
    animation: hero-float 6s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes hero-float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-10px); }
}

/* ── Podium Rank Medal Image ──────────────────────────────── */
.podium-rank-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 6px 18px rgba(0,0,0,0.5));
}
.podium-rank-img-1 { animation: hero-float 5s   ease-in-out infinite; animation-delay:  0.0s; }
.podium-rank-img-2 { animation: hero-float 5.5s ease-in-out infinite; animation-delay: -1.8s; }
.podium-rank-img-3 { animation: hero-float 6s   ease-in-out infinite; animation-delay: -3.5s; }

/* ── Leaderboard Toggle ───────────────────────────────────── */
.lb-toggle-wrap {
    position: relative;
    display: flex;
    background: rgba(255,255,255,0.03);
    border: 0.5px solid rgba(255,255,255,0.08);
    border-radius: 9999px;
    padding: 4px;
}
.lb-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: calc(50% - 4px);
    background: var(--primary);
    border-radius: 9999px;
    transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 2px 12px rgba(120,220,119,0.35);
    z-index: 0;
    pointer-events: none;
}
.lb-toggle-wrap.lb-second .lb-slider {
    transform: translateX(100%);
}
.lb-toggle-btn {
    position: relative;
    z-index: 1;
    border: none;
    background: transparent;
    cursor: pointer;
    color: rgba(229,225,228,0.40);
    border-radius: 9999px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.5rem 1.5rem;
    transition: color 0.2s ease;
    white-space: nowrap;
}
.lb-toggle-btn.lb-active {
    color: var(--on-primary);
    font-weight: 700;
}

/* ── Kick Stream ──────────────────────────────────────────── */
.kick-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 900px) {
    .kick-grid {
        grid-template-columns: 260px 1fr;
        align-items: stretch;
    }
}
.kick-stream-wrap {
    position: relative;
    padding-top: 56.25%;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--surface-container-lowest);
    border: 0.5px solid rgba(255,255,255,0.08);
    min-height: 240px;
}
.kick-offline-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-container-lowest);
    z-index: 10;
}
.kick-offline-inner {
    text-align: center;
    padding: 2rem;
}
.kick-visit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    border: 1px solid rgba(120,220,119,0.25);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    text-decoration: none;
    background: rgba(120,220,119,0.05);
    transition: background 0.2s;
}
.kick-visit-btn:hover { background: rgba(120,220,119,0.12); }
.kick-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(229,225,228,0.2);
    flex-shrink: 0;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}
.kick-live-dot.is-live {
    background: var(--primary);
    box-shadow: 0 0 6px rgba(120,220,119,0.7);
    animation: pulse-green 2s cubic-bezier(0.4,0,0.6,1) infinite;
}

/* ── Gifters Panel ── */
.kick-gifters-panel {
    display: flex;
    flex-direction: column;
    border-radius: 0.75rem;
    overflow: hidden;
    background: rgba(53,52,55,0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top:  0.5px solid rgba(255,255,255,0.10);
    border-left: 0.5px solid rgba(255,255,255,0.10);
    min-height: 320px;
    height: 100%;
}
.kick-gifters-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.kick-gifters-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(229,225,228,0.5);
    text-align: center;
    flex: 1;
}
.kick-nav-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    border: 0.5px solid rgba(255,255,255,0.08);
    border-radius: 0.375rem;
    color: rgba(229,225,228,0.3);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.kick-nav-btn:hover {
    border-color: rgba(120,220,119,0.35);
    color: var(--primary);
    background: rgba(120,220,119,0.06);
}
.kick-gifters-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0;
}
.kick-gifters-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
    gap: 0.5rem;
}
.kick-gifters-loading,
.kick-gifters-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    text-align: center;
    padding: 1rem;
}
.kick-gifters-list { list-style: none; margin: 0; padding: 0; }
.kick-gifter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.15s;
}
.kick-gifter-row:last-child { border-bottom: none; }
.kick-gifter-row:hover { background: rgba(120,220,119,0.03); }
.kick-gifter-rank {
    width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kick-gifter-name {
    flex: 1;
    min-width: 0;
    font-family: 'Manrope', sans-serif;
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kick-gifter-qty {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-family: 'Space Grotesk', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(120,220,119,0.65);
    flex-shrink: 0;
}

/* ── Preloader ────────────────────────────────────────────── */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}
#preloader.preloader-out {
    opacity: 0;
    visibility: hidden;
}
.preloader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
.preloader-grid {
    display: flex;
    gap: 6px;
    perspective: 900px;
}
.preloader-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(229,225,228,0.2);
}

/* ── Cube ── */
.preloader-cube {
    width: 46px;
    height: 46px;
    position: relative;
    transform-style: preserve-3d;
    animation: pl-cube 2.2s ease-in-out infinite;
}
.preloader-cube:nth-child(1) { animation-delay: 0.00s; }
.preloader-cube:nth-child(2) { animation-delay: 0.15s; }
.preloader-cube:nth-child(3) { animation-delay: 0.30s; }
.preloader-cube:nth-child(4) { animation-delay: 0.45s; }
.preloader-cube:nth-child(5) { animation-delay: 0.60s; }
.preloader-cube:nth-child(6) { animation-delay: 0.75s; }

/* ── Faces ── */
.preloader-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 0.5px solid rgba(120,220,119,0.12);
    background: var(--surface-container-low);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    color: rgba(229,225,228,0.25);
    animation: pl-face-bg 2.2s ease-in-out infinite, pl-edge 2.2s ease-in-out infinite;
}
.preloader-face-front  { transform: translateZ(23px);          animation: pl-face-bg 2.2s ease-in-out infinite, pl-face-glow 2.2s ease-in-out infinite, pl-edge 2.2s ease-in-out infinite; }
.preloader-face-back   { transform: rotateY(180deg) translateZ(23px); }
.preloader-face-right  { transform: rotateY( 90deg) translateZ(23px); }
.preloader-face-left   { transform: rotateY(-90deg) translateZ(23px); }
.preloader-face-top    { transform: rotateX( 90deg) translateZ(23px); }
.preloader-face-bottom { transform: rotateX(-90deg) translateZ(23px); }

/* ── Sync face delays with parent cube ── */
.preloader-cube:nth-child(1) .preloader-face { animation-delay: 0.00s; }
.preloader-cube:nth-child(2) .preloader-face { animation-delay: 0.15s; }
.preloader-cube:nth-child(3) .preloader-face { animation-delay: 0.30s; }
.preloader-cube:nth-child(4) .preloader-face { animation-delay: 0.45s; }
.preloader-cube:nth-child(5) .preloader-face { animation-delay: 0.60s; }
.preloader-cube:nth-child(6) .preloader-face { animation-delay: 0.75s; }

/* ── Keyframes ── */
@keyframes pl-cube {
    0%, 40%, 100% { transform: translateZ(-2px); }
    30%            { transform: translateZ(18px) translateY(-4px); }
}
@keyframes pl-face-bg {
    0%, 50%, 100% { background-color: var(--surface-container-low); }
    10%            { background-color: rgba(120,220,119,0.18); }
}
@keyframes pl-face-glow {
    0%, 50%, 100% { color: rgba(229,225,228,0.25); filter: none; }
    30%            { color: var(--primary); filter: drop-shadow(0 10px 18px rgba(120,220,119,0.65)); }
}
@keyframes pl-edge {
    0%, 40%, 100% {
        box-shadow: inset 0 0 2px 1px rgba(0,0,0,0.12),
                    inset 0 0 10px 1px rgba(255,255,255,0.03);
    }
    30% {
        box-shadow: 0 0 6px 1px rgba(120,220,119,0.35);
    }
}
