* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

.game-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
}

.header .divider {
    width: 6rem;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    margin: 16px auto;
    border-radius: 2px;
}

.game-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

@media (min-width: 1024px) {
    .game-content {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 40px;
    }
}

.board-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chess-board {
    position: relative;
    width: min(400px, 90vw);
    height: min(400px, 90vw);
    background: linear-gradient(45deg, #f0d9b5, #e6d0b8);
    border: 4px solid #8b5a2b;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.board-line {
    position: absolute;
    background-color: #000;
}

.board-line-horizontal {
    width: 100%;
    height: 2px;
    left: 0;
}

.board-line-vertical {
    width: 2px;
    height: 100%;
    top: 0;
}

.piece {
    position: absolute;
    width: 12.5%;
    height: 12.5%;
    max-width: 50px;
    max-height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.piece.black {
    background: linear-gradient(135deg, #2c3e50, #1a1a2e);
    border: 3px solid #34495e;
    color: white;
}

.piece.white {
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
    border: 3px solid #95a5a6;
    color: #2c3e50;
}

.piece.selected {
    box-shadow: 0 0 0 6px #f39c12, 0 0 20px rgba(243, 156, 18, 0.6);
}

.move-hint {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(231, 76, 60, 0.9);
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
}

.status-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
}

.status-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

@media (min-width: 640px) {
    .status-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.player-info {
    font-size: 16px;
    color: #333;
}

.player-indicator {
    font-weight: bold;
}

.piece-counts {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.count-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
}

.count-black {
    background: #fee2e2;
    color: #dc2626;
}

.count-white {
    background: #dbeafe;
    color: #2563eb;
}

.buttons {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.btn-secondary {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.win-message {
    display: none;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.95), rgba(41, 128, 185, 0.95));
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    margin-top: 12px;
}

.win-message.show {
    display: block;
}

.win-message h2 {
    font-size: 24px;
    margin-bottom: 16px;
}

.rules-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 380px;
}

.rules-panel h3 {
    text-align: center;
    font-size: 20px;
    color: #333;
    margin-bottom: 16px;
}

.rules-panel .divider {
    width: 4rem;
    height: 4px;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    margin: 0 auto 20px;
    border-radius: 2px;
}

.rule-item {
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid;
}

.rule-item.blue {
    background: #eff6ff;
    border-color: #3b82f6;
}

.rule-item.green {
    background: #f0fdf4;
    border-color: #22c55e;
}

.rule-item.yellow {
    background: #fefce8;
    border-color: #eab308;
}

.rule-item.purple {
    background: #faf5ff;
    border-color: #a855f7;
}

.rule-item span {
    font-weight: bold;
    margin-right: 8px;
}

.rule-list {
    margin-left: 24px;
    margin-top: 8px;
    font-size: 14px;
}

.rule-list li {
    margin-bottom: 4px;
    color: #dc2626;
}
