/* Общие сбросы */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

body {
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 16px;
}

#app {
    max-width: 800px;
    width: 100%;
    background: #16213e;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    color: #f0f0f0;
}

/* Экраны */
.screen {
    display: none;
    flex-direction: column;
    gap: 18px;
}
.screen.active {
    display: flex;
}

/* Выбор героя */
#select-screen h1 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #f7971e, #ffd200);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
}

.hero-btn {
    background: #0f3460;
    border: 2px solid #533483;
    border-radius: 18px;
    padding: 16px 8px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.hero-btn:hover {
    transform: scale(1.05);
    background: #1a4a7a;
    border-color: #e94560;
}
.hero-btn .icon {
    font-size: 2.8rem;
}
.hero-btn .sub {
    font-weight: 400;
    font-size: 0.8rem;
    color: #b0b0b0;
}

/* Игровой экран */
#biom-indicator {
    font-size: 1.6rem;
    text-align: center;
    background: #2a3a5c;
    padding: 8px;
    border-radius: 40px;
    font-weight: 600;
}
#timer {
    font-size: 2.2rem;
    text-align: center;
    font-weight: 700;
    color: #ffd700;
}

.battlefield {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 12px;
    background: #1a2a4a;
    border-radius: 24px;
    padding: 18px;
}

.hero-panel, .enemy-panel {
    flex: 1;
    background: #0f1f3a;
    border-radius: 18px;
    padding: 14px;
    border: 2px solid #3a5a7a;
}
.enemy-panel {
    border-color: #7a3a3a;
}
.vs {
    font-size: 2.6rem;
    display: flex;
    align-items: center;
    color: #ffd700;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.95rem;
    margin: 8px 0;
}
.stats span {
    background: #1a2a4a;
    padding: 2px 8px;
    border-radius: 20px;
}

.hp-bar {
    width: 100%;
    height: 16px;
    background: #3a3a4a;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 6px;
}
.hp-bar div {
    height: 100%;
    background: #e94560;
    transition: width 0.3s;
}
.hero-panel .hp-bar div {
    background: #3cb371;
}

.actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}
#attack-btn {
    background: #e94560;
    border: none;
    padding: 14px 40px;
    border-radius: 60px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 6px 0 #a0233a;
}
#attack-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #a0233a;
}
#attack-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #a0233a;
}
#attack-btn:disabled {
    opacity: 0.5;
    transform: translateY(4px);
    box-shadow: 0 2px 0 #a0233a;
    pointer-events: none;
}
.small {
    background: #4a4a6a;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
}
.small:hover {
    background: #5a5a7a;
}

#log {
    background: #0a0a1a;
    padding: 12px 16px;
    border-radius: 16px;
    min-height: 60px;
    font-family: monospace;
    font-size: 0.95rem;
    border: 1px solid #3a3a5a;
    overflow-y: auto;
    max-height: 100px;
}

/* Экран прокачки */
#upgrade-screen h2 {
    text-align: center;
    font-size: 2rem;
    color: #ffd700;
}
.upgrade-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #1a2a4a;
    padding: 18px;
    border-radius: 18px;
}
.upgrade-stats div {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.2rem;
}
.up-btn {
    background: #3cb371;
    border: none;
    border-radius: 30px;
    padding: 4px 16px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: 0.1s;
}
.up-btn:hover {
    transform: scale(1.1);
}
.up-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}
#next-round-btn {
    background: #ffd700;
    color: #1a1a2e;
    border: none;
    padding: 14px;
    border-radius: 40px;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
#next-round-btn:hover {
    transform: scale(1.02);
}

/* Экран конца */
#end-screen h2 {
    font-size: 2.4rem;
    text-align: center;
}
#end-screen p {
    font-size: 1.3rem;
    text-align: center;
}
#play-again-btn {
    background: #e94560;
    border: none;
    padding: 16px;
    border-radius: 40px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
}
#play-again-btn:hover {
    transform: scale(1.02);
}

/* Адаптив */
@media (max-width: 600px) {
    .battlefield {
        flex-direction: column;
        align-items: center;
    }
    .vs {
        transform: rotate(90deg);
    }
    .hero-list {
        grid-template-columns: 1fr 1fr;
    }
}