@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Press+Start+2P&display=swap');

:root {
    /* Primary Colors */
    --bg-primary: #162639;
    --bg-secondary: #1b263b;
    --bg-tertiary: #415a77;
    
    /* Text Colors */
    --text-primary: #e0e1dd;
    --text-secondary: #d0eef7;
    
    /* Accent Colors */
    --accent-cyan: #cbf3ff;
    --accent-pink: #f72585;
    --accent-pink-dark: #c9184a;
    --accent-orange: #ffb300;
    --accent-orange-light: #ffb300;
    
    /* UI Colors */
    --border-primary: var(--accent-cyan);
    --border-secondary: var(--accent-pink);
    
    /* Transparent Colors */
    --guide-line: rgba(247, 37, 133, 0.4);
    --container-glow: rgba(76, 201, 240, 0.2);
    
    /* Responsive Breakpoints */
    --mobile-breakpoint: 768px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier Prime', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

.game-screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.game-header {
    display: flex;
    justify-content: space-between;
    width: 70vw;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-secondary);
    font-family: 'Press Start 2P', monospace;
}

@media (max-width: var(--mobile-breakpoint)) {
    .game-header {
        width: 80vw;
        font-size: 1rem;
    }
}

.score, .lives {
    padding: 10px 20px;
    border: 3px solid var(--border-secondary);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
}

.game-container {
    width: 70vh;
    aspect-ratio: 1;
    border: 4px solid var(--accent-cyan);
    background-color: var(--bg-primary);
    position: relative;
    display: flex;
    flex-direction: row; /* Default flex direction */
    align-items: flex-start;
    justify-content: flex-start;
    transition: all 0.6s ease;
    box-shadow: inset 0 0 20px rgba(76, 201, 240, 0.2);
}

@media (max-width: var(--mobile-breakpoint)) {
    .game-container {
        width: 80vw;
    }
}

/* Flex axis guide line */
.game-container::before {
    content: '';
    position: absolute;
    background: rgba(247, 37, 133, 0.4);
    z-index: 1;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 2px;
    transform-origin: center;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: transform 0.3s ease-in-out;
}

/* Vertical line for column direction */
.game-container.flex-column::before {
    transform: translate(-50%, -50%) rotate(90deg);
}

.player-box {
    width: calc(100% / 3);
    height: calc(100% / 3);
    background: var(--accent-orange-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

/* Enemy Boxes */
.enemy-box {
    width: 40px;
    height: 40px;
    position: absolute;
    z-index: 5;
}

.enemy-box svg {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Control Panel */
.controls {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

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

.control-btn {
    padding: 12px 20px;
    font-family: 'Press Start 2P', monospace;
    font-weight: 400;
    font-size: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 3px solid var(--accent-cyan);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

@media (max-width: var(--mobile-breakpoint)) {
    .control-btn {
        padding: 10px 16px;
        font-size: 12px;
        min-width: 70px;
    }
}

.control-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-pink);
    transform: translateY(-2px);
}

.control-btn:active {
    transform: translateY(0);
    background: var(--bg-primary);
}

.mode-btn:hover {
    color: var(--accent-pink);
}

.mode-btn.active {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    border-color: var(--accent-pink);
}

.value-btn.active {
    background: var(--accent-pink);
    color: var(--text-primary);
    border-color: var(--accent-cyan);
}

/* Game Over Screen */
.game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-over-screen h2 {
    font-size: 4rem;
    color: var(--accent-pink);
    margin-bottom: 20px;
    animation: pulse 1s infinite;
    font-family: 'Press Start 2P', monospace;
}

@media (max-width: var(--mobile-breakpoint)) {
    .game-over-screen h2 {
        font-size: 2.5rem;
    }
}

.game-over-screen p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--accent-cyan);
    font-family: 'Courier Prime', monospace;
}

.restart-btn {
    padding: 15px 30px;
    font-family: 'Press Start 2P', monospace;
    font-weight: 400;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 3px solid var(--accent-cyan);
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-pink);
    transform: scale(1.05);
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes slideFromLeft {
    from { transform: translateX(-100px); }
    to { transform: translateX(calc(100vw + 100px)); }
}

@keyframes slideFromRight {
    from { transform: translateX(calc(100vw + 100px)); }
    to { transform: translateX(-100px); }
}

@keyframes slideFromTop {
    from { transform: translateY(-100px); }
    to { transform: translateY(calc(100vh + 100px)); }
}

@keyframes slideFromBottom {
    from { transform: translateY(calc(100vh + 100px)); }
    to { transform: translateY(-100px); }
}

/* Enemy movement classes */
.enemy-left { animation: slideFromLeft linear; }
.enemy-right { animation: slideFromRight linear; }
.enemy-top { animation: slideFromTop linear; }
.enemy-bottom { animation: slideFromBottom linear; }