/* CSS Stylesheet: Sisyphus: The Climb */

:root {
    --primary: #a05a2c; /* Earthy terracotta/bronze */
    --primary-light: #c27a3d;
    --primary-glow: rgba(160, 90, 44, 0.4);
    --bg-darker: #120e0a; /* Dark sand/earthy soil */
    --bg-dark: #1b1612;
    --bg-slate: #2c241d;
    --text-light: #f0e6df; /* Warm sand/parchment text */
    --text-muted: #a39485;
    --glass-bg: rgba(27, 22, 18, 0.75);
    --glass-border: rgba(240, 230, 223, 0.08);
    --glass-glow: rgba(240, 230, 223, 0.03);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --safe-area-inset-bottom: 0px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--bg-darker);
    color: var(--text-light);
    font-family: var(--font-body);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========================================== */
/* PHONE FRAME SIMULATOR (DESKTOP)            */
/* ========================================== */
.phone-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 440px;
    max-height: 900px;
    aspect-ratio: 9 / 19.5;
    background: #000;
    border-radius: 44px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8),
                0 0 0 12px #1e293b,
                0 0 0 13px #0f172a;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-frame {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 36px;
}

/* Screen bezel & top notch simulated on desktop */
.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 28px;
    background: #000;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    z-index: 1000;
    pointer-events: none;
}

/* Full screen application */
.game-screen {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #4f3f30 0%, #8c765c 70%, #a08c73 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 3D WebGL Canvas */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ========================================== */
/* HEAD-UP DISPLAY (HUD)                      */
/* ========================================== */
.hud-header {
    position: absolute;
    top: 40px; /* Spacer for notch */
    left: 0;
    width: 100%;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.stats-group {
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.stat-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    min-width: 85px;
    transition: var(--transition);
}

.points-box {
    border-color: rgba(217, 119, 6, 0.3);
    box-shadow: 0 0 15px rgba(217, 119, 6, 0.1);
}

.stat-box .icon {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.stat-value {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-light);
}

.points-box .stat-value {
    color: var(--primary-light);
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 3px;
}

.header-actions {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.icon-btn:hover, .icon-btn:active {
    background: var(--bg-slate);
    border-color: var(--primary);
    transform: scale(1.05);
}

/* ========================================== */
/* PROGRESS & HEIGHT INDICATORS               */
/* ========================================== */
.altitude-indicator {
    position: absolute;
    left: 16px;
    top: 130px;
    bottom: 260px;
    width: 30px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.altitude-bar-container {
    flex: 1;
    width: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.altitude-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, var(--primary), var(--primary-light));
    border-radius: 3px;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: height 0.1s linear;
}

.altitude-marker {
    position: absolute;
    left: 12px;
    transform: translateY(50%);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.altitude-marker::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
    margin-right: 6px;
}

.altitude-text {
    margin-top: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 4px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

/* ========================================== */
/* SPEEDOMETER                                */
/* ========================================== */
.speed-container {
    position: absolute;
    right: 16px;
    top: 130px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px 12px;
    text-align: right;
    pointer-events: none;
    z-index: 10;
}

.speed-value {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-light);
}

.speed-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ========================================== */
/* SHOP FLOATING BUTTON                       */
/* ========================================== */
.shop-trigger-btn {
    position: absolute;
    right: 16px;
    bottom: 220px;
    z-index: 10;
    background: linear-gradient(135deg, var(--bg-slate) 0%, rgba(30, 41, 59, 0.8) 100%);
    border: 1px solid rgba(217, 119, 6, 0.4);
    color: var(--text-light);
    border-radius: 20px;
    padding: 10px 16px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5),
                0 0 15px rgba(217, 119, 6, 0.15);
    transition: var(--transition);
}

.shop-trigger-btn:hover, .shop-trigger-btn:active {
    transform: translateY(-2px);
    border-color: var(--primary-light);
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.6),
                0 0 20px rgba(245, 158, 11, 0.3);
}

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

/* ========================================== */
/* TAP ZONES                                  */
/* ========================================== */
.tap-zones-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 190px;
    display: flex;
    z-index: 5;
    padding: 16px;
    gap: 16px;
    background: linear-gradient(to top, rgba(3, 0, 30, 0.85) 0%, rgba(3, 0, 30, 0) 100%);
}

.tap-zone {
    flex: 1;
    position: relative;
    border: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

/* Custom left/right distinct styling */
.left-zone {
    border-color: rgba(99, 102, 241, 0.15); /* Light Indigo subtle */
}
.right-zone {
    border-color: rgba(239, 68, 68, 0.15); /* Light Red subtle */
}

.tap-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    transition: var(--transition);
}

.tap-letter {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.tap-sub {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.3);
}

/* Active states for tapping feedback */
.tap-zone:active {
    transform: scale(0.97);
}

.left-zone:active {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.2);
}
.left-zone:active .tap-letter {
    color: #818cf8;
    transform: scale(1.1);
}

.right-zone:active {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.2);
}
.right-zone:active .tap-letter {
    color: #f87171;
    transform: scale(1.1);
}

/* Rhythm Guide */
.rhythm-guide {
    position: absolute;
    bottom: 205px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.rhythm-guide.visible {
    opacity: 1;
}
.guide-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
    letter-spacing: 0.05em;
    animation: flash 1s infinite alternate;
}

@keyframes flash {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ========================================== */
/* SHOP DRAWER SYSTEM                         */
/* ========================================== */
.shop-drawer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.shop-drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.shop-drawer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65%;
    background: linear-gradient(to top, var(--bg-dark) 80%, var(--bg-slate) 100%);
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.8);
}
.shop-drawer.active {
    transform: translateY(0);
}

.shop-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.shop-drag-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto 12px;
}

.shop-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.shop-title-row h3 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-light);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.shop-tabs {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 0;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--bg-slate);
    color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.shop-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.shop-body::-webkit-scrollbar {
    width: 4px;
}
.shop-body::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.shop-tab-content {
    display: none;
}
.shop-tab-content.active {
    display: block;
}

/* Item styling */
.upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.shop-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(30, 41, 59, 0.4);
}

.item-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

.item-details {
    flex: 1;
}

.item-details h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.item-details p {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.item-level {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-top: 4px;
    text-transform: uppercase;
}

.buy-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #b45309 100%);
    border: none;
    color: var(--text-light);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
    min-width: 75px;
    transition: var(--transition);
}

.buy-btn:hover, .buy-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
}

.buy-btn.maxed {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.buy-btn.insufficient {
    background: #334155;
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    box-shadow: none;
}

/* Grids for cosmetic skins & stickers */
.skins-grid, .stickers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding-bottom: 20px;
}

.cosmetic-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.cosmetic-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.cosmetic-card.equipped {
    border-color: var(--primary);
    background: rgba(217, 119, 6, 0.05);
    box-shadow: 0 0 15px rgba(217, 119, 6, 0.1);
}

.cosmetic-preview-container {
    width: 60px;
    height: 60px;
    margin: 0 auto 8px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
    overflow: hidden;
}

.cosmetic-preview {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
}

.cosmetic-card h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.cosmetic-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    transition: var(--transition);
}

.cosmetic-card.equipped .cosmetic-status {
    background: var(--primary);
    color: var(--text-light);
}

.cosmetic-card.owned:not(.equipped) .cosmetic-status {
    background: var(--bg-slate);
    color: var(--text-light);
}

.cosmetic-card.locked .cosmetic-status {
    background: rgba(217, 119, 6, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(217, 119, 6, 0.3);
}

.cosmetic-card.locked.insufficient .cosmetic-status {
    background: #1e293b;
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.05);
}

/* ========================================== */
/* MODALS & OVERLAYS                          */
/* ========================================== */
.modal-overlay, .victory-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 12, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-overlay.active, .victory-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card, .victory-card {
    background: linear-gradient(135deg, var(--bg-slate) 0%, var(--bg-dark) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 28px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    transform: scale(0.9);
    transition: var(--transition);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.modal-overlay.active .modal-card,
.victory-modal.active .victory-card {
    transform: scale(1);
}

.modal-card h3, .victory-card h2 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.modal-card p, .victory-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.help-section {
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

.help-section h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-light);
    margin-bottom: 8px;
}

.help-section ul {
    list-style-type: none;
}

.help-section li {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 8px;
    padding-left: 14px;
    position: relative;
    line-height: 1.4;
}

.help-section li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.confirm-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #b45309 100%);
    border: none;
    color: var(--text-light);
    width: 100%;
    padding: 12px 0;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
    transition: var(--transition);
}

.confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.45);
}

/* Victory styling specific */
.victory-card h2 {
    color: var(--primary-light);
    font-size: 1.8rem;
    text-shadow: 0 0 15px rgba(245,158,11,0.3);
}

.victory-sparkles {
    font-size: 2.2rem;
    margin-bottom: 12px;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

.victory-reward {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 600;
}

.reward-val {
    color: var(--primary-light);
    font-weight: 800;
    font-size: 1.3rem;
}

.victory-hint {
    font-style: italic;
    font-size: 0.75rem !important;
}

/* Responsive Overrides (For pure mobile screens) */
@media (max-width: 440px), (max-height: 900px) {
    body {
        background-color: var(--bg-darker);
    }
    
    .phone-wrapper {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
    
    .phone-frame {
        border-radius: 0;
    }
    
    .phone-notch {
        display: none; /* Notch doesn't cover real status bar on actual mobile web */
    }
    
    .hud-header {
        top: 20px; /* Safe space */
    }
}

/* Helper Utilities */
.hidden {
    display: none !important;
}

/* Balance Indicator Styles */
.balance-container {
    position: absolute;
    bottom: 215px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(240, 230, 223, 0.15);
    border-radius: 6px;
    z-index: 10;
    overflow: visible;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.balance-center-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: rgba(240, 230, 223, 0.4);
}

.balance-marker {
    position: absolute;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #c27d3d; /* terracotta */
    border: 2px solid #f0e6df;
    border-radius: 50%;
    transform: translate(-50%);
    transition: left 0.05s ease-out, background-color 0.2s ease;
    box-shadow: 0 0 8px rgba(194, 125, 61, 0.8);
}

.balance-marker.danger {
    background: #ef4444;
    box-shadow: 0 0 12px #ef4444;
    border-color: #ffffff;
}

/* Red overlay when falling/dying */
.death-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(239, 68, 68, 0.25);
    box-shadow: inset 0 0 100px rgba(239, 68, 68, 0.85);
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    transition: opacity 0.25s ease-in;
}

.death-overlay.active {
    opacity: 1;
}

.fall-warning-text {
    position: absolute;
    bottom: 236px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: #ef4444;
    text-transform: uppercase;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}

.fall-warning-text.visible {
    opacity: 1;
    animation: pulse-danger 0.5s infinite alternate;
}

@keyframes pulse-danger {
    0% { transform: translate(-50%) scale(0.95); opacity: 0.7; }
    100% { transform: translate(-50%) scale(1.05); opacity: 1; }
}

/* Main Menu Showcase Overlay */
.main-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(18, 14, 10, 0.9) 0%, rgba(18, 14, 10, 0.15) 35%, rgba(18, 14, 10, 0.15) 65%, rgba(18, 14, 10, 0.95) 100%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 65px 24px 80px;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-menu-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.08);
}

.menu-header {
    text-align: center;
}

.menu-header h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 3.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
    line-height: 1;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8), 0 0 10px rgba(160, 90, 44, 0.3);
}

.menu-subtitle {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.45em;
    color: var(--primary-light);
    text-transform: uppercase;
    text-indent: 0.45em;
    display: block;
    margin-top: 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.menu-stats-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 14px 28px;
    display: flex;
    gap: 32px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.6);
    transform: translateY(-40px);
}

.menu-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.menu-stat .val {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.45rem;
    color: var(--text-light);
}

.menu-stat:first-child .val {
    color: var(--primary-light);
}

.menu-stat .lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 2px;
}

.menu-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 280px;
}

.menu-play-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #b45309 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    width: 100%;
    padding: 16px 0;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.08em;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(160, 90, 44, 0.4), 0 0 12px rgba(255,255,255,0.05);
    transition: var(--transition);
}

.menu-play-btn:hover, .menu-play-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(160, 90, 44, 0.55), 0 0 20px rgba(255,255,255,0.15);
}

.menu-shop-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-light);
    width: 100%;
    padding: 12px 0;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.menu-shop-btn:hover, .menu-shop-btn:active {
    background: var(--bg-slate);
    border-color: var(--primary-light);
}

/* Transitions for HUD elements in Menu state */
.hud-header, .altitude-indicator, .speed-container, .tap-zones-overlay, .balance-container {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hud-header.menu-active {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-20px);
}

.altitude-indicator.menu-active {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(-20px);
}

.speed-container.menu-active {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(20px);
}

.tap-zones-overlay.menu-active {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(40px);
}

.balance-container.menu-active {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(20px);
}

/* ========================================== */
/* SPONSOR & AD SYSTEM STYLING                */
/* ========================================== */

.sponsor-item {
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    background: linear-gradient(135deg, rgba(27, 22, 18, 0.9) 0%, rgba(67, 40, 20, 0.5) 100%) !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.05), inset 0 1px 2px rgba(255, 255, 255, 0.05);
}

.sponsor-item:hover {
    border-color: rgba(245, 158, 11, 0.6) !important;
    background: linear-gradient(135deg, rgba(35, 28, 23, 0.95) 0%, rgba(85, 52, 26, 0.6) 100%) !important;
}

.sponsor-icon {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.ad-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
    color: #120e0a !important;
    text-shadow: none !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35) !important;
}

.ad-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.5) !important;
}

/* 1. Ad Consent Prompt Modal */
.ad-prompt-overlay {
    z-index: 1500 !important; /* Above shop, below fallback ad */
}

.ad-prompt-card {
    text-align: center;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(245, 158, 11, 0.1) !important;
}

.ad-prompt-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.ad-prompt-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    width: 100%;
}

.ad-prompt-confirm {
    flex: 1.3;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
    color: #120e0a !important;
    font-weight: 700;
}

.ad-prompt-cancel {
    flex: 1;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-muted) !important;
}

.ad-prompt-cancel:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-light) !important;
}

/* 4. Particle Burst & Toast Notifications */
.ad-claim-particle {
    position: fixed;
    pointer-events: none;
    z-index: 2500;
    transition: none;
    transform-origin: center;
}

.ad-toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translate(-50%, 40px);
    background: rgba(27, 22, 18, 0.95);
    border: 1px solid #fbbf24;
    border-radius: 20px;
    color: #fbbf24;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 12px 24px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 15px rgba(251, 191, 36, 0.25);
    opacity: 0;
    pointer-events: none;
    z-index: 3000;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ad-toast.active {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
