body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    text-align: center;
    max-width: 650px;
}

.game-area {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    color: var(--primary-color);
    margin: 0;
}

.status {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: bold;
    color: #2c3e50;
    min-height: 1.5em;
}

/* Board wrapper with labels */
.chess-board-wrapper {
    display: inline-block;
    position: relative;
    margin: 0 auto;
}

.chess-rank-labels {
    position: absolute;
    left: -20px;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chess-rank-labels .label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #666;
    font-weight: 600;
}

.chess-file-labels {
    display: flex;
    margin-left: 0;
}

.chess-file-labels .label {
    flex: 1;
    text-align: center;
    font-size: 0.75rem;
    color: #666;
    font-weight: 600;
    padding-top: 2px;
}

/* Board */
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0;
    border: 4px solid #5d3a1a;
    border-radius: 4px;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chess-cell {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
    font-size: 36px;
    user-select: none;
}

.chess-cell.light {
    background: #f0d9b5;
}

.chess-cell.dark {
    background: #b58863;
}

/* Selected piece */
.chess-cell.selected {
    box-shadow: inset 0 0 0 3px #f1c40f;
}

/* Valid move indicator (empty square) */
.chess-cell.valid-move {
    cursor: pointer;
}

.chess-cell.valid-move::after {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(46, 204, 113, 0.6);
    position: absolute;
}

/* Valid capture indicator (square with opponent piece) */
.chess-cell.valid-capture {
    cursor: pointer;
}

.chess-cell.valid-capture::after {
    content: '';
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(231, 76, 60, 0.7);
    background: transparent;
    position: absolute;
}

/* Last move highlight */
.chess-cell.last-move {
    background: rgba(255, 255, 100, 0.5);
}

.chess-cell.light.last-move {
    background: #f5f682;
}

.chess-cell.dark.last-move {
    background: #baca44;
}

/* Check highlight */
.chess-cell.in-check {
    background: radial-gradient(ellipse at center, rgba(255, 0, 0, 0.6), rgba(255, 0, 0, 0.2), transparent 70%);
}

/* Piece hover */
.chess-cell.has-piece {
    cursor: pointer;
}

.chess-cell.has-piece:hover {
    opacity: 0.85;
}

/* Captured pieces sections */
.captured-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 8px 0;
    min-height: 30px;
    flex-wrap: wrap;
}

.captured-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.captured-pieces {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    font-size: 18px;
}

/* Move history */
.move-history {
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    text-align: left;
}

.move-history-header {
    background: #f5f5f5;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    border-bottom: 1px solid #ddd;
}

.move-list {
    max-height: 150px;
    overflow-y: auto;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.move-row {
    display: flex;
    gap: 10px;
    padding: 2px 0;
}

.move-number {
    color: #999;
    min-width: 30px;
    text-align: right;
}

.move-white, .move-black {
    min-width: 55px;
}

.move-white {
    color: #333;
}

.move-black {
    color: #666;
}

/* Game buttons */
.game-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

#exit-game-btn {
    padding: 10px 20px;
    font-size: 1rem;
}

/* Online info */
.online-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.opponent-name {
    font-weight: 600;
    color: var(--text-muted, #666);
}

/* Cover screen */
.cover-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.cover-content {
    text-align: center;
    color: white;
}

.cover-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.cover-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: #ccc;
}

/* Promotion modal */
.promotion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.promotion-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.promotion-content h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.promotion-pieces {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.promotion-btn {
    width: 60px;
    height: 60px;
    font-size: 36px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.promotion-btn:hover {
    border-color: #3498db;
    background: #ebf5fb;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 500px) {
    .chess-cell {
        width: 42px;
        height: 42px;
        font-size: 28px;
    }

    .chess-cell.valid-move::after {
        width: 12px;
        height: 12px;
    }

    .chess-cell.valid-capture::after {
        width: 34px;
        height: 34px;
    }

    .promotion-btn {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }
}
