* {
    box-sizing: border-box;
}

:root {
    --void: #03040c;
    --deep-space: #080b1f;
    --panel: rgba(9, 12, 30, 0.9);
    --panel-soft: rgba(18, 23, 52, 0.74);
    --line: rgba(194, 213, 255, 0.16);
    --text: #edf4ff;
    --muted: #aeb9d4;
    --cyan: #75f6ff;
    --blue: #6aa8ff;
    --purple: #b486ff;
    --magenta: #ff6fd8;
    --red: #ff5d73;
    --orange: #ff9f43;
    --gold: #ffd166;
    --green: #7cffb2;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 93, 115, 0.2), transparent 24%),
        radial-gradient(circle at 78% 12%, rgba(117, 246, 255, 0.15), transparent 26%),
        radial-gradient(circle at 58% 74%, rgba(180, 134, 255, 0.22), transparent 34%),
        linear-gradient(145deg, #03040c 0%, #090824 42%, #050612 100%);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.admin-test-panel {
    position: fixed;
    left: 50%;
    top: 12px;
    z-index: 20;
    width: min(760px, calc(100vw - 24px));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(255, 209, 102, 0.54);
    border-radius: 8px;
    background:
        radial-gradient(circle at 14% 20%, rgba(255, 95, 115, 0.22), transparent 36%),
        radial-gradient(circle at 84% 10%, rgba(117, 246, 255, 0.18), transparent 34%),
        rgba(8, 11, 25, 0.94);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.38), 0 0 28px rgba(255, 209, 102, 0.13);
    padding: 10px 12px;
}

.admin-test-panel strong {
    display: block;
    color: #ffcf5a;
    font-size: 14px;
    font-weight: 1000;
    letter-spacing: 1px;
}

.admin-test-panel span {
    color: #c9d5ef;
    font-size: 12px;
    font-weight: 800;
}

.admin-test-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.admin-test-actions button,
.admin-test-actions a {
    min-width: auto;
    padding: 9px 11px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #75f6ff, #7cffb2);
    color: #041018;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 1000;
    text-decoration: none;
}

#adminTestResetData {
    background: linear-gradient(135deg, #ff5d73, #ff9f6e);
}

body.admin-test-mode .hud {
    top: 86px;
}

canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 112, 67, 0.18) 0%, transparent 25%),
        radial-gradient(circle at 75% 22%, rgba(117, 246, 255, 0.17) 0%, transparent 27%),
        radial-gradient(circle at 55% 72%, rgba(180, 134, 255, 0.22) 0%, transparent 34%),
        radial-gradient(circle at center, #14193d 0%, #080b1f 54%, #03040c 100%);
}

.hud {
    position: fixed;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 4;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none;
}

.hud-group,
.hud-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.score-box,
.health-box,
.shield-box,
.special-box,
.bonus-box,
.mode-box,
.timer-box,
.danger-box,
.objective-box,
.credits-box,
.prestige-box,
.tag {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(14, 20, 48, 0.78), rgba(6, 8, 21, 0.66)),
        radial-gradient(circle at top left, rgba(117, 246, 255, 0.08), transparent 65%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    padding: 9px 12px;
}

.label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#scoreId,
#healthStatus,
#creditsStatus {
    display: block;
    min-width: 60px;
    color: var(--cyan);
    font-size: 27px;
    font-weight: 800;
    line-height: 1;
}

#prestigeStatus {
    display: block;
    min-width: 54px;
    color: var(--purple);
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

#healthStatus {
    color: var(--red);
}

#creditsStatus {
    color: var(--gold);
}

#shieldStatus,
#specialStatus,
#bonusStatus,
#modeStatus,
#timerStatus,
#dangerStatus,
#objectiveStatus {
    display: block;
    min-width: 84px;
    color: #c8edff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
}

#timerStatus {
    color: #dbe8ff;
}

#dangerStatus {
    color: var(--orange);
}

#objectiveStatus {
    max-width: 230px;
    color: var(--green);
}

#objectiveStatus.reward-flash {
    color: #ffefb4;
    text-shadow: 0 0 16px rgba(255, 209, 102, 0.72);
    animation: rewardFlash 900ms ease both;
}

.special-box.ready {
    border-color: rgba(117, 246, 255, 0.58);
    box-shadow: 0 0 24px rgba(117, 246, 255, 0.22);
}

.special-box.active {
    animation: slowPulse 650ms ease-in-out infinite alternate;
    border-color: rgba(104, 162, 255, 0.8);
}

.special-box.cooldown {
    opacity: 0.76;
}

#bonusStatus {
    min-width: 150px;
    color: #ffd166;
}

#shieldStatus {
    color: #baffc9;
}

.shield-box.ready {
    border-color: rgba(124, 255, 178, 0.58);
    box-shadow: 0 0 22px rgba(124, 255, 178, 0.16);
}

.shield-box.active {
    border-color: rgba(157, 123, 255, 0.68);
    box-shadow: 0 0 24px rgba(157, 123, 255, 0.2);
}

.shield-box.cooldown {
    opacity: 0.76;
}

.bonus-box.active {
    border-color: rgba(255, 209, 102, 0.62);
    box-shadow: 0 0 24px rgba(255, 209, 102, 0.2);
}

.score-list li.current-score {
    border: 1px solid rgba(255, 209, 102, 0.65);
    border-radius: 8px;
    background: rgba(255, 209, 102, 0.14);
    box-shadow: 0 0 22px rgba(255, 209, 102, 0.18);
    color: #ffd166;
    padding-left: 10px;
    padding-right: 10px;
}

@keyframes slowPulse {
    from {
        box-shadow: 0 0 18px rgba(117, 246, 255, 0.2);
        transform: translateY(0);
    }

    to {
        box-shadow: 0 0 32px rgba(117, 246, 255, 0.48);
        transform: translateY(-1px);
    }
}

@keyframes rewardFlash {
    0% {
        transform: scale(1);
    }

    35% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

button {
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--cyan), var(--green));
    color: #041018;
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    padding: 12px 16px;
    box-shadow: 0 10px 26px rgba(32, 201, 151, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}

button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    transform: none;
}

.muted-audio {
    background: #526073;
    color: #edf7ff;
}

.hud button {
    pointer-events: auto;
}

body.playing .hud {
    top: 10px;
    left: 10px;
    right: auto;
    max-width: min(940px, calc(100vw - 20px));
}

body.playing .hud-group {
    display: grid;
    grid-template-columns: auto auto auto auto auto;
    align-items: stretch;
    gap: 7px;
}

body.playing .hud-actions,
body.playing .mode-box,
body.playing .credits-box,
body.playing .prestige-box,
body.playing .tag,
body.playing .bonus-box:not(.active) {
    display: none;
}

body.playing .score-box,
body.playing .health-box,
body.playing .special-box,
body.playing .timer-box,
body.playing .danger-box,
body.playing .objective-box,
body.playing .bonus-box {
    min-height: 48px;
    padding: 7px 10px;
    background: rgba(5, 8, 18, 0.52);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.18);
}

body.playing .label {
    font-size: 9px;
}

body.playing #scoreId,
body.playing #healthStatus {
    min-width: 52px;
    font-size: 24px;
}

body.playing #specialStatus,
body.playing #bonusStatus,
body.playing #timerStatus,
body.playing #dangerStatus,
body.playing #objectiveStatus {
    min-width: 0;
    font-size: 13px;
}

body.playing .special-box {
    width: 112px;
}

body.playing .timer-box {
    width: 92px;
}

body.playing .danger-box {
    width: 72px;
}

body.playing .objective-box {
    grid-column: 1 / -1;
    width: min(430px, calc(100vw - 20px));
    border-color: rgba(124, 255, 178, 0.28);
}

body.playing #objectiveStatus {
    max-width: none;
}

body.overlay-open .hud {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.menu-screen,
.shop-screen,
.bonus-screen,
.confirm-screen,
.options-screen,
.profile-screen,
.dashboard-screen,
.game-over {
    position: fixed;
    inset: 0;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 95, 115, 0.14), transparent 25%),
        radial-gradient(circle at 88% 12%, rgba(117, 246, 255, 0.12), transparent 28%),
        rgba(2, 4, 10, 0.68);
    backdrop-filter: blur(9px);
}

.menu-screen.show,
.shop-screen.show,
.bonus-screen.show,
.confirm-screen.show,
.options-screen.show,
.profile-screen.show,
.dashboard-screen.show,
.game-over.show {
    display: flex;
}

.panel {
    width: min(420px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border: 1px solid rgba(194, 213, 255, 0.18);
    border-radius: 8px;
    background:
        radial-gradient(circle at top left, rgba(117, 246, 255, 0.09), transparent 35%),
        radial-gradient(circle at 86% 8%, rgba(255, 111, 216, 0.08), transparent 32%),
        linear-gradient(160deg, rgba(10, 14, 33, 0.96), rgba(5, 7, 18, 0.96));
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.58), 0 0 50px rgba(117, 246, 255, 0.08);
    padding: 26px;
    text-align: center;
}

.wide-panel {
    width: min(980px, 100%);
}

.profile-panel {
    width: min(1040px, 100%);
}

.profile-section {
    margin-top: 18px;
    border-top: 1px solid rgba(194, 213, 255, 0.14);
    padding-top: 16px;
    text-align: left;
}

.profile-section h2 {
    margin: 0 0 12px;
    color: var(--cyan);
    font-size: 26px;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.profile-stat-card,
.achievement-card,
.cosmetic-reward-card {
    border: 1px solid rgba(194, 213, 255, 0.14);
    border-radius: 8px;
    background: rgba(13, 20, 43, 0.78);
    padding: 13px;
}

.profile-stat-card span,
.achievement-card small,
.cosmetic-reward-card small {
    display: block;
    color: #b8c4dc;
    font-size: 12px;
    font-weight: 800;
}

.profile-stat-card strong,
.achievement-card strong,
.cosmetic-reward-card strong {
    display: block;
    color: #f5fbff;
    font-size: 19px;
    margin-top: 4px;
}

.event-history-card {
    grid-column: span 2;
}

.event-history-card small {
    margin-top: 5px;
}

.achievement-list,
.cosmetic-reward-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.achievement-card {
    display: grid;
    gap: 10px;
}

.achievement-card.unlocked,
.cosmetic-reward-card.unlocked {
    border-color: rgba(124, 255, 178, 0.42);
    box-shadow: 0 0 24px rgba(124, 255, 178, 0.12);
}

.achievement-card > span {
    color: #ffcf5a;
    font-weight: 900;
}

.achievement-card.unlocked > span {
    color: #7cffb2;
}

.achievement-bar {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.achievement-bar b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--green), var(--gold));
}

.cosmetic-shop-item.locked {
    opacity: 0.78;
}

.panel-close-button {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 10px 14px;
    min-width: auto;
}

.confirm-screen {
    z-index: 8;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 209, 102, 0.12), transparent 26%),
        radial-gradient(circle at 28% 20%, rgba(157, 123, 255, 0.15), transparent 28%),
        rgba(2, 4, 10, 0.74);
}

.confirm-panel {
    width: min(470px, 100%);
    border-color: rgba(255, 209, 102, 0.42);
    background:
        radial-gradient(circle at 22% 0%, rgba(255, 209, 102, 0.14), transparent 34%),
        radial-gradient(circle at 86% 12%, rgba(117, 246, 255, 0.12), transparent 32%),
        linear-gradient(160deg, rgba(12, 15, 34, 0.98), rgba(7, 7, 18, 0.98));
    box-shadow: 0 0 70px rgba(255, 209, 102, 0.13), 0 30px 100px rgba(0, 0, 0, 0.68);
}

.confirm-panel h1 {
    color: #ffefb4;
    font-size: 34px;
}

.confirm-message {
    margin: 18px 0 22px;
    color: #e9f1ff;
    font-size: 16px;
    font-weight: 750;
    line-height: 1.45;
    white-space: pre-line;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.secondary-button {
    background: linear-gradient(135deg, rgba(82, 96, 115, 0.95), rgba(58, 68, 92, 0.95));
    color: #edf7ff;
}

.panel h1 {
    margin: 0 0 8px;
    color: var(--cyan);
    text-shadow: 0 0 28px rgba(117, 246, 255, 0.25);
    font-size: 42px;
    line-height: 1;
}

.game-over .panel h1 {
    color: #ff5d73;
}

.final-score {
    margin: 0 0 22px;
    color: #dfe8ff;
    font-size: 22px;
    font-weight: 700;
}

.prestige-summary {
    margin: -12px 0 20px;
    color: var(--purple);
    font-size: 15px;
    font-weight: 800;
}

.shop-header {
    position: sticky;
    top: -26px;
    z-index: 4;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: -26px -26px 18px;
    border-bottom: 1px solid rgba(194, 213, 255, 0.14);
    background:
        radial-gradient(circle at 20% 0%, rgba(117, 246, 255, 0.12), transparent 32%),
        linear-gradient(135deg, rgba(11, 16, 39, 0.99), rgba(15, 10, 35, 0.99));
    padding: 22px 26px 16px;
}

.shop-header h1 {
    text-align: left;
}

.shop-header .final-score,
.shop-header .prestige-summary {
    margin-left: 0;
    text-align: left;
}

.shop-header #closeShopButton {
    flex: 0 0 auto;
    margin-top: 4px;
}

.shop-prestige-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    border: 1px solid rgba(180, 134, 255, 0.42);
    border-radius: 8px;
    background:
        radial-gradient(circle at top left, rgba(180, 134, 255, 0.2), transparent 42%),
        linear-gradient(135deg, rgba(42, 22, 82, 0.9), rgba(8, 13, 27, 0.92));
    box-shadow: 0 0 32px rgba(180, 134, 255, 0.16);
    padding: 16px;
    text-align: left;
}

.shop-prestige-panel strong {
    display: block;
    color: var(--purple);
    font-size: 22px;
    margin-bottom: 8px;
}

.shop-prestige-panel small {
    display: block;
    color: #cdd6ea;
    line-height: 1.35;
}

.ship-stats-panel {
    grid-column: 1 / -1;
    border: 1px solid rgba(117, 246, 255, 0.28);
    border-radius: 8px;
    background:
        radial-gradient(circle at top left, rgba(117, 246, 255, 0.1), transparent 36%),
        rgba(5, 8, 18, 0.72);
    box-shadow: inset 0 0 28px rgba(117, 246, 255, 0.06);
    padding: 16px;
    text-align: left;
}

.ship-stats-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.ship-stats-header strong {
    color: var(--cyan);
    font-size: 22px;
}

.ship-stats-header small {
    color: #9fb0ca;
    font-size: 12px;
}

.ship-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.ship-stat {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(20, 29, 64, 0.72), rgba(11, 13, 31, 0.78));
    padding: 9px 10px;
}

.ship-stat span {
    display: block;
    color: #99a7bf;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ship-stat strong {
    display: block;
    color: #edf7ff;
    font-size: 18px;
    margin-top: 4px;
}

.prestige-upgrade-item {
    border-color: rgba(198, 156, 255, 0.2);
}

.upgrade-preview {
    margin-top: 8px;
    border-top: 1px solid rgba(124, 255, 178, 0.18);
    padding-top: 8px;
    color: var(--green) !important;
    font-weight: 800;
}

.mode-grid,
.shop-grid,
.bonus-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 18px;
}

.shop-collapsible {
    grid-column: 1 / -1;
    --section-accent: var(--cyan);
    --section-accent-rgb: 117, 246, 255;
    border: 1px solid rgba(var(--section-accent-rgb), 0.26);
    border-radius: 8px;
    background:
        radial-gradient(circle at 0% 0%, rgba(var(--section-accent-rgb), 0.13), transparent 36%),
        rgba(5, 8, 18, 0.62);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.shop-section-stats {
    --section-accent: var(--cyan);
    --section-accent-rgb: 117, 246, 255;
}

.shop-section-prestige {
    --section-accent: var(--purple);
    --section-accent-rgb: 180, 134, 255;
}

.shop-section-abilities {
    --section-accent: var(--green);
    --section-accent-rgb: 124, 255, 178;
}

.shop-section-powers {
    --section-accent: var(--magenta);
    --section-accent-rgb: 255, 111, 216;
}

.shop-section-upgrades {
    --section-accent: var(--orange);
    --section-accent-rgb: 255, 159, 67;
}

.shop-section-cosmetics {
    --section-accent: var(--blue);
    --section-accent-rgb: 106, 168, 255;
}

.shop-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 0;
    border-radius: 0;
    background:
        linear-gradient(135deg, rgba(var(--section-accent-rgb), 0.16), rgba(16, 24, 45, 0.9) 46%, rgba(8, 10, 25, 0.94)),
        rgba(16, 24, 45, 0.88);
    padding: 14px 16px;
    text-align: left;
}

.shop-section-toggle span,
.shop-section-toggle strong,
.shop-section-toggle small {
    display: block;
}

.shop-section-toggle strong {
    color: var(--section-accent);
    text-shadow: 0 0 20px rgba(var(--section-accent-rgb), 0.22);
    font-size: 22px;
}

.shop-section-toggle small {
    margin-top: 4px;
    color: #aebbd2;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shop-section-toggle b {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(var(--section-accent-rgb), 0.44);
    border-radius: 8px;
    background: rgba(var(--section-accent-rgb), 0.08);
    color: var(--section-accent);
    font-size: 24px;
    line-height: 1;
}

.shop-section-content {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
}

.shop-collapsible.collapsed .shop-section-content {
    display: none;
}

.mode-card,
.shop-item,
.bonus-card {
    min-height: 132px;
    border: 1px solid rgba(194, 213, 255, 0.14);
    background:
        radial-gradient(circle at top right, rgba(117, 246, 255, 0.08), transparent 36%),
        linear-gradient(145deg, rgba(18, 25, 58, 0.9), rgba(10, 13, 32, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    color: #edf7ff;
    text-align: left;
}

.mode-card span,
.shop-item strong,
.bonus-card strong {
    display: block;
    margin-bottom: 8px;
    color: var(--cyan);
    font-size: 19px;
}

.mode-card small,
.shop-item small,
.bonus-card small {
    display: block;
    color: #aebbd2;
    font-size: 13px;
    line-height: 1.35;
}

.tutorial-panel {
    margin-top: 22px;
    border: 1px solid rgba(117, 246, 255, 0.22);
    border-radius: 8px;
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 95, 115, 0.1), transparent 28%),
        radial-gradient(circle at 78% 0%, rgba(117, 246, 255, 0.12), transparent 32%),
        rgba(5, 8, 18, 0.68);
    box-shadow: inset 0 0 32px rgba(117, 246, 255, 0.06), 0 0 34px rgba(180, 134, 255, 0.08);
    padding: 16px;
    text-align: left;
}

.tutorial-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.tutorial-header h2 {
    margin: 0;
    color: var(--cyan);
    font-size: 24px;
    line-height: 1;
}

.tutorial-header span {
    color: #aebbd2;
    font-size: 13px;
    font-weight: 700;
}

.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.tutorial-quickbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.tutorial-quickbar span {
    border: 1px solid rgba(117, 246, 255, 0.2);
    border-radius: 8px;
    background: rgba(16, 24, 45, 0.76);
    color: #dbe8ff;
    font-size: 12px;
    font-weight: 800;
    padding: 8px 10px;
}

.tutorial-feature-grid,
.tutorial-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.tutorial-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.tutorial-feature,
.tutorial-card {
    position: relative;
    border: 1px solid rgba(194, 213, 255, 0.13);
    border-radius: 8px;
    background:
        radial-gradient(circle at top right, rgba(255, 111, 216, 0.08), transparent 38%),
        linear-gradient(145deg, rgba(19, 26, 58, 0.76), rgba(10, 12, 30, 0.86));
    padding: 13px;
    overflow: hidden;
}

.tutorial-feature {
    min-height: 132px;
    border-color: rgba(255, 111, 216, 0.2);
    background:
        radial-gradient(circle at top left, rgba(255, 159, 67, 0.1), transparent 35%),
        linear-gradient(135deg, rgba(16, 24, 45, 0.9), rgba(28, 16, 54, 0.76));
}

.tutorial-feature h3,
.tutorial-card h4 {
    margin: 0 0 8px;
    color: var(--cyan);
    font-size: 18px;
    line-height: 1.05;
}

.tutorial-feature p,
.tutorial-card p {
    margin: 0;
    color: #cbd7ec;
    font-size: 12px;
    line-height: 1.45;
}

.tutorial-card small {
    display: block;
    margin-top: 9px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
    padding-top: 8px;
}

.tutorial-badge {
    display: inline-block;
    margin-bottom: 9px;
    border: 1px solid rgba(255, 209, 102, 0.34);
    border-radius: 999px;
    background: rgba(255, 209, 102, 0.12);
    color: var(--gold);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    padding: 4px 8px;
    text-transform: uppercase;
}

.tutorial-section-heading {
    grid-column: 1 / -1;
    margin: 18px 0 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--gold);
    font-size: 15px;
    letter-spacing: 0.05em;
    padding-bottom: 8px;
    text-transform: uppercase;
}

.codex-icon,
.enemy-dot {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-bottom: 10px;
    border-radius: 50%;
    color: #06101e;
    font-size: 13px;
    font-weight: 900;
}

.codex-icon.time {
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 0 18px rgba(117, 246, 255, 0.28);
}

.codex-icon.shock {
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 0 18px rgba(255, 107, 122, 0.28);
}

.codex-icon.dash {
    background: linear-gradient(135deg, var(--purple), var(--magenta));
    box-shadow: 0 0 18px rgba(157, 123, 255, 0.28);
}

.event-timeline {
    display: grid;
    gap: 8px;
}

.timeline-step {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    align-items: start;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 159, 67, 0.09), rgba(16, 24, 45, 0.72)),
        rgba(16, 24, 45, 0.68);
    padding: 11px 12px;
}

.timeline-step strong {
    color: var(--cyan);
    font-size: 13px;
}

.timeline-step span {
    color: #cbd7ec;
    font-size: 12px;
    line-height: 1.4;
}

.enemy-dot {
    border: 2px solid rgba(255, 255, 255, 0.62);
}

.enemy-dot.basic { background: #8b7a68; }
.enemy-dot.fast { background: #ffd166; clip-path: polygon(75% 50%, 20% 15%, 35% 50%, 20% 85%); }
.enemy-dot.heavy { background: #6d6359; border-radius: 8px; }
.enemy-dot.split { background: #7cffb2; clip-path: polygon(50% 0, 92% 28%, 74% 100%, 26% 100%, 8% 28%); }
.enemy-dot.explosive { background: #ff6b7a; box-shadow: 0 0 16px rgba(255, 107, 122, 0.42); }
.enemy-dot.drone { background: #17233f; border-radius: 8px; box-shadow: -18px 0 0 -9px #75f6ff, 18px 0 0 -9px #75f6ff, 0 0 14px rgba(117, 246, 255, 0.38); }
.enemy-dot.mine { background: #3e284b; clip-path: polygon(50% 0, 62% 28%, 100% 18%, 72% 50%, 100% 82%, 62% 72%, 50% 100%, 38% 72%, 0 82%, 28% 50%, 0 18%, 38% 28%); }
.enemy-dot.missile { background: #ff5d73; clip-path: polygon(100% 50%, 18% 10%, 34% 50%, 18% 90%); }
.enemy-dot.ravager { background: #ff5d73; clip-path: polygon(100% 50%, 0 4%, 30% 50%, 0 96%); }
.enemy-dot.sentry { background: #6aa8ff; border-radius: 7px; box-shadow: inset 0 0 0 9px #10182d, 0 0 14px rgba(106, 168, 255, 0.38); }
.enemy-dot.guardian { background: #102f2b; box-shadow: inset 0 0 0 5px #7cffb2, 0 0 16px rgba(124, 255, 178, 0.34); }
.enemy-dot.comet { background: linear-gradient(90deg, rgba(255, 93, 115, 0.2), #ff9f43, #ffd166); clip-path: polygon(100% 50%, 18% 10%, 0 50%, 18% 90%); }
.enemy-dot.swarm { background: #ff6fd8; clip-path: polygon(82% 50%, 16% 12%, 34% 50%, 16% 88%); }
.enemy-dot.anomaly { background: #9d7bff; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.enemy-dot.boss { background: #ffcf5a; border-radius: 8px; clip-path: polygon(50% 0, 100% 35%, 82% 100%, 18% 100%, 0 35%); }
.enemy-dot.hole { background: #1b102f; box-shadow: inset 0 0 0 6px #07030d, 0 0 18px rgba(157, 123, 255, 0.32); }

.tutorial-block {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(16, 24, 45, 0.7);
    padding: 12px;
}

.tutorial-block h3 {
    margin: 0 0 8px;
    color: #ffd166;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tutorial-block ul {
    margin: 0;
    padding-left: 18px;
}

.tutorial-block li {
    color: #cbd7ec;
    font-size: 12px;
    line-height: 1.38;
    margin: 5px 0;
}

kbd {
    display: inline-block;
    min-width: 22px;
    border: 1px solid rgba(117, 246, 255, 0.34);
    border-bottom-color: rgba(117, 246, 255, 0.18);
    border-radius: 5px;
    background: rgba(3, 7, 17, 0.78);
    color: #edf7ff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    padding: 3px 6px;
    text-align: center;
}

.pause-hint {
    margin: -12px 0 18px;
    color: #aebbd2;
    font-size: 13px;
    font-weight: 700;
}

.shop-item,
.bonus-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bonus-card button,
.shop-item button {
    margin-top: 12px;
    width: 100%;
}

.shop-section-powers .shop-item {
    border-color: rgba(255, 111, 216, 0.18);
    background:
        radial-gradient(circle at top right, rgba(255, 111, 216, 0.14), transparent 38%),
        linear-gradient(145deg, rgba(25, 18, 52, 0.92), rgba(10, 13, 32, 0.94));
}

.shop-section-powers .shop-item strong {
    color: var(--magenta);
}

.shop-section-abilities .shop-item {
    border-color: rgba(124, 255, 178, 0.18);
}

.shop-section-abilities .shop-item strong {
    color: var(--green);
}

.shop-section-upgrades .shop-item {
    border-color: rgba(255, 159, 67, 0.2);
}

.shop-section-upgrades .shop-item strong {
    color: var(--orange);
}

.shop-section-cosmetics .shop-item {
    border-color: rgba(106, 168, 255, 0.2);
}

.shop-section-cosmetics .shop-item strong {
    color: var(--blue);
}

.run-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 18px;
    text-align: left;
}

.run-stats div {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(16, 24, 45, 0.72);
    padding: 8px 10px;
    color: #d8e3f7;
    font-weight: 700;
}

.score-list {
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
    text-align: left;
}

.score-list li {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 9px 2px;
    color: #d8e3f7;
    font-weight: 700;
}

.score-list li:first-child {
    color: #75f6ff;
}

.muted {
    color: #91a0bb;
    font-size: 13px;
}


.cosmetic-preview {
    width: 100%;
    height: 82px;
    display: block;
    margin: 0 0 12px;
    border: 1px solid rgba(117, 246, 255, 0.22);
    border-radius: 8px;
    background: rgba(5, 8, 18, 0.76);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.28);
}

.cosmetic-shop-item.equipped .cosmetic-preview {
    border-color: rgba(255, 209, 102, 0.72);
    box-shadow: 0 0 18px rgba(255, 209, 102, 0.16), inset 0 0 18px rgba(0, 0, 0, 0.28);
}

@media (max-width: 760px) {
    .mode-grid,
    .shop-grid,
    .bonus-grid,
    .shop-section-content,
    .tutorial-feature-grid,
    .tutorial-card-grid {
        grid-template-columns: 1fr;
    }

    .timeline-step {
        grid-template-columns: 1fr;
    }

    .tutorial-grid {
        grid-template-columns: 1fr;
    }

    .tutorial-header {
        display: block;
    }

    .tutorial-header span {
        display: block;
        margin-top: 8px;
    }

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

    .ship-stats-header {
        display: block;
    }
}

@media (max-width: 560px) {
    .hud {
        top: 12px;
        left: 12px;
        right: 12px;
    }

    .tag,
    .health-box,
    .shield-box,
    .special-box,
    .bonus-box,
    .mode-box,
    .timer-box,
    .danger-box,
    .objective-box,
    .credits-box {
        display: none;
    }

    .prestige-box {
        display: none;
    }

    .shop-prestige-panel {
        grid-template-columns: 1fr;
    }

    .ship-stats-grid {
        grid-template-columns: 1fr;
    }

    #scoreId {
        font-size: 24px;
    }

    .panel h1 {
        font-size: 34px;
    }
}


.options-panel {
    width: min(560px, 100%);
}

.options-list {
    display: grid;
    gap: 14px;
    margin: 18px 0 20px;
    text-align: left;
}

.option-row {
    display: grid;
    grid-template-columns: 160px 1fr auto;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(16, 24, 45, 0.72);
    padding: 12px;
    color: #edf7ff;
    font-weight: 800;
}

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

.option-row input[type="checkbox"] {
    width: 24px;
    height: 24px;
    accent-color: #20c997;
}

.option-row input[type="range"] {
    width: 100%;
    accent-color: #75f6ff;
}

.option-row strong {
    min-width: 48px;
    color: #75f6ff;
    text-align: right;
}

.option-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 620px) {
    .option-row,
    .slider-row {
        grid-template-columns: 1fr;
    }

    .option-row strong {
        text-align: left;
    }
}


.text-row input {
    width: min(360px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(5, 8, 18, 0.72);
    color: #edf7ff;
    font-size: 15px;
    font-weight: 700;
    padding: 10px 12px;
}

.server-row {
    align-items: flex-start;
}

.server-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.server-actions a {
    color: #75f6ff;
    font-weight: 800;
    text-decoration: none;
}

.server-actions a:hover {
    text-decoration: underline;
}

.server-actions small {
    color: #99a7bf;
    font-weight: 700;
}


.dashboard-embed {
    display: grid;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(8, 13, 27, 0.82);
    padding: 12px;
}

.dashboard-embed-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: #edf7ff;
}

.dashboard-embed-header strong {
    color: #75f6ff;
}

.dashboard-embed-header small {
    color: #aebbd2;
    font-size: 12px;
}

#dashboardFrame {
    width: 100%;
    height: min(44vh, 460px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: #070912;
}


.server-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.server-actions button,
.server-actions a {
    border-radius: 8px;
    background: #141d36;
    border: 1px solid rgba(117, 246, 255, 0.45);
    color: #edf7ff;
    padding: 9px 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.dashboard-panel {
    width: min(1180px, 100%);
}

@media (max-width: 700px) {
    .dashboard-embed-header {
        display: grid;
    }

    #dashboardFrame {
        height: 360px;
    }
}

.shop-section-title,
.shop-category-title {
    grid-column: 1 / -1;
    text-align: left;
}

.shop-section-title {
    margin-top: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    padding: 6px 0 10px;
}

.shop-section-title h2 {
    margin: 0 0 4px;
    color: #75f6ff;
    font-size: 24px;
}

.shop-section-title small,
.shop-category-title {
    color: #aebbd2;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shop-category-title {
    margin-top: 8px;
    color: #ffd166;
}

.cosmetic-shop-item.equipped {
    border-color: rgba(117, 246, 255, 0.75);
    box-shadow: 0 0 22px rgba(117, 246, 255, 0.18);
}


.dashboard-actions {
    justify-content: center;
    margin: 0 0 14px;
}

.dashboard-embed-standalone #dashboardFrame {
    height: min(64vh, 720px);
}
