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

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 850px;
    width: 95%;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 2.2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.game-settings {
    display: flex;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap;
    min-width: 200px;
}



.mode-selection {
    display: flex;
    gap: 20px;
}



.mode-selection label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.1rem;
    cursor: pointer;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background-color: #e0e0e0;
    color: #333;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background-color: #d0d0d0;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.btn.primary {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.btn.primary:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
}

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

.btn:disabled::before {
    display: none;
}

.action-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.game-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.player-turn {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
}

.game-status {
    font-size: 1.2rem;
    font-weight: 600;
    color: #666;
    min-height: 24px;
}



.player-turn {
    font-weight: bold;
}

#current-player {
    color: #000;
}

.game-status {
    color: #666;
    font-weight: bold;
}

.board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    border: 2px solid #4a2511;
    background-color: #f5deb3;
    margin: 25px auto;
    width: 100%;
    aspect-ratio: 1;
    max-width: 600px;
}

.cell {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 0.5px solid #4a2511;
    position: relative;
}

.cell:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.stone {
    position: absolute;
    width: 85%;
    height: 85%;
    border-radius: 50%;
    transition: all 0.3s ease;
    animation: stonePlace 0.3s ease-out;
}

@keyframes stonePlace {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.stone.black {
    background: radial-gradient(circle at 30% 30%, #333, #000);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
}

.stone.white {
    background: radial-gradient(circle at 30% 30%, #fff, #e0e0e0);
    border: 1px solid #ddd;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}



.instructions {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    text-align: left;
    border-left: 4px solid #2196F3;
}

.instructions h3 {
    margin-bottom: 10px;
    color: #333;
}

.instructions p {
    color: #666;
    line-height: 1.5;
}

.instructions ul {
    margin: 15px 0 0 0;
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
    color: #555;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }
    
    .game-settings {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: center;
        gap: 10px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .timers {
        flex-direction: column;
        gap: 15px;
    }
    
    .timer {
        min-width: 150px;
        padding: 10px 20px;
    }
    
    .timer-value {
        font-size: 1.4rem;
    }
    
    .board {
        max-width: 100%;
        margin: 20px auto;
    }
    
    .stone-coordinate {
        font-size: 0.6em;
    }
}

/* 胜利动画效果 */
.win-animation {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 胜利撒花效果 */
.celebration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 10;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
    animation: confetti-fall 3s ease-in-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-20px) translateX(0) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: translateY(calc(25% + 10px)) translateX(10px) rotate(90deg);
        opacity: 0.9;
    }
    50% {
        transform: translateY(calc(50% + 20px)) translateX(-10px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translateY(calc(75% + 30px)) translateX(5px) rotate(270deg);
        opacity: 0.6;
    }
    100% {
        transform: translateY(calc(100% + 50px)) translateX(-5px) rotate(360deg);
        opacity: 0;
    }
}

/* 公屏胜利提示 */
.victory-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 50px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    z-index: 20;
    animation: victory-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes victory-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}