/* Basic styles for the game */
body {
    margin: 0;
    padding: 0;
    background-color: #0a0c10;
    color: white;
    font-family: 'Press Start 2P', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2vh;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 2 / 1;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(200, 136, 70, 0.25);
    border: 5px solid #c88846;
    border-radius: 12px;
    overflow: hidden;
    background-color: #1a0f0f;
    touch-action: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* HUD Header */
#hudHeader {
    position: absolute;
    top: 18px;
    left: 0;
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.hud-scores {
    display: flex;
    gap: 10px;
}

.hud-pill {
    background: rgba(15, 8, 8, 0.9);
    border: 2px solid #c88846;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 11px;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 3px 3px 0 #000;
}

#highScoreDisplay {
    color: #ffd700;
}

.hud-btn {
    background: #2a1208;
    border: 2px solid #c88846;
    color: #fff;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    box-shadow: 3px 3px 0 #000;
    pointer-events: auto;
}

.hud-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #000;
}

/* Modals */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 5, 5, 0.88);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 20;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.overlay.hidden {
    display: none !important;
}

.pixel-card {
    border: 4px solid #c88846;
    background: rgba(36, 18, 12, 0.96);
    padding: 30px 36px;
    border-radius: 12px;
    box-shadow: 8px 8px 0 #000;
    max-width: 600px;
    width: 95%;
}

.overlay h1 {
    font-size: 26px;
    margin-bottom: 18px;
    color: #ffdfba;
    text-shadow: 3px 3px 0 #4a2114;
    letter-spacing: 1px;
}

.overlay p {
    color: #e6ccb2;
    font-size: 11px;
    line-height: 1.8;
    margin-bottom: 14px;
    text-shadow: 1px 1px 0 #000;
}

.sub-tip {
    font-size: 10px;
    color: #e09f67;
    margin-bottom: 16px;
    line-height: 1.5;
}

button, button.action-btn {
    font-family: 'Press Start 2P', monospace;
    background: #f59e0b;
    color: #000;
    border: 3px solid #ffe8d6;
    padding: 14px 32px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 5px 5px 0 #000;
    border-radius: 6px;
    transition: transform 0.1s, background 0.1s;
}

button:hover, button.action-btn:hover {
    transform: scale(1.04);
    background: #fbbf24;
}

button:active, button.action-btn:active {
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0 #000;
}

.back-link {
    display: inline-block;
    margin-top: 14px;
    color: #ffd700;
    font-size: 9px;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Mobile Jump Bar (Hidden on desktop) */
.mobile-jump-bar {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding: 0;
        overflow: hidden;
        background-color: #000;
    }
    .game-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        width: 100dvw;
        height: 100dvh;
        z-index: 9999;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        background: #000;
        max-width: none;
    }
    #game-container {
        width: 100dvw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        border: none;
        border-radius: 0;
    }

    .game-info-section, .site-footer {
        display: none !important;
    }

    /* Dedicated Mobile Jump Button */
    .mobile-jump-bar {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        z-index: 10001;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 13px 16px;
        background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
        color: #000;
        font-family: 'Press Start 2P', monospace;
        font-size: 11px;
        letter-spacing: 0.5px;
        border: 2px solid #fff;
        border-radius: 8px;
        box-shadow: 0 4px 0 #78350f, 0 6px 12px rgba(0, 0, 0, 0.6);
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.05s, box-shadow 0.05s;
    }
    .mobile-jump-bar:active {
        transform: translateX(-50%) translateY(2px);
        box-shadow: 0 2px 0 #78350f;
        background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
    }

    /* Compact Mobile HUD */
    #hudHeader {
        top: 6px;
        padding: 0 8px;
    }
    .hud-pill {
        padding: 4px 8px;
        font-size: 8px;
        border-width: 1.5px;
        border-radius: 6px;
        box-shadow: 2px 2px 0 #000;
    }
    .hud-btn {
        padding: 4px 7px;
        font-size: 11px;
        border-width: 1.5px;
        border-radius: 5px;
        box-shadow: 2px 2px 0 #000;
    }

    /* Compact Modal Cards */
    .overlay {
        padding: 8px;
    }
    .pixel-card {
        padding: 12px 14px;
        border-width: 2.5px;
        border-radius: 8px;
        box-shadow: 4px 4px 0 #000;
        max-width: 96%;
    }
    .overlay h1 {
        font-size: 15px;
        margin-bottom: 6px;
        text-shadow: 2px 2px 0 #4a2114;
    }
    .overlay p {
        font-size: 8.5px;
        line-height: 1.45;
        margin-bottom: 6px;
    }
    .sub-tip {
        font-size: 7px;
        line-height: 1.4;
        margin-bottom: 6px;
    }
    button, button.action-btn {
        margin-top: 6px;
        padding: 8px 18px;
        font-family: 'Press Start 2P', monospace;
        font-size: 11px;
        border-width: 2px;
        box-shadow: 3px 3px 0 #000;
    }
    .back-link {
        margin-top: 6px;
        font-size: 8px;
    }
}

/* Mobile Auto-Flip for Portrait */
@media (max-width: 768px) and (orientation: portrait) {
    .game-wrapper {
        transform: rotate(90deg);
        transform-origin: center center;
        width: 100dvh;
        height: 100dvw;
        position: fixed;
        top: 50%;
        left: 50%;
        margin-top: -50dvw;
        margin-left: -50dvh;
    }
    #game-container {
        width: 100%;
        height: 100%;
    }
    .mobile-jump-bar {
        bottom: 20px;
        width: 80%;
    }
}

/* Ko-fi Footer */
.site-footer {
    text-align: center;
    padding: 24px 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}
.kofi-footer-container {
    margin: 10px 0;
    display: flex;
    justify-content: center;
    width: 100%;
}
.kofi-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000000 !important;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.35);
}
.kofi-button:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 26px rgba(245, 158, 11, 0.6);
    filter: brightness(1.05);
}
.kofi-icon {
    font-size: 1.2rem;
    display: inline-block;
    animation: kofi-wiggle 3.5s ease-in-out infinite;
    transform-origin: bottom center;
}
@keyframes kofi-wiggle {
    0%, 82%, 100% { transform: rotate(0deg); }
    86% { transform: rotate(-12deg); }
    90% { transform: rotate(10deg); }
    94% { transform: rotate(-6deg); }
    97% { transform: rotate(4deg); }
}
