/* RESET I ZMIENNE GLOBALNE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --body-bg: #0a0b10;
    --panel-bg: rgba(18, 20, 32, 0.75);
    --accent-cyan: #00e5ff;
    --accent-cyan-glow: rgba(0, 229, 255, 0.4);
    --accent-danger: #ff0055;
    --accent-danger-glow: rgba(255, 0, 85, 0.4);
    --text-main: #f0f1f7;
    --text-muted: #8a8f9f;
    --border-color: rgba(255, 255, 255, 0.08);
}

body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: radial-gradient(circle at center, #16192b 0%, var(--body-bg) 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* EFEKTY GLOW */
.text-glow {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px var(--accent-cyan-glow);
}

.danger-text {
    color: var(--accent-danger);
    text-shadow: 0 0 10px var(--accent-danger-glow);
}

/* NAGŁÓWEK */
.game-header {
    width: 100%;
    max-width: 1100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-top: 10px;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-btn:hover {
    background: var(--accent-cyan);
    color: #0a0b10;
    box-shadow: 0 0 15px var(--accent-cyan-glow);
    border-color: var(--accent-cyan);
}

.game-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* UKŁAD STRONY */
.game-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 25px;
    max-width: 1100px;
    width: 100%;
    padding: 20px;
}

/* PANELE PANELOWE */
.panel-box {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    width: 260px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.panel-box h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

kbd {
    background: #222538;
    border: 1px solid #3d425c;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8rem;
    color: var(--text-main);
    box-shadow: 0 2px 0 #111;
}

.tip-box {
    margin-top: 15px;
    background: rgba(0, 229, 255, 0.03);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    line-height: 1.4;
}

.tip-box i {
    color: var(--accent-cyan);
    margin-top: 2px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

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

.stat-value {
    font-weight: 700;
}

/* KONTENER GRY */
.canvas-container {
    position: relative;
}

.game-container {
    position: relative;
    width: 400px;
    height: 600px;
    background-color: #0c0d14;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 0),
        radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 0);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    border: 2px solid #1f2336;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

/* HUD LIKWIDACYJNY */
#timer {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(10, 11, 16, 0.75);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ELEMENTY AKTYWNE */
#player {
    position: absolute;
    bottom: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-cyan), #0055ff);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.5), inset 0 -4px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-core {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px #fff;
}

.falling-object {
    position: absolute;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--accent-danger), #ff6600);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--accent-danger-glow);
}

/* NAKŁADKI INTERFEJSU (OVERLAYS) */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 16, 0.94);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px;
    text-align: center;
    z-index: 20;
    backdrop-filter: blur(4px);
}

.overlay-screen h2 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.overlay-screen p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.5;
    max-width: 260px;
}

/* PRZYCISKI */
.action-btn {
    background: linear-gradient(135deg, var(--accent-cyan), #0077ff);
    color: #0a0b10;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.5);
}

#game-over .action-btn {
    background: linear-gradient(135deg, #ffffff, #ced2e0);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

#game-over .action-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
}

/* RESPONSYWNOŚĆ SYSTEMU */
@media screen and (max-width: 1024px) {
    .game-layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .panel-box {
        width: 400px;
    }
    
    #statsPanel {
        order: 3;
    }
}

@media screen and (max-width: 450px) {
    .game-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .game-container, .panel-box {
        width: 100%;
        max-width: 350px;
    }
}