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

/* 禁止移动端选中效果 */
body, canvas, #canvas-container {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

body {
    font-family: 'Orbitron', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #d4a574 0%, #c49660 30%, #b8894d 60%, #a67c3d 100%);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.hidden {
    display: none !important;
}

/* ========== 粒子背景 ========== */
#particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========== 装饰光晕 ========== */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: 0;
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 90, 43, 0.6), transparent);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(160, 120, 60, 0.5), transparent);
    bottom: -50px;
    right: -50px;
    animation-delay: -3s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(180, 140, 80, 0.4), transparent);
    top: 50%;
    right: 10%;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ========== 大厅界面 ========== */
.lobby {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    padding: 20px 0;
}

/* 比璃卡片 - 透明背景，显示粒子效果 */
.glass-card {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
}

.lobby-content {
    padding: 40px 50px;
    border-radius: 30px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    z-index: 10;
}

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

/* ========== 标题区域 ========== */
.title-container {
    margin-bottom: 30px;
}

.chess-icon {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.piece {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

.black-animated {
    background: radial-gradient(circle at 30% 30%, #555, #000);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.3);
    animation-delay: 0s;
}

.white-animated {
    background: radial-gradient(circle at 30% 30%, #fff, #ccc);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.3);
    animation-delay: 0.5s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 需虹灰标题 */
.neon-title {
    font-size: 36px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow:
        0 0 10px rgba(255, 200, 100, 0.8),
        0 0 20px rgba(255, 180, 80, 0.6),
        0 0 40px rgba(200, 150, 50, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: neonPulse 2s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    from {
        text-shadow:
            0 0 10px rgba(255, 200, 100, 0.8),
            0 0 20px rgba(255, 180, 80, 0.6),
            0 0 40px rgba(200, 150, 50, 0.4),
            2px 2px 4px rgba(0, 0, 0, 0.5);
    }
    to {
        text-shadow:
            0 0 15px rgba(255, 220, 150, 0.9),
            0 0 30px rgba(255, 200, 100, 0.7),
            0 0 60px rgba(220, 180, 80, 0.5),
            2px 2px 4px rgba(0, 0, 0, 0.5);
    }
}

.glow-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    letter-spacing: 3px;
}

/* 特殊欢迎效果 - 世界上最可爱的小女孩 */
.subtitle.special-welcome {
    color: #ff69b4;
    font-size: 15px;
    letter-spacing: 2px;
    animation: specialWelcome 2s ease-in-out infinite alternate;
    text-shadow:
        0 0 10px rgba(255, 105, 180, 0.8),
        0 0 20px rgba(255, 182, 193, 0.6),
        0 0 40px rgba(255, 192, 203, 0.4);
}

@keyframes specialWelcome {
    from {
        text-shadow:
            0 0 10px rgba(255, 105, 180, 0.8),
            0 0 20px rgba(255, 182, 193, 0.6),
            0 0 40px rgba(255, 192, 203, 0.4);
        transform: scale(1);
    }
    to {
        text-shadow:
            0 0 15px rgba(255, 105, 180, 1),
            0 0 30px rgba(255, 182, 193, 0.8),
            0 0 60px rgba(255, 192, 203, 0.6);
        transform: scale(1.02);
    }
}

/* ========== 粉色可爱主题 ========== */
body.pink-theme {
    background: linear-gradient(135deg, #ffb6c1 0%, #ffc0cb 30%, #ffb7c5 60%, #ff91a4 100%);
}

.pink-theme .neon-title {
    color: #ff1493;
    text-shadow:
        0 0 10px rgba(255, 20, 147, 0.8),
        0 0 20px rgba(255, 105, 180, 0.6),
        0 0 40px rgba(255, 182, 193, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.2);
}

.pink-theme .glow-text {
    color: rgba(255, 20, 147, 0.8);
}

.pink-theme .player-name-input label {
    color: #ff69b4;
}

.pink-theme .player-name-input input {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 105, 180, 0.4);
    color: #ff1493;
}

.pink-theme .player-name-input input:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.4);
}

.pink-theme .player-name-input input::placeholder {
    color: rgba(255, 105, 180, 0.5);
}

.pink-theme .section-title {
    color: #ff69b4;
}

.pink-theme .btn-ai,
.pink-theme .btn-primary {
    background: linear-gradient(135deg, #b19cd9 0%, #9370db 100%); /* 淡紫色 */
    box-shadow: 0 5px 20px rgba(147, 112, 219, 0.4);
}

.pink-theme .btn-ai:hover,
.pink-theme .btn-primary:hover {
    background: linear-gradient(135deg, #c4b8e0 0%, #a785e0 100%);
    box-shadow: 0 8px 30px rgba(147, 112, 219, 0.6);
}

.pink-theme .btn-secondary {
    background: linear-gradient(135deg, #87ceeb 0%, #6bb3d9 100%); /* 淡蓝色 */
    color: white;
    box-shadow: 0 5px 20px rgba(135, 206, 235, 0.4);
}

.pink-theme .btn-secondary:hover {
    background: linear-gradient(135deg, #9ed8f0 0%, #7ec8e8 100%);
    box-shadow: 0 8px 30px rgba(135, 206, 235, 0.6);
}

.pink-theme .room-input {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 105, 180, 0.3);
    color: #ff1493;
}

.pink-theme .room-input:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.3);
}

.pink-theme .room-input::placeholder {
    color: rgba(255, 105, 180, 0.5);
}

.pink-theme .diff-btn {
    background: rgba(152, 251, 152, 0.3); /* 淡绿色 */
    border: 1px solid rgba(144, 238, 144, 0.5);
    color: #3cb371;
}

.pink-theme .diff-btn:hover,
.pink-theme .diff-btn.active {
    background: linear-gradient(135deg, #90ee90, #3cb371); /* 淡绿渐变 */
    color: white;
    border-color: #3cb371;
}

.pink-theme #start-ai-game {
    background: linear-gradient(135deg, #98fb98 0%, #3cb371 100%); /* 淡绿色 */
    box-shadow: 0 5px 20px rgba(60, 179, 113, 0.4);
}

.pink-theme #start-ai-game:hover {
    background: linear-gradient(135deg, #a8fba8 0%, #4cd47f 100%);
    box-shadow: 0 8px 30px rgba(60, 179, 113, 0.6);
}

.pink-theme .glow-orb.orb-1 {
    background: radial-gradient(circle, rgba(255, 105, 180, 0.6), transparent);
}

.pink-theme .glow-orb.orb-2 {
    background: radial-gradient(circle, rgba(255, 182, 193, 0.5), transparent);
}

.pink-theme .glow-orb.orb-3 {
    background: radial-gradient(circle, rgba(255, 192, 203, 0.4), transparent);
}

/* 粉色主题 - 卡片透明，只显示背景和粒子 */
.pink-theme .glass-card {
    background: transparent;
    border: none;
    box-shadow: none;
}

.pink-theme .lobby-content {
    background: transparent;
    border: none;
    box-shadow: none;
}

.pink-theme .mode-section {
    background: transparent;
    border: none;
}

.pink-theme .mode-section:hover {
    background: transparent;
}

/* 粉色主题 - 获胜面板 */
.pink-theme #win-modal .modal-content,
#win-modal .modal-content.pink-win {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.95), rgba(255, 105, 180, 0.9));
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 0 40px rgba(255, 105, 180, 0.6),
        0 0 80px rgba(255, 182, 193, 0.4),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
}

.pink-theme #win-modal .modal-content h2,
#win-modal .modal-content.pink-win h2 {
    color: #fff;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.pink-theme #win-modal #play-again-btn,
#win-modal .modal-content.pink-win #play-again-btn {
    background: linear-gradient(135deg, #fff, #ffe4e9);
    color: #ff69b4;
}

.pink-theme #win-modal #back-lobby-btn,
#win-modal .modal-content.pink-win #back-lobby-btn {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* 特殊模式下隐藏棋子动画，显示花朵动画 */
.pink-theme .chess-icon {
    display: none;
}

.pink-theme .flower-icon {
    display: flex !important;
}

/* 特殊模式次标题 */
.special-subtitle {
    color: #ff69b4;
    font-size: 14px;
    margin-top: 8px;
    letter-spacing: 2px;
    animation: subtitlePulse 1.5s ease-in-out infinite alternate;
}

.pink-theme .special-subtitle {
    display: block !important;
}

@keyframes subtitlePulse {
    from {
        opacity: 0.8;
        transform: scale(1);
    }
    to {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* 花朵动画 */
.flower-icon {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.flower {
    font-size: 40px;
    display: inline-block;
    animation: flowerBloom 1.5s ease-in-out infinite;
}

.flower-1 {
    animation-delay: 0s;
}

.flower-2 {
    animation-delay: 0.75s;
}

@keyframes flowerBloom {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    25% {
        transform: scale(1.3) rotate(10deg);
        filter: brightness(1.2);
    }
    50% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    75% {
        transform: scale(1.3) rotate(-10deg);
        filter: brightness(1.2);
    }
}

.subtitle {
    margin-bottom: 25px;
}

/* ========== 输入框 ========== */
.player-name-input {
    margin-bottom: 25px;
}

.player-name-input label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.player-name-input input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
    z-index: 20;
    cursor: text;
}

.player-name-input input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.player-name-input input:focus {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
}

.lobby-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 模式分区 - 透明背景 */
.mode-section {
    margin-bottom: 20px;
    padding: 20px;
    background: transparent;
    border: none;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.mode-section:hover {
    background: transparent;
}

.section-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.icon-pulse {
    animation: iconPulse 2s ease-in-out infinite;
}

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

/* ========== 按钮样式 ========== */
.btn-glow {
    position: relative;
    overflow: hidden;
}

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

.btn-glow:hover .btn-shine {
    left: 100%;
}

.btn-icon {
    font-size: 20px;
}

.btn-text {
    font-weight: 600;
}

/* AI按钮 */
.btn-ai {
    width: 100%;
    padding: 16px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #2d5016 0%, #4a7c23 100%);
    color: #fff;
    box-shadow: 
        0 8px 25px rgba(74, 124, 35, 0.4),
        0 0 0 0 rgba(74, 124, 35, 0.4);
}

.btn-ai:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 15px 40px rgba(74, 124, 35, 0.5),
        0 0 30px rgba(74, 124, 35, 0.3);
}

/* AI难度选择 */
#ai-difficulty {
    margin-top: 15px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

#ai-difficulty #start-ai-game {
    width: 100%;
}

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

#ai-difficulty p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
    font-size: 12px;
    letter-spacing: 2px;
}

.difficulty-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 15px;
}

.diff-btn {
    padding: 10px 16px;
    font-size: 13px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.diff-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.diff-btn.active {
    background: linear-gradient(135deg, rgba(74, 124, 35, 0.7), rgba(45, 80, 22, 0.8));
    border-color: #6b8e23;
    box-shadow: 0 0 20px rgba(107, 142, 35, 0.4);
}

.btn-primary, .btn-secondary {
    padding: 16px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5a2b 0%, #a0522d 100%);
    color: #fff;
    box-shadow: 
        0 8px 25px rgba(139, 90, 43, 0.4),
        0 0 0 0 rgba(139, 90, 43, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 15px 40px rgba(139, 90, 43, 0.5),
        0 0 30px rgba(160, 120, 60, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #cd853f 0%, #d2691e 100%);
    color: #fff;
    box-shadow: 
        0 8px 25px rgba(205, 133, 63, 0.4),
        0 0 0 0 rgba(205, 133, 63, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 15px 40px rgba(205, 133, 63, 0.5),
        0 0 30px rgba(210, 105, 30, 0.3);
}

.btn-cancel {
    padding: 12px 30px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 加入房间输入 */
.room-input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    text-transform: lowercase;
    letter-spacing: 3px;
    text-align: center;
    border: 2px solid rgba(200, 160, 100, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.room-input:focus {
    border-color: rgba(200, 160, 100, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(200, 160, 100, 0.3);
}

.room-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    letter-spacing: 1px;
}

/* 房间信息 */
.room-info {
    margin: 30px 0;
}

.room-info p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.room-id-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.room-id-display span {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 8px;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.8);
}

.room-id-display button {
    padding: 10px 15px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.room-id-display button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.share-tip {
    margin: 20px 0;
}

.share-tip p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 10px;
}

.share-tip input {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 8px;
    color: #fff;
    text-align: center;
}

/* 加载动画 */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ========== 游戏界面 ========== */
#game-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #d4a574 0%, #c49660 50%, #a67c3d 100%);
}

/* 信息面板 */
#info-panel {
    width: 320px;
    background: linear-gradient(180deg, rgba(60, 40, 20, 0.95) 0%, rgba(45, 30, 15, 0.98) 100%);
    backdrop-filter: blur(15px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-right: 3px solid rgba(139, 90, 43, 0.6);
    box-shadow: 5px 0 40px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
}

.room-header {
    text-align: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(139, 90, 43, 0.5), rgba(160, 82, 45, 0.4));
    border: 2px solid rgba(200, 160, 100, 0.4);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#current-room-id {
    font-weight: bold;
    letter-spacing: 3px;
    color: #ffd700;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#info-panel h1 {
    color: #fff;
    text-align: center;
    font-size: 22px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 200, 100, 0.3);
    margin: 5px 0;
}

/* 玩家信息 */
#players-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(80, 50, 25, 0.6), rgba(60, 35, 15, 0.7));
    border: 1px solid rgba(200, 160, 100, 0.2);
    border-radius: 15px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.player-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(100, 65, 30, 0.5), rgba(80, 50, 25, 0.6));
    border: 1px solid rgba(200, 160, 100, 0.15);
    border-radius: 12px;
    width: 100%;
    transition: all 0.3s;
}

.player-card.active {
    background: linear-gradient(135deg, rgba(139, 90, 43, 0.7), rgba(160, 82, 45, 0.6));
    border-color: rgba(255, 200, 100, 0.5);
    box-shadow: 0 0 20px rgba(255, 200, 100, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.player-name {
    flex: 1;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.turn-indicator {
    font-size: 18px;
    opacity: 0.3;
    transition: all 0.3s;
}

.player-card.active .turn-indicator {
    opacity: 1;
    color: #4ade80;
    animation: pulse 1s infinite;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

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

.vs-text {
    color: rgba(255, 200, 100, 0.6);
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 当前玩家 */
#current-player {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(80, 50, 25, 0.6), rgba(60, 35, 15, 0.7));
    border: 1px solid rgba(200, 160, 100, 0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
}

#player-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.1);
}

#player-indicator.black {
    background: radial-gradient(circle at 30% 30%, #555, #000);
}

#player-indicator.white {
    background: radial-gradient(circle at 30% 30%, #fff, #ccc);
}

/* 桌面端倒计时 */
#desktop-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    margin-left: 10px;
}

#desktop-timer-icon {
    font-size: 18px;
    display: inline-block;
}

#desktop-timer-icon.shake-1 {
    animation: desktop-shake 0.5s ease-in-out infinite;
}

#desktop-timer-icon.shake-2 {
    animation: desktop-shake 0.3s ease-in-out infinite;
}

#desktop-timer-icon.shake-3 {
    animation: desktop-shake 0.15s ease-in-out infinite;
}

@keyframes desktop-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

#desktop-timer-count {
    font-size: 16px;
    font-weight: bold;
    min-width: 24px;
    text-align: center;
}

#desktop-timer-count.warning {
    color: #ff6b6b;
}

#desktop-timer-count.danger {
    color: #ff0000;
    animation: desktop-blink 0.5s ease-in-out infinite;
}

@keyframes desktop-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#my-color-info {
    text-align: center;
    padding: 14px;
    background: linear-gradient(135deg, rgba(139, 90, 43, 0.5), rgba(120, 70, 30, 0.6));
    border: 2px solid rgba(255, 200, 100, 0.4);
    border-radius: 12px;
    color: #ffd700;
    font-weight: bold;
    font-size: 15px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 棋子预览 */
.piece-preview {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.black-piece {
    background: radial-gradient(circle at 30% 30%, #555, #000);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.white-piece {
    background: radial-gradient(circle at 30% 30%, #fff, #ccc);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* 控制按钮 */
#controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#controls button {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#undo-btn {
    background: linear-gradient(135deg, #cd853f 0%, #d2691e 100%);
    color: #fff;
    border: 1px solid rgba(255, 200, 100, 0.3);
    box-shadow: 0 4px 15px rgba(205, 133, 63, 0.3);
}

#undo-btn:hover {
    box-shadow: 0 6px 20px rgba(205, 133, 63, 0.5);
}

#restart-btn {
    background: linear-gradient(135deg, #8b5a2b 0%, #a0522d 100%);
    color: #fff;
    border: 1px solid rgba(255, 200, 100, 0.3);
    box-shadow: 0 4px 15px rgba(139, 90, 43, 0.3);
}

#restart-btn:hover {
    box-shadow: 0 6px 20px rgba(139, 90, 43, 0.5);
}

#leave-btn {
    background: linear-gradient(135deg, rgba(100, 65, 30, 0.6), rgba(80, 50, 25, 0.7));
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(200, 160, 100, 0.2);
}

#leave-btn:hover {
    background: linear-gradient(135deg, rgba(120, 75, 35, 0.7), rgba(100, 60, 30, 0.8));
    border-color: rgba(200, 160, 100, 0.4);
}

#controls button:hover {
    transform: translateY(-2px);
}

/* 聊天区域 */
#chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(50, 30, 15, 0.7), rgba(40, 25, 10, 0.8));
    border: 1px solid rgba(200, 160, 100, 0.2);
    border-radius: 15px;
    overflow: hidden;
    min-height: 150px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

#chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-size: 13px;
}

.chat-message {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(100, 65, 30, 0.4), rgba(80, 50, 25, 0.5));
    border: 1px solid rgba(200, 160, 100, 0.1);
}

.chat-message .name {
    font-weight: bold;
    margin-right: 8px;
}

.chat-message.black .name { color: #aaa; }
.chat-message.white .name { color: #fff; }
.chat-message .text { color: rgba(255, 255, 255, 0.9); }

.chat-message.system {
    background: linear-gradient(135deg, rgba(139, 90, 43, 0.4), rgba(120, 70, 30, 0.5));
    color: #ffd700;
    text-align: center;
    font-style: italic;
    border-color: rgba(255, 200, 100, 0.2);
}

#chat-input-area {
    display: flex;
    padding: 10px;
    gap: 8px;
    border-top: 1px solid rgba(200, 160, 100, 0.2);
    background: rgba(40, 25, 10, 0.5);
    min-width: 0;
}

#chat-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(200, 160, 100, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

#chat-input:focus {
    border-color: rgba(200, 160, 100, 0.5);
    background: rgba(255, 255, 255, 0.12);
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#send-chat-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #8b5a2b, #a0522d);
    color: #fff;
    border: 1px solid rgba(255, 200, 100, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

#send-chat-btn:hover {
    background: linear-gradient(135deg, #a0522d, #cd853f);
    box-shadow: 0 4px 15px rgba(139, 90, 43, 0.4);
}

/* Canvas 容器 */
#canvas-container {
    flex: 1;
    position: relative;
    cursor: pointer;
}

/* 弹窗 */
#win-modal, #request-modal, #pause-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

/* 暂停界面特殊样式 */
.pause-modal {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    min-width: 300px;
}

.pause-icon {
    font-size: 60px;
    margin-bottom: 10px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

#pause-title {
    color: #fff;
    margin-bottom: 10px;
}

#pause-reason {
    color: #bdc3c7;
    margin-bottom: 15px;
    font-size: 14px;
}

.pause-timer {
    color: #f39c12;
    font-size: 18px;
    margin-bottom: 20px;
}

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

.pause-buttons button {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-wait {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.btn-wait:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.btn-exit {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-exit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 60px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: bounceIn 0.5s ease;
}

.request-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    padding: 30px;
}

.alert-modal p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #fff;
}

.alert-modal button {
    padding: 12px 40px;
    font-size: 16px;
}

#alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
    color: #fff;
    font-size: 32px;
    margin-bottom: 25px;
}

.modal-content h3 {
    color: #fff;
    font-size: 20px;
    margin-bottom: 20px;
}

#play-again-btn, #back-lobby-btn {
    padding: 15px 35px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    margin: 5px;
}

#play-again-btn {
    background: #fff;
    color: #764ba2;
}

#back-lobby-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

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

.btn-accept {
    padding: 12px 30px;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-reject {
    padding: 12px 30px;
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

/* 通知提示 */
#notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border-radius: 10px;
    z-index: 2000;
    animation: slideDown 0.3s ease;
}

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

/* 响应式 */
@media (max-width: 768px) {
    .lobby-content {
        padding: 30px;
        margin: 20px;
    }
    
    .lobby-content h1 {
        font-size: 28px;
    }
    
    /* 隐藏桌面端状态栏 */
    #info-panel {
        display: none !important;
    }
    
    #game-container {
        position: relative;
    }
    
    #canvas-container {
        width: 100vw;
        height: 100vh;
    }
    
    /* ========== 移动端浮动UI ========== */
    #mobile-ui {
        display: block !important;
    }
    
    /* 底部中间 - 倒计时和回合提示 */
    #mobile-timer-area {
        position: fixed;
        bottom: 25px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        z-index: 100;
    }
    
    #mobile-turn-indicator {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        background: linear-gradient(135deg, rgba(60, 40, 20, 0.95), rgba(45, 30, 15, 0.98));
        border-radius: 20px;
        border: 2px solid rgba(255, 215, 0, 0.4);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
    
    #mobile-turn-piece {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
    }
    
    #mobile-turn-piece.black-piece {
        background: radial-gradient(circle at 30% 30%, #4a4a4a, #1a1a1a);
    }
    
    #mobile-turn-piece.white-piece {
        background: radial-gradient(circle at 30% 30%, #ffffff, #d0d0d0);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    #mobile-turn-text {
        color: #fff;
        font-size: 14px;
        font-weight: bold;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    }
    
    #mobile-timer {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        background: linear-gradient(135deg, rgba(60, 40, 20, 0.9), rgba(45, 30, 15, 0.95));
        border-radius: 18px;
        border: 2px solid rgba(200, 160, 100, 0.3);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    }
    
    #timer-icon {
        font-size: 20px;
        display: inline-block;
    }
    
    #timer-icon.shake-1 {
        animation: shake 0.5s ease-in-out infinite;
    }
    
    #timer-icon.shake-2 {
        animation: shake 0.3s ease-in-out infinite;
    }
    
    #timer-icon.shake-3 {
        animation: shake 0.15s ease-in-out infinite;
    }
    
    @keyframes shake {
        0%, 100% { transform: rotate(0deg); }
        25% { transform: rotate(-15deg); }
        75% { transform: rotate(15deg); }
    }
    
    #timer-count {
        color: #fff;
        font-size: 18px;
        font-weight: bold;
        min-width: 26px;
        text-align: center;
    }
    
    #timer-count.warning {
        color: #ff6b6b;
    }
    
    #timer-count.danger {
        color: #ff0000;
        animation: blink 0.5s ease-in-out infinite;
    }
    
    @keyframes blink {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.5; }
    }
    
    /* 左上角 - 对手状态卡片 */
    #mobile-opponent {
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 100;
    }
    
    /* 右下角 - 我方状态卡片 */
    #mobile-me {
        position: fixed;
        bottom: 15px;
        right: 15px;
        z-index: 100;
    }
    
    .mobile-player-card {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 15px;
        background: linear-gradient(135deg, rgba(60, 40, 20, 0.9), rgba(45, 30, 15, 0.95));
        border-radius: 25px;
        border: 2px solid rgba(200, 160, 100, 0.3);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
        transition: all 0.3s ease;
    }
    
    .mobile-player-card.active {
        border-color: #ffd700;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3);
        animation: pulse-glow 1.5s ease-in-out infinite;
    }
    
    @keyframes pulse-glow {
        0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3); }
        50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.5); }
    }
    
    .mobile-piece {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }
    
    .mobile-piece.black-piece, #mobile-opponent .opponent-piece.black {
        background: radial-gradient(circle at 30% 30%, #4a4a4a, #1a1a1a);
    }
    
    .mobile-piece.white-piece, #mobile-me .my-piece.white {
        background: radial-gradient(circle at 30% 30%, #ffffff, #d0d0d0);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .mobile-player-name {
        color: #fff;
        font-size: 14px;
        font-weight: bold;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    }
    
    /* 左下角 - 功能按钮 */
    #mobile-buttons {
        position: fixed;
        bottom: 15px;
        left: 15px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        z-index: 100;
    }
    
    .mobile-btn {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        border: 2px solid rgba(200, 160, 100, 0.4);
        background: linear-gradient(135deg, rgba(60, 40, 20, 0.9), rgba(45, 30, 15, 0.95));
        font-size: 22px;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-btn:active {
        transform: scale(0.95);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    /* 落子确认按钮 */
    #mobile-confirm-btn {
        position: fixed;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 150;
    }
    
    #confirm-place-btn {
        padding: 15px 40px;
        background: linear-gradient(135deg, #27ae60, #2ecc71);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 30px;
        color: #fff;
        font-size: 18px;
        font-weight: bold;
        cursor: pointer;
        box-shadow: 0 6px 25px rgba(39, 174, 96, 0.5);
        animation: pulse-confirm 1s ease-in-out infinite;
    }
    
    @keyframes pulse-confirm {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.05); }
    }
    
    #confirm-place-btn:active {
        transform: scale(0.95);
    }
    
    /* ========== 移动端弹窗 ========== */
    .mobile-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        backdrop-filter: blur(5px);
    }
    
    .mobile-modal-content {
        background: linear-gradient(135deg, rgba(60, 40, 20, 0.98), rgba(45, 30, 15, 0.98));
        border: 2px solid rgba(200, 160, 100, 0.5);
        border-radius: 20px;
        padding: 25px;
        width: 85%;
        max-width: 320px;
        text-align: center;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }
    
    .mobile-modal-content h3 {
        color: #ffd700;
        font-size: 18px;
        margin-bottom: 20px;
        text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
    }
    
    .mobile-modal-btn {
        display: block;
        width: 100%;
        padding: 14px;
        margin-bottom: 10px;
        background: linear-gradient(135deg, rgba(139, 90, 43, 0.6), rgba(160, 82, 45, 0.5));
        border: 1px solid rgba(200, 160, 100, 0.4);
        border-radius: 12px;
        color: #fff;
        font-size: 15px;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-modal-btn:active {
        background: linear-gradient(135deg, rgba(139, 90, 43, 0.8), rgba(160, 82, 45, 0.7));
        transform: scale(0.98);
    }
    
    .mobile-modal-close {
        margin-top: 10px;
        padding: 12px 30px;
        background: rgba(100, 100, 100, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 10px;
        color: #ccc;
        font-size: 14px;
        cursor: pointer;
    }
    
    /* 聊天弹窗 */
    .mobile-chat-content {
        max-height: 70vh;
        display: flex;
        flex-direction: column;
    }
    
    #mobile-chat-messages {
        flex: 1;
        min-height: 200px;
        max-height: 300px;
        overflow-y: auto;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 10px;
        padding: 10px;
        margin-bottom: 15px;
    }
    
    #mobile-chat-messages .chat-message {
        padding: 8px 12px;
        margin-bottom: 8px;
        border-radius: 10px;
        font-size: 13px;
    }
    
    #mobile-chat-input-area {
        display: flex;
        gap: 8px;
    }
    
    #mobile-chat-input {
        flex: 1;
        padding: 12px;
        border-radius: 10px;
        border: 1px solid rgba(200, 160, 100, 0.3);
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        font-size: 14px;
    }
    
    #mobile-send-chat-btn {
        padding: 12px 18px;
        background: linear-gradient(135deg, #667eea, #764ba2);
        border: none;
        border-radius: 10px;
        color: #fff;
        font-size: 14px;
        cursor: pointer;
    }
    
    /* 离开弹窗 */
    .mobile-leave-content p {
        color: #ccc;
        margin-bottom: 20px;
        font-size: 14px;
    }
    
    .mobile-leave-buttons {
        display: flex;
        gap: 15px;
        justify-content: center;
    }
    
    .mobile-leave-btn {
        padding: 14px 30px;
        border-radius: 12px;
        font-size: 15px;
        font-weight: bold;
        cursor: pointer;
        border: none;
        transition: all 0.2s ease;
    }
    
    .mobile-leave-btn.leave {
        background: linear-gradient(135deg, #e74c3c, #c0392b);
        color: #fff;
    }
    
    .mobile-leave-btn.stay {
        background: linear-gradient(135deg, #27ae60, #2ecc71);
        color: #fff;
    }
    
    .mobile-leave-btn:active {
        transform: scale(0.95);
    }
}

/* 桌面端隐藏移动端UI */
#mobile-ui {
    display: none;
}

.mobile-modal {
    display: none;
}

.mobile-modal:not(.hidden) {
    display: flex;
}

/* ========== 计分板样式 ========== */
#scoreboard {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 15px 20px;
    min-width: 180px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.scoreboard-title {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.score-player {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
}

.score-piece {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.black-dot {
    background: radial-gradient(circle at 30% 30%, #555, #000);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.white-dot {
    background: radial-gradient(circle at 30% 30%, #fff, #ddd);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.score-value {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    min-width: 30px;
    text-align: right;
}

.player-title {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 4px;
    font-weight: bold;
}

.title-master {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.title-genius {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

.title-leading {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #000;
}

@media (max-width: 768px) {
    #scoreboard {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
        min-width: 150px;
    }
    
    .scoreboard-title {
        font-size: 14px;
    }
    
    .score-player {
        font-size: 12px;
    }
    
    .score-value {
        font-size: 20px;
    }
    
    .player-title {
        font-size: 9px;
    }
}

/* ========== 特殊玩家称号 ========== */
.player-name-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.special-title {
    font-size: 10px;
    color: #ffd700;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 50%, #ff6b9d 100%);
    background-size: 200% 200%;
    animation: shimmer 2s ease-in-out infinite;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 2px;
    white-space: nowrap;
}

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

.special-btn {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%) !important;
    border: 2px solid #ffd700 !important;
    animation: pulse-special 1.5s ease-in-out infinite;
}

.special-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.6);
}

@keyframes pulse-special {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

/* 移动端特殊头衔 */
.mobile-player-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.mobile-special-title {
    font-size: 8px;
    color: #ffd700;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 50%, #ff6b9d 100%);
    background-size: 200% 200%;
    animation: shimmer 2s ease-in-out infinite;
    padding: 1px 5px;
    border-radius: 6px;
    margin-top: 2px;
    white-space: nowrap;
}

/* ========== 冬至节日按钮 ========== */
.festival-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-festival {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #a8e6cf 0%, #88d8b0 50%, #7fcdbb 100%);
    color: #2d5a45;
    box-shadow: 0 5px 20px rgba(136, 216, 176, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-festival:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(136, 216, 176, 0.6);
}

.btn-festival.winter-active {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 50%, #6c5ce7 100%);
    color: #fff;
    box-shadow: 0 5px 20px rgba(116, 185, 255, 0.6);
}

.btn-festival.winter-active:hover {
    box-shadow: 0 8px 30px rgba(116, 185, 255, 0.8);
}

/* ========== 冬至艺术字弹窗 ========== */
.festival-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease;
}

.festival-modal.hidden {
    display: none;
}

.festival-content {
    text-align: center;
    animation: winterPopIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes winterPopIn {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.winter-text {
    font-size: 80px;
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #e8f4fc 30%, #b8d4e8 60%, #87ceeb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 4px 8px rgba(135, 206, 235, 0.5))
            drop-shadow(0 0 30px rgba(255, 255, 255, 0.8));
    animation: winterGlow 2s ease-in-out infinite alternate;
    letter-spacing: 10px;
}

@keyframes winterGlow {
    from {
        filter: drop-shadow(0 4px 8px rgba(135, 206, 235, 0.5))
                drop-shadow(0 0 30px rgba(255, 255, 255, 0.8));
    }
    to {
        filter: drop-shadow(0 4px 15px rgba(135, 206, 235, 0.8))
                drop-shadow(0 0 50px rgba(255, 255, 255, 1));
    }
}

.winter-subtitle {
    font-size: 24px;
    color: #fff;
    margin-top: 20px;
    letter-spacing: 5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease 0.3s both;
}

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

.tangyuan-decoration {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    animation: fadeInUp 0.8s ease 0.5s both;
}

.tangyuan {
    font-size: 50px;
    animation: tangyuanBounce 1s ease-in-out infinite;
}

.tangyuan:nth-child(1) { animation-delay: 0s; }
.tangyuan:nth-child(2) { animation-delay: 0.2s; }
.tangyuan:nth-child(3) { animation-delay: 0.4s; }

@keyframes tangyuanBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* ========== 冰雪主题 ========== */
body.winter-theme {
    background: linear-gradient(135deg, #e8f4fc 0%, #d4e9f7 30%, #b8d4e8 60%, #a8c8dc 100%);
}

.winter-theme .neon-title {
    color: #4a90a4;
    text-shadow:
        0 0 10px rgba(135, 206, 235, 0.8),
        0 0 20px rgba(173, 216, 230, 0.6),
        0 0 40px rgba(176, 224, 230, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.2);
}

.winter-theme .glow-text {
    color: rgba(70, 130, 180, 0.9);
}

.winter-theme .player-name-input label {
    color: #5f9ea0;
}

.winter-theme .player-name-input input {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(135, 206, 235, 0.5);
    color: #4682b4;
}

.winter-theme .player-name-input input:focus {
    border-color: #87ceeb;
    box-shadow: 0 0 20px rgba(135, 206, 235, 0.5);
}

.winter-theme .player-name-input input::placeholder {
    color: rgba(70, 130, 180, 0.5);
}

.winter-theme .section-title {
    color: #5f9ea0;
}

.winter-theme .btn-ai,
.winter-theme .btn-primary {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    box-shadow: 0 5px 20px rgba(116, 185, 255, 0.4);
}

.winter-theme .btn-ai:hover,
.winter-theme .btn-primary:hover {
    background: linear-gradient(135deg, #81c4ff 0%, #2d9cee 100%);
    box-shadow: 0 8px 30px rgba(116, 185, 255, 0.6);
}

.winter-theme .btn-secondary {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: white;
    box-shadow: 0 5px 20px rgba(162, 155, 254, 0.4);
}

.winter-theme .btn-secondary:hover {
    background: linear-gradient(135deg, #b2abfe 0%, #7d6ef0 100%);
    box-shadow: 0 8px 30px rgba(162, 155, 254, 0.6);
}

.winter-theme .room-input {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(135, 206, 235, 0.4);
    color: #4682b4;
}

.winter-theme .room-input:focus {
    border-color: #87ceeb;
    box-shadow: 0 0 15px rgba(135, 206, 235, 0.4);
}

.winter-theme .room-input::placeholder {
    color: rgba(70, 130, 180, 0.5);
}

.winter-theme .diff-btn {
    background: rgba(135, 206, 235, 0.3);
    border: 1px solid rgba(135, 206, 235, 0.5);
    color: #4682b4;
}

.winter-theme .diff-btn:hover,
.winter-theme .diff-btn.active {
    background: linear-gradient(135deg, #87ceeb, #4682b4);
    color: white;
    border-color: #4682b4;
}

.winter-theme #start-ai-game {
    background: linear-gradient(135deg, #81ecec 0%, #00cec9 100%);
    box-shadow: 0 5px 20px rgba(0, 206, 201, 0.4);
}

.winter-theme #start-ai-game:hover {
    background: linear-gradient(135deg, #92f5f5 0%, #1dd6d1 100%);
    box-shadow: 0 8px 30px rgba(0, 206, 201, 0.6);
}

.winter-theme .glow-orb.orb-1 {
    background: radial-gradient(circle, rgba(135, 206, 235, 0.6), transparent);
}

.winter-theme .glow-orb.orb-2 {
    background: radial-gradient(circle, rgba(173, 216, 230, 0.5), transparent);
}

.winter-theme .glow-orb.orb-3 {
    background: radial-gradient(circle, rgba(176, 224, 230, 0.4), transparent);
}

.winter-theme .glass-card {
    background: transparent;
    border: none;
    box-shadow: none;
}

.winter-theme .lobby-content {
    background: transparent;
    border: none;
    box-shadow: none;
}

.winter-theme .mode-section {
    background: transparent;
    border: none;
}

.winter-theme .mode-section:hover {
    background: transparent;
}

/* 冬至主题 - 菜单中的汤圆图标 */
.winter-theme .chess-icon .piece {
    border-radius: 50%;
    position: relative;
}

.winter-theme .chess-icon .black-animated {
    background: radial-gradient(circle at 35% 35%, #4a4a4a, #1a1a1a);
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.4),
        inset 0 -3px 8px rgba(255, 255, 255, 0.1),
        inset 0 3px 8px rgba(255, 255, 255, 0.2);
}

.winter-theme .chess-icon .white-animated {
    background: radial-gradient(circle at 35% 35%, #fff, #e0e0e0);
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.2),
        inset 0 -3px 8px rgba(0, 0, 0, 0.1),
        inset 0 3px 8px rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
    .winter-text {
        font-size: 50px;
        letter-spacing: 5px;
    }
    
    .winter-subtitle {
        font-size: 16px;
    }
    
    .tangyuan {
        font-size: 35px;
    }
}
