/* css/games.css — Styling for The Road Never Ends & One More Rep Mini-Games */

.game-window-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.game-canvas-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-canvas {
    background: #000;
    image-rendering: pixelated;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Touch Controls Bar for Mobile/Tablet */
.game-touch-bar {
    position: absolute;
    bottom: 12px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 16px;
    pointer-events: none;
    z-index: 100;
}

.touch-btn {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition: transform 0.1s, background 0.1s, border-color 0.1s;
}

.touch-btn:active, .touch-btn.touch-active {
    background: rgba(56, 189, 248, 0.35);
    border-color: #38bdf8;
    color: #fff;
    transform: scale(0.92);
}

#stroll-touch-jump {
    width: auto;
    min-width: 96px;
    border-radius: 25px;
    padding: 0 16px;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: var(--font-retro);
    letter-spacing: 1px;
}

/* Batman Game Touch Bar */
.batman-touch-bar {
    position: absolute;
    bottom: 16px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    pointer-events: none;
    z-index: 100;
}

.bat-touch-left-group, .bat-touch-right-group {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.bat-btn-action {
    width: auto;
    min-width: 86px;
    height: 48px;
    border-radius: 25px;
    padding: 0 14px;
    font-size: 0.88rem;
    font-weight: 800;
    font-family: var(--font-retro);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.bat-btn-primary {
    width: auto;
    min-width: 96px;
    height: 52px;
    border-radius: 26px;
    padding: 0 18px;
    font-size: 0.98rem;
    font-weight: 800;
    font-family: var(--font-retro);
    letter-spacing: 1px;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #fff;
    border: 2px solid #38bdf8;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.45);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#bat-touch-jump {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #fff;
    border-color: #38bdf8;
}

#bat-touch-batarang {
    color: #facc15;
    border-color: #facc15;
}

.voice-note-btn {
    background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
    color: #fff !important;
    border: 1.5px solid rgba(56, 189, 248, 0.6) !important;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35) !important;
    font-weight: 800;
}

.voice-note-btn:active, .voice-note-btn.touch-active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #0369a1, #0284c7) !important;
}

/* Big Curl Button for Gym */
.gym-curl-touch-btn {
    pointer-events: auto;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #fff;
    border: 1.5px solid rgba(56, 189, 248, 0.5);
    padding: 12px 36px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.45);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition: transform 0.1s, box-shadow 0.1s;
}

.gym-curl-touch-btn:active, .gym-curl-touch-btn.touch-active {
    transform: scale(0.94);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.7);
    background: linear-gradient(135deg, #0369a1, #0284c7);
}

/* Reaction popup modal in Car Game */
.car-reaction-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease-out;
}

.reaction-box {
    background: #1e293b;
    border: 2px solid #38bdf8;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 20px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.reaction-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
    image-rendering: pixelated;
}

.reaction-text {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent-gold);
    font-family: var(--font-retro);
}

/* Results Screen Overlay */
.game-results-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 29, 0.94);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: fadeIn 0.4s ease-out;
}

.results-card {
    background: #1e293b;
    border: 2px solid #38bdf8;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.25);
    border-radius: 14px;
    padding: 30px 36px;
    width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.results-fade-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #f87171;
    font-family: var(--font-retro);
    letter-spacing: 2px;
}

.results-fade-sub {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-blue);
    font-family: var(--font-retro);
    letter-spacing: 1px;
}

.results-quote {
    font-size: 0.95rem;
    font-style: italic;
    color: #e2e8f0;
    background: rgba(0, 0, 0, 0.4);
    border-left: 3px solid #38bdf8;
    padding: 10px 14px;
    border-radius: 4px;
    line-height: 1.4;
    width: 100%;
}

.results-rank-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.results-rank-badge {
    font-size: 2.2rem;
    font-weight: 900;
    color: #38bdf8;
    font-family: var(--font-retro);
    background: rgba(56, 189, 248, 0.15);
    border: 2px solid #38bdf8;
    padding: 4px 18px;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.4);
    letter-spacing: 2px;
}

.results-rank-badge.rank-s {
    color: #38bdf8;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.5);
}

.results-record-badge {
    background: linear-gradient(90deg, #0284c7, #6366f1);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 3px 12px;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
    animation: pulseRecord 1.5s infinite;
}

@keyframes pulseRecord {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.results-stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: var(--font-retro);
}

.stat-row strong {
    color: #38bdf8;
}

.results-buttons {
    display: flex;
    gap: 14px;
    margin-top: 6px;
}

/* Intro Screen Overlay */
.game-intro-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 29, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 400;
    animation: fadeIn 0.4s ease-out;
}

.intro-card {
    background: rgba(30, 41, 59, 0.85);
    border: 2px solid #38bdf8;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.25);
    border-radius: 14px;
    padding: 32px 36px;
    width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

/* Upgraded Arcade Mission Deck */
.car-arcade-deck {
    width: 480px;
    max-width: 94vw;
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid rgba(245, 158, 11, 0.7);
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.9),
        0 0 35px rgba(245, 158, 11, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 26px 30px;
    gap: 14px;
}

.deck-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.deck-tag {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.6);
    color: #f87171;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 2px 10px;
    border-radius: 12px;
    font-family: var(--font-retro);
}

.intro-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent-gold);
    font-family: var(--font-retro);
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

.deck-subtitle {
    font-size: 0.85rem;
    color: #38bdf8;
    letter-spacing: 1.5px;
    font-family: var(--font-retro);
}

.intro-quote {
    font-size: 0.88rem;
    font-style: italic;
    color: #e2e8f0;
    background: rgba(0, 0, 0, 0.5);
    border-left: 3px solid var(--accent-gold);
    padding: 8px 12px;
    border-radius: 4px;
    line-height: 1.35;
    width: 100%;
}

.car-specs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}

.spec-cell {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spec-k {
    font-size: 0.68rem;
    color: #94a3b8;
    font-family: var(--font-retro);
    letter-spacing: 1px;
}

.spec-v {
    font-size: 0.78rem;
    font-weight: 800;
    color: #f8fafc;
    font-family: var(--font-retro);
}

.deck-controls-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.ctrl-chip {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #e2e8f0;
    font-size: 0.76rem;
    font-family: var(--font-retro);
    padding: 4px 10px;
    border-radius: 12px;
}

.ctrl-key {
    color: #38bdf8;
    font-weight: bold;
}

.deck-mission-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.mission-pill {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    color: #cbd5e1;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: var(--font-ui);
}

.car-ignition-btn {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    padding: 12px 32px;
    border-radius: 25px;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.5);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    animation: pulseIgnition 2s infinite alternate;
}

.car-ignition-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.8);
}

@keyframes pulseIgnition {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(56, 189, 248, 0.4); }
    100% { transform: scale(1.03); box-shadow: 0 0 32px rgba(56, 189, 248, 0.75); }
}

/* Cockpit Touch Controls */
.car-cockpit-touch-bar {
    position: absolute;
    bottom: 14px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 100;
}

.touch-group {
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

.touch-btn-steer {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: all 0.15s;
}

.touch-btn-steer:active {
    background: rgba(56, 189, 248, 0.3);
    border-color: #38bdf8;
    transform: scale(0.92);
}

.touch-btn-brake {
    background: rgba(239, 68, 68, 0.25);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(239, 68, 68, 0.6);
    color: #f87171;
    height: 50px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    font-family: var(--font-retro);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: all 0.15s;
}

.touch-btn-brake:active {
    background: rgba(239, 68, 68, 0.5);
    transform: scale(0.92);
}

.touch-btn-gas {
    background: rgba(34, 197, 94, 0.25);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(34, 197, 94, 0.6);
    color: #4ade80;
    height: 50px;
    padding: 0 18px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    font-family: var(--font-retro);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: all 0.15s;
}

.touch-btn-gas:active {
    background: rgba(34, 197, 94, 0.5);
    transform: scale(0.92);
}

/* ============================================================ */
/* MOBILE PHONE OPTIMIZATION (@media max-width: 768px)          */
/* ============================================================ */
@media (max-width: 768px) {
    .game-canvas {
        touch-action: none;
    }

    .intro-card {
        width: 94%;
        max-width: 94%;
        max-height: 88vh;
        overflow-y: auto;
        padding: 16px 14px;
        gap: 10px;
    }

    .car-arcade-deck {
        padding: 16px 12px;
        gap: 10px;
    }

    .intro-title {
        font-size: clamp(1.15rem, 5vw, 1.6rem);
    }

    .deck-tag {
        font-size: 0.68rem;
    }

    .deck-subtitle {
        font-size: 0.72rem;
    }

    .intro-quote {
        font-size: 0.76rem;
    }

    .car-specs-grid {
        gap: 6px;
    }

    .spec-cell {
        padding: 4px 2px;
    }

    .spec-k {
        font-size: 0.6rem;
    }

    .spec-v {
        font-size: 0.7rem;
    }

    .deck-controls-row {
        gap: 4px;
    }

    .ctrl-chip {
        font-size: 0.68rem;
        padding: 3px 7px;
    }

    .deck-mission-pills {
        gap: 4px;
    }

    .mission-pill {
        font-size: 0.68rem;
        padding: 2px 6px;
    }

    .car-ignition-btn {
        font-size: 0.95rem;
        padding: 10px 22px;
        margin-top: 4px;
    }

    /* Cockpit Touch Controls */
    .car-cockpit-touch-bar {
        bottom: 10px;
        padding: 0 10px;
    }

    .touch-group {
        gap: 8px;
    }

    .touch-btn-steer {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
        touch-action: none;
    }

    .touch-btn-brake {
        height: 52px;
        padding: 0 14px;
        font-size: 0.8rem;
        touch-action: none;
    }

    .touch-btn-gas {
        height: 52px;
        padding: 0 16px;
        font-size: 0.85rem;
        touch-action: none;
    }

    .gym-curl-touch-btn {
        width: 82%;
        max-width: 260px;
        padding: 12px 20px;
        font-size: 1.05rem;
        touch-action: none;
    }

    .touch-btn {
        touch-action: none;
    }

    .reaction-box {
        padding: 14px 18px;
        gap: 12px;
    }

    .reaction-avatar {
        width: 48px;
        height: 48px;
    }

    .reaction-text {
        font-size: 1.1rem;
    }

    .results-card {
        width: 92%;
        max-width: 330px;
        padding: 20px 16px;
    }

    .results-title {
        font-size: 1.3rem;
    }

    .results-score-big {
        font-size: 2.2rem;
    }

    /* Batman Mobile Ergonomic Cockpit & Controls */
    #win-batman-game .game-window-container {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
        overflow: hidden;
    }

    #win-batman-game .game-canvas-wrap {
        flex: 1;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 0;
        position: relative;
    }

    .batman-touch-bar {
        position: relative;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 12px 14px clamp(16px, 3vh, 28px);
        background: linear-gradient(to top, rgba(10, 15, 29, 0.98), rgba(10, 15, 29, 0.8));
        border-top: 1px solid rgba(56, 189, 248, 0.25);
        display: flex;
        justify-content: space-between;
        align-items: center;
        z-index: 100;
        touch-action: none;
    }

    .bat-touch-left-group {
        display: flex;
        gap: 8px;
    }

    .bat-touch-right-group {
        display: flex;
    }

    .bat-btn-action {
        min-width: 76px;
        height: 52px;
        padding: 0 12px;
        font-size: 0.86rem;
        background: rgba(15, 23, 42, 0.85);
        border: 1.5px solid rgba(56, 189, 248, 0.45);
        touch-action: none;
    }

    .bat-btn-primary {
        min-width: 96px;
        height: 54px;
        padding: 0 18px;
        font-size: 1.05rem;
        touch-action: none;
    }

    #bat-touch-batarang {
        color: #facc15;
        border-color: rgba(250, 204, 21, 0.6);
        box-shadow: 0 2px 10px rgba(250, 204, 21, 0.2);
    }
}
