/* Retro Arcade Boxing Theme */

:root {
    --neon-blue: #00f3ff;
    --neon-pink: #ff00ea;
    --health-player: #00ff00;
    --health-enemy: #ff0000;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #050510;
    font-family: 'Press Start 2P', cursive;
    overflow: hidden;
    /* Prevent scrolling during gameplay */
    user-select: none;
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
}

#output_canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* CSS transform scaleX(-1) mirror effect can be added here, 
       but we will do it logically in JS to ensure gameplay math makes sense */
}

/* UI Overlay Layer */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through to canvas if needed */
    z-index: 10;
}

/* Overlay Screens (Start, Game Over) */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    pointer-events: auto;
    /* Catch clicks for buttons */
}

h1 {
    font-size: 4rem;
    color: var(--neon-blue);
    text-shadow: 4px 4px 0px var(--neon-pink);
    margin-bottom: 2rem;
    letter-spacing: 5px;
}

h2 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 2rem;
}

p {
    color: #ccc;
    font-size: 1rem;
    line-height: 2;
    margin-bottom: 1rem;
}

button {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    padding: 1rem 2rem;
    margin-top: 2rem;
    background-color: var(--neon-pink);
    color: #fff;
    border: 4px solid #fff;
    cursor: pointer;
    box-shadow: 6px 6px 0px var(--neon-blue);
    transition: transform 0.1s, box-shadow 0.1s;
}

button:hover {
    transform: translate(2px, 2px);
    box-shadow: 4px 4px 0px var(--neon-blue);
}

button:active {
    transform: translate(6px, 6px);
    box-shadow: 0px 0px 0px var(--neon-blue);
}

/* Status Text */
.status-warning {
    color: #ffaa00;
    margin-top: 2rem;
    font-size: 0.8rem;
    animation: flash 1s infinite alternate;
}

.status-ready {
    color: #00ffaa;
    margin-top: 2rem;
    font-size: 0.8rem;
}

@keyframes flash {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.3;
    }
}

/* ------------- HUD (Health Bars) ------------- */

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    display: flex;
    justify-content: space-between;
    padding: 20px 50px;
    box-sizing: border-box;
}

.health-container {
    display: flex;
    flex-direction: column;
    width: 35%;
}

.hp-label {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0px #000;
}

.enemy-hp-box {
    align-items: flex-end;
}

.health-bar-bg {
    width: 100%;
    height: 30px;
    background-color: #333;
    border: 4px solid #fff;
    box-shadow: 4px 4px 0px #000;
    position: relative;
    overflow: hidden;
}

.health-bar-fill {
    width: 100%;
    /* Updates via JS */
    height: 100%;
    background-color: var(--health-player);
    transition: width 0.2s ease-out;
    transform-origin: left;
}

.enemy-fill {
    background-color: var(--health-enemy);
    transform-origin: right;
    float: right;
    /* Aligns visually to the right */
}

/* Action Text (DODGE! BLOCK!) */
#action-text {
    position: absolute;
    top: 150px;
    width: 100%;
    text-align: center;
    font-size: 3rem;
    color: #fff;
    text-shadow: 3px 3px 0px #000, -3px -3px 0px #ff00ea;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

/* Big Round Texts */
#round-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 6rem;
    color: #fff;
    text-shadow: 6px 6px 0px #f00;
    animation: zoomInOut 1.5s forwards;
    pointer-events: none;
}

@keyframes zoomInOut {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    30% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    70% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* Screen Shake Effect */
@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(0px, 0px) rotate(0deg);
    }
}

.shake {
    animation: shake 0.3s cubic-bezier(.36, .07, .19, .97) both;
}

/* --- New Fitness HUD Styles --- */
#timer-box {
    color: #fff;
    font-size: 3rem;
    text-shadow: 2px 2px 0px #000, 0 0 10px #00f3ff;
    align-self: flex-start;
    margin-top: -10px;
}

.combo-style {
    color: #ffaa00;
    font-size: 1rem;
    margin-left: 10px;
    text-shadow: 1px 1px 0px #000;
}

/* Stats Grid for Game Over Screen */
#stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border: 3px solid var(--neon-blue);
    margin-bottom: 20px;
    text-align: left;
}

.stat-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-size: 1rem;
    padding: 10px;
    border-bottom: 1px solid #333;
}

.stat-val {
    color: var(--neon-pink);
    font-weight: bold;
    margin-left: 20px;
}

.neon-text {
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
    font-size: 1.5rem;
}

/* Telemetry Panel (Force & Speed) - Alt Bant */
#telemetry-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.85) 20%, rgba(0, 0, 0, 0.95) 100%);
    border-top: 2px solid var(--neon-blue);
    padding: 18px 20px;
    color: var(--neon-blue);
    text-shadow: 0 0 5px var(--neon-blue);
    box-shadow: 0 -4px 20px var(--neon-blue);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    transition: transform 0.1s;
    z-index: 100;
}

.tele-divider {
    width: 1px;
    height: 24px;
    background: rgba(0, 255, 255, 0.3);
}

.tele-row {
    font-size: 0.8rem;
    color: #aaa;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tele-row span {
    font-size: 1.3rem;
    color: #ffd700;
    text-shadow: 0 0 8px #ffd700;
}