/* ========================================
   Jungle Dash - Game Styles
   ======================================== */

/* CSS Variables for Game */
:root {
    --game-primary: #6366f1;
    --game-secondary: #8b5cf6;
    --game-accent: #ec4899;
    --game-bg: #1e293b;
    --game-light: #f8fafc;
    --game-gold: #fbbf24;
    --game-danger: #ef4444;
    --game-success: #10b981;
}

/* ========================================
   Game Container
   ======================================== */

#web-game-section {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    padding: 60px 0;
    min-height: 100vh;
}

.game-wrapper {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.game-container {
    position: relative;
    background: var(--game-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* ========================================
   Game UI Overlay
   ======================================== */

.game-ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.game-ui-overlay > * {
    pointer-events: auto;
}

/* ========================================
   Game HUD (Heads Up Display)
   ======================================== */

.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    z-index: 10;
}

.game-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-title i {
    color: var(--game-accent);
}

.game-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
}

.stat-item i {
    font-size: 18px;
}

.stat-item.coins i {
    color: var(--game-gold);
}

.stat-item.distance i {
    color: var(--game-primary);
}

/* ========================================
   Game Menu Screens
   ======================================== */

.game-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 20;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.game-menu.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.menu-logo {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--game-primary) 0%, var(--game-secondary) 50%, var(--game-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-align: center;
}

.menu-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.menu-score {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px 40px;
    margin-bottom: 30px;
    text-align: center;
}

.menu-score-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 5px;
}

.menu-score-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--white);
}

.menu-score-value span {
    font-size: 18px;
    font-weight: 500;
    color: var(--game-gold);
}

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

.game-btn {
    width: 100%;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.game-btn-primary {
    background: linear-gradient(135deg, var(--game-primary) 0%, var(--game-secondary) 100%);
    color: var(--white);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.game-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.game-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.game-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.game-btn-success {
    background: linear-gradient(135deg, var(--game-success) 0%, #059669 100%);
    color: var(--white);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.game-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.5);
}

.game-btn-danger {
    background: linear-gradient(135deg, var(--game-danger) 0%, #dc2626 100%);
    color: var(--white);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.game-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.5);
}

.game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.menu-controls {
    margin-top: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.menu-controls p {
    margin: 5px 0;
}

.menu-controls kbd {
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
}

/* ========================================
   Power Up Active Indicators
   ======================================== */

.powerup-indicators {
    position: absolute;
    top: 60px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 15;
}

.powerup-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: var(--white);
    animation: powerupPulse 1s ease-in-out infinite;
}

.powerup-indicator.magnet {
    border: 2px solid #3b82f6;
}

.powerup-indicator.double {
    border: 2px solid var(--game-gold);
}

.powerup-indicator i {
    font-size: 16px;
}

.powerup-indicator.magnet i {
    color: #3b82f6;
}

.powerup-indicator.double i {
    color: var(--game-gold);
}

@keyframes powerupPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ========================================
   Shop Modal
   ======================================== */

.shop-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

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

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.shop-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
}

.shop-close {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.shop-balance {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--game-gold) 0%, #f59e0b 100%);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 20px;
    align-self: flex-start;
}

.shop-balance i {
    font-size: 20px;
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.shop-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px 20px;
    transition: all 0.3s ease;
}

.shop-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--game-primary);
    transform: translateX(5px);
}

.shop-item-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.shop-item-icon.revive {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.shop-item-icon.magnet {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.shop-item-icon.double {
    background: linear-gradient(135deg, var(--game-gold) 0%, #f59e0b 100%);
}

.shop-item-info {
    flex: 1;
}

.shop-item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 5px;
}

.shop-item-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.shop-item-price {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(251, 191, 36, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--game-gold);
}

.shop-item-price i {
    font-size: 14px;
}

/* ========================================
   Payment Modal
   ======================================== */

.payment-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    z-index: 40;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

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

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.payment-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-title i {
    color: var(--game-gold);
}

.payment-packages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 25px;
}

.payment-package {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-package:hover {
    border-color: var(--game-gold);
    background: rgba(251, 191, 36, 0.1);
}

.payment-package.selected {
    border-color: var(--game-gold);
    background: rgba(251, 191, 36, 0.15);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.payment-package-coins {
    font-size: 20px;
    font-weight: 700;
    color: var(--game-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.payment-package-price {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
}

.payment-package.best-value::after {
    content: 'BEST VALUE';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--game-gold);
    color: var(--game-bg);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
}

.payment-package.best-value {
    position: relative;
    border-color: var(--game-gold);
}

.payment-form {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 20px;
}

.payment-form-group {
    margin-bottom: 15px;
}

.payment-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.payment-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.payment-form input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--white);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.payment-form input:focus {
    outline: none;
    border-color: var(--game-primary);
    background: rgba(255, 255, 255, 0.08);
}

.payment-form input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.payment-card-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.payment-card-icon {
    width: 40px;
    height: 30px;
    background: var(--white);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-card-icon i {
    color: #1a1f71;
    font-size: 20px;
}

.payment-card-numbers {
    display: flex;
    gap: 5px;
}

.payment-card-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.payment-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.payment-buttons .game-btn {
    flex: 1;
}

/* ========================================
   Touch Controls (Mobile)
   ======================================== */

.touch-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    display: none;
    z-index: 25;
}

.touch-controls.active {
    display: block;
}

.touch-zone {
    position: absolute;
    bottom: 0;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: rgba(255, 255, 255, 0.3);
    user-select: none;
    -webkit-user-select: none;
}

.touch-zone-left {
    left: 0;
}

.touch-zone-right {
    right: 0;
}

.touch-zone:active {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   Notifications
   ======================================== */

.game-notification {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    z-index: 100;
    animation: notifySlide 0.3s ease, notifyFade 0.3s ease 2.7s forwards;
    pointer-events: none;
}

.game-notification.success {
    background: linear-gradient(135deg, var(--game-success) 0%, #059669 100%);
}

.game-notification.error {
    background: linear-gradient(135deg, var(--game-danger) 0%, #dc2626 100%);
}

.game-notification.info {
    background: linear-gradient(135deg, var(--game-primary) 0%, var(--game-secondary) 100%);
}

@keyframes notifySlide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes notifyFade {
    to {
        opacity: 0;
    }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    #web-game-section {
        padding: 20px 0;
    }

    .game-hud {
        padding: 10px 15px;
    }

    .game-title {
        font-size: 14px;
    }

    .stat-item {
        font-size: 14px;
    }

    .menu-logo {
        font-size: 32px;
    }

    .menu-score-value {
        font-size: 28px;
    }

    .menu-buttons {
        max-width: 240px;
    }

    .game-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .payment-packages {
        grid-template-columns: 1fr;
    }

    .touch-controls.active {
        display: block;
    }

    .powerup-indicators {
        top: 55px;
        right: 10px;
    }

    .powerup-indicator {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .game-stats {
        gap: 10px;
    }

    .stat-item span {
        display: none;
    }

    .stat-item i {
        font-size: 20px;
    }
}
