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

body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 0%, #42206c 0%, transparent 55%),
        linear-gradient(135deg, #080617, #130a2b, #080617);
    color: white;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 25px;
}

.game {
    width: 100%;
    max-width: 900px;
    text-align: center;
}

h1 {
    font-size: clamp(28px, 5vw, 48px);
    letter-spacing: 5px;
    color: #f1d5ff;
    text-shadow: 0 0 10px #bd4cff, 0 0 25px #922bff;
    margin-bottom: 8px;
}

.subtitle {
    color: #bda0e9;
    letter-spacing: 5px;
    font-size: 12px;
    margin-bottom: 25px;
}

.screen {
    width: 100%;
}

.screen[hidden] {
    display: none !important;
}

.stats {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.stats span {
    flex: 1;
    padding: 12px 5px;
    background: #ffffff0d;
    border: 1px solid #9d54d877;
    border-radius: 10px;
    color: #e8d5ff;
    font-size: 13px;
}

.stats b {
    color: #ffffff;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #08091c;
    border: 2px solid #a34aff;
    border-radius: 12px;
    box-shadow: 0 0 15px #922bff66, 0 0 40px #922bff22;
}

button {
    padding: 13px 28px;
    border: 1px solid #e4b4ff;
    border-radius: 10px;
    background: linear-gradient(135deg, #7135c5, #bd38a8);
    color: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 18px #b34cff;
}

button:active:not(:disabled) {
    transform: scale(0.96);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
}

.level-buttons button {
    min-width: 190px;
}

.menu-extra-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}

#hangarButton {
    background: linear-gradient(135deg, #075985, #2563eb);
    border-color: #7dd3fc;
}

#shopButton {
    background: linear-gradient(135deg, #7135c5, #bd38a8);
}

#message {
    margin-top: 18px;
    color: #e2caff;
    font-size: 15px;
}

.help {
    margin-top: 10px;
    color: #9f8bbd;
    font-size: 12px;
}

#menuScreen,
#victoryScreen {
    padding: 45px 15px;
    text-align: center;
}

#menuScreen h2,
#victoryScreen h2 {
    color: #e9d5ff;
    text-shadow: 0 0 15px #a855f7;
    margin-top: 35px;
}

#menuMessage,
#victoryDescription {
    color: #d8b4fe;
    margin: 25px 0;
}

.reward {
    color: #facc15;
    font-weight: bold;
    text-shadow: 0 0 12px #facc15;
    margin: 30px 0;
}

#victoryMenuButton {
    margin-top: 15px;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 18px;
}

/* МАГАЗИН РАСКРАСОК И АНГАР */

#shopScreen,
#hangarScreen {
    padding: 35px 10px;
    text-align: center;
}

#shopScreen h2,
.hangar-tokens {
    color: #facc15;
    text-shadow: 0 0 12px #facc15;
    margin: 15px 0;
}

.shop-items {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px auto;
    max-width: 850px;
}

.shop-item {
    width: 155px;
    min-height: 225px;
    padding: 15px 12px;
    border: 1px solid #a855f7;
    border-radius: 15px;
    background:
        radial-gradient(circle at 50% 35%, #47216b88, transparent 65%),
        rgba(12, 7, 35, 0.95);
    box-shadow: 0 0 15px #9333ea33;
    transition: 0.25s;
}

.shop-item:hover {
    transform: translateY(-5px);
    border-color: #e879f9;
    box-shadow: 0 0 25px #a855f7aa;
}

.shop-item.selected {
    border: 2px solid #4ade80;
    box-shadow: 0 0 22px #4ade8077;
}

.ship-preview {
    width: 125px;
    height: 100px;
    margin: 8px auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ship-preview canvas {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.ship-name {
    color: #f3e8ff;
    font-weight: bold;
    min-height: 35px;
}

.ship-price {
    color: #facc15;
    font-weight: bold;
    text-shadow: 0 0 8px #facc15;
    margin: 8px 0;
}

.shop-item button {
    margin-top: 8px;
    width: 100%;
    padding: 10px 5px;
    font-size: 11px;
}

.shop-item.selected button {
    background: linear-gradient(135deg, #15803d, #22c55e);
    border-color: #86efac;
}

/* УЛУЧШЕНИЯ */

.upgrade-heading {
    color: #7dd3fc;
    text-shadow: 0 0 15px #38bdf8;
    margin: 35px 0 12px;
}

.upgrade-items {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 25px auto;
    max-width: 850px;
}

.upgrade-card {
    width: 175px;
    padding: 18px 14px;
    border: 1px solid #38bdf8;
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 0%, #07598566, transparent 75%),
        rgba(5, 15, 38, 0.95);
    box-shadow: 0 0 15px #0ea5e933;
}

.upgrade-icon {
    font-size: 35px;
    margin-bottom: 10px;
}

.upgrade-name {
    color: #bae6fd;
    font-weight: bold;
    margin-bottom: 8px;
}

.upgrade-description {
    color: #cbd5e1;
    font-size: 12px;
    min-height: 35px;
    margin-bottom: 10px;
}

.upgrade-level {
    color: #4ade80;
    font-size: 12px;
    margin: 8px 0;
}

.upgrade-card button {
    width: 100%;
    padding: 10px 5px;
    font-size: 11px;
    background: linear-gradient(135deg, #075985, #2563eb);
    border-color: #7dd3fc;
}

#shopMessage,
#hangarMessage {
    color: #d8b4fe;
    margin: 20px 0;
    min-height: 20px;
}

#shopBackButton,
#hangarBackButton {
    margin-top: 12px;
}

@media (max-width: 500px) {
    body {
        padding: 12px;
    }

    .stats span {
        font-size: 10px;
    }

    button {
        padding: 12px 17px;
    }

    .shop-item {
        width: 135px;
    }

    .ship-preview {
        width: 110px;
    }

    .upgrade-card {
        width: 145px;
    }
}