/* =========================================
   WASTELAND WHEEL OF FORTUNE — Lottery Tracker
   CapStash Network DApp
   ========================================= */

/* === CSS VARIABLES (Shared with main site) === */
:root {
    --pip-green: #00ff41;
    --pip-green-dim: #00cc33;
    --pip-green-dark: #00872b;
    --pip-green-glow: rgba(0, 255, 65, 0.15);
    --pip-green-glow-strong: rgba(0, 255, 65, 0.35);
    --amber: #ffb000;
    --amber-dim: #cc8d00;
    --amber-glow: rgba(255, 176, 0, 0.15);
    --red-alert: #ff2d2d;
    --red-glow: rgba(255, 45, 45, 0.2);
    --gold: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.2);

    --bg-darkest: #050505;
    --bg-dark: #0a0a0a;
    --bg-card: #0d0d0d;
    --bg-card-hover: #111111;
    --bg-terminal: #060a06;
    --bg-surface: rgba(0, 255, 65, 0.03);

    --text-primary: #00ff41;
    --text-secondary: #00cc33;
    --text-dim: #007a1e;
    --text-muted: #004d13;
    --text-white: #e0e0e0;

    --border-green: rgba(0, 255, 65, 0.2);
    --border-green-strong: rgba(0, 255, 65, 0.4);
    --border-amber: rgba(255, 176, 0, 0.3);

    --font-mono: 'Share Tech Mono', 'Courier New', monospace;
    --font-display: 'Orbitron', sans-serif;
    --font-typewriter: 'Special Elite', 'Courier New', monospace;

    --section-padding: 100px 0;
    --container-max: 1200px;
    --container-padding: 0 24px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s ease;
}

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--pip-green-dark) var(--bg-dark);
}

body {
    font-family: var(--font-mono);
    background: var(--bg-darkest);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--pip-green);
    color: var(--bg-darkest);
}

a {
    color: var(--pip-green);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--amber);
}

/* === CRT EFFECTS === */
.crt-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.15) 100%);
}

.scanlines {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px, transparent 2px,
        rgba(0, 0, 0, 0.06) 2px, rgba(0, 0, 0, 0.06) 4px
    );
    animation: scanlineFlicker 8s linear infinite;
}

.vignette {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9997;
    box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.7);
}

@keyframes scanlineFlicker {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.55; }
    93% { opacity: 0.5; }
    94% { opacity: 0.8; }
    95% { opacity: 0.5; }
}

/* === PARTICLE CANVAS === */
.particle-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* === NAVIGATION === */
.nav-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-green);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    padding: 6px 12px;
    border: 1px solid var(--border-green);
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.nav-back:hover {
    color: var(--pip-green);
    background: var(--pip-green-glow);
    border-color: var(--pip-green);
}

.back-arrow {
    font-size: 1.1rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.4rem;
    animation: slotSpin 3s ease-in-out infinite;
}

@keyframes slotSpin {
    0%, 85%, 100% { transform: rotate(0deg); }
    90% { transform: rotate(360deg); }
}

.logo-text {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--pip-green);
    text-shadow: 0 0 15px var(--pip-green-glow-strong);
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--text-dim);
}

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

.status-dot.connected {
    background: var(--pip-green);
    box-shadow: 0 0 8px var(--pip-green);
}

.status-dot.error {
    background: var(--red-alert);
    box-shadow: 0 0 8px var(--red-alert);
}

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

/* === HERO LOTTERY === */
.hero-lottery {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px 60px;
    position: relative;
    z-index: 1;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(255, 215, 0, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 255, 65, 0.03) 0%, transparent 50%),
        var(--bg-darkest);
}

.hero-content {
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.lottery-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: var(--gold-glow);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 30px;
    font-size: 0.65rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 32px;
    animation: badgeGlow 4s ease-in-out infinite;
}

@keyframes badgeGlow {
    0%, 100% { border-color: rgba(255, 215, 0, 0.3); box-shadow: 0 0 15px rgba(255, 215, 0, 0.05); }
    50% { border-color: rgba(255, 215, 0, 0.6); box-shadow: 0 0 30px rgba(255, 215, 0, 0.1); }
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1;
}

.title-main {
    display: block;
    font-size: clamp(2rem, 6vw, 4rem);
    letter-spacing: 8px;
    color: var(--pip-green);
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.4), 0 0 60px rgba(0, 255, 65, 0.15);
}

.title-sub {
    display: block;
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    letter-spacing: 12px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--amber) 50%, var(--gold) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShimmer 4s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.3));
}

@keyframes goldShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px;
    line-height: 1.8;
}

.hl-amber { color: var(--amber); font-weight: bold; text-shadow: 0 0 10px rgba(255, 176, 0, 0.4); }
.hl-green { color: var(--pip-green); font-weight: bold; text-shadow: 0 0 10px rgba(0, 255, 65, 0.4); }

/* === COUNTDOWN RING === */
.countdown-container {
    display: flex;
    justify-content: center;
    margin-bottom: 48px;
}

.countdown-ring {
    position: relative;
    width: 260px;
    height: 260px;
}

.ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(0, 255, 65, 0.08);
    stroke-width: 6;
}

.ring-progress {
    fill: none;
    stroke: var(--gold);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 1s ease-out;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

.countdown-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.countdown-label {
    font-size: 0.6rem;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.countdown-value {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 60px rgba(255, 215, 0, 0.2);
    line-height: 1;
    margin-bottom: 8px;
    min-width: 120px;
}

.countdown-est {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 1px;
}

/* Lottery hit animation */
.countdown-ring.lottery-hit {
    animation: lotteryFlash 2s ease-out;
}

@keyframes lotteryFlash {
    0% { filter: brightness(1); }
    10% { filter: brightness(3) drop-shadow(0 0 40px var(--gold)); }
    30% { filter: brightness(2) drop-shadow(0 0 30px var(--gold)); }
    100% { filter: brightness(1); }
}

/* === CURRENT INFO GRID === */
.current-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.info-cell {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-green);
    border-radius: 6px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all var(--transition-normal);
}

.info-cell:hover {
    border-color: var(--border-green-strong);
    background: rgba(0, 255, 65, 0.03);
    transform: translateY(-2px);
}

.info-label {
    font-size: 0.55rem;
    letter-spacing: 2px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.info-value {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* === SECTIONS === */
.section {
    padding: var(--section-padding);
    position: relative;
    z-index: 1;
}

.section::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 60%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-green), transparent);
}

.section-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--container-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--pip-green);
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.section-icon {
    font-size: 1.5rem;
}

.section-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    max-width: 500px;
    margin: 0 auto;
}

/* === WINNERS TABLE === */
.winners-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-green);
    border-radius: 8px;
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 60px 100px 1fr 120px 120px;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(0, 255, 65, 0.05);
    border-bottom: 1px solid var(--border-green);
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.table-body {
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--pip-green-dark) var(--bg-dark);
}

.table-row {
    display: grid;
    grid-template-columns: 60px 100px 1fr 120px 120px;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 255, 65, 0.06);
    font-size: 0.8rem;
    transition: background var(--transition-fast);
    align-items: center;
}

.table-row:hover {
    background: rgba(0, 255, 65, 0.03);
}

.table-row:last-child {
    border-bottom: none;
}

.row-rank {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--amber);
    font-size: 0.75rem;
}

.row-rank.gold { color: var(--gold); text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
.row-rank.silver { color: #c0c0c0; text-shadow: 0 0 10px rgba(192, 192, 192, 0.3); }
.row-rank.bronze { color: #cd7f32; text-shadow: 0 0 10px rgba(205, 127, 50, 0.3); }

.row-block {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.row-address {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.row-address:hover {
    color: var(--pip-green);
}

.row-reward {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--gold);
    font-size: 0.8rem;
}

.row-time {
    color: var(--text-dim);
    font-size: 0.75rem;
}

.loading-row {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.scanning-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    animation: scanBlink 1.5s ease-in-out infinite;
}

@keyframes scanBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* New winner flash animation */
.table-row.new-winner {
    animation: newWinnerFlash 3s ease-out;
}

@keyframes newWinnerFlash {
    0% { background: rgba(255, 215, 0, 0.3); box-shadow: inset 0 0 30px rgba(255, 215, 0, 0.2); }
    100% { background: transparent; box-shadow: none; }
}

/* Load More */
.load-more-container {
    text-align: center;
    margin-top: 30px;
}

/* === STATS GRID === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-green);
    border-radius: 8px;
    padding: 28px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--pip-green), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-green-strong);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 255, 65, 0.08);
}

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

.stat-icon-wrap {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 0.65rem;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--pip-green);
    margin-bottom: 16px;
    min-height: 2rem;
}

.stat-bar {
    height: 3px;
    background: rgba(0, 255, 65, 0.1);
    border-radius: 2px;
    margin-bottom: 12px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: var(--pip-green);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--pip-green-glow-strong);
    transition: width 1s ease-out;
}

.stat-footer {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* === HOW IT WORKS GRID === */
.how-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.how-card {
    background: var(--bg-card);
    border: 1px solid var(--border-green);
    border-radius: 8px;
    padding: 36px 28px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.how-card:hover {
    border-color: var(--border-green-strong);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 255, 65, 0.08);
}

.how-number {
    position: absolute;
    top: 16px;
    right: 20px;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--pip-green);
    opacity: 0.08;
}

.how-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.how-card h3 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 3px;
    color: var(--pip-green);
    margin-bottom: 12px;
}

.how-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 1px solid;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-secondary {
    border-color: var(--border-green-strong);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--pip-green-glow);
    border-color: var(--pip-green);
    color: var(--pip-green);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1rem;
}

/* === FOOTER === */
.site-footer {
    border-top: 1px solid var(--border-green);
    padding: 40px 24px;
    text-align: center;
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.5);
}

.footer-content {
    max-width: var(--container-max);
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.footer-icon {
    font-size: 1.2rem;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.7rem;
    letter-spacing: 1px;
}

.footer-sep {
    color: var(--text-muted);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .current-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .table-header,
    .table-row {
        grid-template-columns: 40px 70px 1fr 80px;
        font-size: 0.7rem;
    }

    .th-time,
    .row-time {
        display: none;
    }

    .countdown-value {
        font-size: 2.5rem;
    }

    .nav-container {
        gap: 8px;
    }

    .back-text {
        display: none;
    }

    .logo-text {
        font-size: 0.7rem;
        letter-spacing: 2px;
    }

    .status-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .current-info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .info-value {
        font-size: 0.8rem;
    }

    .hero-lottery {
        padding: 70px 16px 40px;
    }

    .table-header,
    .table-row {
        grid-template-columns: 35px 60px 1fr 70px;
        gap: 6px;
        padding: 10px 12px;
        font-size: 0.65rem;
    }
}
