:root {
    --bg: #08111f;
    --panel: rgba(8, 17, 31, 0.74);
    --panel-strong: rgba(10, 23, 42, 0.92);
    --line: rgba(116, 219, 255, 0.28);
    --text: #f4f7fb;
    --muted: #92a9c3;
    --accent: #74dbff;
    --accent-hot: #ff7b54;
    --accent-toxic: #9bff6a;
    --danger: #ff4d6d;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Chakra Petch", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(116, 219, 255, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(255, 123, 84, 0.18), transparent 25%),
        linear-gradient(135deg, #050a14 0%, #08111f 48%, #101b33 100%);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.76), transparent);
}

body::after {
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.4));
}

.shell {
    width: min(1240px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 32px 0 40px;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(8, 17, 31, 0.92), rgba(8, 17, 31, 0.6));
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.82rem;
}

h1 {
    margin: 0;
    font-family: "Black Ops One", cursive;
    font-size: clamp(2.8rem, 7vw, 4.6rem);
    line-height: 0.94;
    text-shadow: 0 0 24px rgba(116, 219, 255, 0.34);
}

.subtitle {
    margin: 14px 0 0;
    max-width: 540px;
    color: var(--muted);
    font-size: 1.04rem;
}

.hero-actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.character-gallery {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid rgba(116, 219, 255, 0.18);
    border-radius: 24px;
    background: rgba(10, 23, 42, 0.62);
}

.character-gallery-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.character-gallery-head span {
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.character-gallery-head strong {
    font-size: 0.94rem;
}

.character-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.character-card {
    appearance: none;
    text-align: left;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(116, 219, 255, 0.18);
    background: linear-gradient(180deg, rgba(11, 27, 46, 0.95), rgba(8, 18, 31, 0.95));
    color: var(--text);
    cursor: pointer;
    display: grid;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.character-card:hover {
    transform: translateY(-2px);
    border-color: rgba(116, 219, 255, 0.38);
}

.character-card.active {
    border-color: rgba(116, 219, 255, 0.72);
    box-shadow: 0 0 0 3px rgba(116, 219, 255, 0.14);
}

.character-card.locked {
    opacity: 0.7;
    cursor: not-allowed;
}

.character-card-swatch {
    height: 82px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.08), transparent 32%),
        linear-gradient(180deg, rgba(14, 29, 49, 0.92), rgba(8, 18, 31, 0.84));
}

.character-card-swatch::before {
    content: none;
}

.character-card-swatch::after {
    content: none;
}

.character-preview-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.character-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.character-card-title {
    font-size: 1rem;
    font-weight: 700;
}

.character-card-status {
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
}

.character-card-passive {
    display: grid;
    gap: 4px;
}

.character-card-passive strong,
.character-card-weapons strong {
    font-size: 0.76rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.character-card-passive span,
.character-card-weapons span {
    font-size: 0.9rem;
    line-height: 1.45;
}

.character-card-weapons {
    display: grid;
    gap: 4px;
}

.character-card-lock {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    color: #f4f7fb;
    background: rgba(8, 17, 31, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.level-picker {
    display: grid;
    gap: 6px;
}

.level-picker span {
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.level-picker select {
    min-width: 136px;
    appearance: none;
    border: 1px solid rgba(116, 219, 255, 0.24);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(15, 39, 67, 0.96), rgba(10, 25, 43, 0.96));
    color: var(--text);
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
}

.level-picker select:focus {
    outline: none;
    border-color: rgba(116, 219, 255, 0.72);
    box-shadow:
        0 0 0 3px rgba(116, 219, 255, 0.18),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.level-picker select option {
    color: #f4f7fb;
    background: #0d1c31;
}

.hero-button {
    appearance: none;
    border: 1px solid rgba(116, 219, 255, 0.24);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(15, 39, 67, 0.96), rgba(10, 25, 43, 0.96));
    color: var(--text);
    font: inherit;
    font-weight: 700;
    padding: 12px 18px;
    cursor: pointer;
}

.hero-button:hover {
    border-color: rgba(116, 219, 255, 0.48);
}

.hero-button-feedback {
    border-color: rgba(255, 123, 84, 0.38);
    background: linear-gradient(180deg, rgba(91, 34, 20, 0.96), rgba(54, 20, 12, 0.96));
}

.hero-button-feedback:hover {
    border-color: rgba(255, 123, 84, 0.72);
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
    min-width: min(100%, 320px);
}

.stats div,
.hud-strip div,
.side-panel section {
    border: 1px solid rgba(116, 219, 255, 0.18);
    border-radius: 20px;
    background: rgba(14, 26, 46, 0.78);
}

.stats div {
    padding: 14px 16px;
}

.stats span,
.hud-strip span,
.side-panel h2 {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stats strong,
.hud-strip strong {
    display: block;
    margin-top: 8px;
    font-size: 1.32rem;
}

.arena-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 24px;
}

.arena-panel {
    padding: 20px;
    border-radius: 30px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.arena-panel:fullscreen {
    width: 100vw;
    height: 100vh;
    padding: 14px;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(5, 12, 24, 0.98);
}

.arena-panel:fullscreen canvas {
    flex: 1;
    height: auto;
    max-height: calc(100vh - 160px);
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(5, 12, 24, 0.85), rgba(8, 17, 31, 0.95));
}

.boss-hud {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 123, 84, 0.28);
    border-radius: 20px;
    background: rgba(44, 16, 17, 0.64);
}

.boss-hud.hidden {
    display: none;
}

.boss-hud-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.92rem;
    color: var(--text);
}

.boss-role-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.boss-role-row span {
    color: #ffd39b;
    letter-spacing: 0.04em;
}

.boss-role-row strong {
    color: #fff0db;
    font-size: 0.8rem;
    font-weight: 600;
}

.boss-bar-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.boss-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff7b54, #ff4d6d);
}

.hud-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.hud-strip div,
.side-panel section {
    padding: 14px 16px;
}

.side-panel {
    display: grid;
    gap: 16px;
}

.side-panel h2 {
    margin: 0 0 14px;
}

.side-panel ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text);
    line-height: 1.7;
}

.mobile-controls {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.mobile-pad {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.mobile-pad button {
    appearance: none;
    border: 1px solid rgba(116, 219, 255, 0.2);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(15, 39, 67, 0.95), rgba(10, 25, 43, 0.95));
    color: var(--text);
    font: inherit;
    font-weight: 700;
    min-height: 56px;
    padding: 0 18px;
}

.mobile-pad button.primary {
    background: linear-gradient(180deg, rgba(255, 123, 84, 0.95), rgba(161, 51, 19, 0.95));
}

.movement-pad {
    display: grid;
    justify-items: center;
    gap: 12px;
}

.movement-pad > button {
    width: min(160px, 100%);
}

.mobile-pad-row {
    display: grid;
    gap: 12px;
}

.movement-pad .mobile-pad-row {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-row-wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 980px) {
    .hero,
    .arena-wrap {
        grid-template-columns: 1fr;
        display: grid;
    }

    .stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .side-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .character-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .shell {
        width: min(100vw - 16px, 100%);
        padding-top: 16px;
    }

    .hero,
    .arena-panel {
        padding: 16px;
        border-radius: 22px;
    }

    .stats,
    .hud-strip,
    .side-panel,
    .mobile-controls {
        grid-template-columns: 1fr;
    }

    .subtitle {
        font-size: 0.96rem;
    }

    .hero-actions {
        align-items: stretch;
    }

    .character-card-grid {
        grid-template-columns: 1fr;
    }

    .level-picker select,
    .hero-button {
        width: 100%;
    }

    .mobile-controls {
        display: grid;
    }
}