/* ============================
   Lizard Lizard Clicker Game
   ============================ */

:root {
    --green-primary: #00cc66;
    --green-dark: #00994d;
    --green-neon: #00ff80;
    --bg-dark: #0a0a0a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-accent: #00cc66;
    --font-display: 'Lilita One', cursive;
    --font-body: 'Quicksand', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 204, 102, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 204, 102, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(0, 204, 102, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 1000;
}

.nav-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.nav-logo-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--green-primary);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--green-primary);
}

.nav-wallet {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 10px;
    border-radius: 6px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: #141414;
    border: 1px solid rgba(0, 204, 102, 0.2);
    border-radius: 16px;
    padding: 40px;
    max-width: 460px;
    width: 100%;
    text-align: center;
}

.modal h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--green-primary);
    margin-bottom: 8px;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.modal input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.modal input:focus {
    border-color: var(--green-primary);
}

.modal input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.modal-error {
    color: #ff4d4d;
    font-size: 0.8rem;
    margin-top: 8px;
    min-height: 20px;
}

.btn-start {
    margin-top: 20px;
    width: 100%;
    padding: 14px;
    background: var(--green-primary);
    color: #000;
    border: none;
    border-radius: 10px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s;
}

.btn-start:hover {
    background: var(--green-neon);
    transform: scale(1.02);
}

.btn-start:active {
    transform: scale(0.98);
}

/* ===== GAME CONTAINER ===== */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 90px 20px 20px;
    padding-right: 300px;
    position: relative;
    z-index: 1;
}

/* ===== SCORE DISPLAY ===== */
.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.score-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.score-number {
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--text-primary);
    line-height: 1;
    transition: transform 0.1s;
}

.score-number.bump {
    transform: scale(1.15);
}

/* ===== LIZARD ===== */
.lizard-wrapper {
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
    transform: translateZ(0);
}

.lizard-wrapper:active {
    transform: scale(0.95) translateZ(0);
}

.lizard-img {
    width: 380px;
    height: 380px;
    image-rendering: pixelated;
    pointer-events: none;
}

.click-hint {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ===== FLOATING +1 ===== */
.float-plus {
    position: fixed;
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--green-neon);
    pointer-events: none;
    z-index: 100;
    will-change: transform, opacity;
    animation: floatUp 0.6s ease-out forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
    100% {
        opacity: 0;
        transform: translate3d(0, -60px, 0);
    }
}

/* ===== LEADERBOARD ===== */
.leaderboard {
    position: fixed;
    top: 90px;
    right: 0;
    width: 280px;
    height: calc(100vh - 90px);
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    padding: 20px 16px;
    overflow-y: auto;
    z-index: 500;
}

.leaderboard-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--green-primary);
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 1px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leaderboard-loading {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 20px 0;
}

.lb-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-card);
    border-radius: 8px;
    transition: background 0.2s;
}

.lb-entry:hover {
    background: var(--bg-card-hover);
}

.lb-entry.is-you {
    background: rgba(0, 204, 102, 0.1);
    border: 1px solid rgba(0, 204, 102, 0.2);
}

.lb-rank {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 24px;
    text-align: center;
}

.lb-rank.gold { color: #ffd700; }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }

.lb-address {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-primary);
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

.lb-address:hover {
    color: var(--green-primary);
}

.lb-clicks {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--green-primary);
    font-weight: 700;
}

/* ===== SCROLLBAR ===== */
.leaderboard::-webkit-scrollbar {
    width: 4px;
}

.leaderboard::-webkit-scrollbar-track {
    background: transparent;
}

.leaderboard::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .leaderboard {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 35vh;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 16px 16px 0 0;
    }

    .game-container {
        min-height: calc(100vh - 35vh);
        padding-right: 20px;
        padding-bottom: 40px;
    }

    .lizard-img {
        width: 200px;
        height: 200px;
    }

    .score-number {
        font-size: 3rem;
    }

    .nav-wallet {
        display: none;
    }
}

@media (max-width: 480px) {
    .lizard-img {
        width: 160px;
        height: 160px;
    }

    .score-number {
        font-size: 2.5rem;
    }

    .modal {
        padding: 28px 20px;
    }
}
