* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body {
    margin: 0;
    padding: 24px 16px 60px 16px;
    background-color: #1a1512;
    color: #4a3424;
    font-family: 'Press Start 2P', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin: 0 auto;
}

/* Top Brand Navigation Banner (PC) */
.top-nav {
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 18px;
    margin-bottom: 12px;
    background: rgba(26, 21, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: system-ui, -apple-system, sans-serif;
}

.brand-link {
    font-family: 'Cinzel', serif, system-ui;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #f59e0b;
    text-decoration: none;
    transition: filter 0.2s;
    line-height: 1;
}

.brand-link:hover {
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
}

.nav-divider {
    color: #94a3b8;
    opacity: 0.4;
    font-size: 1.1rem;
    line-height: 1;
}

.nav-sublink {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: color 0.2s;
    line-height: 1;
}

.nav-sublink:hover {
    color: #fff;
}

.game-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.15));
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 20px;
    line-height: 1;
}

@media (max-width: 768px) {
    .top-nav {
        display: none !important;
    }
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 2 / 1;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(210, 180, 140, 0.3);
    border-radius: 10px;
    overflow: hidden;
    background-color: #F8F1DF; /* Will be dynamically updated by game.js */
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#scoreDisplay {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 16px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.65);
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #4a3424;
    text-shadow: 1px 1px 0 #000;
    z-index: 10;
    text-align: right;
    line-height: 1.5;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(248, 241, 223, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    backdrop-filter: blur(3px);
}

.overlay h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #8b5a2b;
    text-shadow: 2px 2px 0 #fff;
}

.overlay p {
    font-size: 14px;
    margin-bottom: 30px;
    line-height: 1.5;
    color: #4a3424;
}

button {
    font-family: 'Press Start 2P', monospace;
    background: #8b5a2b;
    color: #fff;
    border: 4px solid #4a3424;
    padding: 15px 30px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.1s;
}

button:hover {
    transform: scale(1.05);
    background: #a06e3b;
}

button:active {
    transform: scale(0.95);
}

.cookie-lb-btn {
    font-family: 'Press Start 2P', monospace !important;
    background: #d97706 !important;
    color: #ffffff !important;
    border: 4px solid #78350f !important;
    padding: 13px 26px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    margin-top: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-shadow: 2px 2px 0 #78350f !important;
    box-shadow: 0 4px 0 #78350f !important;
    transition: transform 0.1s, background 0.1s, box-shadow 0.1s !important;
    width: auto !important;
}

.cookie-lb-btn:hover {
    background: #f59e0b !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 0 #78350f !important;
}

.cookie-lb-btn:active {
    transform: translateY(2px) !important;
    box-shadow: 0 2px 0 #78350f !important;
}

.hidden {
    display: none !important;
}
@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;
        aspect-ratio: auto !important;
    }
    .game-info-section, .site-footer {
        display: none !important;
    }
    .overlay h1 {
        font-size: 20px;
    }
    .overlay p {
        font-size: 10px;
    }
    button {
        padding: 10px 20px;
        font-size: 12px;
    }
    #scoreDisplay {
        font-size: 12px;
    }
}

/* Mobile Auto-Flip for Portrait (Matching Coffee Crash) */
@media (max-width: 768px) and (orientation: portrait) {
    html, body {
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #000 !important;
    }
    .game-info-section, .site-footer {
        display: none !important;
    }
    .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%;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        aspect-ratio: auto !important;
    }
    #gameCanvas {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }
}

@media (max-width: 950px) and (orientation: landscape) {
    html, body {
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #000 !important;
    }
    .game-info-section, .site-footer {
        display: none !important;
    }
    .game-wrapper {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }
    #game-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100dvw !important;
        height: 100dvh !important;
        transform: none !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        aspect-ratio: auto !important;
        z-index: 100 !important;
    }
    #gameCanvas {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }
}
/* 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); }
}
