﻿body {
    margin: 0;
    padding: 0;
    background-color: #050505;
    color: #ffffff;
    font-family: 'Exo 2', 'Orbitron', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    user-select: none;
    /* Р—Р°Р±РѕСЂРѕРЅСЏС”РјРѕ РІРёРґС–Р»РµРЅРЅСЏ С‚РµРєСЃС‚Сѓ */
}

input {
    user-select: text;
    /* Р”РѕР·РІРѕР»СЏС”РјРѕ РІРёРґС–Р»РµРЅРЅСЏ РІ С–РЅРїСѓС‚Р°С… РґР»СЏ Р·СЂСѓС‡РЅРѕСЃС‚С– */
}

#account-status {
    position: fixed;
    top: 25px;
    left: 25px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#user-greeting {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(15, 15, 15, 0.85);
    padding: 10px 20px;
    border-radius: 40px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 255, 136, 0.3);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

#player-name {
    color: #00ff88;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

#logout-btn {
    background: rgba(255, 77, 77, 0.15);
    border: 1px solid rgba(255, 77, 77, 0.4);
    color: #ff4d4d !important;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    min-width: unset !important;
}

#logout-btn:hover {
    background: #ff4d4d;
    color: #fff !important;
}

#auth-open-btn {
    min-width: unset;
    padding: 12px 25px;
    font-size: 0.9rem;
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid rgba(0, 255, 136, 0.5);
    color: #00ff88;
    border-radius: 40px;
}

#auth-open-btn:hover {
    background: #00ff88;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

#auth-screen {
    z-index: 2000;
}

.auth-modal {
    max-width: 400px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    margin: 20px 0;
}

.auth-form input,
.auth-form textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    border-radius: 10px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.auth-form textarea {
    height: 120px;
    resize: none;
}

.auth-form input:focus,
.auth-form textarea:focus {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.05);
}

.auth-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.auth-modal button {
    min-width: unset !important;
    flex: 1;
    font-size: 0.9rem;
    padding: 12px 10px;
}

.discord-btn {
    background: #5865F2 !important;
    border: none !important;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: bold;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.discord-btn:hover {
    background: #4752C4 !important;
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.5);
    transform: translateY(-2px);
}

.discord-icon {
    width: 20px;
    height: 20px;
}

/* --- ЗДІБНОСТІ --- */
.ability-icon {
    width: 131px;
    height: 131px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.4));
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.hud-ability-slot {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 163px;
    height: 163px;
    background: rgba(10, 10, 10, 0.9);
    border: 2px solid #00ff88;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 101;
    /* Трохи вище, щоб активна була головною */
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

#left-ability-slot {
    right: 0;
    border-right: none;
    border-radius: 15px 0 0 15px;
}

#right-ability-slot {
    left: 0;
    border-left: none;
    border-radius: 0 15px 15px 0;
}

.hud-ability-slot img {
    width: 85%;
    height: 85%;
    object-fit: contain;
}

.hud-passive-slot {
    position: absolute;
    top: 50%;
    transform: translateY(-165px);
    width: 82px;
    height: 82px;
    background: rgba(10, 10, 10, 0.9);
    border: 2px solid #ff00ff;
    /* Фіолетовий колір для пасивних */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

#left-passive-slot {
    right: 0;
    border-right: none;
    border-radius: 12px 0 0 12px;
}

#right-passive-slot {
    left: 0;
    border-left: none;
    border-radius: 0 12px 12px 0;
}

.hud-passive-slot img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.cooldown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
}

.cooldown-timer {
    color: #fff;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 0, 0, 1);
}

.ability-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.ability-card:hover {
    background: rgba(0, 255, 136, 0.05);
    border-color: rgba(0, 255, 136, 0.3);
}

.ability-card.active {
    background: rgba(0, 255, 136, 0.1);
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

#game-over-screen,
#game-intro {
    text-align: center;
    background: rgba(15, 15, 15, 0.9);
    padding: 1.5rem;
    border-radius: 25px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 255, 136, 0.1);
    position: absolute;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    box-sizing: border-box;
}

#game-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    border-radius: 0;
    z-index: 5000;
    background: #000;
    justify-content: center;
    overflow: hidden;
}

.intro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.05) 0%, rgba(0, 0, 0, 0.9) 100%);
    pointer-events: none;
}

.intro-content {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    max-width: 1200px;
    z-index: 2;
}

.intro-player-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    opacity: 0;
}

#intro-player-left {
    transform: translateX(-100px);
    animation: slideInLeft 0.6s ease forwards 0.2s;
}

#intro-player-right {
    transform: translateX(100px);
    animation: slideInRight 0.6s ease forwards 0.2s;
}

@keyframes slideInLeft {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.intro-avatar {
    width: 180px;
    height: 180px;
    background: #111;
    border: 4px solid #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
    position: relative;
    overflow: hidden;
}

.intro-avatar canvas {
    width: 100%;
    height: 100%;
}

.intro-name {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 5px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    margin-bottom: 5px;
}

.intro-abilities {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.intro-ability-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 100px;
}

.intro-ability-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.intro-ability-icon.active-icon {
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.4));
}

.intro-ability-icon.passive-icon {
    filter: drop-shadow(0 0 15px rgba(255, 0, 255, 0.4));
}

.intro-ability-name {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.intro-ability-name.active-name {
    color: #00ffff;
}

.intro-ability-name.passive-name {
    color: #ff00ff;
}

.intro-vs {
    font-size: 6rem;
    font-weight: 900;
    font-style: italic;
    background: linear-gradient(45deg, #00ff88, #ff4d4d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: vsPulse 1s ease-in-out infinite alternate;
    padding: 0 40px;
}

@keyframes vsPulse {
    from {
        transform: scale(1);
        filter: brightness(1);
    }

    to {
        transform: scale(1.1);
        filter: brightness(1.3);
    }
}

#ui-container,
#game-over-screen {
    text-align: center;
    background: rgba(15, 15, 15, 0.9);
    padding: 1.5rem;
    border-radius: 25px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 255, 136, 0.1);
    position: absolute;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    box-sizing: border-box;
}

#game-actions-panel {
    background: rgba(127, 128, 255, 0.1);
    padding: 15px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    margin: 15px 0;
    border: 1px solid rgba(127, 128, 255, 0.3);
}


#game-actions-panel button {
    margin-top: 0 !important;
}

/* --- РќРђР›РђРЁРўРЈР’РђРќРќРЇ --- */
.settings-tabs {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    width: 100%;
}

.settings-tab-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.settings-tab-btn.active {
    background: rgba(0, 255, 136, 0.1);
    border-color: #00ff88;
    color: #00ff88;
}

.settings-tab-content {
    display: none;
    width: 100%;
}

.settings-tab-content.active {
    display: block;
}

.settings-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.keybind-row,
.audio-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    gap: 20px;
}

.keybind-row:hover,
.audio-setting-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.keybind-row span,
.audio-setting-row span {
    font-size: 0.9rem;
    color: #ccc;
    font-weight: bold;
}

/* Switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #00ff88;
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.keybind-btn {
    min-width: 100px;
    padding: 8px 12px;
    font-size: 0.8rem;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.4);
    color: #00ff88;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.keybind-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    transform: scale(1.05);
}

.keybind-btn.waiting {
    background: rgba(255, 200, 0, 0.1);
    border-color: #ffcc00;
    color: #ffcc00;
    animation: pulse-waiting 1.5s infinite;
}

@keyframes pulse-waiting {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* --- РўРђР›РђРќРўР --- */
.talents-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}

.talents-container::-webkit-scrollbar {
    width: 6px;
}

.talents-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.talents-container::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 10px;
}

.talents-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

.talent-row {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.talent-row-title {
    font-size: 1rem;
    color: #00ff88;
    margin-bottom: 4px;
    letter-spacing: 2px;
    font-weight: bold;
    text-align: center;
}

.talent-row-subtitle {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.talent-options {
    display: flex;
    gap: 8px;
    width: 100%;
}

.talent-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}

.talent-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 10px 5px !important;
    color: #ccc !important;
    font-size: 0.75rem !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    min-width: unset !important;
    text-transform: uppercase;
    text-align: center;
}

.talent-card:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
    transform: translateY(-2px);
}

.talent-card.active {
    background: rgba(0, 255, 136, 0.1) !important;
    border-color: #00ff88 !important;
    color: #00ff88 !important;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

/* Р’С–Р·СѓР°Р»СЊРЅРёР№ Р·РІ'СЏР·РѕРє РґР»СЏ СЂСЏРґС–РІ 1-5 */
.talents-group {
    border: 1px dashed rgba(0, 255, 136, 0.2);
    border-radius: 15px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.ability-section-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.abilities-flex-row {
    flex-direction: row !important;
    gap: 15px !important;
    align-items: flex-start !important;
    overflow-y: visible !important;
}

.abilities-flex-row .ability-section-panel {
    flex: 1;
    margin-bottom: 0 !important;
}

.ability-section-panel:hover {
    border-color: rgba(0, 255, 136, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.ability-section-panel .talent-row-title {
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ability-section-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90.0deg, transparent, rgba(0, 255, 136, 0.3), transparent);
}

.talent-row-title {
    font-size: 0.75rem !important;
    letter-spacing: 4px !important;
    color: #00ff88 !important;
    opacity: 0.8;
    text-align: center;
    margin-bottom: 5px !important;
}

.talents-group::before {
    content: var(--linked-text, "в›“ LINKED");
    position: absolute;
    top: -10px;
    right: 20px;
    background: #111;
    padding: 0 10px;
    font-size: 0.6rem;
    color: #00ff88;
    letter-spacing: 2px;
}

/* --- Р’РР‘Р†Р  РњРћР’Р --- */
#language-wrapper {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

#lang-toggle-btn {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #00ff88;
    padding: 14px 45px;
    border-radius: 60px;
    cursor: pointer;
    backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.3), 0 0 50px rgba(0, 0, 0, 0.7);
}

.lang-icon {
    font-size: 28px;
    margin-right: 8px;
    filter: drop-shadow(0 0 10px rgba(0, 195, 255, 0.8));
    transition: transform 0.4s ease;
}

#lang-toggle-btn:hover .lang-icon {
    transform: rotate(15deg) scale(1.15);
}

#lang-toggle-btn:hover {
    background: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5), 0 0 60px rgba(0, 255, 136, 0.2);
    transform: scale(1.05) translateY(-3px);
}

#lang-hint {
    font-size: 13px;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 800;
    white-space: nowrap;
    transition: all 0.3s;
}

#lang-toggle-btn:hover #lang-hint {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.lang-divider {
    width: 2px;
    height: 24px;
    background: rgba(0, 255, 136, 0.4);
    margin: 0 22px;
}

#current-lang-label {
    color: #00ff88;
    font-weight: 900;
    font-size: 18px;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
    display: flex;
    align-items: center;
    gap: 10px;
}

#lang-options {
    margin-top: 10px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
    min-width: 180px;
    backdrop-filter: blur(20px);
    animation: fadeInDown 0.3s ease;
    width: 100%;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-option {
    padding: 18px 30px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-option:hover {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
}

.lang-option.active {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.05);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #00ff88, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 5px;
    background-clip: text;
}

#status-text {
    margin-bottom: 10px;
    font-size: 1rem;
    color: #aaa;
    min-height: 0;
}

.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

button {
    background: linear-gradient(90deg, #00ff88, #00ccff);
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    color: #000;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Orbitron', sans-serif;
    min-width: 300px;
}

button.secondary-btn {
    background: transparent;
    border: 2px solid #00ff88;
    color: #00ff88;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

button.secondary-btn:hover {
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

button:active {
    transform: scale(0.95);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: grayscale(0.5);
}

/* --- РђРЅС–РјР°С†С–СЏ РїРѕС€СѓРєСѓ (Loader) --- */
.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 255, 136, 0.1);
    border-top: 5px solid #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 20px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#game-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    background: #000;
    z-index: 5;
}

#game-center {
    height: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
    position: relative;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    background: #111;
    display: block;
    cursor: crosshair;
    width: 100%;
    height: 100%;
}

/* Side Panels */
.hp-side-panel {
    flex: 1;
    position: relative;
    border: 3px solid yellow;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

/* Р¤РѕРЅ РґР»СЏ Р±Р°СЂСѓ (РІРµСЂС‚РёРєР°Р»СЊРЅРёР№) */
.hp-bar-vertical {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* РџС–Рґ С‚РµРєСЃС‚РѕРј */
}

/* Заливка */
.hp-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: height 0.3s;
    opacity: 0.6;
}

/* РўРµРєСЃС‚ РҐРџ */
.hp-text {
    position: absolute;
    top: 20px;
    width: 100%;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    z-index: 2;
    /* РќР°Рґ Р±Р°СЂРѕРј */
    text-shadow: 2px 2px 0 #000;
}

/* --- РЎРўРР›Р† РњРћР”РђР›Р¬РќРћР“Рћ Р’Р†РљРќРђ --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: #0a0a0a;
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid #00ff88;
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.2);
    text-align: center;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Спеціальний стиль для вікон з фіксованою шапкою */
.modal-content.fixed-header-layout {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Вимикаємо загальний скрол */
    padding: 0;
    /* Обнуляємо паддінг, щоб додати його в під-панелі */
}

.modal-fixed-header {
    flex: 0 0 auto;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    background: rgba(10, 10, 10, 0.95);
    z-index: 10;
}

.modal-scroll-area {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 30px;
    max-height: 75vh;
}

/* Стилізація скроллбару для внутрішньої області */
.modal-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.modal-scroll-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.modal-scroll-area::-webkit-scrollbar-thumb {
    background: #00ff88;
    border-radius: 10px;
}

/* Стилізація скроллбару для модалок */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.modal-content::-webkit-scrollbar-thumb {
    background: #00ff88;
    border-radius: 10px;
}

.modal-content h2 {
    color: #00ff88;
    margin-top: 0;
    letter-spacing: 3px;
    font-size: 2rem;
}

.mechanics-list {
    text-align: left;
    margin: 2rem 0;
}

.mechanics-list p {
    margin: 12px 0;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid #00ff88;
    font-size: 0.95rem;
}

.mechanics-list b {
    color: #00ccff;
}

#close-mechanics-btn {
    min-width: 200px;
    background: transparent;
    border: 2px solid #00ff88;
    color: #00ff88;
}

#close-mechanics-btn:hover {
    background: #00ff88;
    color: #000;
}

/* --- РЎРљР†РќР --- */
.skins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.skin-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.skin-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-5px);
}

.skin-card.active {
    background: rgba(0, 255, 136, 0.1);
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.skin-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: #111;
}

.skin-card.active .skin-preview {
    border-color: #00ff88;
}

.skin-name {
    font-size: 0.8rem;
    color: #ccc;
    text-transform: uppercase;
    text-align: center;
}

.skin-card.active .skin-name {
    color: #00ff88;
    font-weight: bold;
}

/* --- РњРЈР—РР§РќРР™ РџР›Р•Р„Р  --- */
#music-player {
    position: fixed;
    bottom: 25px;
    right: 25px;
    margin-top: 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 20px;
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    width: 320px;
}

.player-info {
    width: 100%;
    text-align: center;
    overflow: hidden;
    height: 1.2rem;
}

#track-name {
    font-size: 0.85rem;
    color: #00ff88;
    white-space: nowrap;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
    max-width: 100%;
}

.player-controls {
    display: flex;
    gap: 15px;
}

.player-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
    min-width: unset !important;
    padding: 0;
}

.player-btn:hover {
    background: #00ff88;
    color: #000;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.volume-icon {
    font-size: 1rem;
}

#volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    height: 4px;
    border-radius: 2px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #00ff88;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* --- РђР”РђРџРўРР’РќР†РЎРўР¬ (MEDIA QUERIES) --- */

@media (max-width: 1200px) {
    #music-player {
        width: 260px;
        padding: 10px 15px;
        bottom: 15px;
        right: 15px;
    }
}

@media (max-height: 900px) {
    h1 {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }

    #ui-container {
        padding: 1.5rem;
    }

    #game-actions-panel {
        margin: 15px 0;
        padding: 15px;
    }

    button {
        padding: 12px 30px;
        font-size: 1rem;
        min-width: 250px;
    }

    .talents-container {
        gap: 6px;
    }

    .talent-row {
        padding: 6px 10px;
    }

    .talent-row-subtitle {
        font-size: 0.6rem;
        margin-bottom: 4px;
    }

    .talents-group {
        gap: 8px;
    }
}

@media (max-width: 600px),
(max-height: 700px) {
    h1 {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }

    #status-text {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    button {
        min-width: 200px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    #game-actions-panel {
        padding: 10px;
        gap: 8px;
    }

    #music-player {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        bottom: 10px;
        flex-direction: row;
        padding: 8px 15px;
        justify-content: space-between;
    }

    .volume-container {
        display: none;
    }

    /* РҐРѕРІР°С”РјРѕ РіСѓС‡РЅС–СЃС‚СЊ РЅР° РјР°Р»РµРЅСЊРєРёС… РµРєСЂР°РЅР°С… */

    #account-status {
        top: 10px;
        left: 10px;
    }

    #user-greeting {
        padding: 5px 12px;
        font-size: 0.8rem;
    }

    #language-wrapper {
        top: 10px;
    }

    #lang-toggle-btn {
        padding: 8px 20px;
    }

    .modal-content {
        padding: 1.2rem;
    }

    .modal-content h2 {
        font-size: 1.4rem;
    }
}

@media (orientation: portrait) {
    #game-container {
        width: 95vw;
        height: 95vw;
    }
}

/* --- РќРђР›РђРЁРўРЈР’РђРќРќРЇ --- */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
    width: 100%;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-label {
    color: #ccc;
    font-size: 1rem;
    text-transform: uppercase;
}

.key-bind-btn {
    min-width: 100px !important;
    padding: 8px 15px !important;
    font-size: 0.9rem !important;
    background: rgba(0, 255, 136, 0.1) !important;
    color: #00ff88 !important;
    border: 1px solid #00ff88 !important;
}

.key-bind-btn:hover {
    background: #00ff88 !important;
    color: #000 !important;
}

.key-bind-btn.binding {
    background: #ff4d4d !important;
    border-color: #ff4d4d !important;
    color: #fff !important;
    animation: pulse 1s infinite;
}

.setting-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Екран 'Суперник втік' */
#opponent-fled-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 0, 0, 0.95);
    z-index: 6000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.fled-content {
    text-align: center;
    border: 2px solid #ff4d4d;
    padding: 40px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 50px rgba(255, 77, 77, 0.3);
    animation: scaleUp 0.3s ease;
}

.fled-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

#fled-text {
    color: #ff4d4d;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 77, 77, 0.5);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
}

#fled-ok-btn {
    background: transparent;
    border: 2px solid #ff4d4d;
    color: #ff4d4d;
    padding: 12px 30px;
    font-size: 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    transition: all 0.3s ease;
}

#fled-ok-btn:hover {
    background: #ff4d4d;
    color: #000;
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.6);
    transform: scale(1.05);
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}