* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    width: 100%;
    max-width: 1200px;
    background: #1e1e1e;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.game-header h1 {
    font-size: 24px;
    color: #fff;
}

.settings-panel {
    display: flex;
    gap: 15px;
    font-size: 14px;
}

.settings-panel select {
    background: #2d2d2d;
    color: #fff;
    border: 1px solid #444;
    padding: 4px 8px;
    border-radius: 4px;
}

.economy-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #252525;
    padding: 8px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    border: 1px solid #383838;
}

.main-layout {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

/* Шахматная доска */
.chess-board {
    width: 560px;
    height: 560px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    border: 4px solid #444;
    border-radius: 6px;
    background-size: 100% 100%;
    flex-shrink: 0;
}

.square {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.square.selected {
    background-color: rgba(255, 235, 59, 0.4) !important;
}

.square.highlight::after {
    content: '';
    width: 20px;
    height: 20px;
    background-color: rgba(76, 175, 80, 0.6);
    border-radius: 50%;
    position: absolute;
}

.square.capture::after {
    background-color: rgba(244, 67, 54, 0.7);
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.square.last-move {
    background-color: rgba(33, 150, 243, 0.3) !important;
}

/* Фигуры */
.piece {
    width: 85%;
    height: 85%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    transition: filter 0.3s ease;
}

/* Эффект невидимости Таро (Карта Луна) */
.piece.invisible-to-enemy {
    filter: blur(8px) grayscale(100%);
    opacity: 0.2;
}

/* Боковая панель */
.sidebar {
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-box {
    background: #252525;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #383838;
}

.status-box h3 {
    font-size: 16px;
    color: #4caf50;
    margin-bottom: 4px;
}

.status-box p {
    font-size: 13px;
    color: #aaa;
}

.timers-container {
    display: flex;
    gap: 10px;
}

.timer-card {
    flex: 1;
    background: #252525;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #383838;
}

.timer-card.active {
    border-color: #4caf50;
    background: #1b331e;
}

.timer-card span {
    font-size: 12px;
    color: #aaa;
    display: block;
}

.timer-card strong {
    font-size: 18px;
    color: #fff;
}

.cards-deck-container {
    display: flex;
    gap: 10px;
}

.card-slot {
    flex: 1;
    background: #252525;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #383838;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.card-slot img {
    width: 60px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.card-slot img:hover {
    transform: scale(1.05);
}

.card-slot span {
    font-size: 12px;
    color: #ccc;
}

.spell-panel, .spawn-panel, .history-box {
    background: #252525;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #383838;
    text-align: center;
}

.animation-slot {
    margin-top: 6px;
    font-size: 12px;
    color: #888;
    background: #1c1c1c;
    padding: 4px;
    border-radius: 4px;
}

.spawn-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 8px 0;
}

.move-history {
    height: 90px;
    overflow-y: auto;
    background: #1c1c1c;
    border-radius: 4px;
    padding: 6px;
    text-align: left;
    font-size: 12px;
    border: 1px solid #333;
}

.move-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 4px;
    border-bottom: 1px solid #252525;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* Кнопки */
.btn {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    font-size: 13px;
    color: #fff;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary { background-color: #2e7d32; }
.btn-blue { background-color: #1976d2; }
.btn-danger { background-color: #c62828; width: 100%; }
.btn-success { background-color: #388e3c; flex: 1; }
.btn-secondary { background-color: #424242; flex: 1; }
.btn-shop { background-color: #f57c00; padding: 4px 10px; font-size: 12px; }

.btn-spawn {
    background-color: #333;
    border: 1px solid #555;
    font-size: 11px;
    padding: 6px;
}

.btn-spawn.active {
    background-color: #1976d2;
    border-color: #90caf9;
}