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

body {
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    animation: fadeInDown 0.8s ease;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 10px;
}

.slogan {
    font-size: 1.5em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    margin-top: 10px;
    letter-spacing: 2px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 3px 3px 6px rgba(0,0,0,0.5), 0 0 10px #FFD700;
    }
    50% {
        text-shadow: 3px 3px 6px rgba(0,0,0,0.5), 0 0 20px #FFD700, 0 0 30px #FFA500;
    }
}

.game-status {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-mode {
    padding: 10px 25px;
    font-size: 1em;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    background: white;
    color: #667eea;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-mode:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-mode.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.current-turn {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 10px;
}

.game-message {
    min-height: 30px;
    margin: 15px 0;
    font-size: 1.1em;
    color: #e74c3c;
    font-weight: bold;
}

.btn-reset, .btn-rules {
    padding: 12px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 5px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-reset {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-rules {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-reset:hover, .btn-rules:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.game-main {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 20px;
}

.player-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.player-info {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    width: 280px;
}

.player-info h2 {
    margin-bottom: 15px;
    font-size: 1.5em;
    text-align: center;
}

.black-player {
    border: 3px solid #333;
}

.white-player {
    border: 3px solid #ddd;
}

.skill-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skill-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skill-card:hover::before {
    opacity: 1;
}

.skill-card:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.skill-card.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 1s infinite;
}

.skill-card.used {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.skill-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #999 0%, #666 100%);
}

.skill-name {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 5px;
}

.skill-desc {
    font-size: 0.8em;
    opacity: 0.9;
}

.skill-count {
    position: absolute;
    top: 5px;
    right: 10px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

/* 石刹海区域 */
.shichahai-zone {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    min-height: 150px;
}

.shichahai-zone h3 {
    color: white;
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.shichahai-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    min-height: 80px;
}

.shichahai-piece {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    animation: fallIntoSea 0.8s ease-out;
}

.shichahai-piece.black {
    background: radial-gradient(circle at 30% 30%, #666, #000);
}

.shichahai-piece.white {
    background: radial-gradient(circle at 30% 30%, #fff, #ddd);
}

@keyframes fallIntoSea {
    0% {
        transform: translateY(-300px) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(0) rotate(360deg);
        opacity: 1;
    }
}

.game-board-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    background: #f4e4c1;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    cursor: pointer;
}

/* 要爆啦提示 */
.explosion-alert {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 2.5em;
    font-weight: bold;
    color: #FF4500;
    text-shadow: 0 0 20px #FFD700, 0 0 30px #FF6347;
    z-index: 100;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    text-align: center;
    white-space: nowrap;
}

.explosion-alert.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: explosionBounce 0.6s ease-out;
}

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

/* 速冻效果 */
.frozen-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(173, 216, 230, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 4em;
    font-weight: bold;
    color: #00BFFF;
    text-shadow: 0 0 20px #FFFFFF;
    border-radius: 10px;
    z-index: 50;
    animation: frozenPulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

.frozen-effect.show {
    display: flex;
}

@keyframes frozenPulse {
    0%, 100% {
        background: rgba(173, 216, 230, 0.5);
    }
    50% {
        background: rgba(173, 216, 230, 0.8);
    }
}

/* 棋盘碎裂效果 */
.board-crack {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 200;
}

.board-crack.cracking {
    background: 
        linear-gradient(45deg, transparent 48%, #000 48%, #000 52%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, #000 48%, #000 52%, transparent 52%),
        linear-gradient(90deg, transparent 48%, #000 48%, #000 52%, transparent 52%);
    animation: crackBoard 1s ease-out forwards;
}

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

.history-panel {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    max-height: 200px;
    overflow-y: auto;
}

.history-panel h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.history-item {
    padding: 8px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 0.9em;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.rules-content h3 {
    color: #667eea;
    margin: 20px 0 10px 0;
}

.rules-content ul {
    margin-left: 20px;
    line-height: 1.8;
}

.skill-description {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skill-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.skill-item strong {
    color: #667eea;
    font-size: 1em;
}

.skill-item p {
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

/* 动画 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 响应式设计 */
@media (max-width: 1400px) {
    .game-main {
        flex-direction: column;
        align-items: center;
    }
    
    .player-side {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }
    
    #gameCanvas {
        width: 600px;
        height: 600px;
    }
}

@media (max-width: 768px) {
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .slogan {
        font-size: 1.2em;
    }
    
    .player-info {
        width: 200px;
    }
    
    .explosion-alert {
        font-size: 3em;
    }
}
/* 彩带特效 */
.confetti {
    position: absolute;
    width: 10px;
    height: 30px;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #FFE66D, #A8E6CF);
    top: -50px;
    animation: confettiFall 3s linear infinite;
    pointer-events: none;
    z-index: 90;
}

.confetti:nth-child(2n) {
    background: linear-gradient(45deg, #FF1744, #00E676, #FFD600, #00B0FF);
    animation-delay: 0.2s;
}

.confetti:nth-child(3n) {
    background: linear-gradient(45deg, #F50057, #76FF03, #FFAB00, #00E5FF);
    animation-delay: 0.4s;
}

.confetti:nth-child(4n) {
    background: linear-gradient(45deg, #D500F9, #64DD17, #FF6D00, #18FFFF);
    animation-delay: 0.6s;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes explosionGlow {
    0%, 100% {
        text-shadow: 
            0 0 20px #FFD700,
            0 0 40px #FF6347,
            0 0 60px #FF1493,
            0 5px 10px rgba(0,0,0,0.5);
    }
    50% {
        text-shadow: 
            0 0 30px #FFD700,
            0 0 60px #FF6347,
            0 0 90px #FF1493,
            0 5px 15px rgba(0,0,0,0.7);
        transform: translate(-50%, -50%) scale(1.05);
    }
}

@keyframes explosionBounce {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
    }
    60% {
        transform: translate(-50%, -50%) scale(1.1) rotate(10deg);
    }
    80% {
        transform: translate(-50%, -50%) scale(0.95) rotate(-5deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}
