/* ============================================
   CRUNCHY'S CEREAL RUN - Game Page Styles
   Brand: Critter Crunchies by Kappa Foods
   ============================================ */

:root {
    --teal: #00b4a6;
    --teal-dark: #009688;
    --pink: #e91e8c;
    --pink-light: #ff4db8;
    --orange: #ff6d00;
    --orange-light: #ff9e40;
    --yellow: #ffd600;
    --yellow-light: #fff176;
    --blue: #2979ff;
    --purple: #7c4dff;
    --purple-dark: #6200ea;
    --dark: #2d1b4e;
    --white: #ffffff;
    --off-white: #fef9f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    color: var(--dark);
    background: linear-gradient(180deg, #1a0a2e 0%, #2d1b4e 50%, #3d2566 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Header ---- */
.game-header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 24px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-kappa {
    font-family: 'Bangers', cursive;
    font-size: 11px;
    color: #ff1744;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.logo-critter {
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    background: linear-gradient(135deg, var(--teal), var(--pink), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-tagline {
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    font-weight: 600;
}

/* ---- Main Game Area ---- */
.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px 24px;
}

.game-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 28px;
    text-align: center;
    color: var(--yellow);
    text-shadow: 3px 3px 0 var(--orange), 6px 6px 0 rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.game-subtitle {
    font-family: 'Fredoka One', cursive;
    font-size: 18px;
    color: var(--pink-light);
    text-align: center;
    margin-bottom: 24px;
}

/* ---- Game Container ---- */
.game-container {
    position: relative;
    background: #1a1a2e;
    border-radius: 16px;
    border: 4px solid var(--teal);
    box-shadow:
        0 0 20px rgba(0, 180, 166, 0.3),
        0 0 60px rgba(0, 180, 166, 0.1),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    max-width: 1208px;
    width: 100%;
}

.score-display {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid rgba(0, 180, 166, 0.2);
}

.score-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.score-value {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    color: var(--yellow);
}

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

.game-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 10;
}

.game-instructions.hidden {
    display: none;
}

.instruction-main {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    color: var(--white);
    margin-bottom: 12px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.8);
    animation: blink 1.2s ease-in-out infinite;
}

.instruction-main kbd {
    background: var(--yellow);
    color: var(--dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
}

.instruction-sub {
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ---- Difficulty Select ---- */
.difficulty-select {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
    pointer-events: all;
}

.diff-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.15s ease;
}

.diff-btn:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: rgba(0, 180, 166, 0.1);
}

.diff-btn.active {
    border-color: var(--yellow);
    color: var(--yellow);
    background: rgba(255, 214, 0, 0.15);
    box-shadow: 0 0 12px rgba(255, 214, 0, 0.2);
}

/* ---- Mobile Jump Button ---- */
.game-controls-mobile {
    display: none;
    margin-top: 16px;
    width: 100%;
    max-width: 1208px;
}

.jump-btn {
    width: 100%;
    padding: 20px;
    font-family: 'Press Start 2P', monospace;
    font-size: 16px;
    background: linear-gradient(135deg, var(--teal), var(--blue));
    color: var(--white);
    border: 3px solid var(--teal);
    border-radius: 12px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: transform 0.1s ease;
}

.jump-btn:active {
    transform: scale(0.96);
    background: linear-gradient(135deg, var(--teal-dark), var(--blue));
}

/* ---- Game Lore ---- */
.game-lore {
    max-width: 600px;
    text-align: center;
    margin-top: 24px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.game-lore p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.game-lore strong {
    color: var(--yellow);
}

/* ---- Footer ---- */
.game-footer {
    text-align: center;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.game-footer p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
}

.game-footer a {
    color: var(--teal);
    text-decoration: none;
    font-weight: 700;
}

.game-footer a:hover {
    color: var(--pink-light);
}

/* ---- Responsive ---- */
@media (max-width: 840px) {
    .game-title {
        font-size: 20px;
    }

    .game-subtitle {
        font-size: 16px;
    }
}

@media (max-width: 640px) {
    .game-main {
        padding: 20px 12px 16px;
    }

    .game-title {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .game-subtitle {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .game-container {
        border-width: 3px;
        border-radius: 12px;
    }

    .instruction-main {
        font-size: 11px;
    }

    .game-controls-mobile {
        display: block;
    }

    .score-display {
        padding: 6px 12px;
    }

    .score-value {
        font-size: 12px;
    }

    .game-lore {
        margin-top: 16px;
        padding: 12px 16px;
    }
}
