/* TECTI SPACE DEFENDERS - Game Styles */
/* Liquid Glass Aesthetic + Power-Ups */

#tecti-space-game {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.game-overlay {
    position: relative;
    width: 100%;
    max-width: 700px;
    height: 100%;
    max-height: 900px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 1.5rem;
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 60px rgba(6, 182, 212, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.game-close-btn {
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Game Header & Stats - Liquid Glass Premium */
.game-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    z-index: 10;
    pointer-events: none;
    flex-wrap: wrap;
}

.game-header>* {
    pointer-events: all;
}

.stat-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(15, 23, 42, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    padding: 0.5rem 1.25rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 60px;
}

.stat-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Special Lives Box Design */
.lives-stat-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(15, 23, 42, 0.4));
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15);
    position: relative;
    overflow: hidden;
}

.lives-stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ef4444, transparent);
}

/* Combo Bar */
.combo-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.combo-bar {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    width: 0%;
    transition: width 0.1s linear;
}

/* ===== POWER-UP INDICATOR ===== */
.powerup-indicator {
    position: absolute;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    transition: all 0.3s ease;
    animation: powerupSlideIn 0.4s ease;
}

.powerup-plc {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 101, 52, 0.4));
    border: 1px solid rgba(34, 197, 94, 0.5);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.powerup-firewall {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(8, 145, 178, 0.4));
    border: 1px solid rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.powerup-active-icon {
    font-size: 1.2rem;
}

.powerup-active-name {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.powerup-timer-bar-container {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.powerup-timer-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.15s linear;
}

.powerup-time-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    min-width: 22px;
    text-align: right;
}

/* Expiring flash */
.powerup-expiring {
    animation: powerupFlash 0.5s ease infinite;
}

@keyframes powerupSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes powerupFlash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* ===== POWER-UP PREVIEW (Instructions) ===== */
.powerup-preview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.powerup-preview-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
}

.powerup-icon-plc {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    border-radius: 0.5rem;
    font-size: 1.2rem;
}

.powerup-icon-fw {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(6, 182, 212, 0.2);
    border: 1px solid rgba(6, 182, 212, 0.5);
    border-radius: 0.5rem;
    font-size: 1.2rem;
}

/* ===== GAME BUTTONS ===== */
.game-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.25rem;
    color: white;
    padding: 0;
}

.game-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ===== MOBILE CONTROLS ===== */
.mobile-controls {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 1.5rem;
    pointer-events: none;
    z-index: 1000;
}

.mobile-controls>* {
    pointer-events: all;
}

.dpad {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.dpad-btn {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
    box-shadow: 0 4px 24px rgba(6, 182, 212, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dpad-btn:active {
    transform: scale(0.9);
    background: rgba(6, 182, 212, 0.4);
    border-color: #06b6d4;
}

.shoot-btn {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.5), rgba(239, 68, 68, 0.3));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 3px solid rgba(239, 68, 68, 0.6);
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 24px rgba(239, 68, 68, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.shoot-btn:active {
    transform: scale(0.92);
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.8),
        inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===== GAME OVER OVERLAY ===== */
.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.game-over-box {
    text-align: center;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(15, 23, 42, 0.5));
    border-radius: 2rem;
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

.game-over-title {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    animation: gameover-pulse 1.5s ease infinite;
}

@keyframes gameover-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.game-over-score,
.game-over-level {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.75rem;
}

.game-over-score span,
.game-over-level span {
    font-weight: 700;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.8rem;
}

/* Score Submit */
.score-submit {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.player-name-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.player-name-input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.player-name-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.submit-score-btn {
    background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
    border: none !important;
}

/* High Scores Table */
.high-scores-table {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.high-scores-table h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: #f59e0b;
    margin-bottom: 0.75rem;
}

.high-scores-table table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
}

.high-scores-table th {
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.high-scores-table td {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.high-scores-table tr:first-child td {
    color: #f59e0b;
    font-weight: 700;
}

/* Game Over Actions */
.game-over-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

.game-over-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    box-shadow: 0 4px 24px rgba(6, 182, 212, 0.4);
}

.game-over-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 32px rgba(6, 182, 212, 0.6);
}

.game-over-btn.secondary {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.4), rgba(71, 85, 105, 0.4));
    box-shadow: 0 4px 24px rgba(100, 116, 139, 0.2);
}

.game-over-btn.secondary:hover {
    box-shadow: 0 6px 32px rgba(100, 116, 139, 0.5);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #tecti-space-game {
        padding: 0.5rem;
    }

    .game-header {
        gap: 0.5rem;
        padding: 0.75rem 0.75rem;
        flex-wrap: wrap;
    }

    .stat-box {
        padding: 0.4rem 0.8rem;
    }

    .stat-label {
        font-size: 0.55rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .game-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .mobile-controls {
        bottom: 1.5rem;
        padding: 0 1rem;
    }

    .dpad-btn {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .shoot-btn {
        width: 90px;
        height: 90px;
        font-size: 1rem;
    }

    .powerup-indicator {
        top: 65px;
        font-size: 0.75rem;
        padding: 0.3rem 0.75rem;
    }

    .game-over-title {
        font-size: 2.5rem;
    }

    .game-over-score,
    .game-over-level {
        font-size: 1.1rem;
    }

    .game-over-score span,
    .game-over-level span {
        font-size: 1.4rem;
    }

    .game-over-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .game-over-box {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    #tecti-space-game {
        padding: 0.25rem;
    }

    .game-header {
        gap: 0.25rem;
        padding: 0.5rem;
    }

    .stat-box {
        padding: 0.3rem 0.6rem;
    }

    .stat-label {
        font-size: 0.5rem;
    }

    .stat-value {
        font-size: 0.95rem;
    }

    .mobile-controls {
        bottom: 1rem;
        padding: 0 0.75rem;
    }

    .dpad-btn {
        width: 65px;
        height: 65px;
        font-size: 1.5rem;
    }

    .shoot-btn {
        width: 80px;
        height: 80px;
        font-size: 0.9rem;
    }

    .game-over-box {
        padding: 1.25rem;
        max-height: 80vh;
    }

    .game-over-title {
        font-size: 2rem;
    }

    .game-over-btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }

    .powerup-indicator {
        top: 58px;
        font-size: 0.65rem;
        gap: 0.3rem;
    }

    .powerup-timer-bar-container {
        width: 40px;
    }
}

/* ===== LOGO EASTER EGG HINT ===== */
@keyframes logo-float-hint {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.3));
    }

    25% {
        transform: scale(1.05) rotate(1deg);
        filter: drop-shadow(0 0 15px rgba(6, 182, 212, 0.5));
    }

    50% {
        transform: scale(1.02) rotate(-0.5deg);
        filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
    }

    75% {
        transform: scale(1.07) rotate(0.5deg);
        filter: drop-shadow(0 0 15px rgba(6, 182, 212, 0.5));
    }
}

.logo-easter-egg-hint {
    animation: logo-float-hint 4s ease-in-out infinite;
}

.logo-easter-egg-hint:hover {
    animation-play-state: paused;
    transform: scale(1.25) rotate(0deg) !important;
    filter: drop-shadow(0 0 50px rgba(34, 211, 238, 1)) brightness(1.3) !important;
}

/* ===== INSTRUCTIONS OVERLAY ===== */
.game-instructions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.game-instructions-box {
    text-align: center;
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
}

.game-instructions-box h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 40px rgba(6, 182, 212, 0.3);
}

.instructions-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.controls-preview {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    font-family: 'Outfit', sans-serif;
    color: #22d3ee;
    font-weight: 600;
    border: 1px solid rgba(6, 182, 212, 0.3);
    font-size: 0.95rem;
}

.start-game-btn {
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    border: none;
    color: white;
    padding: 1rem 3rem;
    border-radius: 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 24px rgba(6, 182, 212, 0.4);
}

.start-game-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 32px rgba(6, 182, 212, 0.6);
}