/* games.css — Shared game UI (HUDs, dialogs, overlays) */

/* === GAME HUD ELEMENTS === */
.hud-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px;
    font-size: 12px;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    pointer-events: none;
    z-index: 20;
}

.hud-score {
    font-weight: bold;
    letter-spacing: 2px;
}

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

.hud-life-icon {
    width: 12px;
    height: 12px;
    background: #cc2222;
    border-radius: 50%;
    border: 1px solid #ff4444;
}

/* Health bar */
.health-bar {
    width: 120px;
    height: 10px;
    background: #222;
    border: 1px solid #444;
    border-radius: 2px;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    background: linear-gradient(180deg, #44cc44 0%, #228822 100%);
    transition: width 0.3s;
}

.health-fill.low {
    background: linear-gradient(180deg, #cc4444 0%, #882222 100%);
    animation: healthPulse 0.5s ease-in-out infinite;
}

.health-fill.corrupted {
    background: linear-gradient(180deg, #8844cc 0%, #442288 100%);
}

@keyframes healthPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Timer display */
.hud-timer {
    font-size: 16px;
    font-weight: bold;
    color: #ffcc00;
    text-shadow: 1px 1px 0 #000, 0 0 8px rgba(255,204,0,0.3);
}

.hud-timer.danger {
    color: #ff4444;
    animation: timerDanger 0.3s ease-in-out infinite alternate;
}

@keyframes timerDanger {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

/* === DIALOG BOX === */
.game-dialog {
    position: absolute;
    bottom: 40px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 40, 0.9);
    border: 2px solid #6688cc;
    border-radius: 4px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    line-height: 1.6;
    z-index: 30;
    pointer-events: none;
}

.game-dialog .speaker {
    color: #88bbff;
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 12px;
}

.game-dialog .dialog-text {
    min-height: 40px;
}

.game-dialog .dialog-continue {
    position: absolute;
    bottom: 6px;
    right: 10px;
    color: #88bbff;
    font-size: 10px;
    animation: dialogBlink 1s ease-in-out infinite;
}

@keyframes dialogBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Corrupted dialog */
.game-dialog.corrupted {
    border-color: #cc4488;
    background: rgba(40, 0, 20, 0.9);
}

.game-dialog.corrupted .speaker {
    color: #ff4488;
}

/* === GAME OVER / TITLE SCREENS === */
.game-title-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 25;
}

.game-title {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 0 #000, 0 0 20px rgba(255,255,255,0.3);
    margin-bottom: 12px;
    letter-spacing: 3px;
}

.game-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.press-start {
    margin-top: 40px;
    font-size: 14px;
    color: #ffcc00;
    animation: pressStartBlink 1.5s ease-in-out infinite;
    letter-spacing: 3px;
}

@keyframes pressStartBlink {
    0%, 40% { opacity: 1; }
    50%, 90% { opacity: 0; }
    100% { opacity: 1; }
}

/* Game over */
.game-over-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.85);
    z-index: 25;
}

.game-over-text {
    font-size: 36px;
    font-weight: bold;
    color: #cc2222;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 6px;
}

.game-over-score {
    margin-top: 20px;
    font-size: 14px;
    color: #aaa;
}

/* === MENU === */
.game-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 30px;
}

.menu-item {
    font-size: 14px;
    color: #888;
    padding: 4px 20px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: color 0.2s;
}

.menu-item.selected {
    color: #fff;
}

.menu-item.selected::before {
    content: '▶ ';
    color: #ffcc00;
}

/* === INVENTORY / STATUS === */
.status-panel {
    position: absolute;
    top: 40px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
    z-index: 20;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #aaa;
}

.status-icon {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.3);
}

/* === MINI-MAP === */
.mini-map {
    position: absolute;
    top: 40px;
    right: 8px;
    width: 80px;
    height: 80px;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.2);
    pointer-events: none;
    z-index: 20;
}

.mini-map-player {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #44ff44;
    border-radius: 50%;
}

/* === BATTLE UI (RPG) === */
.battle-menu {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 40, 0.9);
    border: 2px solid #4466aa;
    border-radius: 4px;
    padding: 8px 12px;
    z-index: 30;
}

.battle-menu-item {
    font-size: 12px;
    color: #aaa;
    padding: 2px 0;
    cursor: pointer;
}

.battle-menu-item.selected {
    color: #fff;
}

.battle-menu-item.selected::before {
    content: '▶ ';
    color: #ffcc00;
}

/* ATB gauge */
.atb-gauge {
    width: 60px;
    height: 6px;
    background: #222;
    border: 1px solid #444;
    border-radius: 2px;
    overflow: hidden;
}

.atb-fill {
    height: 100%;
    background: linear-gradient(90deg, #4466cc, #66aaff);
    transition: width 0.1s linear;
}

/* === CORRUPTION VISUAL OVERLAYS === */
.corruption-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 19;
    mix-blend-mode: screen;
}

.pixel-sort-band {
    position: absolute;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,0,100,0.2) 20%,
        rgba(0,255,100,0.2) 50%,
        rgba(100,0,255,0.2) 80%,
        transparent 100%
    );
    pointer-events: none;
}

/* Ghost face flash */
.ghost-face {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 200px;
    color: rgba(255,255,255,0.02);
    pointer-events: none;
    z-index: 18;
    opacity: 0;
    transition: opacity 0.05s;
}

.ghost-face.flash {
    opacity: 1;
}
