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

body {
    margin: 0;
    padding: 16px 12px 48px 12px;
    background: radial-gradient(circle at 50% 25%, #25140b 0%, #0d0603 100%);
    color: white;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    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%;
    max-width: 980px;
    margin: 0 auto;
}

/* Top Brand Navigation Banner */
.top-nav {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 18px;
    margin-bottom: 14px;
    background: rgba(18, 11, 7, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-link {
    font-family: 'Cinzel', serif;
    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.7));
}

.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.5);
    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;
    }
}

/* 8-Bit Dino Game Container */
#game-container {
    position: relative;
    width: 100%;
    max-width: 960px;
    aspect-ratio: 3 / 1;
    min-height: 250px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85), 0 0 25px rgba(217, 119, 6, 0.2);
    border: 4px solid #b45309;
    border-radius: 12px;
    overflow: hidden;
    background-color: #fbf5eb;
    touch-action: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* In-Game HUD Header */
#hudHeader {
    position: absolute;
    top: 12px;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.hud-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-scores {
    display: flex;
    gap: 10px;
}

.hud-pill {
    background: rgba(28, 15, 9, 0.85);
    border: 2px solid #b45309;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    color: #fef08a;
    letter-spacing: 1px;
    box-shadow: 2px 2px 0 #000;
}

.hud-shield {
    background: rgba(2, 132, 199, 0.9);
    border: 2px solid #38bdf8;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: #ffffff;
    letter-spacing: 0.5px;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.7), 2px 2px 0 #000;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: shieldPulse 1.2s infinite alternate;
}

.hud-shield.hidden {
    display: none !important;
}

@keyframes shieldPulse {
    0% {
        box-shadow: 0 0 6px rgba(56, 189, 248, 0.4), 2px 2px 0 #000;
        border-color: #38bdf8;
    }
    100% {
        box-shadow: 0 0 14px rgba(56, 189, 248, 0.95), 2px 2px 0 #000;
        border-color: #ffffff;
    }
}

.hud-btn {
    background: rgba(28, 15, 9, 0.85);
    border: 2px solid #b45309;
    color: #fff;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    box-shadow: 2px 2px 0 #000;
    pointer-events: auto;
    transition: transform 0.1s, background 0.15s;
}

.hud-btn:hover {
    background: rgba(50, 25, 15, 0.95);
    transform: scale(1.05);
}

.hud-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* Overlays (Start & Game Over) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(14, 8, 5, 0.86);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 20;
    backdrop-filter: blur(4px);
    padding: 16px;
}

.overlay.hidden {
    display: none !important;
}

.pixel-card {
    border: 4px solid #f59e0b;
    background: rgba(26, 14, 8, 0.95);
    padding: 24px 28px;
    border-radius: 12px;
    box-shadow: 6px 6px 0 #000;
    max-width: 520px;
    width: 92%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pixel-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 24px;
    color: #fbbf24;
    text-shadow: 3px 3px 0 #78350f;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.cooked-title {
    color: #ef4444;
    text-shadow: 3px 3px 0 #7f1d1d;
}

.cooked-sub {
    font-size: 13px;
    color: #fed7aa;
    margin-bottom: 16px;
    font-weight: 600;
}

.dino-instructions {
    margin: 10px 0 16px 0;
    font-size: 12px;
    color: #fde68a;
    line-height: 1.8;
}

.key-badge {
    display: inline-block;
    background: #451a03;
    border: 2px solid #b45309;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 2px 2px 0 #000;
    margin: 0 4px;
}

.sub-hint {
    font-size: 11px;
    color: #d97706;
    margin-top: 6px;
}

.high-score-banner {
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.gold-text {
    color: #f59e0b;
}

.score-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.action-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.6);
    box-shadow: 4px 4px 0 #000;
    transition: transform 0.1s, filter 0.15s;
    border: none;
}

.play-btn {
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    border: 3px solid #86efac;
    color: #ffffff;
}

.lb-btn {
    background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
    border: 3px solid #fde68a;
    color: #1a0f08;
    font-weight: 900;
}

.action-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.03);
}

.action-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.space-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 14px;
    letter-spacing: 0.5px;
}

/* Auth Bar */
.auth-bar-start {
    margin-bottom: 14px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-prompt-label {
    font-size: 10px;
    color: #fde68a;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.skibidi-logged-out {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.skibidi-user-pill {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.6);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    color: #fef08a;
    display: inline-block;
    margin-right: 8px;
}

.skibidi-logout-btn {
    background: #451a03;
    border: 1px solid #78350f;
    color: #cbd5e1;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
}

/* Leaderboard Submission Card on Game Over */
.go-leaderboard-card {
    width: 100%;
    background: rgba(18, 10, 6, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    padding: 8px 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
    text-align: center;
}

.lb-submit-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    color: #e2e8f0;
}

.lb-status-icon {
    font-size: 14px;
}

.lb-auth-prompt {
    margin-top: 6px;
    border-top: 1px solid rgba(245, 158, 11, 0.2);
    padding-top: 6px;
}

.lb-prompt-title {
    font-size: 10px;
    color: #fef08a;
    margin-bottom: 6px;
    font-weight: 600;
}

.google-btn-wrapper {
    display: flex;
    justify-content: center;
}

/* Mobile Specific Buttons */
.mobile-flip-btn {
    display: none;
    font-size: 12px;
    padding: 6px 8px;
}

.mobile-duck-btn {
    display: none;
    position: absolute;
    bottom: 12px;
    right: 14px;
    z-index: 15;
    background: rgba(28, 15, 9, 0.88);
    border: 3px solid #f59e0b;
    color: #fef08a;
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    padding: 12px 18px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 2px 2px 0 #000;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.mobile-duck-btn:active {
    background: rgba(245, 158, 11, 0.95);
    color: #1a0f08;
    transform: scale(0.96);
}

/* Mobile Auto-Flip 90deg on Portrait */
@media (max-width: 900px) and (orientation: portrait) {
    html, body {
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .top-nav, .game-info-section, .site-footer {
        display: none !important;
    }

    .game-wrapper {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        width: 100vh !important;
        width: 100dvh !important;
        height: 100vw !important;
        height: 100dvw !important;
        transform: translate(-50%, -50%) rotate(90deg) !important;
        transform-origin: center center !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        overflow: hidden !important;
    }

    body.flip-270 .game-wrapper {
        transform: translate(-50%, -50%) rotate(-90deg) !important;
    }

    #game-container {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        aspect-ratio: auto !important;
        border-radius: 0 !important;
        border: none !important;
    }

    .mobile-flip-btn {
        display: inline-flex !important;
    }

    .mobile-duck-btn {
        display: flex !important;
    }

    .pixel-card {
        padding: 10px 16px !important;
        max-width: 92% !important;
        max-height: 94% !important;
    }

    .pixel-title {
        font-size: 15px !important;
        margin-bottom: 4px !important;
    }

    .dino-instructions {
        margin: 3px 0 6px 0 !important;
        font-size: 8.5px !important;
        line-height: 1.4 !important;
    }

    .sub-hint {
        font-size: 7.5px !important;
        margin-top: 2px !important;
    }

    .high-score-banner {
        font-size: 8.5px !important;
        margin-bottom: 6px !important;
    }

    .score-summary {
        margin-bottom: 6px !important;
        font-size: 9.5px !important;
        gap: 12px !important;
    }

    .action-btn {
        font-size: 9.5px !important;
        padding: 6px 12px !important;
    }

    .cooked-sub {
        font-size: 9px !important;
        margin-bottom: 6px !important;
    }
}

/* Mobile Landscape (Native Horizontal) */
@media (max-height: 520px) and (orientation: landscape) {
    html, body {
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .top-nav, .game-info-section, .site-footer {
        display: none !important;
    }

    .game-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        width: 100dvw !important;
        height: 100vh !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
    }

    #game-container {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        aspect-ratio: auto !important;
        border-radius: 0 !important;
        border: none !important;
    }

    .mobile-duck-btn {
        display: flex !important;
    }

    .pixel-card {
        padding: 10px 16px !important;
        max-width: 90% !important;
        max-height: 94% !important;
    }

    .pixel-title {
        font-size: 15px !important;
        margin-bottom: 4px !important;
    }

    .dino-instructions {
        margin: 3px 0 6px 0 !important;
        font-size: 8.5px !important;
        line-height: 1.4 !important;
    }

    .sub-hint {
        font-size: 7.5px !important;
        margin-top: 2px !important;
    }

    .high-score-banner {
        font-size: 8.5px !important;
        margin-bottom: 6px !important;
    }

    .score-summary {
        margin-bottom: 6px !important;
        font-size: 9.5px !important;
        gap: 12px !important;
    }

    .action-btn {
        font-size: 9.5px !important;
        padding: 6px 12px !important;
    }
}

/* Game Info and SEO section */
.game-info-section {
    margin-top: 24px;
    margin-bottom: 20px;
    max-width: 960px;
    width: 100%;
    padding: 20px;
    color: #f8fafc;
    text-align: left;
    background: rgba(24, 15, 10, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.game-info-section h2 {
    font-family: 'Outfit', sans-serif;
    color: #f59e0b;
    font-size: 1.2rem;
    margin-top: 12px;
    margin-bottom: 6px;
}

.game-info-section h2:first-child {
    margin-top: 0;
}

.game-info-section p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #cbd5e1;
}

/* Ko-Fi Footer (Standard Skibidi Style) */
.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); }
}
