/* ===== 主题变量 ===== */
:root {
    /* 主色调 */
    --primary: #6366F1;
    --primary-light: #818CF8;
    --primary-dark: #4F46E5;
    --primary-glow: rgba(99, 102, 241, 0.4);

    /* 状态色 */
    --win-color: #10B981;
    --win-bg: #D1FAE5;
    --win-text: #065F46;
    --lose-color: #EF4444;
    --lose-bg: #FEE2E2;
    --lose-text: #991B1B;
    --draw-color: #F59E0B;
    --draw-bg: #FEF3C7;
    --draw-text: #92400E;

    /* 背景 */
    --bg-gradient: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 30%, #F5F3FF 60%, #FDF2F8 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-bg-solid: #ffffff;
    --surface: #F1F5F9;
    --surface-hover: #E2E8F0;
    --surface-active: linear-gradient(135deg, #EEF2FF, #E0E7FF);

    /* 文字 */
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-on-primary: #ffffff;
    --text-result-win: #059669;
    --text-result-lose: #DC2626;
    --text-result-draw: #D97706;

    /* 边框与阴影 */
    --border: rgba(148, 163, 184, 0.2);
    --border-active: rgba(99, 102, 241, 0.5);
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

    /* 圆角 */
    --radius: 20px;
    --radius-sm: 12px;

    /* 玻璃效果 */
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: blur(20px);

    /* 按钮悬浮色 */
    --rock-hover-bg: #FEF2F2;
    --rock-hover-border: #EF4444;
    --scissors-hover-bg: #EFF6FF;
    --scissors-hover-border: #3B82F6;
    --paper-hover-bg: #ECFDF5;
    --paper-hover-border: #10B981;

    /* 模态框遮罩 */
    --modal-overlay: rgba(15, 23, 42, 0.5);
    --modal-bg: #ffffff;

    /* 倒计时/VS */
    --vs-color: #6366F1;
    --battle-center-color: #6366F1;

    /* 手势展示区背景 */
    --hand-bg: #F1F5F9;

    /* 粒子背景 */
    --bg-particle-color: rgba(99, 102, 241, 0.08);
}

/* ===== 暗色主题 ===== */
[data-theme="dark"] {
    /* 主色调 */
    --primary: #818CF8;
    --primary-light: #A5B4FC;
    --primary-dark: #6366F1;
    --primary-glow: rgba(129, 140, 248, 0.35);

    /* 状态色 */
    --win-color: #34D399;
    --win-bg: rgba(16, 185, 129, 0.15);
    --win-text: #6EE7B7;
    --lose-color: #F87171;
    --lose-bg: rgba(239, 68, 68, 0.15);
    --lose-text: #FCA5A5;
    --draw-color: #FBBF24;
    --draw-bg: rgba(245, 158, 11, 0.15);
    --draw-text: #FDE68A;

    /* 背景 */
    --bg-gradient: linear-gradient(135deg, #0F172A 0%, #1E1B4B 30%, #1E293B 60%, #0C1222 100%);
    --card-bg: rgba(30, 41, 59, 0.8);
    --card-bg-solid: #1E293B;
    --surface: #334155;
    --surface-hover: #475569;
    --surface-active: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));

    /* 文字 */
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;
    --text-on-primary: #ffffff;
    --text-result-win: #34D399;
    --text-result-lose: #F87171;
    --text-result-draw: #FBBF24;

    /* 边框与阴影 */
    --border: rgba(148, 163, 184, 0.1);
    --border-active: rgba(129, 140, 248, 0.5);
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 30px rgba(129, 140, 248, 0.2);

    /* 玻璃效果 */
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(148, 163, 184, 0.1);
    --glass-blur: blur(20px);

    /* 按钮悬浮色 */
    --rock-hover-bg: rgba(239, 68, 68, 0.1);
    --rock-hover-border: #F87171;
    --scissors-hover-bg: rgba(59, 130, 246, 0.1);
    --scissors-hover-border: #60A5FA;
    --paper-hover-bg: rgba(16, 185, 129, 0.1);
    --paper-hover-border: #34D399;

    /* 模态框 */
    --modal-overlay: rgba(0, 0, 0, 0.7);
    --modal-bg: #1E293B;

    /* 倒计时/VS */
    --vs-color: #A5B4FC;
    --battle-center-color: #C084FC;

    /* 手势展示区背景 */
    --hand-bg: #334155;

    /* 粒子背景 */
    --bg-particle-color: rgba(129, 140, 248, 0.06);
}

/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-primary);
    transition: background 0.4s ease, color 0.4s ease;
}

/* ===== 主题切换按钮 ===== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 600;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    transform: rotate(30deg) scale(1.1);
    box-shadow: var(--shadow-md);
}

.theme-toggle:active {
    transform: rotate(30deg) scale(0.95);
}

/* ===== 粒子画布 ===== */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* ===== 屏幕切换 ===== */
.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 开始界面 ===== */
.start-container {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.logo-area {
    margin-bottom: 30px;
}

.logo-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-icon {
    font-size: 3rem;
    display: inline-block;
    animation: bounce 2s ease infinite;
}

.logo-icon img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.logo-icon:nth-child(1) { animation-delay: 0s; }
.logo-icon:nth-child(2) { animation-delay: 0.3s; }
.logo-icon:nth-child(3) { animation-delay: 0.6s; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.game-title {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), #A78BFA, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.game-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* 规则选择 */
.rules-section {
    margin: 25px 0;
}

.section-title {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 700;
}

.rule-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.rule-btn {
    background: var(--surface);
    border: 3px solid transparent;
    border-radius: 14px;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.rule-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-active);
    transform: translateY(-2px);
}

.rule-btn.active {
    background: var(--surface-active);
    border-color: var(--primary);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.rule-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rule-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 开始按钮 */
.start-btn {
    background: linear-gradient(135deg, var(--primary), #A78BFA);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 16px 50px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px var(--primary-glow);
    font-family: inherit;
    margin-top: 10px;
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 35px var(--primary-glow);
}

.start-btn:active {
    transform: translateY(0) scale(0.98);
}

/* ===== 游戏界面 ===== */
#gameScreen.active {
    flex-direction: column;
    align-items: stretch;
    padding: 15px;
}

.game-container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

/* 顶部信息栏 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.back-btn, .reset-btn {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.back-btn:hover, .reset-btn:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
}

.match-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
}

.match-rule {
    font-size: 0.85rem;
    opacity: 0.85;
}

.match-progress {
    font-size: 1.1rem;
    font-weight: 700;
}

/* 比分板 */
.scoreboard {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.score-item {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px 30px;
    text-align: center;
    box-shadow: var(--shadow-md);
    min-width: 120px;
    transition: all 0.3s ease;
}

.score-item.score-highlight {
    animation: scorePulse 0.6s ease;
}

@keyframes scorePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.score-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.score-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
}

.student-score .score-value {
    color: var(--win-color);
}

.computer-score .score-value {
    color: var(--lose-color);
}

.score-divider {
    color: var(--vs-color);
    font-size: 1.3rem;
    font-weight: 900;
}

.vs-text {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* 对战区域 */
.battle-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    min-height: 200px;
}

.player-side {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px 30px;
    text-align: center;
    box-shadow: var(--shadow-md);
    min-width: 160px;
    transition: all 0.3s ease;
}

.player-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 700;
}

.hand-display {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--hand-bg);
    transition: all 0.3s ease;
}

.hand-emoji {
    font-size: 3.5rem;
    line-height: 1;
}

.hand-emoji img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.1));
}

.battle-center {
    font-size: 2.5rem;
    color: var(--battle-center-color);
    text-shadow: 0 0 20px var(--primary-glow);
}

/* 出拳动画 - 轮播滚动效果 */
.hand-display.cycling {
    animation: handCycle 0.08s steps(1) infinite;
    border: 4px solid var(--primary-light);
    box-shadow: 0 0 20px var(--primary-glow);
}

.hand-display.cycling-fast {
    border: 4px solid var(--primary-light);
    box-shadow: 0 0 20px var(--primary-glow);
}

.hand-display.cycling-slow {
    border: 4px solid var(--draw-color);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

/* 确定结果时的弹跳效果 */
.hand-display.reveal {
    animation: revealBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes revealBounce {
    0% { transform: scale(0.3); opacity: 0.3; }
    50% { transform: scale(1.2); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* 确定时背景闪烁 */
.hand-display.reveal-flash {
    animation: flashBg 0.4s ease;
}

@keyframes flashBg {
    0% { background: var(--hand-bg); }
    50% { background: var(--surface-hover); }
    100% { background: var(--hand-bg); }
}

/* 胜负高亮 */
.player-side.winner {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
    border: 3px solid var(--win-color);
}

.player-side.loser {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.2);
    border: 3px solid var(--lose-color);
    opacity: 0.7;
}

.player-side.draw-state {
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.25);
    border: 3px solid var(--draw-color);
}

/* 结果显示 */
.result-area {
    text-align: center;
    margin-bottom: 15px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-text {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-primary);
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-text.show {
    opacity: 1;
    transform: scale(1);
}

.result-text.win { color: var(--text-result-win); text-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }
.result-text.lose { color: var(--text-result-lose); text-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
.result-text.draw { color: var(--text-result-draw); text-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }

/* 出拳按钮 */
.choice-area {
    text-align: center;
    margin-bottom: 20px;
}

.choice-prompt {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 15px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.choice-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.choice-btn {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 4px solid transparent;
    border-radius: 20px;
    padding: 20px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
    font-family: inherit;
    min-width: 110px;
}

.choice-btn:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.choice-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.rock-btn:hover { border-color: var(--rock-hover-border); background: var(--rock-hover-bg); }
.scissors-btn:hover { border-color: var(--scissors-hover-border); background: var(--scissors-hover-bg); }
.paper-btn:hover { border-color: var(--paper-hover-border); background: var(--paper-hover-bg); }

.choice-emoji {
    font-size: 3rem;
    line-height: 1;
}

.choice-emoji img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.1));
}

.choice-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.choice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 历史记录 */
.history-area {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 15px 20px;
    box-shadow: var(--shadow-sm);
    transition: background 0.4s ease;
}

.history-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
}

.history-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.history-item.win {
    background: var(--win-bg);
    color: var(--win-text);
}

.history-item.lose {
    background: var(--lose-bg);
    color: var(--lose-text);
}

.history-item.draw {
    background: var(--draw-bg);
    color: var(--draw-text);
}

.history-round {
    font-weight: 400;
    opacity: 0.7;
    font-size: 0.75rem;
}

.history-hand-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
}

/* ===== 最终结果弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 500;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--modal-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.7) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: bounce 1.5s ease infinite;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-title.win-title { color: var(--win-color); }
.modal-title.lose-title { color: var(--lose-color); }

.modal-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.modal-stats {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    display: block;
}

.stat-value.win-stat { color: var(--win-color); }
.stat-value.lose-stat { color: var(--lose-color); }
.stat-value.draw-stat { color: var(--draw-color); }

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    border: none;
    border-radius: 14px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.modal-btn:hover {
    transform: translateY(-2px);
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--primary), #A78BFA);
    color: white;
    box-shadow: 0 6px 20px var(--primary-glow);
}

.modal-btn.primary:hover {
    box-shadow: 0 10px 30px var(--primary-glow);
}

.modal-btn.secondary {
    background: var(--surface);
    color: var(--text-secondary);
}

.modal-btn.secondary:hover {
    background: var(--surface-hover);
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .start-container {
        padding: 25px;
    }

    .game-title {
        font-size: 2rem;
    }

    .logo-icon {
        font-size: 2.2rem;
    }

    .rule-options {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .rule-btn {
        padding: 12px 8px;
    }

    .battle-area {
        gap: 10px;
        flex-wrap: nowrap;
    }

    .player-side {
        padding: 15px 20px;
        min-width: 100px;
    }

    .hand-display {
        width: 75px;
        height: 75px;
    }

    .hand-emoji {
        font-size: 2.5rem;
    }

    .hand-emoji img {
        width: 50px;
        height: 50px;
    }

    .logo-icon img {
        width: 45px;
        height: 45px;
    }

    .choice-emoji img {
        width: 38px;
        height: 38px;
    }

    .battle-center {
        font-size: 1.8rem;
    }

    .choice-btn {
        padding: 15px 20px;
        min-width: 90px;
    }

    .choice-emoji {
        font-size: 2.2rem;
    }

    .score-item {
        padding: 10px 20px;
        min-width: 90px;
    }

    .score-value {
        font-size: 2rem;
    }

    .result-text {
        font-size: 1.3rem;
    }

    .theme-toggle {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .rule-options {
        grid-template-columns: 1fr;
    }

    .choice-buttons {
        gap: 10px;
    }

    .choice-btn {
        padding: 12px 15px;
        min-width: 80px;
    }

    .battle-area {
        gap: 5px;
    }

    .player-side {
        padding: 10px 12px;
        min-width: 85px;
    }

    .hand-display {
        width: 60px;
        height: 60px;
    }

    .hand-emoji {
        font-size: 2rem;
    }

    .hand-emoji img {
        width: 38px;
        height: 38px;
    }

    .logo-icon img {
        width: 35px;
        height: 35px;
    }

    .choice-emoji img {
        width: 30px;
        height: 30px;
    }

    .modal-content {
        padding: 25px;
    }

    .modal-title {
        font-size: 1.4rem;
    }
}

/* ===== 倒计时覆盖 ===== */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    pointer-events: none;
}

.countdown-number {
    font-size: 8rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
    animation: countDown 0.8s ease;
    opacity: 0;
}

@keyframes countDown {
    0% { opacity: 0; transform: scale(2); }
    30% { opacity: 1; transform: scale(1); }
    80% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.5); }
}

/* ===== 胜利彩带效果 ===== */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 20px;
    border-radius: 2px;
    animation: confettiFall linear forwards;
    z-index: 999;
    pointer-events: none;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-100vh) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* ===== 平滑过渡 ===== */
.screen,
.start-container,
.player-side,
.score-item,
.choice-btn,
.history-area,
.modal-content,
.rule-btn {
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, color 0.3s ease;
}

/* ===== 暗色模式滚动条 ===== */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1E293B;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== 选区高亮 ===== */
::selection {
    background: var(--primary-light);
    color: white;
}
