/* =========================================================
   СБРОС
========================================================= */

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

/* =========================================================
   ПЕРЕМЕННЫЕ
========================================================= */

:root {

    --bg: #0b0f16;
    --bg2: #111827;

    --card: rgba(22, 28, 40, 0.9);

    --text: #ecf0ff;
    --muted: #94a3b8;

    --blue: #4a9eff;
    --purple: #8b5cf6;
    --green: #2ecc71;
    --red: #ff4d6d;

    --border: rgba(255,255,255,0.08);

}

/* =========================================================
   BODY
========================================================= */

body {

    min-height: 100vh;

    background:
        radial-gradient(circle at top left,
            rgba(74,158,255,0.15),
            transparent 35%
        ),
        radial-gradient(circle at bottom right,
            rgba(139,92,246,0.15),
            transparent 35%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    overflow-x: hidden;
}

/* =========================================================
   HEADER
========================================================= */

header {

    width: 100%;

    padding: 20px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    border-bottom: 1px solid var(--border);

    background: rgba(10,15,25,0.8);

    backdrop-filter: blur(12px);

    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {

    font-size: 2rem;

    background:
        linear-gradient(
            135deg,
            var(--blue),
            var(--purple)
        );

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hud {

    display: flex;
    gap: 16px;
}

.hud-item {

    background: var(--card);

    padding: 12px 18px;

    border-radius: 14px;

    border: 1px solid var(--border);

    font-weight: 700;

    box-shadow:
        0 0 15px rgba(0,0,0,0.35);
}

/* =========================================================
   MAIN
========================================================= */

main {

    width: 100%;

    display: flex;
    justify-content: center;

    padding: 30px;
}

/* =========================================================
   КАРТОЧКА ИГРЫ
========================================================= */

.game-container {

    width: 100%;
    max-width: 1100px;

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 24px;

    padding: 24px;

    box-shadow:
        0 25px 60px rgba(0,0,0,0.45);

    backdrop-filter: blur(10px);
}

/* =========================================================
   CANVAS
========================================================= */

#gameCanvas {

    width: 100%;

    border-radius: 18px;

    background:
        linear-gradient(
            180deg,
            #111827,
            #0b1220
        );

    border: 2px solid rgba(255,255,255,0.08);

    box-shadow:
        0 0 30px rgba(74,158,255,0.12),
        inset 0 0 30px rgba(255,255,255,0.03);
}

/* =========================================================
   КНОПКИ
========================================================= */

.buttons {

    margin-top: 20px;

    display: flex;
    gap: 16px;
}

button {

    border: none;

    padding: 14px 22px;

    border-radius: 14px;

    color: white;

    font-size: 1rem;
    font-weight: 700;

    cursor: pointer;

    transition: 0.25s;
}

#startBtn {

    background:
        linear-gradient(
            135deg,
            var(--green),
            var(--blue)
        );
}

#restartBtn {

    background:
        linear-gradient(
            135deg,
            var(--purple),
            var(--blue)
        );
}

button:hover {

    transform: translateY(-3px);

    box-shadow:
        0 12px 25px rgba(74,158,255,0.3);
}

/* =========================================================
   MESSAGE
========================================================= */

.message-box {

    margin-top: 18px;

    padding: 16px;

    border-radius: 14px;

    background: rgba(255,255,255,0.04);

    border: 1px solid var(--border);

    color: var(--muted);

    font-weight: 600;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    header {

        flex-direction: column;
        gap: 16px;
    }

    .hud {

        flex-wrap: wrap;
        justify-content: center;
    }

    .buttons {

        flex-direction: column;
    }

}

/* =========================================================
   ИГРА
========================================================= */

.game-layout {

    width: 100%;

    display: flex;
    justify-content: center;
}

.game-card {

    width: 100%;
    max-width: 760px;

    background: rgba(26, 31, 40, 0.92);

    border:
        1px solid var(--border-color);

    border-radius: 24px;

    padding: 24px;

    box-shadow:
        0 18px 50px rgba(0,0,0,0.35);

    backdrop-filter: blur(12px);
}

#gameCanvas {

    width: 100%;

    display: block;

    border-radius: 18px;

    border:
        1px solid var(--border-color);

    background:
        linear-gradient(
            180deg,
            #131925,
            #0d121b
        );

    box-shadow:
        inset 0 0 20px rgba(255,255,255,0.03),
        0 0 25px rgba(74,158,255,0.08);
}

/* =========================================================
   HUD
========================================================= */

.game-actions {

    gap: 12px;
    flex-wrap: wrap;
}

.hud-box {

    background:
        var(--bg-card);

    border:
        1px solid var(--border-color);

    border-radius:
        var(--radius-md);

    padding: 10px 14px;

    font-size: 14px;
    font-weight: 700;

    color: var(--text-primary);

    box-shadow:
        0 4px 14px rgba(0,0,0,0.25);
}

/* =========================================================
   КНОПКИ
========================================================= */

.game-btn {

    min-width: 120px;
}

/* =========================================================
   MESSAGE
========================================================= */

.game-message {

    margin-top: 18px;

    background:
        var(--bg-secondary);

    border:
        1px solid var(--border-color);

    border-radius:
        var(--radius-md);

    padding: 16px;

    color:
        var(--text-secondary);

    font-weight: 600;

    text-align: center;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 900px) {

    header {

        flex-direction: column;
        align-items: stretch;
    }

    .game-actions {

        justify-content: center;
    }

}

/* =========================================================
   HEADER FIX
========================================================= */

.game-header {

    justify-content: space-between;

    align-items: center;

    padding: 14px 24px;

    min-height: auto;
}

.page-title {

    margin: 0;
}

/* =========================================================
   GAME
========================================================= */

.game-layout {

    width: 100%;

    display: flex;

    justify-content: center;
}

.game-card {

    width: 100%;

    max-width: 760px;

    background:
        rgba(26, 31, 40, 0.92);

    border:
        1px solid var(--border-color);

    border-radius: 24px;

    padding: 24px;

    box-shadow:
        0 18px 50px rgba(0,0,0,0.35);

    backdrop-filter: blur(12px);
}

#gameCanvas {

    width: 100%;

    display: block;

    border-radius: 18px;

    border:
        1px solid var(--border-color);

    background:
        linear-gradient(
            180deg,
            #131925,
            #0d121b
        );
}

/* =========================================================
   HUD
========================================================= */

.game-actions {

    display: flex;

    align-items: center;

    gap: 10px;

    flex-wrap: wrap;
}

.hud-box {

    background:
        var(--bg-card);

    border:
        1px solid var(--border-color);

    border-radius:
        var(--radius-md);

    padding: 10px 14px;

    font-size: 14px;

    font-weight: 700;
}

/* =========================================================
   BUTTONS
========================================================= */

.game-btn {

    min-width: 120px;
}

/* =========================================================
   MESSAGE
========================================================= */

.game-message {

    margin-top: 18px;

    background:
        var(--bg-secondary);

    border:
        1px solid var(--border-color);

    border-radius:
        var(--radius-md);

    padding: 16px;

    color:
        var(--text-secondary);

    text-align: center;

    font-weight: 600;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 900px) {

    .game-header {

        flex-direction: column;

        gap: 14px;
    }

    .game-actions {

        justify-content: center;
    }

}