/* Modernized Splash Screen & Global Styles */

:root {
    --bg-color: #050510;
    --primary-color: #00f3ff;
    --secondary-color: #ff00ff;
    --accent-color: #ffe600;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

body {
    background-color: #000;
    color: var(--text-color);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

/* Dynamic Background Animation */
.bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('assets/ui/bg_main.png') no-repeat center center fixed;
    background-size: cover;
    z-index: -1;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image:
        linear-gradient(rgba(0, 243, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    animation: gridMove 20s linear infinite;
    opacity: 0.3;
}

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px);
    }
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 500px;
    max-height: 900px;
    max-height: 900px;
    background: rgba(5, 5, 16, 0.85);
    /* Slight transparency */
    border: none;
    box-shadow: 0 0 20px #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Canvas */
#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    position: absolute;
    /* Canvas fills container */
    top: 0;
    left: 0;
    z-index: 1;
}

/* UI Layers */
.ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    pointer-events: none;
    z-index: 10;
}

#ui-top-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    /* Center Vertically too if needed */
    pointer-events: none;
    padding: 10px;
    width: 100%;
    /* Ensure full width */
}

.hud-bar {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 480px;
}

.hud-stats {
    flex-grow: 1;
    display: flex;
    gap: 8px;
    background: rgba(5, 5, 16, 0.6);
    backdrop-filter: blur(10px);
    padding: 8px 15px;
    border-radius: 12px;
    border: 1px solid rgba(0, 243, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    align-items: center;
    justify-content: space-between;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
    font-weight: 700;
    color: #e0e0e0;
}

.stat-box .icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

/* Custom Exit Button */
.btn-hud-exit {
    width: 44px;
    height: 44px;
    background: rgba(255, 0, 85, 0.15);
    border: 1px solid rgba(255, 0, 85, 0.4);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    pointer-events: all;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-right: 15px;
    /* Added to move it left */
}

.btn-hud-exit::before,
.btn-hud-exit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 3px;
    background-color: #ff0055;
    border-radius: 2px;
    transform-origin: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(255, 0, 85, 0.5);
}

.btn-hud-exit::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.btn-hud-exit::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Main Menu Layout - CYBERPUNK STYLE */
/* Main Menu Layout - CYBERPUNK STYLE */
#main-play-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 90px;
    z-index: 5;
    position: relative;
    gap: 20px;
    /* Space between flex items */
}

/* Concept Art Style: Rectangular with Cut Corners & Double Glow */
.btn-play-large {
    width: 250px;
    height: 100px;
    background: rgba(0, 0, 0, 0.6);
    border: 3px solid var(--secondary-color);
    /* Pink inner */
    outline: 3px solid var(--primary-color);
    /* Cyan outer */
    outline-offset: 5px;
    color: #fff;
    font-size: 3rem;
    font-family: var(--font-heading);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 5px;
    cursor: pointer;
    position: relative;
    z-index: 10;

    /* Cyberpunk Glows */
    box-shadow:
        0 0 20px var(--secondary-color),
        inset 0 0 20px var(--secondary-color),
        0 0 50px var(--primary-color);

    /* Champfered Corners using Clip Path */
    clip-path: polygon(15px 0, 100% 0,
            100% calc(100% - 15px), calc(100% - 15px) 100%,
            0 100%, 0 15px);

    transition: all 0.2s ease-in-out;
}

/* Glitch Text Effect Simulation */
.btn-play-large:hover {
    transform: scale(1.05);
    background: rgba(255, 0, 255, 0.1);
    text-shadow:
        -2px 0 var(--primary-color),
        2px 0 var(--secondary-color);
    box-shadow:
        0 0 40px var(--secondary-color),
        0 0 80px var(--primary-color);
}

.btn-play-large:active {
    transform: scale(0.98);
}

/* Floating Action Buttons (Spin/Mine) - Now Flex Items */
.fab-btn {
    position: relative;
    /* Changed from absolute */
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid;
    font-size: 1.5rem;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 0 15px currentColor;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s;
    /* Reset absolute props */
    top: auto;
    left: auto;
    right: auto;
    margin: 0;
}

/* Spin Button */
.spin-btn {
    border-color: #ff00ff;
    color: #ff00ff;
    /* Static by default */
}

/* Mine Button */
.mine-btn {
    border-color: #ff9900;
    color: #ff9900;
    /* Static by default */
}

/* Active State for Features (Filled/Ready) */
.feature-ready {
    animation: floatReady 2s ease-in-out infinite;
    box-shadow: 0 0 20px currentColor;
    /* Enhanced glow using current text color */
}

@keyframes floatReady {

    0%,
    100% {
        transform: translateY(0);
        filter: brightness(1);
    }

    50% {
        transform: translateY(-10px);
        filter: brightness(1.5);
        /* Flash effect */
    }
}



/* Bottom Navigation - Card Style */
#bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    padding: 10px 15px 20px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.8) 50%, rgba(0, 0, 0, 0) 100%);
    /* Stronger gradient at bottom */
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    z-index: 20;
    border-top: none;
}

/* ... existing nav styles ... */

.nav-item {
    flex: 1;
    height: 70px;
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s;

    /* Cut Corners for Nav Items too */
    clip-path: polygon(10px 0, 100% 0,
            100% calc(100% - 10px), calc(100% - 10px) 100%,
            0 100%, 0 10px);

    box-shadow: inset 0 0 10px rgba(0, 243, 255, 0.1);
}

.nav-item:hover {
    background: rgba(0, 243, 255, 0.2);
    box-shadow:
        0 0 15px rgba(0, 243, 255, 0.4),
        inset 0 0 20px rgba(0, 243, 255, 0.2);
    transform: translateY(-5px);
}

.nav-item .nav-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 5px var(--primary-color));
}

.nav-item .nav-label {
    font-size: 0.7rem;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Social Submenu (Popup) - Matches Cyberpunk Aesthetic */
.submenu {
    position: absolute;
    bottom: 110px;
    /* Above new nav */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 20, 0.95);
    border: 2px solid var(--primary-color);
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 200px;
    z-index: 25;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.3);
    clip-path: polygon(15px 0, 100% 0,
            100% calc(100% - 15px), calc(100% - 15px) 100%,
            0 100%, 0 15px);
    opacity: 1;
    transition: opacity 0.2s;
}

.submenu.hidden {
    opacity: 0;
    pointer-events: none;
}

.submenu-item {
    background: transparent;
    color: #fff;
    padding: 12px;
    text-align: center;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.submenu-item:hover {
    background: rgba(0, 243, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(0, 243, 255, 0.3);
    box-shadow: inset 0 0 10px rgba(0, 243, 255, 0.2);
}

.screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 16, 0.4);
    /* Much more transparent to see background */
    backdrop-filter: blur(5px);
    /* Reduced blur to see city details */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    transition: opacity 0.4s ease, visibility 0.4s;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* Specific override for Main Menu transparency */
#screen-main-menu {
    background: rgba(5, 5, 16, 0.2);
    /* Even more transparent for main menu */
    backdrop-filter: none;
}



.screen-overlay.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

/* Glass Panel for Menu Content */
.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    width: 85%;
    max-width: 400px;
}

/* Typography */
.game-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 0.9;
    text-align: center;
    color: #fff;
    /* Solid white for better readability */
    text-shadow:
        0 0 10px var(--primary-color),
        0 0 20px var(--primary-color),
        0 0 40px var(--primary-color);
    margin-bottom: 10px;
    letter-spacing: 2px;
    animation: glowPulse 3s infinite alternate;
}

@keyframes glowPulse {
    from {
        text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color);
    }

    to {
        text-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color), 0 0 50px var(--primary-color);
    }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    letter-spacing: 4px;
    margin-bottom: 40px;
    text-transform: uppercase;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

/* Menu Buttons Container */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

/* Buttons */
button {
    border: none;
    outline: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

button:active {
    transform: scale(0.96);
}

.btn-primary {
    background: transparent;
    color: var(--primary-color);
    font-size: 1.5rem;
    padding: 15px 0;
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    width: 100%;
    letter-spacing: 2px;
}

.btn-primary:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.6);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    padding: 12px 0;
    border-radius: 12px;
    width: 100%;
    letter-spacing: 1px;
}

.btn-secondary:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Video Button (Revive) */
.btn-video {
    background: rgba(255, 0, 153, 0.1);
    color: #ff0099;
    font-size: 1.1rem;
    padding: 12px 30px;
    border-radius: 50px;
    margin-bottom: 15px;
    border: 2px solid #ff0099;
    box-shadow: 0 0 10px rgba(255, 0, 153, 0.3);
    width: 80%;
}

.btn-video:hover {
    background: #ff0099;
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 0, 153, 0.6);
}

/* Animations */
.animate-pulse {
    animation: pulseBtn 2s infinite;
}

@keyframes pulseBtn {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 243, 255, 0.4);
    }

    70% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(0, 243, 255, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 243, 255, 0);
    }
}

/* Shop Styling */
#screen-shop {
    justify-content: flex-start;
    padding-top: 20px;
}

/* Reuse existing shop/toast styles or refine them below... */
/* Keeping essential valid CSS from previous file while creating this full override */
.shop-header {
    width: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.shop-header h2 {
    flex-grow: 1;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-right: 20px;
}

.btn-icon {
    background: none;
    font-size: 2rem;
    color: white;
}

.shop-content {
    width: 90%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.shop-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-icon {
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.3);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Leaderboard Styles */
.leaderboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    border-bottom: 1px solid #333;
    font-size: 14px;
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row.me {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid #00f3ff;
    border-radius: 4px;
}

.leaderboard-row .rank {
    width: 30px;
    color: #aaa;
    font-weight: bold;
}

.leaderboard-row .name {
    flex: 1;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.leaderboard-row .score {
    color: #ff0;
    font-weight: bold;
}

.leaderboard-row .lvl {
    width: 50px;
    text-align: right;
    color: #aaa;
    font-size: 10px;
}

.item-info {
    flex-grow: 1;
}

.item-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.item-info p {
    font-size: 0.9rem;
    color: #aaa;
}

.btn-buy {
    background: var(--accent-color);
    color: black;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(255, 230, 0, 0.5);
}

.btn-buy:hover {
    background: #fff;
    box-shadow: 0 0 20px rgba(255, 230, 0, 0.8);
}

/* Shake Animation */
.shake {
    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);
    }
}

/* Toast */
#toast-container {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
    width: 90%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(10, 10, 20, 0.95);
    color: #fff;
    padding: 15px 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--glass-border);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    font-family: var(--font-body);
    font-size: 1rem;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Small Icon Button (Exit, etc.) */
.btn-icon-small {
    background: rgba(255, 0, 85, 0.2);
    border: 1px solid #ff0055;
    color: #fff;
    font-size: 1.2rem;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    /* Match stat-box height roughly */
}

.btn-icon-small:hover {
    background: #ff0055;
    box-shadow: 0 0 10px #ff0055;
    transform: scale(1.05);
}

.btn-icon-small:active {
    transform: scale(0.95);
}

/* Tabs */
.btn-tab {
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    transition: all 0.2s;
    border-radius: 4px;
}

.btn-tab:hover {
    filter: brightness(1.2);
}

/* SPIN WHEEL */
#spin-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 20px auto;
}

#spin-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid #fff;
    z-index: 5;
    filter: drop-shadow(0 0 5px #000);
}

#spin-wheel-outer {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 0 20px #00f3ff;
    overflow: hidden;
    position: relative;
}

#spin-wheel-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 4s cubic-bezier(0.25, 1, 0.5, 1);
    /* Background set by JS */
}

.wheel-seg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    /* This element is just for text placement anchor */
}

.wheel-seg span {
    display: block;
    position: absolute;
    left: -50px;
    top: -120px;
    width: 100px;
    text-align: center;
    transform-origin: center bottom;
    /* Not quite */
}