:root {
    --bg: #05070c;
    --panel: rgba(12, 18, 28, 0.78);
    --panel-strong: rgba(8, 12, 22, 0.92);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.22);
    --text: #eef3ff;
    --muted: #9aa6be;
    --accent: #74b8ff;
    --accent-warm: #ff8740;
    --danger: #ff4d3d;
    --glow: rgba(116, 184, 255, 0.35);
}

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background:
        radial-gradient(circle at top, rgba(58, 88, 132, 0.32), transparent 38%),
        radial-gradient(circle at bottom right, rgba(255, 90, 35, 0.12), transparent 26%),
        linear-gradient(180deg, #08111f 0%, #03060a 100%);
    color: var(--text);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    user-select: none;
}

body.pointer-locked {
    cursor: none;
}

#gameCanvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 0;
}

.menu-screen {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

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

.menu-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(37, 81, 145, 0.32), transparent 30%),
        radial-gradient(circle at bottom, rgba(255, 110, 55, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(2, 5, 10, 0.7), rgba(3, 5, 8, 0.94));
    backdrop-filter: blur(10px);
}

.menu-content {
    position: relative;
    z-index: 1;
    width: min(840px, 100%);
    padding: 42px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(14, 20, 32, 0.74), rgba(7, 9, 15, 0.92)),
        rgba(8, 12, 20, 0.86);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.panel-screen {
    max-width: 760px;
}

.pause-screen {
    max-width: 420px;
}

.eyebrow {
    letter-spacing: 0.36em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--accent);
    margin-bottom: 16px;
}

.title-container {
    text-align: center;
    margin-bottom: 34px;
}

.game-title {
    font-size: clamp(2.8rem, 7vw, 5.6rem);
    line-height: 0.95;
    letter-spacing: 0.1em;
    font-weight: 900;
    color: #ffffff;
    text-shadow:
        0 0 35px rgba(116, 184, 255, 0.25),
        0 0 65px rgba(255, 130, 64, 0.12);
}

.game-subtitle {
    margin-top: 12px;
    color: #9fd6ff;
    font-size: clamp(1rem, 2.2vw, 1.5rem);
    letter-spacing: 0.42em;
    text-transform: uppercase;
    font-weight: 600;
}

.title-tagline {
    max-width: 620px;
    margin: 22px auto 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}

.menu-buttons {
    display: grid;
    gap: 14px;
    justify-content: center;
}

.menu-btn {
    min-width: min(360px, 100%);
    padding: 16px 28px;
    border-radius: 16px;
    border: 1px solid rgba(125, 192, 255, 0.28);
    background:
        linear-gradient(180deg, rgba(119, 176, 255, 0.18), rgba(22, 38, 70, 0.58)),
        rgba(14, 20, 36, 0.8);
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.menu-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.44);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 22px rgba(116, 184, 255, 0.18);
}

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

.menu-btn.danger {
    background:
        linear-gradient(180deg, rgba(255, 109, 78, 0.18), rgba(70, 18, 20, 0.58)),
        rgba(18, 10, 14, 0.8);
    border-color: rgba(255, 104, 82, 0.34);
}

.menu-loading {
    margin-top: 28px;
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
    letter-spacing: 0.08em;
}

.menu-loading.ready {
    color: #8ff0b1;
}

.screen-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: 22px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.info-panel {
    border-radius: 22px;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(16, 22, 34, 0.78), rgba(7, 11, 20, 0.92)),
        var(--panel);
    padding: 26px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    margin-bottom: 22px;
}

.instruction-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 12px;
    color: var(--text);
}

.key-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #d3ebff;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.info-copy,
.credit-line,
.credit-label,
.credit-big {
    line-height: 1.7;
}

.info-copy {
    margin-top: 12px;
    color: var(--muted);
}

.credits-panel {
    text-align: center;
}

.credit-big {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 14px;
}

.credit-label {
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.24em;
    text-transform: uppercase;
    margin-top: 16px;
}

.credit-line {
    color: #d7e2f8;
}

.hud {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.hud.hidden {
    display: none;
}

.hud-top {
    position: absolute;
    top: 18px;
    left: 18px;
    right: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.hud-card {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(12, 18, 28, 0.68), rgba(6, 8, 16, 0.88)),
        var(--panel);
    padding: 14px 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
}

.card-label {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.card-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.score-value {
    color: #ffc66a;
    text-shadow: 0 0 14px rgba(255, 198, 106, 0.28);
}

.rage-bar-shell {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 8px;
}

.rage-bar-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(90deg, #ffad52 0%, #ff5b3f 35%, #ff2f2f 68%, #c10f3f 100%);
    box-shadow: 0 0 22px rgba(255, 76, 58, 0.44);
    transition: width 0.18s ease;
}

.hud-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.crosshair {
    width: 26px;
    height: 26px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    box-shadow:
        0 0 14px rgba(255, 255, 255, 0.25),
        inset 0 0 12px rgba(255, 255, 255, 0.12);
    position: relative;
}

.crosshair::before,
.crosshair::after {
    content: "";
    position: absolute;
    background: rgba(255, 255, 255, 0.86);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.crosshair::before {
    width: 2px;
    height: 34px;
}

.crosshair::after {
    width: 34px;
    height: 2px;
}

.target-prompt {
    margin-top: 26px;
    max-width: min(460px, 90vw);
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(8, 12, 20, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e7f1ff;
    text-align: center;
    backdrop-filter: blur(8px);
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

.hud-bottom {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: min(1080px, calc(100vw - 36px));
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.weapon-slots {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    pointer-events: auto;
}

.weapon-slot {
    border-radius: 18px;
    padding: 12px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(12, 18, 28, 0.68), rgba(7, 10, 18, 0.9)),
        rgba(6, 9, 15, 0.82);
    color: var(--text);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.weapon-slot:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.weapon-slot.active {
    border-color: rgba(255, 155, 93, 0.88);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.35),
        0 0 24px rgba(255, 125, 70, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 137, 77, 0.24), rgba(28, 18, 18, 0.92)),
        rgba(10, 8, 12, 0.88);
}

.slot-key {
    display: block;
    color: #9fb2cc;
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.slot-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
}

.status-hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
    letter-spacing: 0.03em;
    order: -1;
}

.wifi-panel {
    position: absolute;
    top: 118px;
    right: 20px;
    width: min(360px, calc(100vw - 40px));
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(148, 196, 255, 0.22);
    background:
        linear-gradient(180deg, rgba(23, 34, 56, 0.76), rgba(11, 17, 29, 0.9)),
        rgba(9, 15, 26, 0.88);
    box-shadow:
        0 18px 48px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
}

.panel-header,
.network-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-header {
    margin-bottom: 18px;
}

.panel-title {
    font-size: 1rem;
    font-weight: 700;
}

.panel-chip {
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    color: #d5e8ff;
}

.network-name {
    font-weight: 700;
}

.network-state {
    color: #9fd6ff;
}

.network-bar {
    height: 8px;
    margin-top: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.network-bar-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #82c9ff, #5c7cff);
    box-shadow: 0 0 16px rgba(92, 124, 255, 0.4);
}

.network-message {
    margin-top: 14px;
    color: var(--muted);
    line-height: 1.5;
}

.flash-overlay,
.damage-overlay,
.rage-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.flash-overlay {
    opacity: 0;
    background:
        radial-gradient(circle at center, rgba(255, 235, 170, 0.28), rgba(255, 106, 40, 0.08), transparent 58%);
    transition: opacity 0.2s ease;
}

.flash-overlay.active {
    opacity: 1;
}

.damage-overlay {
    opacity: 0;
    background:
        repeating-linear-gradient(127deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 19px),
        repeating-linear-gradient(37deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 13px),
        radial-gradient(circle at center, transparent 42%, rgba(255, 61, 31, 0.08) 100%);
    mix-blend-mode: screen;
    transition: opacity 0.16s ease;
}

.rage-overlay {
    opacity: 0;
    background:
        radial-gradient(circle at center, rgba(255, 130, 44, 0.1), rgba(255, 44, 12, 0.04), transparent 68%),
        linear-gradient(180deg, rgba(255, 80, 52, 0.02), rgba(255, 25, 25, 0.09));
    transition: opacity 0.24s ease;
}

@media (max-width: 960px) {
    .hud-top {
        grid-template-columns: 1fr;
    }

    .wifi-panel {
        top: auto;
        right: 18px;
        left: 18px;
        bottom: 178px;
        width: auto;
    }

    .weapon-slots {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .slot-name {
        font-size: 0.82rem;
    }
}


@media (max-width: 720px) {
    .menu-content {
        padding: 28px 18px;
    }

    .instruction-row {
        grid-template-columns: 1fr;
    }

    .hud-bottom {
        width: calc(100vw - 22px);
        bottom: 10px;
    }

    .weapon-slots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .target-prompt {
        font-size: 0.85rem;
        margin-top: 22px;
    }
}

