/* CSS for Mayan Kukulkan Feathered Serpent Snake (2026-08-13) */
:root {
    --bg-dark: #070b10;
    --bg-panel: rgba(14, 22, 30, 0.88);
    --jade-primary: #00e676;
    --jade-light: #b9f6ca;
    --jade-dark: #00897b;
    --gold-primary: #ffd700;
    --gold-light: #fff59d;
    --gold-dark: #c79a00;
    --solar-orange: #ff6d00;
    --solar-fire: #ff3d00;
    --obsidian-dark: #0d131a;
    --border-gold: rgba(255, 215, 0, 0.4);
    --border-jade: rgba(0, 230, 118, 0.35);
    --text-light: #e8f5e9;
    --text-muted: #80cbc4;
    --font-heading: 'Cinzel', 'Noto Sans SC', serif;
    --font-ui: 'Orbitron', 'Outfit', sans-serif;
    --font-body: 'Outfit', 'Noto Sans SC', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background & Ambient Visuals */
.mayan-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 40%, #0d211a 0%, #070b10 85%);
    z-index: -3;
}

.obsidian-sun-disk-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vw;
    max-width: 800px;
    max-height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.06) 0%, rgba(0, 230, 118, 0.03) 40%, transparent 70%);
    box-shadow: 0 0 120px rgba(0, 230, 118, 0.08), inset 0 0 80px rgba(255, 109, 0, 0.06);
    pointer-events: none;
    z-index: -2;
    animation: sunPulse 12s ease-in-out infinite alternate;
}

@keyframes sunPulse {
    0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

.solar-flares-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 109, 0, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(0, 230, 118, 0.08) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
}

.ambient-jade-dust {
    position: fixed;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle at 40% 60%, rgba(0, 230, 118, 0.04), transparent 60%),
                radial-gradient(circle at 70% 30%, rgba(255, 215, 0, 0.05), transparent 50%);
    animation: dustDrift 20s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: -1;
}

@keyframes dustDrift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-3%, 3%) scale(1.05); }
}

/* Container & Header */
.app-container {
    width: 100%;
    max-width: 900px;
    min-height: 100vh;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-panel);
    border: 2px solid var(--border-gold);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(0, 230, 118, 0.15);
    backdrop-filter: blur(12px);
    margin-bottom: 16px;
}

.back-home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 8px 14px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    transition: all 0.25s ease;
}

.back-home-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.25);
}

.title-wrapper {
    text-align: center;
}

.main-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--gold-light);
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4), 0 0 20px rgba(0, 230, 118, 0.3);
}

.sub-highlight {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--jade-primary);
    display: block;
    letter-spacing: 3px;
    margin-top: 2px;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
    letter-spacing: 1px;
}

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

.icon-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-jade);
    color: var(--text-light);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(0, 230, 118, 0.15);
    border-color: var(--jade-primary);
    transform: scale(1.05);
}

/* Dashboard Stats */
.dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-panel);
    border: 1.5px solid rgba(255, 215, 0, 0.25);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-ui);
    font-size: 1.3rem;
    font-weight: 800;
}

.card-jade .stat-value {
    color: var(--jade-primary);
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}

.card-gold .stat-value {
    color: var(--gold-primary);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.card-solar .stat-value {
    color: var(--solar-orange);
    text-shadow: 0 0 10px rgba(255, 109, 0, 0.4);
}

.energy-card {
    grid-column: span 1;
    align-items: stretch;
}

.energy-bar-track {
    width: 100%;
    height: 14px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-gold);
    border-radius: 7px;
    overflow: hidden;
    position: relative;
}

.energy-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6d00, #ffd700, #00e676);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
    transition: width 0.25s ease-out;
    position: relative;
}

.energy-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: barShimmer 2s infinite;
}

@keyframes barShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Main Content & Game Canvas */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1 / 1;
    background: var(--obsidian-dark);
    border: 3px solid var(--border-gold);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 230, 118, 0.15);
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Solar Overlay Badge */
.solar-overlay {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 10;
}

.solar-overlay.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.solar-badge {
    background: linear-gradient(135deg, rgba(255, 109, 0, 0.95), rgba(255, 215, 0, 0.95));
    color: #050a0f;
    font-weight: 900;
    font-size: 0.85rem;
    padding: 8px 18px;
    border-radius: 30px;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    letter-spacing: 1px;
    white-space: nowrap;
}

/* Overlay Screens */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 11, 16, 0.88);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 20;
}

.overlay-screen.active {
    opacity: 1;
    pointer-events: auto;
}

.glass-panel {
    background: rgba(14, 22, 30, 0.92);
    border: 2px solid var(--gold-primary);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 230, 118, 0.1);
    padding: 28px 24px;
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.mayan-icon-wrapper {
    margin: 0 auto 16px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mayan-svg {
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.6));
    animation: iconSpin 25s linear infinite;
}

@keyframes iconSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.overlay-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--gold-light);
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.overlay-subtitle {
    font-size: 0.88rem;
    color: var(--jade-primary);
    margin-bottom: 20px;
}

.rules-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    margin-bottom: 24px;
    background: rgba(0, 0, 0, 0.35);
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.15);
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-light);
}

.rule-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.btn {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 800;
    padding: 12px 28px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), var(--solar-orange));
    color: #070b10;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

.btn-glow {
    animation: btnPulse 2s infinite alternate;
}

@keyframes btnPulse {
    0% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
    100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.8); }
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    border: 1px solid var(--border-gold);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.text-danger {
    color: #ff5252 !important;
    text-shadow: 0 0 12px rgba(255, 82, 82, 0.5);
}

.gameover-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.go-stat {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.go-stat span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.go-stat strong {
    font-family: var(--font-ui);
    font-size: 1.1rem;
    color: var(--gold-primary);
}

.go-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Touch Controls */
.touch-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 600px;
    padding: 10px 16px;
    background: var(--bg-panel);
    border: 1.5px solid var(--border-gold);
    border-radius: 16px;
}

.dpad {
    position: relative;
    width: 130px;
    height: 130px;
}

.dpad-btn {
    position: absolute;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid var(--border-jade);
    color: var(--gold-primary);
    border-radius: 10px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
}

.dpad-btn:active {
    background: rgba(0, 230, 118, 0.3);
    transform: scale(0.92);
}

.dpad-up { top: 0; left: 44px; }
.dpad-left { top: 44px; left: 0; }
.dpad-right { top: 44px; right: 0; }
.dpad-down { bottom: 0; left: 44px; }

.solar-touch-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 90px;
    background: linear-gradient(135deg, rgba(255, 109, 0, 0.25), rgba(255, 215, 0, 0.25));
    border: 2px solid var(--gold-primary);
    border-radius: 14px;
    color: var(--gold-light);
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 4px 16px rgba(255, 109, 0, 0.3);
}

.solar-touch-btn:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, rgba(255, 109, 0, 0.6), rgba(255, 215, 0, 0.6));
}

.solar-touch-btn .btn-icon {
    font-size: 1.6rem;
    margin-bottom: 2px;
}

.solar-touch-btn .btn-text {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 1px;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(5, 8, 12, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

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

.modal-card {
    text-align: left;
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-gold);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-family: var(--font-heading);
    color: var(--gold-primary);
    font-size: 1.2rem;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
}

.modal-close-btn:hover {
    color: #fff;
}

.help-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-list li {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-light);
}

.footer {
    text-align: center;
    padding: 16px 0 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .header {
        padding: 10px 14px;
    }

    .main-title {
        font-size: 1.1rem;
    }

    .subtitle {
        font-size: 0.68rem;
    }

    .dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .energy-card {
        grid-column: span 2;
    }

    .overlay-card {
        padding: 20px 16px;
    }

    .overlay-title {
        font-size: 1.25rem;
    }

    .touch-controls {
        padding: 8px 12px;
    }

    .dpad {
        width: 110px;
        height: 110px;
    }

    .dpad-btn {
        width: 36px;
        height: 36px;
    }

    .dpad-up { left: 37px; }
    .dpad-left { top: 37px; }
    .dpad-right { top: 37px; }
    .dpad-down { left: 37px; }

    .solar-touch-btn {
        width: 90px;
        height: 80px;
    }
}
