/* ========== БАЗОВЫЕ СТИЛИ ========== */
html, body {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    color: #c5a476;
    background-color: #1a1a1a;
    line-height: 1.6;
    font-family: 'Roboto', sans-serif;
}

/* ========== ХЕДЕР ========== */
.main-header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #FFD700;
    background: #0d0d0d;
}

.logo img {
    height: 80px;
    width: auto;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.main-nav a {
    color: #b0b0b0;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: #FFD700;
    border-bottom: 2px solid #FFD700;
}

/* ========== ОСНОВНОЙ КОНТЕНТ ========== */
.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-section {
    background: #252525;
    border-radius: 8px;
    padding: 2rem;
    border: 10px solid #333;
    margin-bottom: 2rem;
}

.welcome-section h2 {
    color: #FFD700;
    text-align: center;
    font-size: 2rem;
}

.features h4 {
    color: #FFD700;
    margin-top: 1rem;
}

/* ========== КАРТОЧНОЕ ПОЛЕ ========== */
.game_table {
    display: flex;
    justify-content: center;
    width: 100%;
}

.card-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    position: relative;
    max-width: 900px;
}

#game-info {
    display: flex;
    justify-content: flex-end;
    gap: 30px;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: 0;
    padding: 0.5rem 1.5rem;
    font-size: 1.2rem;
}

.board-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 900px;
    max-width: 800px;
    margin: 0 auto;
}

/* Основные ряды для карт - ЕДИНСТВЕННОЕ ОПРЕДЕЛЕНИЕ */
.game-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-height: 70px;
    padding: 5px 15px;
    border: 2px dashed #555;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    transition: 0.2s;
    width: 100%;
}

.game-row:hover {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

/* Цвета рядов в зависимости от типа */
.game-row[data-row="melee"] {
    background: rgba(255, 0, 0, 0.08);
}

.game-row[data-row="mid"] {
    background: rgba(255, 255, 0, 0.08);
}

.game-row[data-row="ranged"] {
    background: rgba(0, 150, 255, 0.08);
}

.row-cards {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 2;
    min-height: 90px;
}

.row-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 50px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.stat-attack {
    color: #ff8888;
    font-weight: bold;
    font-size: 16px;
}

.stat-attack, .stat-hp {
    font-size: 12px;
}

.stat-hp {
    color: #88ff88;
    font-weight: bold;
    font-size: 16px;
}

.row-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.5);
    flex-shrink: 0;
}

.melee-icon { color: #ff6666; }
.mid-icon { color: #ffff66; }
.ranged-icon { color: #66ccff; }

/* Центральная панель */
.board-center {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px 0;
}

.board-title {
    font-weight: bold;
    font-size: 1.3rem;
    color: #FFD700;
    text-align: center;
}

#endTurn {
    padding: 10px 24px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid #FFD700;
    background: #111;
    color: #fff;
    transition: 0.2s;
    font-family: inherit;
    margin: 0;
    position: static;
}

#endTurn:hover {
    background: #222;
    border-color: #fff000;
    transform: scale(1.02);
}

/* ========== КАРТЫ ========== */
#hand {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px;
}

.card {
    width: 90px;
    height: 110px;
    border-radius: 10px;
    border: 2px solid white;
    position: relative;
    background-size: cover;
    background-position: center;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-weight: bold;
    text-shadow: 1px 1px 0 black;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.card::after {
    content: attr(data-attack)"⚔️ "attr(data-hp)"❤️";
    position: absolute;
    bottom: 6px;
    left: 6px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: bold;
}

.card.melee { border-color: #ff4444; }
.card.mid { border-color: #ffdd44; }
.card.ranged { border-color: #44aaff; }

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.card.dragging {
    cursor: grabbing;
    transform: scale(1.1);
    opacity: 0.9;
    position: fixed;
    z-index: 9999;
    pointer-events: none;
}

.card.dead {
    opacity: 0;
    transform: scale(0.5);
    transition: 0.2s;
    pointer-events: none;
}

/* Анимация атаки */
.card.attack {
    transform: scale(1.2) translateY(-10px);
    transition: 0.2s;
}

@keyframes shake {
    0% { transform: translate(0px, 0px) rotate(0deg) scale(1.15); }
    25% { transform: translate(1px, -1px) rotate(-1deg) scale(1.15); }
    50% { transform: translate(-1px, 1px) rotate(1deg) scale(1.15); }
    75% { transform: translate(1px, 1px) rotate(0deg) scale(1.15); }
    100% { transform: translate(-1px, -1px) rotate(1deg) scale(1.15); }
}

/* ========== МУСОРКА ========== */
.trash-bin {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 75px;
    height: 75px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #ff4444;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    z-index: 1000;
    transition: 0.2s;
    cursor: pointer;
}

.trash-bin:hover {
    transform: translateY(-50%) scale(1.05);
    border-color: #ff0000;
}

.trash-bin.drag-over {
    transform: translateY(-50%) scale(1.1);
    background: rgba(255, 0, 0, 0.4);
}

.trash-bin span {
    font-size: 1.8rem;
}

/* ========== КНОПКИ ========== */
.deck {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 85px;
    height: 115px;
    background: #2a2a2a;
    border: 2px solid gold;
    border-radius: 10px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
    background-image: url("../images/goose-card.jpg");
    background-size: cover;
    background-position: center;
}

@keyframes cardAdded {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.deck-card {
    transition: all 0.2s ease;
}

.deck-card:active {
    transform: scale(0.95);
}

.deck-card:hover:not(.disabled-card) {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
}

.deck-card:active:not(.disabled-card) {
    transform: scale(0.98);
    transition: 0.05s;
}

.deck:hover {
    transform: scale(1.03);
    border-color: #FFD700;
}


.deck::after {
    content: "Справочник";
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: gold;
    background: rgba(0, 0, 0, 0.7);
    padding: 3px;
    border-radius: 0 0 8px 8px;
}

.deck-builder-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 85px;
    height: 115px;
    background-image: url("../images/goose-card-revers.jpg");
    background-size: cover;
    background-position: center;
    border: 2px solid gold;
    border-radius: 10px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}

.deck-builder-fixed:hover {
    transform: scale(1.03);
    border-color: #FFD700;
}

.deck-builder-fixed::after {
    content: "Колода";
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: gold;
    background: rgba(0, 0, 0, 0.7);
    padding: 3px;
    border-radius: 0 0 8px 8px;
}

/* ========== ЭКРАН ЗАВЕРШЕНИЯ ========== */
.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.game-over.hidden {
    display: none;
}

.game-over-content {
    background: #1e1e1e;
    padding: 40px 60px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid gold;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.game-over-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #FFD700;
}

.game-over-content button {
    margin-top: 20px;
    padding: 12px 28px;
    font-size: 18px;
    cursor: pointer;
    background: #4CAF50;
    border: none;
    border-radius: 30px;
    color: white;
    font-weight: bold;
    transition: 0.2s;
}

.game-over-content button:hover {
    background: #45a049;
    transform: scale(1.02);
}

/* ========== СПРАВОЧНИК КАРТ ========== */
.guide-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    z-index: 10000;
    overflow-y: auto;
    display: none;
}

.guide-page:not(.hidden) {
    display: block;
}

.guide-page-header {
    position: sticky;
    top: 0;
    background: #1a1a1a;
    padding: 1rem 2rem;
    border-bottom: 2px solid #FFD700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
}

.guide-page-header h2 {
    margin: 0;
    color: #FFD700;
    font-size: 1.8rem;
}

.close-guide-btn {
    background: #dc143c;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s ease;
}

.close-guide-btn:hover {
    background: #ff1a4f;
    transform: scale(1.02);
}

.guide-page-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.cards-guide-container {
    display: grid;
    grid-template-columns: repeat(4, 280px);
    gap: 1.5rem;
    padding: 1rem;
    justify-content: center;
    margin: 0 auto;
}

.guide-card {
    width: 280px;
    background: linear-gradient(135deg, #252525 0%, #1a1a1a 100%);
    border: 2px solid #FFD700;
    border-radius: 16px;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

.guide-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.25);
    border-color: #fff000;
}

.guide-card-img {
    width: 100%;
    height: 160px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 2px solid #FFD700;
    background-color: #0a0a0a;
}

.guide-card-name {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin: 0.5rem 0;
    color: #FFD700;
}

.guide-card-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 0.8rem 0;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
}

.guide-card-stats span {
    font-size: 1.2rem;
    font-weight: bold;
}

.guide-card-type {
    text-align: center;
    padding: 0.4rem;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    font-weight: bold;
    font-size: 1rem;
}

.guide-card-type.melee {
    background: rgba(255, 0, 0, 0.3);
    color: #ff8888;
    border: 1px solid #ff4444;
}

.guide-card-type.mid {
    background: rgba(255, 255, 0, 0.3);
    color: #ffff88;
    border: 1px solid #ffff44;
}

.guide-card-type.ranged {
    background: rgba(0, 150, 255, 0.3);
    color: #88ccff;
    border: 1px solid #44aaff;
}

.guide-abilities {
    margin-top: 0.8rem;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

.guide-abilities-title {
    color: #FFD700;
    font-weight: bold;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    text-align: center;
}

.guide-ability {
    color: #ddd;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    border-left: 3px solid #FFD700;
    padding-left: 0.6rem;
    margin: 0.3rem 0;
    line-height: 1.4;
}

/* Анимация */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guide-card {
    animation: fadeIn 0.2s ease;
}

/* ========== КОНСТРУКТОР КОЛОДЫ ========== */
.deckbuilder-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    
}

.deckbuilder-header {
    background: #1a1a1a;
    padding: 1rem 2rem;
    border-bottom: 2px solid #FFD700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
}

.deckbuilder-header h2 {
    color: #FFD700;
    margin: 0;
}

.close-deckbuilder {
    background: #dc143c;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.deckbuilder-container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    flex: 1;
    min-height: 0; 
    height: calc(100vh - 180px);
}

.available-section,
.playerdeck-section {
    flex: 1;
    background: #252525;
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid #FFD700;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 70vh;
}

.available-section h3,
.playerdeck-section h3 {
    color: #FFD700;
    margin-top: 0;
    text-align: center;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    overflow-y: auto; /* ← скролл ТОЛЬКО у сетки */
    padding-right: 8px; /* ← чтобы скролл не налезал на карты */
    flex: 1;
    align-content: start;
    
}

/* Красим скроллбар (опционально) */
.cards-grid::-webkit-scrollbar {
    width: 6px;
}

.cards-grid::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.cards-grid::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 4px;
}


.deck-card {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border: 1px solid #FFD700;
    border-radius: 12px;
    padding: 0.8rem;
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.deck-card-img {
    width: 60px;
    height: 80px;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    border: 1px solid gold;
}

.deck-card-info {
    flex: 1;
}

.deck-card-name {
    font-weight: bold;
}

.deck-card-stats {
    font-size: 0.8rem;
    display: flex;
    gap: 0.5rem;
}

.deck-card button {
    background: #444;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    padding: 4px 8px;
}

.deck-card button:hover {
    background: #666;
}

.playerdeck-stats {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    background: #000000aa;
    padding: 0.5rem;
    border-radius: 8px;
}

.start-battle-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.2rem;
    border-radius: 32px;
    cursor: pointer;
    margin: 1rem auto;
    display: block;
    font-weight: bold;
}

.start-battle-btn:hover {
    background: #45a049;
}

/* ========== ФУТЕР ========== */
.main-footer {
    background: #0d0d0d;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    border-top: 2px solid #FFD700;
}

/* ========== СПРАВОЧНИК КАРТ - ИСПРАВЛЕННЫЙ (хедер не перекрывает карты) ========== */
.guide-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    z-index: 10000;
    overflow-y: auto;
    display: none;
}

.guide-page:not(.hidden) {
    display: block;
}

.guide-page-header {
    position: sticky;
    top: 0;
    background: #1a1a1a;
    padding: 1rem 2rem;
    border-bottom: 2px solid #FFD700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10001;
}

.guide-page-header h2 {
    margin: 0;
    color: #FFD700;
    font-size: 1.8rem;
}

.close-guide-btn {
    background: #dc143c;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s ease;
    position: static;
    transform: none;
}

.close-guide-btn:hover {
    background: #ff1a4f;
    transform: scale(1.02);
}

.guide-page-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 10000;
}

.cards-guide-container {
    display: grid;
    grid-template-columns: repeat(4, 280px);
    gap: 1.5rem;
    padding: 1rem;
    justify-content: center;
    margin: 0 auto;
}

.guide-card {
    width: 280px;
    background: linear-gradient(135deg, #252525 0%, #1a1a1a 100%);
    border: 2px solid #FFD700;
    border-radius: 16px;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    position: relative;
    z-index: 10000;
}

.guide-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.25);
    border-color: #fff000;
}

.guide-card-img {
    width: 100%;
    height: 160px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 2px solid #FFD700;
    background-color: #0a0a0a;
}

.guide-card-name {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin: 0.5rem 0;
    color: #FFD700;
}

.guide-card-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 0.8rem 0;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
}

.guide-card-stats span {
    font-size: 1.2rem;
    font-weight: bold;
}

.guide-card-type {
    text-align: center;
    padding: 0.4rem;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    font-weight: bold;
    font-size: 1rem;
}

.guide-card-type.melee {
    background: rgba(255, 0, 0, 0.3);
    color: #ff8888;
    border: 1px solid #ff4444;
}

.guide-card-type.mid {
    background: rgba(255, 255, 0, 0.3);
    color: #ffff88;
    border: 1px solid #ffff44;
}

.guide-card-type.ranged {
    background: rgba(0, 150, 255, 0.3);
    color: #88ccff;
    border: 1px solid #44aaff;
}

.guide-abilities {
    margin-top: 0.8rem;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

.guide-abilities-title {
    color: #FFD700;
    font-weight: bold;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    text-align: center;
}

.guide-ability {
    color: #ddd;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    border-left: 3px solid #FFD700;
    padding-left: 0.6rem;
    margin: 0.3rem 0;
    line-height: 1.4;
}

/* Анимация */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guide-card {
    animation: fadeIn 0.2s ease;
}

/* ========== АНИМАЦИИ ========== */

/* Тряска при перетаскивании карты */
@keyframes shake {
    0% { transform: translate(0px, 0px) rotate(0deg) scale(1.15); }
    25% { transform: translate(2px, -1px) rotate(-1deg) scale(1.15); }
    50% { transform: translate(-2px, 1px) rotate(1deg) scale(1.15); }
    75% { transform: translate(1px, -1px) rotate(0deg) scale(1.15); }
    100% { transform: translate(-1px, 1px) rotate(1deg) scale(1.15); }
}

.card.dragging {
    transform: scale(1.15);
    animation: shake 0.2s infinite;
    filter: brightness(1.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    cursor: grabbing !important;
    transition: none !important;
}

.card {
    width: 65px;
    height: 85px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    will-change: transform;
}

.card::after {
    font-size: 9px;
    bottom: 3px;
    left: 3px;
}   

/* ========== КОНТЕЙНЕР С ПОЛЕМ И ПАНЕЛЬЮ СПРАВА ========== */
.game-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 20px;
}

.game-field-container {
    flex: 1;
    max-width: 800px;
}

/* ========== ПРАВАЯ ПАНЕЛЬ СО СТАТИСТИКОЙ ========== */
.stats-panel {
    width: 180px;
    display: flex;
    flex-direction: column;
    gap:250px;
    margin-top: 20px;
    margin-left: 50px;
}

.stats-card {
    background: rgba(13, 13, 13, 0.9);
    border: 2px solid #FFD700;
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    backdrop-filter: blur(5px);
    transition: 0.2s;
}

.stats-card:hover {
    transform: scale(1.02);
    border-color: #fff000;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #FFD700;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hp-info {
    text-align: center;
}

.hp-label {
    font-size: 0.85rem;
    color: #c5a476;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.hp-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ff8888;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

.hp-value span {
    font-size: 2rem;
    color: #ff6666;
}

/* Скрываем старый блок game-info */
#game-info {
    display: none;
}

/* ========== УМЕНЬШЕННЫЕ КАРТЫ И ПОЛЯ ========== */
.game-row {
    min-height: 70px;
    padding: 5px 15px;
}

.card {
    width: 65px;
    height: 85px;
}

.card::after {
    font-size: 9px;
    bottom: 3px;
    left: 3px;
}

.row-icon {
    width: 38px;
    height: 38px;
    font-size: 22px;
}

.row-stats {
    min-width: 50px;
    padding: 4px 8px;
}

.stat-attack, .stat-hp {
    font-size: 12px;
}

/* Адаптация для мобилок */
@media (max-width: 800px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-panel {
        flex-direction: row;
        width: 100%;
        justify-content: center;
        gap: 20px;
        margin-top: 0;
    }
    
    .stats-card {
        width: 150px;
    }
    
    .avatar {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .hp-value {
        font-size: 1.4rem;
    }
    
    .hp-value span {
        font-size: 1.6rem;
    }
}

/* Заголовок группы ордена */
.orden-group-header {
    grid-column: 1 / -1;
    padding: 12px 16px;
    margin: 10px 0 8px 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border-left: 4px solid #FFD700;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #FFD700;
}

.orden-group-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.orden-icon {
    font-size: 1.8rem;
}

.orden-count {
    font-size: 0.9rem;
    color: #aaa;
    font-weight: normal;
    margin-left: auto;
}

/* Разделительная линия между орденами */
.orden-group-header:not(:first-child) {
    margin-top: 20px;
    border-top: 2px dashed rgba(255, 215, 0, 0.3);
    padding-top: 16px;
}

/* ========== РЕЖИМ ПОЖИРАНИЯ ========== */
.card.marked-for-eat {
    animation: pulse-eat 0.8s infinite alternate;
    cursor: pointer !important;
}

@keyframes pulse-eat {
    0% {
        box-shadow: 0 0 10px #ff6b00, 0 0 20px #ff6b00;
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 30px #ff6b00, 0 0 60px #ff4400;
        transform: scale(1.05);
    }
}

.eat-mark {
    animation: bounce-mark 0.5s infinite alternate;
}

@keyframes bounce-mark {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

#eat-btn {
    animation: glow-btn 1s infinite alternate;
    position: fixed !important;
    bottom: 150px !important;
    right: 30px !important;
    z-index: 1000 !important;
}

@keyframes glow-btn {
    0% { box-shadow: 0 4px 20px rgba(255, 100, 0, 0.5); }
    100% { box-shadow: 0 4px 40px rgba(255, 100, 0, 0.8); }
}

/* 🛠 ФИКС: Ограничиваем трансформации карт */
.card {
    will-change: transform, box-shadow;
    backface-visibility: hidden;
}

.card:not(.dragging) {
    transition: box-shadow 0.3s, border 0.3s !important;
}