/**
 * ZONE OF THE DEAD - Game Styles
 * Dark neon post-apocalyptic theme
 */

/* ============== BASE RESET ============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0a0f;
    --bg-medium: #12121a;
    --bg-light: #1a1a25;

    --primary: #00ff88;
    --primary-dim: #00aa5c;
    --primary-glow: rgba(0, 255, 136, 0.5);
    --secondary: #ff3366;
    --secondary-glow: rgba(255, 51, 102, 0.5);
    --warning: #ffaa00;
    --danger: #ff2200;

    --text-bright: #ffffff;
    --text-normal: #cccccc;
    --text-dim: #666666;

    --health: #00ff88;
    --armor: #00aaff;
    --stamina: #ffcc00;
    --boss: #ff3366;

    --font-display: 'Orbitron', sans-serif;
    --font-ui: 'Rajdhani', sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
    font-family: var(--font-ui);
    color: var(--text-normal);
}

/* ============== BACKGROUND CANVAS ============== */
#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============== GAME CANVAS ============== */
#gameCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0f;
    cursor: crosshair;
    z-index: 1;
}

/* ============== MENU SCREENS ============== */
.menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: linear-gradient(180deg,
        rgba(10, 10, 15, 0.95) 0%,
        rgba(20, 10, 15, 0.98) 50%,
        rgba(10, 10, 15, 0.95) 100%);
}

.menu-screen.active {
    display: flex;
}

.menu-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px;
    max-width: 100%;
}

/* ============== TITLE ============== */
.title-container {
    position: relative;
    margin-bottom: 50px;
}

.title-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse, var(--primary-glow) 0%, transparent 70%);
    filter: blur(60px);
    opacity: 0.4;
    animation: titlePulse 4s ease-in-out infinite;
}

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

.game-title {
    font-family: var(--font-display);
    font-weight: 900;
    letter-spacing: 0.15em;
    display: flex;
    flex-direction: column;
    line-height: 0.9;
    position: relative;
}

.title-zone {
    font-size: clamp(4rem, 15vw, 8rem);
    color: var(--text-bright);
    text-shadow:
        0 0 20px var(--primary),
        0 0 40px var(--primary),
        0 0 80px var(--primary-dim);
    position: relative;
    animation: glitchText 8s ease-in-out infinite;
}

.title-zone::before {
    content: attr(data-text);
    position: absolute;
    left: 2px;
    top: 0;
    color: var(--secondary);
    opacity: 0;
    animation: glitchLeft 8s ease-in-out infinite;
}

.title-zone::after {
    content: attr(data-text);
    position: absolute;
    left: -2px;
    top: 0;
    color: var(--primary);
    opacity: 0;
    animation: glitchRight 8s ease-in-out infinite;
}

@keyframes glitchText {
    0%, 90%, 100% { transform: translateX(0); }
    92% { transform: translateX(-3px); }
    94% { transform: translateX(3px); }
    96% { transform: translateX(-2px); }
    98% { transform: translateX(2px); }
}

@keyframes glitchLeft {
    0%, 90%, 100% { opacity: 0; }
    92%, 94% { opacity: 0.8; left: -4px; }
    96%, 98% { opacity: 0; }
}

@keyframes glitchRight {
    0%, 90%, 100% { opacity: 0; }
    93%, 95% { opacity: 0.8; left: 4px; }
    97%, 99% { opacity: 0; }
}

.title-of {
    font-size: clamp(0.8rem, 3vw, 1.2rem);
    color: var(--text-dim);
    letter-spacing: 1em;
    margin: 15px 0;
    font-weight: 400;
}

.title-dead {
    font-size: clamp(4rem, 15vw, 8rem);
    color: var(--secondary);
    text-shadow:
        0 0 20px var(--secondary),
        0 0 40px var(--secondary),
        0 0 80px var(--secondary-glow);
    animation: deadPulse 2s ease-in-out infinite;
}

@keyframes deadPulse {
    0%, 100% {
        text-shadow:
            0 0 20px var(--secondary),
            0 0 40px var(--secondary),
            0 0 80px var(--secondary-glow);
    }
    50% {
        text-shadow:
            0 0 30px var(--secondary),
            0 0 60px var(--secondary),
            0 0 100px var(--secondary-glow),
            0 0 150px var(--secondary-glow);
    }
}

.title-tagline {
    font-family: var(--font-display);
    font-size: clamp(0.7rem, 2vw, 1rem);
    letter-spacing: 0.8em;
    color: var(--primary);
    margin-top: 25px;
    opacity: 0.8;
}

/* ============== ZOMBIE SILHOUETTES ============== */
.zombie-silhouettes {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    pointer-events: none;
    opacity: 0.03;
    overflow: hidden;
}

/* ============== FORM ============== */
.menu-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-bottom: 50px;
}

.input-container {
    position: relative;
}

.input-glow {
    position: absolute;
    inset: -3px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 8px;
    opacity: 0;
    filter: blur(10px);
    transition: opacity 0.3s ease;
    z-index: -1;
}

.input-container:focus-within .input-glow {
    opacity: 0.5;
}

input[type="text"] {
    width: 350px;
    padding: 18px 25px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--primary-dim);
    border-radius: 6px;
    color: var(--text-bright);
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 20px rgba(0, 255, 136, 0.3),
        inset 0 0 20px rgba(0, 255, 136, 0.1);
}

input[type="text"]::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}

/* ============== COLOR PICKER ============== */
.color-picker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.color-label {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-dim);
}

.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 350px;
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.color-option:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px currentColor;
}

.color-option.selected {
    border-color: var(--text-bright);
    box-shadow: 0 0 15px currentColor, 0 0 30px currentColor;
    transform: scale(1.1);
}

.color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: bold;
    color: #000;
    text-shadow: 0 0 2px #fff;
}

/* ============== BUTTONS ============== */
.btn-primary {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding: 20px 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dim) 100%);
    border: none;
    border-radius: 6px;
    color: var(--bg-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-primary .btn-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow:
        0 10px 40px rgba(0, 255, 136, 0.4),
        0 0 60px rgba(0, 255, 136, 0.2);
}

.btn-primary:hover .btn-icon {
    transform: translateX(5px);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover .btn-shine {
    left: 100%;
}

.btn-secondary {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 14px 35px;
    background: transparent;
    border: 2px solid var(--text-dim);
    border-radius: 6px;
    color: var(--text-normal);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

/* ============== CONTROLS GRID ============== */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 500px;
    margin: 0 auto 40px;
}

.control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.control-item .key {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    padding: 4px 10px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 4px;
}

.control-item .action {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ============== VERSION TAG ============== */
.version-tag {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.2em;
    opacity: 0.5;
}

/* ============== LOBBY ============== */
.lobby-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px;
    width: 100%;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary-dim);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.lobby-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 30px var(--primary-glow);
    margin-bottom: 30px;
    letter-spacing: 0.1em;
}

.lobby-players {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 10px;
    padding: 20px;
    min-height: 150px;
    margin-bottom: 20px;
}

.lobby-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.lobby-player.ready {
    border-left-color: var(--primary);
    background: rgba(0, 255, 136, 0.05);
}

.lobby-player-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.lobby-player-status {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.lobby-player.ready .lobby-player-status {
    color: var(--primary);
    font-weight: 700;
}

.lobby-status {
    font-size: 1.1rem;
    color: var(--warning);
    margin-bottom: 20px;
}

.lobby-chat {
    margin-top: 30px;
    text-align: left;
}

.chat-messages {
    height: 120px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    padding: 12px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.chat-message {
    margin: 6px 0;
}

.chat-message .sender {
    color: var(--primary);
    font-weight: 600;
}

#chatInput {
    width: 100%;
}

/* ============== HUD ============== */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

#hud > * {
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

/* Health & Armor */
.hud-health {
    position: absolute;
    bottom: 30px;
    left: 30px;
}

.health-bar {
    width: 260px;
    height: 32px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--health);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--health) 0%, #00cc66 100%);
    transition: width 0.3s ease;
    width: 100%;
}

.health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    text-shadow: 0 0 10px black, 0 2px 4px black;
}

.armor-bar {
    width: 260px;
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}

.armor-fill {
    height: 100%;
    background: var(--armor);
    width: 0%;
    transition: width 0.3s ease;
}

/* Stamina */
.hud-stamina {
    position: absolute;
    bottom: 85px;
    left: 30px;
}

.stamina-bar {
    width: 160px;
    height: 6px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    overflow: hidden;
}

.stamina-fill {
    height: 100%;
    background: var(--stamina);
    width: 100%;
    transition: width 0.1s ease;
}

/* Weapon */
.hud-weapon {
    position: absolute;
    bottom: 30px;
    right: 30px;
    text-align: right;
}

.weapon-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-bright);
    text-shadow: 0 0 15px var(--primary-glow);
}

.weapon-ammo {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 700;
}

.ammo-current {
    color: var(--text-bright);
}

.ammo-divider {
    color: var(--text-dim);
    margin: 0 5px;
}

.ammo-total {
    color: var(--text-dim);
    font-size: 1.6rem;
}

.reload-indicator {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--warning);
    animation: pulse 0.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Wave Info */
.hud-wave {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.wave-number {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-bright);
}

.wave-number span {
    color: var(--primary);
    font-size: 2.2rem;
    text-shadow: 0 0 20px var(--primary-glow);
}

.wave-scenario {
    font-size: 1rem;
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-top: 5px;
}

/* Score */
.hud-score {
    position: absolute;
    top: 30px;
    right: 30px;
    text-align: right;
}

.score-value, .cash-value {
    font-family: var(--font-display);
    font-weight: 700;
}

.score-label, .cash-label {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-right: 8px;
}

.score-value span, .cash-value span {
    font-size: 1.6rem;
    color: var(--text-bright);
}

.cash-value {
    margin-top: 8px;
}

.cash-value span {
    color: var(--warning);
}

/* Kill Feed */
.kill-feed {
    position: absolute;
    top: 100px;
    right: 30px;
    width: 260px;
    text-align: right;
}

.kill-entry {
    font-size: 0.9rem;
    padding: 6px 12px;
    margin-bottom: 6px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Boss Health */
.boss-health {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 420px;
}

.boss-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--boss);
    text-shadow: 0 0 25px var(--secondary-glow);
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}

.boss-bar {
    height: 22px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--boss);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 20px var(--secondary-glow);
}

.boss-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--boss) 0%, #ff6699 100%);
    transition: width 0.3s ease;
}

.boss-phase {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 8px;
}

/* Prep Timer */
.prep-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--text-bright);
}

.timer-value {
    display: block;
    font-size: 6rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 40px var(--primary), 0 0 80px var(--primary-glow);
}

/* Interaction Prompt */
.interaction-prompt {
    position: absolute;
    bottom: 160px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.85);
    padding: 12px 24px;
    border-radius: 6px;
    border: 1px solid var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.prompt-key {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--bg-dark);
    background: var(--primary);
    padding: 6px 14px;
    border-radius: 4px;
}

.prompt-text {
    font-size: 1.1rem;
    color: var(--text-bright);
}

/* Minimap */
.minimap {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 160px;
    height: 110px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--primary-dim);
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.1);
}

/* ============== SHOP OVERLAY ============== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    backdrop-filter: blur(5px);
}

.shop-container {
    background: var(--bg-medium);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 35px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 0 50px var(--primary-glow);
}

.shop-container h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 12px;
    text-shadow: 0 0 20px var(--primary-glow);
    letter-spacing: 0.1em;
}

.shop-cash {
    text-align: center;
    font-size: 1.3rem;
    color: var(--warning);
    margin-bottom: 25px;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.shop-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--text-dim);
    border-radius: 8px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-item:hover {
    border-color: var(--primary);
    background: rgba(0, 255, 136, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.2);
}

.shop-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.shop-item-name {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 6px;
}

.shop-item-price {
    color: var(--warning);
    font-weight: 600;
    font-size: 1.1rem;
}

.shop-item-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 6px;
}

#closeShop {
    display: block;
    width: 100%;
}

/* ============== GAME OVER ============== */
.gameover-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px;
}

.gameover-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 12vw, 6rem);
    font-weight: 900;
    color: var(--secondary);
    text-shadow:
        0 0 30px var(--secondary),
        0 0 60px var(--secondary-glow),
        0 0 100px var(--secondary-glow);
    margin-bottom: 25px;
    letter-spacing: 0.1em;
}

.gameover-wave {
    font-size: 1.6rem;
    color: var(--text-normal);
    margin-bottom: 35px;
}

.gameover-wave span {
    color: var(--primary);
    font-weight: 700;
    font-size: 2rem;
}

.gameover-stats {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 35px;
    display: inline-block;
    min-width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-dim);
}

.stat-value {
    color: var(--text-bright);
    font-weight: 700;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hud-health {
        bottom: 15px;
        left: 15px;
    }

    .health-bar {
        width: 180px;
        height: 26px;
    }

    .hud-weapon {
        bottom: 15px;
        right: 15px;
    }

    .weapon-name {
        font-size: 1.2rem;
    }

    .weapon-ammo {
        font-size: 2rem;
    }

    .minimap {
        width: 100px;
        height: 70px;
    }

    .boss-health {
        width: 280px;
    }

    input[type="text"] {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .controls-grid {
        display: none;
    }

    .game-title .title-zone,
    .game-title .title-dead {
        font-size: 3rem;
    }
}
