/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ffffff;
    overflow-x: auto;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 200, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* 主标题样式 */
.main-title {
    text-align: center;
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.main-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 主容器布局 */
.main-container {
    display: flex;
    gap: 20px;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-start;
    min-height: calc(100vh - 120px);
}

/* 通用面板样式 */
.control-panel,
.instructions-panel {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* 面板区块样式 */
.panel-section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

.panel-section:hover::before {
    left: 100%;
}

.panel-section:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 面板标题样式 */
.panel-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.panel-title .icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* 玩家统计区域 */
.player-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.player-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.player-stat:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-name {
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.win-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4ecdc4;
    text-shadow: 0 2px 8px rgba(78, 205, 196, 0.4);
    min-width: 60px;
    text-align: center;
}

/* 控制按钮区域 */
.control-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

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

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

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.secondary-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.6);
}

.btn-icon {
    font-size: 1.1rem;
}

/* 警告卡片样式 */
.warning-card {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 12px;
    padding: 16px;
    position: relative;
}

.warning-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #ff6b6b;
    font-size: 1.1rem;
    font-weight: 600;
}

.warning-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* 游戏区域样式 */
.game-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
    max-width: 500px;
}

.player-area {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-area:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.player-title {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    margin: 0;
}

.player-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.score-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.score-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4ecdc4;
    text-shadow: 0 2px 8px rgba(78, 205, 196, 0.4);
    min-width: 80px;
    text-align: center;
}

/* 画布容器样式 */
.canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

canvas {
    border: none;
    border-radius: 8px;
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

canvas:hover {
    box-shadow: 
        0 0 30px rgba(78, 205, 196, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.15);
}

/* 说明面板内容样式 */
.instructions-content {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.instructions-content h3 {
    color: #4ecdc4;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.instructions-content p {
    margin-bottom: 12px;
}

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

.instructions-content li {
    margin-bottom: 6px;
    position: relative;
}

.instructions-content li::marker {
    color: #4ecdc4;
}

/* 版权信息样式 */
.copyright-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    text-align: center;
    margin-top: auto;
    position: relative;
}

.copyright-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, #4ecdc4, #45b7d1);
    border-radius: 1px;
}

.copyright-section p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    transition: opacity 0.3s ease;
}

.copyright-section p:hover {
    opacity: 1;
    color: rgba(255, 255, 255, 0.95);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }
    
    .control-panel,
    .instructions-panel {
        flex: none;
        width: 100%;
        max-width: 600px;
    }
    
    .game-section {
        width: 100%;
    }
    
    .game-grid {
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .main-title h1 {
        font-size: 2rem;
    }
    
    .main-container {
        padding: 15px;
        gap: 15px;
    }
    
    .panel-section {
        padding: 15px;
    }
    
    .game-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 300px;
    }
    
    .player-area {
        padding: 15px;
    }
    
    .player-header {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .score-display {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .main-title h1 {
        font-size: 1.5rem;
    }
    
    .panel-title {
        font-size: 1rem;
    }
    
    .player-name {
        font-size: 0.9rem;
    }
    
    .win-count,
    .score-value {
        font-size: 1.2rem;
    }
    
    .game-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}