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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    color: #fff;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2em;
    color: #b8b8b8;
}

/* Стартовый экран */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.start-screen-content {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
}

.start-screen-content h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.start-subtitle {
    font-size: 1.2em;
    color: #b8b8b8;
    margin-bottom: 30px;
}

.start-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 0;
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.3em;
    width: 100%;
}

.btn-small {
    padding: 8px 20px;
    font-size: 0.9em;
}

.start-stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #b8b8b8;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #FFD700;
}

.game-screen {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.controls {
    display: none; /* Скрываем, UI теперь на canvas */
}

.btn {
    padding: 12px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

.btn-shop {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: white;
}

.btn-shop:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(246, 211, 101, 0.4);
}

.stats {
    display: flex;
    gap: 30px;
    font-size: 1.1em;
}

.stats strong {
    color: #4ecdc4;
    font-size: 1.3em;
}

#rating {
    color: #FFD700;
    transition: all 0.3s ease;
}

.rating-change {
    transform: scale(1.2);
    color: #FF6B6B !important;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.8);
}

.game-area-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.game-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 0;
    margin: 0;
    background: transparent;
}

/* Нативный магазин в игре */
.in-game-shop {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    max-height: calc(100vh - 40px);
    background: rgba(15, 15, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-header h3 {
    margin: 0;
    color: #FFD700;
    font-size: 1.2em;
}

.btn-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    transition: color 0.3s;
}

.btn-close:hover {
    color: #ff6b6b;
}

.in-game-shop .shop-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.shop-category-header {
    margin-top: 15px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.shop-category-header:first-child {
    margin-top: 0;
}

.shop-category-header h3 {
    font-size: 1.1em;
    margin: 0;
    color: #FFD700;
    font-weight: bold;
}

.in-game-shop .shop-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #FFD700;
    transition: background 0.2s;
}

.in-game-shop .shop-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.in-game-shop .shop-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.in-game-shop .shop-item-header h4 {
    font-size: 1em;
    margin: 0;
    flex: 1;
}

.in-game-shop .shop-item-header h3 {
    font-size: 1em;
    margin: 0;
}

.in-game-shop .shop-description {
    font-size: 0.85em;
    margin: 5px 0;
}

.in-game-shop .shop-item-footer {
    margin-top: 10px;
}

.in-game-shop .shop-price {
    font-size: 1em;
}

.in-game-shop .btn-buy {
    padding: 6px 15px;
    font-size: 0.9em;
}

.controls-bottom {
    display: none; /* Скрываем, кнопки теперь на canvas */
}

#gameCanvas {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    border: none;
    background: rgba(0, 0, 0, 0.9);
    display: block;
    z-index: 1;
}

.info-panel {
    display: none; /* Скрываем, статистика теперь на canvas */
}

.team-info {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.team1 {
    border-left: 4px solid #4a90e2;
}

.team2 {
    border-left: 4px solid #e24a4a;
}

.team-info h3 {
    margin-bottom: 15px;
    font-size: 1.5em;
}

.team-info div {
    font-size: 0.95em;
    line-height: 1.8;
}

/* Модальное окно навыков */
.skills-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.skills-modal-content {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(15, 52, 96, 0.95) 100%);
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    position: relative;
}

.skills-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: color 0.3s;
}

.skills-modal-close:hover {
    color: #fff;
}

.skills-modal-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

.skills-modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skills-category h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.skill-item.skill-active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.skill-icon {
    font-size: 18px;
}

.skill-name {
    flex: 1;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.skill-level {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: bold;
}

/* Модальное окно магазина */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin: 5% auto;
    padding: 30px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #fff;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #FFD700;
    text-align: center;
}

.shop-items {
    display: grid;
    gap: 15px;
}

.shop-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #FFD700;
    transition: transform 0.2s, background 0.2s;
}

.shop-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.shop-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.shop-item-header h3 {
    margin: 0;
    font-size: 1.3em;
}

.shop-level {
    background: rgba(255, 215, 0, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    color: #FFD700;
}

.shop-description {
    color: #b8b8b8;
    margin: 10px 0;
    font-size: 0.95em;
}

.shop-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.shop-price {
    font-size: 1.2em;
    font-weight: bold;
    color: #FFD700;
}

.btn-buy {
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-buy:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    
    .info-panel {
        grid-template-columns: 1fr;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .shop-item-footer {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .btn-buy {
        width: 100%;
    }
    
    .start-screen-content {
        padding: 20px;
    }
    
    .start-screen-content h2 {
        font-size: 2em;
    }
    
    .start-menu {
        gap: 10px;
    }
    
    .btn-large {
        padding: 15px 30px;
        font-size: 1.1em;
    }
}
