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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.35), rgba(118, 75, 162, 0.35));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.15);
    padding: 16px 25px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}


.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    position: relative;
}

.header-title-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.header-music-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
}

.game-header h1 {
    font-size: 2.4rem;
    font-weight: 900;
    color: #2c3e50;
    margin: 0;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.6), 
                 0 1px 3px rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 100;
}

.header-subtitle {
    display: none;
}

.header-subtitle-inline {
    font-size: 0.95rem;
    color: rgba(44, 62, 80, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.header-top .header-music-btn {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.95), rgba(56, 161, 105, 0.95));
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 55px;
    height: 55px;
}

.header-top .header-music-btn:hover {
    transform: translateY(-50%) translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(56, 161, 105, 0.55);
    background: linear-gradient(135deg, rgba(56, 161, 105, 1), rgba(72, 187, 120, 1));
}

.header-top .header-music-btn:active {
    transform: translateY(-50%) scale(1.02);
}

.header-top .header-music-btn.muted {
    background: linear-gradient(135deg, rgba(149, 165, 166, 0.8), rgba(127, 140, 141, 0.8));
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.header-top .header-music-btn.muted:hover {
    background: linear-gradient(135deg, rgba(127, 140, 141, 0.9), rgba(149, 165, 166, 0.9));
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.3);
    padding: 15px 25px;
    border-radius: 12px;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.current-player, .game-status {
    font-weight: 600;
    color: #2c3e50;
}

.current-player span, .game-status span {
    font-weight: 700;
    color: #e74c3c;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.game-main {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 30px;
    align-items: start;
}

.left-panel, .right-panel {
    background: rgba(255, 255, 255, 0.2);
    padding: 25px;
    border-radius: 16px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.player-info h3, .ai-info h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
    font-weight: 700;
}

.skills h4, .ai-skills h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #34495e;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.skill-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skill-btn {
    background: linear-gradient(135deg, rgba(168, 230, 207, 0.95), rgba(123, 220, 181, 0.95)); /* 浅绿色系 */
    color: #064e3b;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 16px 18px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 18px rgba(123, 220, 181, 0.45);
    backdrop-filter: blur(10px);
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.skill-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(46, 204, 113, 0.55);
    background: linear-gradient(135deg, rgba(123, 220, 181, 1), rgba(168, 230, 207, 1));
}

.skill-btn:active {
    transform: translateY(-1px);
}

.skill-btn:disabled {
    background: linear-gradient(135deg, rgba(189, 195, 199, 0.7), rgba(171, 183, 183, 0.7));
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(171, 183, 183, 0.35);
    opacity: 0.7;
}

.skill-btn.active {
    background: linear-gradient(135deg, rgba(72, 187, 120, 1), rgba(56, 161, 105, 1));
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(56, 161, 105, 0.55);
    transform: translateY(-2px);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.skill-name {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.skill-count {
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.35);
    color: #065f46;
    padding: 4px 8px;
    border-radius: 12px;
    backdrop-filter: blur(6px);
}

.skill-desc {
    font-size: 0.8rem;
    opacity: 0.9;
    line-height: 1.3;
    font-weight: 400;
    margin-top: 4px;
}

.ai-skill-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-skill {
    background: #ecf0f1;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.ai-thinking {
    margin-top: 20px;
    text-align: center;
}

.thinking-animation {
    color: #e74c3c;
    font-weight: 600;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.board-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.25);
    padding: 20px;
    border-radius: 16px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#game-board {
    border-radius: 12px;
    cursor: pointer;
    display: block;
}

.board-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 600px;
    height: 600px;
    pointer-events: none;
    border-radius: 12px;
}


/* 浮动新游戏按钮 */
.floating-new-game-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.9), rgba(39, 174, 96, 0.9));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 16px 24px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
    z-index: 1000;
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.floating-new-game-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(39, 174, 96, 0.6);
    background: linear-gradient(135deg, rgba(39, 174, 96, 1), rgba(46, 204, 113, 1));
}

.floating-new-game-btn:active {
    transform: translateY(-1px) scale(1.02);
}


.skill-description {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.skill-description h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.skill-description ul {
    list-style: none;
}

.skill-description li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.skill-description li::before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.skill-note {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.9), rgba(230, 126, 34, 0.9));
    color: white;
    padding: 18px 25px;
    border-radius: 16px;
    margin: 25px auto;
    text-align: center;
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
    max-width: 600px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.skill-note p {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.modal-content p {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .game-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .left-panel, .right-panel {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    #game-board {
        width: 100%;
        height: auto;
        max-width: 500px;
    }
    
    .board-wrapper {
        padding: 15px;
    }
    
    .floating-new-game-btn {
        bottom: 20px;
        right: 20px;
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .header-music-btn {
        min-width: 45px;
        height: 45px;
        font-size: 1.2rem;
        padding: 10px 12px;
    }
}

/* 棋子高亮效果 */
.piece-highlight {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid #e74c3c;
    border-radius: 50%;
    pointer-events: none;
    animation: highlight-pulse 1s ease-in-out infinite;
}

@keyframes highlight-pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.4;
    }
}

/* 可落子位置提示 */
.valid-move {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(52, 152, 219, 0.3);
    border: 2px solid #3498db;
    border-radius: 50%;
    pointer-events: none;
    animation: move-hint 2s ease-in-out infinite;
}

@keyframes move-hint {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.6;
    }
    50% { 
        transform: scale(1.3);
        opacity: 0.3;
    }
}
