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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #FFAB91 0%, #FF5722 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* 扁平化设计 - 主容器 */
.game-container {
    max-width: 1000px;
    margin: 0 auto; 
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 扁平化设计 - 游戏头部 */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 20px;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.game-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.current-player {
    flex: 1;
}

.player-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.piece {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.piece.black {
    background: linear-gradient(135deg, #424242, #212121);
}

.piece.white {
    background: linear-gradient(135deg, #FAFAFA, #E0E0E0);
    border-color: rgba(0, 0, 0, 0.2);
}

.game-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.info-item {
    text-align: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.info-item .label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-item .value {
    font-size: 1.2rem;
    font-weight: 600;
}

/* 游戏描述 */
.game-description {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.game-description p {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* 扁平化设计 - 模式选择 */
.game-mode-selector, .difficulty-selector {
    margin-bottom: 25px;
    text-align: center;
}

.game-mode-selector h3, .difficulty-selector h3 {
    margin-bottom: 15px;
    font-size: 1.25rem;
    font-weight: 500;
    opacity: 0.9;
}

.mode-buttons, .difficulty-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn, .difficulty-btn {
    padding: 20px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
    border: 2px solid transparent;
}

.mode-btn:hover, .difficulty-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.mode-btn.active, .difficulty-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.mode-btn span, .difficulty-btn span {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.mode-btn div, .difficulty-btn div {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.mode-btn small, .difficulty-btn small {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* 扁平化设计 - 游戏控制 */
.game-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: #E65100;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(230, 81, 0, 0.3);
    min-width: 120px;
}

.btn:hover {
    background: #D84315;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 81, 0, 0.4);
}

.btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

.start-btn {
    background: #4CAF50;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.start-btn:hover {
    background: #45a049;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* 扁平化设计 - 棋盘容器 */
.game-board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.board-wrapper {
    display: flex;
    flex-direction: column;
    background: rgba(139, 69, 19, 0.1);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.board-content {
    display: flex;
    align-items: center;
}

.coordinate-labels {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 600;
}

.coord-row {
    display: flex;
    justify-content: center;
    margin: 5px 0;
}

.coord-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 5px;
}

.coord-cell {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1px;
}

/* 扁平化设计 - 游戏棋盘 */
.game-board {
    width: 450px;
    height: 450px;
    background: linear-gradient(45deg, #8D6E63, #6D4C41);
    border-radius: 15px;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 1px;
    padding: 15px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.board-cell {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #BCAAA4, #A1887F);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.board-cell:hover:not(.occupied) {
    background: linear-gradient(135deg, #D7CCC8, #BCAAA4);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.board-cell.star-point {
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.3);
}

.board-cell.occupied {
    cursor: default;
}

.board-cell .piece {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.board-cell .piece.new {
    animation: pieceAppear 0.3s ease;
}

.board-cell.winning {
    animation: winningPulse 1s infinite;
}

@keyframes pieceAppear {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes winningPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 193, 7, 0);
    }
}

/* 获胜模式展示 */
.win-patterns {
    margin-bottom: 30px;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.win-patterns h3 {
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 500;
    opacity: 0.9;
}

.pattern-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.pattern-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(15px);
}

.pattern-icon {
    font-size: 2rem;
    color: #FFD700;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

.pattern-desc {
    text-align: left;
}

.pattern-desc strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1rem;
}

.pattern-desc small {
    opacity: 0.8;
    font-size: 0.8rem;
}

/* 扁平化设计 - 弹窗 */
.victory-popup, .help-popup, .stats-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.victory-popup.show, .help-popup.show, .stats-popup.show {
    display: flex;
}

.popup-content {
    background: linear-gradient(135deg, #FFAB91 0%, #FF5722 100%);
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    max-height: 80vh;
    overflow-y: auto;
}

.popup-content h2 {
    font-size: 2rem;
    margin-bottom: 25px;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 胜利弹窗样式 */
.victory-pattern {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(20px);
}

.pattern-display-large {
    text-align: center;
}

.win-type {
    font-size: 1.5rem;
    font-weight: 600;
    color: #FFD700;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

.win-detail {
    font-size: 1rem;
    opacity: 0.9;
}

.victory-stats {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(20px);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 1rem;
}

.stat-row:last-child {
    margin-bottom: 0;
}

/* 统计弹窗样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(20px);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.popup-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 帮助弹窗特殊样式 */
.help-content {
    text-align: left;
}

.help-content h2 {
    text-align: center;
}

.help-section {
    margin-bottom: 25px;
}

.help-section h3 {
    color: #FFD700;
    margin-bottom: 12px;
    font-size: 1.125rem;
    font-weight: 600;
}

.help-section p {
    margin-bottom: 12px;
    opacity: 0.9;
    line-height: 1.5;
}

.help-section ul {
    margin-left: 20px;
    opacity: 0.9;
}

.help-section li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.help-section strong {
    color: #FFD700;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .game-status {
        flex-direction: column;
        gap: 15px;
    }
    
    .game-info {
        justify-content: center;
        gap: 15px;
    }
    
    .mode-buttons, .difficulty-buttons {
        flex-direction: column;
        align-items: center;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .mode-btn, .difficulty-btn {
        width: 100%;
        min-width: 180px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        min-width: 200px;
    }
    
    .game-board {
        width: 360px;
        height: 360px;
        padding: 12px;
    }
    
    .board-cell {
        width: 18px;
        height: 18px;
    }
    
    .board-cell .piece {
        width: 16px;
        height: 16px;
    }
    
    .coord-cell {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }
    
    .pattern-display {
        flex-direction: column;
        gap: 15px;
    }
    
    .popup-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .popup-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .game-board {
        width: 300px;
        height: 300px;
        padding: 10px;
    }
    
    .board-cell {
        width: 16px;
        height: 16px;
    }
    
    .board-cell .piece {
        width: 14px;
        height: 14px;
    }
    
    .coord-cell {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
    
    .game-header {
        padding: 20px 15px;
    }
    
    .info-item {
        padding: 6px 12px;
    }
    
    .info-item .value {
        font-size: 1rem;
    }
}