/**
 * platformer.css - Dad's Great Escape game styles
 */

* {
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: #1a1a2e;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 15px;
    z-index: 201;
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.back-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 15px;
}

.back-btn:hover, .back-btn:active {
    color: #1a1a2e;
}

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

.lives {
    font-size: 1.3rem;
}

.level-display {
    color: white;
    font-weight: bold;
    font-size: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.ammo-display {
    color: #FFD700;
    font-weight: bold;
    font-size: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.3);
    padding: 2px 8px;
    border-radius: 10px;
}

.score-display {
    color: #FFD700;
    font-weight: bold;
    font-size: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.pause-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pause-btn:hover {
    background: white;
    color: #1a1a2e;
}

#gameContainer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Touch Controls */
.touch-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    z-index: 90;
    pointer-events: none;
}

body.touch-device .touch-controls {
    display: flex;
}

.control-group {
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.control-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: 4px solid rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    transition: transform 0.1s, background 0.1s;
}

.control-btn:active, .control-btn.active {
    transform: scale(0.9);
    background: rgba(255,255,255,0.6);
}

.control-btn.large {
    width: 95px;
    height: 95px;
    font-size: 2.5rem;
}

/* D-pad style for movement */
.dpad {
    display: flex;
    gap: 5px;
}

/* Action buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-row {
    display: flex;
    gap: 10px;
}

.attack-btn {
    background: rgba(255,100,100,0.5);
    border-color: rgba(255,150,150,0.8);
}

.attack-btn.has-weapon {
    background: rgba(255,200,0,0.6);
    border-color: rgba(255,220,100,0.9);
    box-shadow: 0 0 15px rgba(255,200,0,0.5);
}

/* Overlays */
.overlay {
    z-index: 200;
    color: white;
    text-align: center;
}

.overlay h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
}

.overlay h2 {
    font-size: 1.8rem;
}

.overlay p {
    margin-bottom: 15px;
    opacity: 0.9;
    color: inherit;
    max-width: none;
}

.overlay .controls-hint {
    font-size: 0.95rem;
    opacity: 0.7;
    margin-bottom: 25px;
    line-height: 1.6;
}

.start-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    padding: 15px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 20px rgba(255,165,0,0.4);
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(255,165,0,0.6);
}

.hidden {
    display: none !important;
}

/* Confetti — uses shared .confetti and @keyframes confettiFall from game-common.css */

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Bonus Timer */
.bonus-timer {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #FFD700;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 1.3rem;
    font-weight: bold;
    z-index: 201;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,215,0,0.4);
    display: none;
}

.bonus-timer.timer-critical {
    color: #FF4444;
    border-color: rgba(255,68,68,0.6);
    animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.1); }
}

/* Responsive */
@media (max-width: 500px) {
    .control-btn {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    .control-btn.large {
        width: 85px;
        height: 85px;
        font-size: 2.2rem;
    }
    .touch-controls {
        height: 160px;
        padding: 10px 15px;
    }
    .overlay h1 {
        font-size: 1.8rem;
    }
}

@media (max-height: 500px) {
    .touch-controls {
        height: 120px;
    }
    .control-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    .control-btn.large {
        width: 70px;
        height: 70px;
    }
}

/* ===== MODE SELECTOR ===== */
.mode-select-content {
    text-align: center;
}

.mode-select-content h2 {
    font-size: 2rem;
    margin-bottom: 8px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
}

.mode-select-content > p {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 20px;
}

.mode-cards {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-card {
    background: rgba(30,30,60,0.9);
    border: 3px solid;
    border-radius: 20px;
    padding: 25px 20px;
    width: 200px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.mode-card:hover {
    transform: scale(1.05);
}

.mode-card:active {
    transform: scale(0.97);
}

.mode-normal {
    border-color: #4CAF50;
}

.mode-normal:hover {
    box-shadow: 0 0 25px rgba(76,175,80,0.5);
}

.mode-hard {
    border-color: #dc3545;
}

.mode-hard:hover {
    box-shadow: 0 0 25px rgba(220,53,69,0.5);
}

.mode-emoji {
    display: block;
    font-size: 3rem;
    margin-bottom: 10px;
}

.mode-title {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.mode-desc {
    display: block;
    font-size: 0.85rem;
    opacity: 0.7;
    line-height: 1.4;
}

/* ===== HARD MODE VISUAL INDICATORS ===== */
.hard-badge {
    display: none;
    color: #ff4444;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    background: rgba(220,20,60,0.2);
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid rgba(220,20,60,0.4);
}

body.hard-mode .hard-badge {
    display: block;
}

body.hard-mode .hud {
    border-bottom: 2px solid rgba(220,20,60,0.4);
    box-shadow: 0 2px 10px rgba(220,20,60,0.3);
    padding-bottom: 6px;
}

/* ===== HARD MODE GAME OVER ===== */
.hard-gameover-bg {
    background: linear-gradient(180deg, rgba(60,0,0,0.95) 0%, rgba(20,0,0,0.98) 100%);
}

.hard-gameover-skull {
    font-size: 4rem;
    margin-bottom: 10px;
}

.hard-gameover-title {
    font-size: 2.2rem;
    color: #ff4444;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255,0,0,0.5);
    margin-bottom: 5px;
}

.hard-gameover-badge {
    display: inline-block;
    background: rgba(220,20,60,0.3);
    border: 1px solid #dc3545;
    color: #ff6b6b;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.hard-gameover-stats {
    text-align: left;
    max-width: 260px;
    margin: 0 auto 20px;
    font-size: 1rem;
    line-height: 1.8;
}

.hard-gameover-stats span {
    color: #FFD700;
    font-weight: bold;
}

@media (prefers-reduced-motion: reduce) {
    .mode-card {
        transition: none;
    }
}

@media (max-width: 500px) {
    .mode-card {
        width: 160px;
        padding: 18px 14px;
    }
    .mode-emoji {
        font-size: 2.5rem;
    }
    .hard-gameover-skull {
        font-size: 3rem;
    }
    .hard-gameover-title {
        font-size: 1.8rem;
    }
}
