@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;700&family=Orbitron:wght@400;700&display=swap');

:root {
    --bg-dark: #0a0a12;
    --neon-cyan: #00f2fe;
    --neon-pink: #ff007f;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Exo 2', sans-serif;
    --font-heading: 'Orbitron', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: white;
    font-family: var(--font-main);
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
}

/* --- OVERLAYS --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: var(--bg-dark);
    /* Solid background to hide game canvas */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 10px;
}


/* --- HEADER / MENU --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
    position: relative;
    cursor: default;
}

.logo-main {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    letter-spacing: -1px;
}

.logo-tagline {
    font-size: 10px;
    color: var(--neon-cyan);
    letter-spacing: 2.5px;
    margin-top: 4px;
    opacity: 0.9;
    text-transform: uppercase;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
    width: 100%;
    text-align: center;
}


.logo-main span {
    color: var(--neon-cyan);
    font-size: 42px;
    text-shadow: 0 0 15px var(--neon-cyan);
    margin-right: -1px;
    display: inline-block;
}


/* --- QUEST BTN --- */
.menu-actions {
    display: flex;
    gap: 15px;
    width: 80%;
    /* Match btn-quick-play width style */
    max-width: 450px;
    margin-top: 15px;
}

.quest-btn.small,
.reward-btn.small {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 10px;
    border-radius: 15px;
    color: black;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.quest-btn.small {
    background: linear-gradient(135deg, #ffcc00 0%, #ff9900 100%);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
    animation: quest-pulse 2s infinite;
}

.reward-btn.small {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}

.quest-btn.small:hover,
.reward-btn.small:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

@keyframes quest-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(255, 204, 0, 0.8);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
    }
}

.nav-links {
    display: flex;
    gap: 25px;
    list-style: none;
}

.nav-links li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.profile-circle {
    width: 38px;
    height: 38px;
    background: #333;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: 0.3s;
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.ui-profile {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--neon-cyan);
    background-size: cover;
    background-position: center;
    margin-right: 10px;
    display: inline-block;
    vertical-align: middle;
}

.wallet-btn {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid var(--neon-cyan);
    padding: 8px 15px;
    border-radius: 12px;
    color: var(--neon-cyan);
    font-family: var(--font-heading);
    font-size: 12px;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-btn.connected {
    border-color: #00ff8d;
    color: #00ff8d;
    background: rgba(0, 255, 141, 0.1);
}

.wallet-balance {
    color: var(--neon-cyan);
    font-family: var(--font-heading);
    font-size: 14px;
    background: rgba(0, 242, 254, 0.05);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 242, 254, 0.2);
    display: none;
}

.wallet-btn.connected+.wallet-balance {
    display: inline-block;
}

/* --- ECONOMY BAR --- */
.economy-bar {
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 10px 25px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.economy-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
}

.eco-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.eco-value {
    font-size: 16px;
    color: white;
    font-weight: bold;
}

.eco-value.soo {
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
}

.eco-value.energy {
    color: #00ff8d;
    text-shadow: 0 0 10px rgba(0, 255, 141, 0.4);
}

.floating-text {
    position: fixed;
    pointer-events: none;
    color: #ffcc00;
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 20px;
    z-index: 2000;
    animation: floatUp 1s ease-out forwards;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

@keyframes floatUp {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -100px);
        opacity: 0;
    }
}

.shake-animation {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* --- MAIN MENU CONTENT --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 40px 0;
}

/* --- CUSTOMIZE BTN --- */
.mini-customize-btn {
    background: rgba(0, 242, 254, 0.05);
    border: 1px solid rgba(0, 242, 254, 0.2);
    color: var(--neon-cyan);
    font-family: var(--font-heading);
    font-size: 10px;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: 0.3s;
    margin-bottom: -20px;
    z-index: 2;
}

.mini-customize-btn:hover {
    background: var(--neon-cyan);
    color: black;
    box-shadow: 0 0 15px var(--neon-cyan);
}

.skin-selector {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-arrow {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--neon-cyan);
    font-size: 30px;
    transition: 0.3s;
}

.segmented-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    position: relative;
    height: 100px;
}

.preview-bead {
    width: 40px;
    height: 40px;
    background: var(--snake-body-color, var(--neon-cyan));
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
    position: relative;
    flex-shrink: 0;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.preview-bead.head {
    width: 48px;
    height: 48px;
    background: var(--snake-head-color, #fff);
    order: 10;
    /* Put head at the front (right side) */
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
}

.preview-eye-left,
.preview-eye-right {
    width: 10px;
    height: 10px;
    background: var(--snake-eye-color, black);
    border-radius: 50%;
}


.btn-quick-play {
    background: linear-gradient(90deg, #7b2ff7 0%, #3d5afe 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 15px 60px;
    color: white;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.3s;
}

.btn-quick-play:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 50px rgba(123, 47, 247, 0.6);
}

.play-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3d5afe;
}

.big-snake-preview {
    transform: scale(1.5);
    transition: 0.3s;
}

.pulse-animation {
    animation: skin-pulse 0.3s ease-out;
}

@keyframes skin-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.cards-container {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 1100px;
    padding: 0 20px;
}

.sci-fi-card {
    flex: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: 0.3s;
}

.sci-fi-card.pink {
    border-color: var(--neon-pink);
}

.sci-fi-card.blue {
    border-color: var(--neon-cyan);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 22px;
}

.pink .card-title {
    color: var(--neon-pink);
}

.blue .card-title {
    color: var(--neon-cyan);
}

.card-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    line-height: 1.6;
}

.card-link {
    color: white;
    text-decoration: none;
    font-weight: bold;
    margin-top: auto;
}

/* Modal General Styles */
.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--neon-cyan);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
}

.sci-fi-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 12px 30px;
    border-radius: 15px;
    color: white;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: 0.3s;
}

#profileModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.profile-preview-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--neon-cyan);
    margin: 0 auto 20px;
    background: #222;
    background-size: cover;
    background-position: center;
}

.file-input-label {
    display: inline-block;
    padding: 10px 20px;
    background: var(--neon-cyan);
    color: black;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 15px;
}


@media (max-width: 900px) {
    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 5px;
        position: relative;
    }

    .nav-links {
        display: none;
    }

    .user-info {
        order: -1;
        width: 100%;
        justify-content: center;
        scale: 0.9;
    }

    .logo {
        align-items: center;
    }


    .menu-actions {
        width: 85%;
        gap: 10px;
    }

    .quest-btn.small,
    .reward-btn.small {
        font-size: 11px;
        padding: 10px 5px;
    }

    .cards-container {
        flex-direction: column;
        padding: 0 15px 30px;
    }

    .btn-quick-play {
        width: 85%;
        font-size: 18px;
    }

    /* Fix Economy Bar Overlap on Mobile */
    .economy-bar {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        margin: 10px auto;
        width: 90%;
        max-width: 450px;
        justify-content: center;
        gap: 15px;
        background: rgba(0, 0, 0, 0.6);
        border-radius: 20px;
        z-index: 10;
        padding: 10px;
    }

    .economy-item {
        flex-direction: column;
        gap: 2px;
    }

    .eco-value {
        font-size: 14px;
    }
}