/* --- Reset & Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    /* Disable text selection for game feel */
    -webkit-user-drag: none;
    /* Disable blue tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #000;
    background-image: url('space/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    font-family: system-ui, sans-serif;
    /* Removed Roboto per user request */
    overflow: hidden;
    color: white;
}

/* --- Layout --- */
.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 100%;
    position: relative;
    padding-top: 20px;
}

/* --- UI Controls --- */
.ui-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 15px;
    z-index: 20;
}

.ui-controls i {
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8));
}

.ui-controls i:hover {
    transform: scale(1.1);
}

/* --- Profile Icon (Top Right) --- */
.profile-control {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    display: flex;
    /* Group icons */
    gap: 15px;
}

.profile-control i {
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8));
}

.profile-control i:hover {
    transform: scale(1.1);
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .ui-controls {
        flex-direction: column;
        align-items: center;
        /* Center icons relative to each other */
        /* Stack icons vertically */
        gap: 20px;
    }

    .profile-control {
        flex-direction: column;
        align-items: center;
        /* Center icons relative to each other */
        /* Stack icons vertically */
        gap: 20px;
    }

    /* Reorder Right Icons on Mobile: Profile, Help, Audio, Music */
    #btn-profile {
        order: 1;
    }

    #btn-help {
        order: 2;
    }

    #btn-audio {
        order: 3;
    }

    #btn-music {
        order: 4;
    }
}

/* --- Header --- */
/* --- Header --- */
.game-header {
    position: absolute;
    /* Vertically centered in the space above the globe */
    /* Container Height 100%. Center is 50%. Globe Top is 50% - 200px. */
    /* Midpoint = (50% - 200px) / 2 = 25% - 100px */
    top: calc(25% - 100px);
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
    transform: translateY(-50%);
}

.logo {
    width: 250px;
    height: auto;
    margin-bottom: 20px;
    /* Removed pixelated rendering for logo if standard image, keep good scaling */
}

.score-board {
    font-family: 'Bungee', cursive;
    /* New Font */
    font-size: 4rem;
    /* Large font */
    font-weight: 400;
    /* Bungee is bold by default */
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    /* Soft shadow */
    color: #ffffff;
    /* White text */
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.player-score {
    font-family: 'Bungee', cursive;
    font-size: 2rem;
    /* Half of score-board size */
    color: #ffffff;
    /* White text for value */
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}

.player-icon,
.currency-symbol-small {
    color: rgba(255, 255, 255, 0.5);
    /* Grey like dollar sign */
    font-size: 1.5rem;
    /* Slightly smaller icon */
}

.country-flag {
    width: 4rem;
    height: 4rem;
    /* Match score font size */
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.8));
}

.currency-symbol {
    margin-right: 10px;
    color: #fff;
    opacity: 0.5;
    /* 50% opacity */
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

/* --- Globe System --- */
.game-stage {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

.globe-wrapper-anchor {
    position: relative;
    width: 400px;
    height: 400px;
    /* This anchor stays static/centered */
    perspective: 1000px;
    /* Force 3D context for anti-jitter */
}

/* NEW: Rotator Container handles the -15deg tilt for everything */
/* NEW: Rotator Container handles the -15deg tilt for everything */
.systems-rotator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Removed rotation from here to ensure Travel Translation is Axis-Aligned */
    /* transform: rotate(-15deg); */
    transform-style: preserve-3d;
    /* Keep children in 3D space */
    pointer-events: none;
    /* Let clicks pass to children */
}

/* CSS Variable for Animation Loop */
:root {
    --globe-width: 580px;
    /* Desktop: 394px * 1.47 (Original Aspect Ratio to fix stretching) */
}

.globe-system {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    /* Re-enable clicks on the system itself */

    /* Rotation Moved to Parent! Just Translate now. */
    transform: translate3d(0, 0, 0.1px);
    /* Force 3D + Micro-offset to prevent snap */

    /* Transition transform for 1.5s. */
    transition: transform 1.5s cubic-bezier(0.45, 0, 0.55, 1), visibility 0s 0s;
    visibility: visible;
    will-change: transform;
    opacity: 1;
    backface-visibility: hidden;
    /* Stabilize rendering */
}

.pulse-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Apply Rotation Here - Separates Tilt from Travel Movement */
    transform: rotate(-15deg);
    will-change: transform;
}

/* Scale the WRAPPER (mask + glow) when clicking */
.pulse-wrapper.trigger-pulse {
    animation: clickPulse 0.15s ease-out forwards;
}

@keyframes clickPulse {
    0% {
        transform: rotate(-15deg) scale(1);
        /* Maintain Rotation */
    }

    50% {
        transform: rotate(-15deg) scale(0.95);
    }

    100% {
        transform: rotate(-15deg) scale(1);
    }
}

/* ... (skip inner styles) ... */

/* --- Space Travel Transitions --- */
/* State: Default Earth Centered is handled by default class output (translateX(0)) */

/* State: Off Screen Left (Earth leaving) */
.off-screen-left {
    transform: translate3d(-150vw, 0, 0) !important;
    /* Pure Translation 3D */
    visibility: hidden;
    transition: transform 1.5s cubic-bezier(0.45, 0, 0.55, 1), visibility 0s 1.5s;
    pointer-events: none !important;
}

/* State: Off Screen Right (Moon waiting) */
.off-screen-right {
    transform: translate3d(150vw, 0, 0) !important;
    /* Pure Translation 3D */
    visibility: hidden;
    transition: transform 1.5s cubic-bezier(0.45, 0, 0.55, 1), visibility 0s 1.5s;
    pointer-events: none !important;
}

/* Mask - The Circle & Click Target */
.globe-mask {
    position: absolute;
    /* Changed to absolute to center within system */
    top: 3px;
    left: 3px;
    width: 394px;
    /* Reduced by 6px total (3px per side) */
    height: 394px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;

    /* FIX: Inner shadow to hide jagged clipping edges */
    /* This creates a 2px dark fading ring inside the circle */
    box-shadow: inset 0 0 2px 2px rgba(0, 0, 0, 0.5);

    cursor: url('tools/dug_vacuumer.png'), pointer;

    /* Strict circular masking for clicks in modern browsers */
    /* border-radius affects hit-testing */

    /* Fix for some browsers clipping issues with radius */
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Extra stabilization */
}


/* Glow - Larger than mask, ON TOP */
.globe-glow {
    position: absolute;
    top: -50px;
    left: -50px;
    right: -50px;
    bottom: -50px;
    background-image: url('space/earth_glow.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 10;
    /* Visuals on top */
    pointer-events: none;
    /* KEY FIX: Clicks pass through to mask */
    animation: pulseGlow 4s infinite ease-in-out;
}

/* --- Start Overlay --- */
#start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    /* Above everything else */
    pointer-events: none;
    /* Let clicks pass specific to logic or allow? */
    /* Wait, user wants to click "Play". If I make it none, the click goes to mask. */
    /* Since we handle start logic in the mask click, we can make this none so it doesn't block the mask's event */
    /* OR we handle it separately. User said "when the player click play". */
    /* But standard clicker behavior usually treats the big initial button as the start. */
    /* Stick to pointer-events: none and let the mask click trigger it via JS state check, 
       this keeps the 'hitbox' perfect circle. */
    transition: opacity 0.3s ease;

    /* Counter-rotate to fix text alignment (Globe is -15deg, so we go +15deg) */
    transform: rotate(15deg);
}

#start-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    /* KEY FIX: Ensures invisible PLAY text doesn't capture clicks */
}

/* Icon removed from CSS usage, focused on Span */

#start-overlay span {
    font-family: 'Bungee', cursive;
    font-size: 4rem;
    /* Doubled from 2rem */
    color: white;
    /* Blurred shadow, reduced opacity */
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* --- Moon Travel Button --- */
.moon-travel-btn {
    position: absolute;
    bottom: -30px;
    /* Moved down 20px (was -10px) */
    right: -20px;
    /* Moved right 20px (outwards) */
    /* Fixed Width Layout - Reduced to ~60% */
    width: 75px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center Align */
    cursor: pointer;
    z-index: 15;

    /* Default: Hidden (Before Game Start / During Travel) */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.moon-travel-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.moon-travel-btn i {
    font-size: 2rem;
    color: white;
    transform: rotate(-90deg);
    /* 90 degrees total */
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.8));
    margin-bottom: 10px;
    /* Reduced distance */
    margin-right: 0;
    transition: transform 0.2s;
    transform-origin: center;
}

.moon-travel-btn:hover i {
    transform: rotate(-90deg) scale(1.1);
    /* Center scale only */
}

.moon-travel-btn .text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center Align */
    text-align: center;
    margin-top: 7px;
    /* Moved text down 7px */
}

.moon-travel-btn span {
    font-family: 'Roboto', system-ui, sans-serif;
    color: white;
    font-size: 0.8rem;
    opacity: 0.7;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
}

.moon-travel-btn .title {
    font-weight: 900;
    /* Bold */
    font-size: 1.4rem;
    /* Larger */
    opacity: 0.5;
    /* 50% opacity */
    letter-spacing: 1px;
}


/* Common Layer Styles */
.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat-x;

    /* FIX: Force GPU promotion to prevent freezing during parent movement */
    transform: translateZ(0);
    will-change: background-position;
    backface-visibility: hidden;
    /* Ensure browser knows this element animates internally */
    background-size: var(--globe-width) 100%;
    /* Fix Width via Variable */
}

/* Earth Layer - Slow movement */
/* Seamless loop: Fixed size 589px (Derived from 754x512 @ 400px height) */
.earth-layer {
    background-image: url('space/earth.png');
    /* background-size handled by .layer generic or override if needed */
    animation: rotateGlobe 60s linear infinite;
}

/* Clouds Layer - Faster movement */
/* Double speed: 15s */
.clouds-layer {
    background-image: url('space/clouds.png');
    /* background-size handled by .layer generic */
    animation: rotateGlobe 15s linear infinite;
    opacity: 0.9;
}

/* Shading Layer */
.shading-layer {
    background-image: url('space/circular_shading.png');
    background-size: 100% 100%;
    /* Force fit to the container */
    mix-blend-mode: normal;
    /* per user request, use png alpha */
    pointer-events: none;

    /* Aggressive Oversize: Mask is 394px */
    /* We make this 410px to ensure edges are completely clipped */
    width: 410px !important;
    height: 410px !important;
    /* Center it: (410 - 394) / 2 = 8px offset */
    top: -8px !important;
    left: -8px !important;
}

/* Animations */
@keyframes rotateGlobe {
    from {
        background-position-x: 0px;
    }

    to {
        background-position-x: var(--globe-width);
        /* Matches exact width for seamless loop */
    }
}

/* --- Popups --- */
.resource-popup {
    position: fixed;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: floatUp 1s ease-out forwards;
    z-index: 100;
    transform: translate(-50%, -100%);
}

.resource-popup img {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.resource-popup span {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    margin-top: 5px;
}

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

    20% {
        opacity: 1;
        transform: translate(-50%, -120%) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -300%) scale(1);
    }
}

/* --- Moon Specific Layers --- */
.moon-layer {
    background-image: url('space/moon.png');
    /* background-size handled by .layer generic */
    animation: rotateGlobe 60s linear infinite;
}

.moon-border-layer {
    background-image: url('space/moon_border.png');
    background-size: 100% 100%;
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    z-index: 2;
    /* Ensure it is above moon layer */
}

.moon-glow {
    background-image: url('space/moon_glow.png') !important;
}


/* --- Help Overlay --- */
#help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.86);
    /* 86% Opacity Black */
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

#help-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.help-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    height: 65vh;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: white;
    overflow: visible;
}

.help-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.close-btn {
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    opacity: 0.7;
}

.close-btn:hover {
    transform: scale(1.1);
    opacity: 1;
}

.help-text {
    font-family: 'Roboto', system-ui, sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 15px;
    /* Space for scrollbar */
}

/* Guide text container - no overflow, flexbox layout */
.guide-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    /* Prevent parent scrolling */
    width: 100%;
}

/* Stylized Scrollbar */
.help-text::-webkit-scrollbar {
    width: 8px;
}

.help-text::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.help-text::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.help-text::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}


/* --- Menu Overlay Styles Removed --- */

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background-color: transparent;
    border: 1px solid transparent;
    /* Hidden by default */
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Bungee', cursive;
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-item i {
    font-size: 1.5rem;
    width: 40px;
    /* Fixed width for alignment */
    text-align: center;
    margin-right: 15px;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 1);
    color: black;
    border-color: white;
    /* Visible on hover */
}

/* Anchor links styled as menu items */
a.menu-item {
    text-decoration: none;
    color: inherit;
}

a.menu-item:hover {
    color: black;
}

/* Menu footer links */
.menu-footer-link {
    text-decoration: none;
    color: inherit;
}

/* --- Guide Overlays (Resources / Tools) --- */
#resources-overlay,
#tools-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.86);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

#resources-overlay.hidden,
#tools-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.guide-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    height: 65vh;
    padding: 40px;
    padding-top: 50px;
    /* Extra space for close button */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: white;
    overflow: visible;
    /* Allow close button to show */
}

/* Guide title - fixed at top */
.guide-title {
    flex-shrink: 0;
}

/* Guide tabs - fixed below title */
.guide-tabs {
    flex-shrink: 0;
}

.guide-title {
    font-family: 'Bungee', cursive;
    text-align: center;
    margin: 10px 0 20px;
    font-size: 2rem;
    color: white;
}

.guide-subtitle {
    font-family: 'Roboto', system-ui, sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    line-height: 1.5;
    margin: -10px 0 20px;
    padding: 0 10px;
}

.guide-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

/* Unified Hover for Homepage Icons - Now White */
/* Top Right Icons & Menu */
.profile-control i:hover,
#btn-menu:hover {
    color: white;
    transform: scale(1.1);
}

/* Shuttle Icon Hover (Icon ONLY, Text unchanged) */
#btn-travel:hover i {
    color: white;
    transform: rotate(-90deg) scale(1.1);
    /* Preserve rotation */
}

/* Explicitly prevent text change on shuttle hover if inherited */
#btn-travel:hover .text-container span {
    color: white;
    /* Keep white */
}

/* Start Screen Play Button Hover */
#start-overlay span {
    pointer-events: auto;
    cursor: pointer;
    transition: color 0.3s, font-size 0.3s;
}

#start-overlay span:hover {
    color: white;
    font-size: 4.4rem;
}

/* Tab Styles */
.tab-btn {
    /* Manual override of menu-item styles for tab context */
    padding: 10px 30px;
    font-size: 1.5rem;
    /* Larger Font */
}

/* --- Action Buttons (Shop / Leaderboard) --- */
.action-buttons-container {
    position: fixed;
    /* Fixed to screen bottom */
    bottom: 20px;
    /* Small margin */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 900;
    /* High z-index to be above everything */
    width: auto;
}

.action-btn {
    /* Exact Match of Tab Style: Rectangle, No Border (Idle), Transparent */
    /* Inherits .menu-item base styles (transparent bg, transparent border) */

    width: 220px;
    /* Fixed Equal Width */
    justify-content: center;
    font-size: 1rem;
    /* Reduced Font Size */
    padding: 15px 0;
    /* Vertical padding */

    /* Ensure no rounded corners */
    border-radius: 0;

    /* Ensure border is transparent in idle (inherited, but enforcing) */
    border: 1px solid transparent;
    background-color: transparent;
}

/* Hover State - Inherits .menu-item:hover (White bg, Black text) */
.action-btn:hover {
    /* Explicitly ensuring correct hover behavior if menu-item didn't cover it */
    background-color: white;
    color: black;
    border-color: white;
    transform: scale(1.05);
}

.action-btn i {
    font-size: 1.2rem;
    /* Reduced icon size relative to font */
    margin-right: 15px;
    /* Spacing */
}

/* --- Top Left Controls Removed (Reverted to standard UI controls) --- */
/* UI Controls (Restored) */
.ui-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 15px;
    z-index: 100;
}

#btn-menu {
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8));
}

#btn-menu:hover {
    transform: scale(1.1);
}

/* Base Profile Control (Ensure it matches exactly if not already) */
.profile-control {
    top: 20px;
    right: 20px;
    gap: 15px;
    z-index: 100;
    /* Boost to match Top-Left */
}

/* Mobile Responsive For Top Left */
@media (max-width: 768px) {
    .top-left-controls {
        flex-direction: column;
        /* Stack vertically on mobile */
        gap: 20px;
    }

    /* Ensure Top Right also stacks (existing rule covers it, but nice to confirm) */
}

/* --- Action Buttons (Shop / Leaderboard) REMOVED --- */

/* --- Shop Styles --- */
#shop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.86);
    z-index: 950;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

#shop-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.shop-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    height: 65vh;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: white;
    overflow: visible;
}

.shop-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    /* Match help-text max-height for consistent popup sizing */
    max-height: 60vh;
    flex: 1;
    /* Fill remaining space */
    padding-right: 10px;
    /* Space for scrollbar */
}

.shop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: none;
    /* Remove border */
}

.shop-item img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.shop-info {
    flex-grow: 1;
    text-align: left;
    margin-left: 20px;
    display: flex;
    flex-direction: column;
}

.shop-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    text-shadow: none;
    margin-bottom: 5px;
}

.shop-price {
    font-size: 1.5rem;
    /* Large Font as requested */
    font-family: 'Bungee', cursive;
    color: #ffd700;
    /* Yellow for Price */
    text-shadow: none;
}

.shop-desc {
    font-family: 'Roboto', system-ui, sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.btn-buy {
    background-color: #2ecc71;
    /* Green */
    color: white;
    border: none;
    padding: 10px 25px;
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Bungee', cursive;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-buy:hover {
    background-color: #27ae60;
    transform: scale(1.05);
}

.btn-buy:active {
    transform: scale(0.95);
}

.tab-btn i {
    font-size: 2rem;
    /* Larger Icon */
}

.tab-btn.active {
    background-color: white;
    color: black;
    border-color: white;
}

/* Guide list - scrollable content area */
.guide-list {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    text-align: left;
}

/* Guide list scrollbar styling */
.guide-list::-webkit-scrollbar {
    width: 8px;
}

.guide-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.guide-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.guide-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.guide-list.hidden,
.shop-list.hidden {
    display: none;
}


/* --- Leaderboard Overlay --- */
#leaderboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.86);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

#leaderboard-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Leaderboard List - inherits from .guide-list */
.leaderboard-list {
    gap: 8px;
}

/* Leaderboard Item */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: background 0.2s;
    cursor: pointer;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Rank Number */
.lb-rank {
    font-family: 'Bungee', cursive;
    font-size: 1.2rem;
    color: #fff;
    min-width: 40px;
    text-align: center;
}

/* Top 3 Rank Colors */
.leaderboard-item:nth-child(1) .lb-rank {
    color: #ffd700;
    /* Gold */
}

.leaderboard-item:nth-child(2) .lb-rank {
    color: #c0c0c0;
    /* Silver */
}

.leaderboard-item:nth-child(3) .lb-rank {
    color: #cd7f32;
    /* Bronze */
}

/* Country Flag in Leaderboard */
.lb-flag {
    width: 32px;
    height: 32px;
    margin: 0 12px;
}

/* Player/Country Name */
.lb-name {
    flex: 1;
    font-family: 'Roboto', system-ui, sans-serif;
    font-size: 1rem;
    margin: 0;
    margin-right: auto;
    /* Pushes score to right but allow arrow after */
}

/* Leaderboard Score */
.lb-score {
    font-family: 'Bungee', cursive;
    color: #fff;
    font-size: 1.1rem;
    margin-right: 15px;
}

.lb-arrow {
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.leaderboard-entry.active .lb-arrow {
    transform: rotate(90deg);
    color: #fff;
}

.leaderboard-details {
    display: none;
    padding: 15px;
    padding-top: 20px;
    /* Increased top margin/padding as requested */
    /* "Blank background" means transparent, falling through to main bg */
}

.leaderboard-entry.active .leaderboard-details {
    display: block;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* 5 Columns */
    gap: 15px;
    border: none;
    /* Borderless */
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-family: 'Bungee', cursive;
    font-size: 0.9rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    /* Black blurred shadow */
}

.tool-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    /* Shadow for icon */
}

.tool-x {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin: 0 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Remove Text Shadows in Popups */
.help-text,
.guide-text,
.guide-info h3,
.guide-info p {
    text-shadow: none !important;
}

/* Ensure Close Button is clickable */
.close-btn {
    z-index: 10;
}

/* Removed old h2 styling as we use tabs now */

.guide-item {
    display: flex;
    align-items: flex-start;
    /* Align Top Always */
    margin-bottom: 25px;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    transition: background 0.2s;
}

.guide-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.guide-img {
    width: 100px;
    /* Bigger */
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.guide-info {
    flex: 1;
}

.guide-info h3 {
    margin: 0 0 5px 0;
    font-family: 'Bungee', cursive;
    font-size: 1rem;
    color: #ffd700;
    /* Goldish for titles */
}

.guide-info p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.menu-footer {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-family: 'Bungee', cursive;
    font-size: 1.1rem;
    /* Slightly larger */
    margin-top: 20px;
    border-top: none;
    padding-top: 0;
    color: #ffffff;
    width: 100%;
}

.menu-footer span {
    cursor: pointer;
    transition: color 0.2s;
}

.menu-footer span:hover {
    color: #ffd700;
}

/* --- Loading Screen --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#loading-overlay .loading-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(0, 153, 255, 0.5));
}

.loading-text {
    font-family: 'Roboto', sans-serif;
    color: #fff;
    font-size: 1.2rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.loading-bar-container {
    width: 100%;
    height: 20px;
    background-color: #333;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.loading-bar-fill {
    width: 0%;
    height: 100%;
    background-color: #fff;
    transition: width 0.1s linear;
}

/* ========================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
    :root {
        --globe-width: 403px;
        /* Mobile: 274px * 1.47 (Original Aspect Ratio to fix stretching) */
    }

    /* --- Fix Background Scrollbars --- */
    html,
    body {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    body {
        background-attachment: fixed;
    }

    /* Un-lock both html and body for standalone pages to allow scrolling */
    html.standalone-page,
    body.standalone-page {
        overflow: auto !important;
        position: relative !important;
        height: auto !important;
        width: 100% !important;
    }

    /* Support case where only body has the class (modern browsers) */
    html:has(body.standalone-page) {
        overflow: auto !important;
        position: relative !important;
        height: auto !important;
    }

    /* --- Globe System --- */
    .globe-wrapper-anchor {
        width: 280px;
        height: 280px;
    }

    .globe-mask {
        width: 274px;
        height: 274px;
        top: 3px;
        left: 3px;
    }



    .globe-glow {
        top: -35px;
        left: -35px;
        right: -35px;
        bottom: -35px;
    }

    /* Shading Layer - Scale proportionally */
    .shading-layer {
        width: 290px !important;
        height: 290px !important;
        top: -8px !important;
        left: -8px !important;
    }

    /* --- Logo & Header --- */
    .logo {
        width: 150px;
        margin-bottom: 10px;
    }

    /* Move score down on mobile */
    .game-header {
        top: calc(25% - 40px);
    }

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

    .score-container {
        height: 4.2rem;
        /* Fixed height for flag (4rem) to prevent jump */
    }

    /* --- Control Icons --- */
    .ui-controls,
    .profile-control {
        top: 15px;
        gap: 18px;
    }

    .ui-controls {
        left: 15px;
    }

    .profile-control {
        right: 15px;
    }

    .ui-controls i,
    .profile-control i {
        font-size: 1.3rem;
    }

    /* --- Start Overlay PLAY Text --- */
    #start-overlay span {
        font-size: 2.5rem;
    }

    /* --- Travel Button - Moved down more --- */
    .moon-travel-btn {
        bottom: -50px;
        right: -10px;
        width: 60px;
    }

    .moon-travel-btn i {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .moon-travel-btn span {
        font-size: 0.65rem;
    }

    .moon-travel-btn .title {
        font-size: 1rem;
    }

    /* --- Overlay Panels --- */
    .help-content,
    .guide-content,
    .menu-content,
    .shop-content {
        width: 95%;
        max-width: none;
        padding: 25px 15px;
        height: 65vh;
    }

    .close-btn {
        font-size: 1.5rem;
        top: -20px;
        right: 5px;
    }

    /* --- Help Panel --- */
    .help-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }

    .help-text {
        font-size: 0.95rem;
        padding-right: 5px;
    }

    /* --- Guide Panels --- */
    .guide-title {
        font-size: 1.5rem;
        margin: 5px 0 15px;
        text-align: center;
        /* Center Title */
        width: 100%;
    }

    .guide-tabs {
        gap: 10px;
        margin-bottom: 20px;
    }

    .tab-btn {
        padding: 8px 20px;
        font-size: 1rem;
    }

    .tab-btn i {
        font-size: 1.3rem;
    }

    .guide-item {
        padding: 12px;
        gap: 12px;
        margin-bottom: 15px;
    }

    .guide-img {
        width: 70px;
        height: 70px;
    }

    .guide-info h3 {
        font-size: 0.9rem;
    }

    .guide-info p {
        font-size: 0.8rem;
    }

    /* --- Menu Panel --- */
    .menu-item {
        padding: 12px 15px;
        font-size: 1rem;
    }

    .menu-item i {
        font-size: 1.2rem;
        width: 30px;
        margin-right: 10px;
    }

    .menu-footer {
        gap: 20px;
        font-size: 0.7rem;
    }

    /* --- Shop Panel --- */
    .shop-content {
        padding: 20px 10px;
    }

    .shop-list {
        padding-right: 5px;
    }

    .shop-item {
        padding: 12px 10px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .shop-item img {
        width: 50px;
        height: 50px;
    }

    .shop-info {
        margin-left: 10px;
        flex: 1;
        min-width: 100px;
    }

    .shop-name {
        font-size: 0.95rem;
    }

    .shop-price {
        font-size: 1.1rem;
    }

    .btn-buy {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    /* --- Loading Screen --- */
    .loading-content {
        width: 250px;
    }

    #loading-overlay .loading-logo {
        width: 80px;
        height: 80px;
    }

    .loading-bar-container {
        height: 15px;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 400px) {
    .globe-wrapper-anchor {
        width: 240px;
        height: 240px;
    }

    .globe-mask {
        width: 234px;
        height: 234px;
    }

    /* Fix stretched globe textures for extra small screens */
    /* 240px container * 1.4725 = ~354px width */
    .earth-layer,
    .moon-layer,
    .clouds-layer {
        background-size: 354px auto;
    }

    @keyframes rotateGlobe {
        from {
            background-position-x: 0px;
        }

        to {
            background-position-x: 354px;
        }
    }

    .shading-layer {
        width: 250px !important;
        height: 250px !important;
    }

    .globe-glow {
        top: -30px;
        left: -30px;
        right: -30px;
        bottom: -30px;
    }

    .logo {
        width: 120px;
    }

    .score-board {
        font-size: 2rem;
    }

    #start-overlay span {
        font-size: 2rem;
    }

    .guide-img {
        width: 55px;
        height: 55px;
    }

    .shop-item img {
        width: 45px;
        height: 45px;
    }
}

/* --- Standalone Pages --- */
.standalone-page {
    min-height: 100vh;
    background-color: #000;
    background-image: url('space/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: white;
    font-family: system-ui, sans-serif;
    overflow-y: auto;
    overflow-x: hidden;
}

.back-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    font-family: 'Roboto', system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.back-link:hover {
    opacity: 1;
    transform: translateX(-3px);
}

.back-link i {
    font-size: 1.2rem;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px 40px;
    min-height: 100vh;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.page-wrapper .help-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.page-wrapper .help-text {
    max-height: none;
    overflow: visible;
}

.page-wrapper .guide-text {
    overflow: visible;
    width: 100%;
}

.page-wrapper .guide-list {
    overflow: visible;
    max-height: none;
}

.page-wrapper .shop-list {
    overflow: visible;
    max-height: none;
}

.page-wrapper .leaderboard-list {
    overflow: visible;
    max-height: none;
}

/* Astronauts Specific Styles */
.astronauts-intro {
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 20px;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
    padding: 0 10px;
}

#list-astronauts .lb-name {
    text-align: right;
    margin-right: 0;
    margin-left: auto;
    /* Push to right */
    padding-right: 10px;
}

/* --- Login Page Styles --- */
.login-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 350px;
    margin-top: 20px;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    border-radius: 8px;
    border: none;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
    text-decoration: none;
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-email {
    background: #555;
}

.btn-google {
    background: #ea4335;
}

.btn-apple {
    background: #000;
}

.login-btn i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.legal-content {
    font-family: 'Roboto', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    text-align: left;
    width: 100%;
}

.legal-content h1 {
    font-family: 'Bungee', cursive;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.legal-content h2 {
    font-family: 'Bungee', cursive;
    font-size: 1.2rem;
    margin: 25px 0 10px;
    color: #ffd700;
}

.legal-content p {
    margin-bottom: 15px;
}

.legal-content ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.legal-content li {
    margin-bottom: 8px;
}

.legal-content a {
    color: #ffd700;
    text-decoration: none;
    transition: opacity 0.2s;
}

.legal-content a:hover {
    opacity: 0.7;
}

/* --- Mobile Menu Styles (Global) --- */
#btn-menu {
    display: none;
    /* Hidden by default on desktop */
}

#mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(5px);
}

#mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#btn-mobile-close {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

#btn-mobile-close:hover {
    transform: scale(1.1);
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
    font-family: 'Bungee', cursive;
    font-size: 1.4rem;
    padding: 15px 40px;
    width: 100%;
    /* Full width */
    justify-content: flex-start;
    /* Left align */
    box-sizing: border-box;
    border-radius: 8px;
    /* Default radius */
    transition: background 0.2s, color 0.2s, border-radius 0.2s;
    cursor: pointer;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.mobile-menu-item i {
    font-size: 1.4rem;
    width: 30px;
    text-align: center;
    transition: color 0.2s;
}

.mobile-menu-item:hover {
    background: white;
    color: black;
    text-shadow: none;
    border-radius: 0;
    /* Remove radius on hover */
}

.mobile-menu-item:hover i {
    color: black;
}

.mobile-menu-footer {
    display: flex;
    gap: 40px;
    margin-top: 50px;
}

.mobile-menu-footer i {
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    transition: transform 0.2s;
}

.mobile-menu-footer i:hover {
    transform: scale(1.1);
}


/* --- Mobile Updates (Step 962) --- */
@media (max-width: 768px) {

    /* 1. Mobile Menu Logic & Icon Hiding */
    .ui-controls i {
        display: none;
        /* Hide top-left icons */
    }

    #btn-menu {
        display: block;
        /* Show ONLY menu icon */
        font-size: 1.8rem;
    }

    /* Hide Top-Right Icons (except Profile) */
    .profile-control i {
        display: none;
    }

    #btn-profile {
        display: inline-block;
        /* Keep Profile */
    }

    /* 2. Restore Icon Text (Smaller) */
    /* Redesigned Mobile Buttons (Grid Layout) */
    /* Redesigned Mobile Buttons (Flex Layout - Fit Content) */
    .guide-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        /* Reduced gap between buttons */
        width: 100%;
        max-width: 100%;
        /* Allow full width */
        margin: 0 auto 25px;
        /* Center container + bottom spacing */
        justify-content: center;
    }

    .tab-btn,
    .action-btn {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        width: auto !important;
        /* Fit content */
        flex: 0 1 auto;
        height: auto;
        padding: 8px 10px !important;
        /* Reduced padding to prevent stacking */
        gap: 6px !important;
        /* Reduced internal gap */
        box-sizing: border-box;
        margin: 0;
        /* Reset margins */
        min-width: 0;

        /* Ensure Font/Icon Sizes for Mobile */
        font-size: 0.9rem !important;
    }

    .tab-btn span,
    .action-btn span {
        display: block !important;
        font-size: 0.9rem !important;
        /* Restore readable size */
        margin: 0;
        /* Reset margin */
        line-height: 1;
    }

    .tab-btn i,
    .action-btn i {
        font-size: 1rem !important;
        margin: 0;
    }



    /* 3. Compact Leaderboard / Astronauts */
    .leaderboard-item {
        padding: 8px 10px;
    }

    .lb-rank {
        font-size: 0.9rem;
        min-width: 25px;
    }

    .lb-flag {
        width: 24px;
        height: 24px;
        margin: 0 8px;
    }

    .lb-name {
        font-size: 0.85rem;
    }

    .lb-score {
        font-size: 0.9rem;
    }

    /* 4. 3-Column Tool Grid on Mobile */
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* 5. Layout Reset & Center Scores */
    /* Fix Flex Direction to Column so Header and Globe stack vertically */
    .game-stage {
        flex-direction: column;
        justify-content: flex-start;
        /* Top align content in stage */
        padding-top: 10px;
    }

    /* Make Header Relative to flow between Logo and Planet */
    .game-header {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin-top: 10px;
        margin-bottom: 20px;
    }

    /* 6. Back Button Styling */
    .back-link {
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 15px 20px;
        background-color: rgba(0, 0, 0, 0.9) !important;
        /* 90% opacity forced */
        border-radius: 0;
        z-index: 9999;
        backdrop-filter: blur(2px);
    }

    /* Increase bottom padding for mobile wrapper to ensure margin at bottom */
    .page-wrapper {
        padding-bottom: 80px !important;
    }


}

/* --- Travel Confirmation Popup --- */
#travel-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    /* Remove background behind popup */
    z-index: 300;
    /* Above regular guides */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}

#travel-confirm-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.travel-confirm-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: rgba(0, 0, 0, 0.9);
    /* 90% black */
    border: none;
    /* No borders */
    border-radius: 20px;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.travel-icon {
    font-size: 5rem;
    color: white;
    margin-bottom: 25px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

.travel-title {
    font-family: 'Bungee', cursive;
    font-size: 1.4rem;
    color: #ffd700;
    /* Yellow */
    margin-bottom: 15px;
    line-height: 1.3;
}

.travel-message {
    font-family: 'Roboto', system-ui, sans-serif;
    font-size: 0.95rem;
    /* Smaller font as requested */
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 35px;
    letter-spacing: 0.3px;
}

#btn-travel-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
}

#btn-travel-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

#btn-pay-travel {
    width: 100%;
    max-width: 250px;
}

/* --- Nickname Page --- */
.nickname-container {
    width: 90%;
    max-width: 450px;
    background: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    margin-top: 20px;
}

.nickname-instruction {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 25px;
    line-height: 1.5;
}

.nickname-instruction span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.input-group {
    width: 100%;
    margin-bottom: 10px;
}

#nickname-input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #ffd700;
    font-size: 2rem;
    /* Larger font size */
    font-weight: 900;
    font-family: 'Roboto', sans-serif;
    text-align: center;
    outline: none;
    transition: all 0.2s;
}

#nickname-input:focus {
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.15);
}

.error-text {
    color: #ff4d4d;
    font-size: 0.85rem;
    margin-top: 8px;
    font-family: 'Roboto', sans-serif;
}

.error-text.hidden {
    display: none;
}

/* --- Profile Page --- */
.profile-header {
    text-align: center;
    margin-bottom: 40px;
}

.welcome-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.profile-nickname {
    font-family: 'Roboto', sans-serif;
    /* Changed for case sensitivity */
    font-size: 3.5rem;
    font-weight: 900;
    /* Boldest */
    color: #ffd700;
    /* Yellow */
    margin-top: 5px;
    text-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.profile-value-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: -10px;
    margin-bottom: 30px;
}

.profile-value {
    font-family: 'Bungee', cursive;
    font-size: 4rem;
    /* Matching index total value size */
    color: #ffffff;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.profile-value-symbol {
    font-family: 'Bungee', cursive;
    font-size: 4rem;
    color: #fff;
    opacity: 0.5;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.section-title {
    font-family: 'Bungee', cursive;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 25px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.profile-section {
    width: 100%;
    max-width: 800px;
}

.tools-grid-profile {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* 5 columns desktop */
    gap: 15px;
    width: 100%;
}

.tool-item-profile {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s;
}

.tool-item-profile:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.tool-icon-wrapper {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.tool-icon-wrapper img {
    max-width: 100%;
    max-height: 100%;
}

.tool-count {
    font-family: 'Bungee', cursive;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .tools-grid-profile {
        grid-template-columns: repeat(3, 1fr);
        /* 3 columns mobile */
    }

    .profile-nickname {
        font-size: 2rem;
    }
}