:root {
    --bg: #0b1120;
    --panel: #1a2332;
    --card: #1e2a3a;
    --accent: #f59e0b;
    --accent2: #10b981;
    --text: #f1f5f9;
    --muted: #6b7a8f;
    --danger: #ef4444;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --cyan: #06b6d4;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    user-select: none;
}
.nav {
    display: flex; gap: 8px; padding: 14px 24px;
    background: rgba(26,35,50,0.92); backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--accent);
    overflow-x: auto; flex-shrink: 0; z-index: 10;
}
.nav button {
    background: var(--card); border: 2px solid transparent;
    color: var(--text); padding: 10px 20px; border-radius: 10px;
    cursor: pointer; font-size: 1.05rem; font-weight: 600;
    transition: all 0.3s; white-space: nowrap;
}
.nav button:hover { border-color: var(--accent); transform: translateY(-2px); }
.nav button.active {
    background: linear-gradient(135deg, var(--accent), #f97316);
    color: #000; border-color: var(--accent);
    box-shadow: 0 0 20px rgba(245,158,11,0.3);
}
.main { flex: 1; display: flex; padding: 20px; gap: 20px; min-height: 0; }
.stage {
    flex: 1; background: var(--panel); border-radius: 20px;
    padding: 30px 35px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; position: relative;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4); overflow: hidden;
}
.stage-glass {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(245,158,11,0.04) 0%, transparent 70%);
    pointer-events: none;
}
.sidebar { width: 320px; display: flex; flex-direction: column; gap: 14px; flex-shrink: 0; }

/* ── 计时器 ── */
.timer-box {
    background: linear-gradient(135deg, #1a2332 0%, #0b1120 100%);
    border: 2px solid var(--accent); border-radius: 18px;
    padding: 16px; text-align: center;
    box-shadow: 0 0 30px rgba(245,158,11,0.15);
}
.timer-label { font-size: 1rem; color: var(--accent); font-weight: 700; letter-spacing: 3px; margin-bottom: 4px; }
.timer-display {
    font-size: 5rem; font-weight: 900; font-variant-numeric: tabular-nums;
    line-height: 1; color: var(--text);
    text-shadow: 0 0 25px rgba(245,158,11,0.4); transition: color 0.3s;
}
.timer-display.warning { color: var(--danger); text-shadow: 0 0 30px rgba(239,68,68,0.6); }
.timer-display.urgent { animation: pulse 0.5s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.timer-controls { display: flex; gap: 6px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.timer-controls input { width: 50px; font-size: 1rem; text-align: center; background: var(--bg); border: 2px solid var(--muted); color: var(--text); border-radius: 8px; padding: 5px; }

/* ── 按钮 ── */
.btn { padding: 8px 16px; font-size: 0.9rem; font-weight: 700; border: none; border-radius: 10px; cursor: pointer; transition: all 0.2s; }
.btn:hover { transform: scale(1.04); }
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: #000; }
.btn-secondary { background: var(--card); color: var(--text); border: 2px solid var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--accent2); color: #fff; }
.btn-purple { background: var(--purple); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.big-action { font-size: 1.3rem; padding: 12px 36px; }

/* ── 计分板 ── */
.score-board {
    background: var(--panel); border-radius: 16px; padding: 14px 16px;
    display: flex; flex-direction: column;
}
.score-board h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--accent2); text-align: center; letter-spacing: 2px; }
.team-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 1rem; }
.team-label { min-width: 60px; font-weight: 700; }
.score-num { font-size: 1.5rem; font-weight: 900; min-width: 32px; text-align: center; font-variant-numeric: tabular-nums; }
.score-btn { width: 30px; height: 30px; border-radius: 50%; border: none; font-size: 1rem; cursor: pointer; font-weight: 700; flex-shrink: 0; }
.score-btn.minus { background: var(--danger); color: #fff; }
.score-btn.plus { background: var(--accent2); color: #fff; }
.score-actions { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }

/* ── 二维码 ── */
.qr-box {
    background: var(--panel); border-radius: 14px; padding: 12px;
    text-align: center; border: 1px solid var(--card);
}
.qr-label { font-size: 0.9rem; color: var(--accent); font-weight: 700; margin-bottom: 6px; }

/* ── 通用活动 ── */
.activity-title { font-size: 2.5rem; font-weight: 900; margin-bottom: 10px; color: var(--accent); text-align: center; }
.activity-desc { font-size: 1.15rem; color: var(--muted); margin-bottom: 16px; text-align: center; max-width: 750px; line-height: 1.6; }
.fullscreen-tip {
    position: fixed; bottom: 10px; right: 14px;
    background: rgba(0,0,0,0.6); padding: 5px 12px; border-radius: 8px;
    font-size: 0.75rem; color: var(--muted); z-index: 1000; pointer-events: none;
}

/* ── 游戏1: 转盘 + 断句 ── */
.game1-flex { display: flex; gap: 20px; width: 100%; align-items: flex-start; }
.wheel-section { display: flex; flex-direction: column; align-items: center; transition: none; }
.wheel-wrapper { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.wheel-pointer {
    position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 18px solid transparent; border-right: 18px solid transparent;
    border-top: 28px solid var(--danger);
    filter: drop-shadow(0 4px 10px rgba(239,68,68,0.7)); z-index: 10;
}
#wheelCanvas { border-radius: 50%; box-shadow: 0 0 40px rgba(245,158,11,0.15), 0 10px 40px rgba(0,0,0,0.4); display: block; }
.wheel-result { font-size: 2rem; font-weight: 900; margin-top: 8px; min-height: 44px; color: var(--accent); }
.group-selector { display: flex; gap: 12px; margin-bottom: 12px; }
.group-tab {
    padding: 8px 24px; border-radius: 12px; cursor: pointer; font-size: 1.1rem;
    font-weight: 700; background: var(--card); color: var(--text);
    border: 2px solid var(--muted); transition: all 0.3s;
}
.group-tab.active { background: var(--accent2) !important; color: #000 !important; border-color: var(--accent2) !important; box-shadow: 0 0 15px rgba(16,185,129,0.3); }
.question-panel {
    flex: 0 0 0%; min-width: 0; min-height: 0; overflow: hidden;
    background: var(--card); border-radius: 20px; padding: 0; opacity: 0;
    border: 2px solid var(--purple); box-shadow: 0 0 30px rgba(139,92,246,0.15);
    display: none; flex-direction: column;
}
.question-label { font-size: 0.85rem; color: var(--purple); font-weight: 700; letter-spacing: 2px; margin-bottom: 4px; }
.question-text {
    font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1.8;
    margin: 8px 0 14px 0; padding: 14px 18px; background: var(--bg);
    border-radius: 12px; border-left: 4px solid var(--purple);
    letter-spacing: 3px; transition: none;
}
.question-text.answer-shown { border-left-color: var(--accent2); color: var(--accent2); }
.question-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }

/* ── 游戏2: Emoji抢答 ── */
.emoji-puzzle { font-size: 5rem; letter-spacing: 12px; text-align: center; margin-bottom: 8px; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.emoji-hint { font-size: 1rem; color: var(--muted); margin-bottom: 12px; }
.buzzer-actions { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.btn-buzzer-open { font-size: 1.3rem; padding: 14px 40px; animation: glow-pulse 1.5s infinite; }
@keyframes glow-pulse { 0%,100% { box-shadow: 0 0 20px rgba(239,68,68,0.3); } 50% { box-shadow: 0 0 40px rgba(239,68,68,0.6); } }
.buzzer-status { font-size: 1.5rem; font-weight: 700; margin-top: 8px; min-height: 40px; }
.buzzer-status.open { color: var(--accent2); animation: pulse 0.8s infinite; }
.buzzer-status.pressed { color: var(--accent); }
.buzzer-status.answered { color: var(--muted); }
.buzzer-result { font-size: 1.3rem; margin-top: 6px; min-height: 32px; }
.buzzer-result .who { color: var(--accent); font-weight: 700; }
.buzzer-connection { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* ── 游戏3: 家乡话 ── */
.dialect-card { width: 100%; max-width: 600px; }
.dialect-phrase { font-size: 2.5rem; font-weight: 700; color: var(--accent); text-align: center; margin-bottom: 4px; letter-spacing: 4px; }
.dialect-region { font-size: 1rem; color: var(--muted); text-align: center; margin-bottom: 16px; }
.dialect-choices { display: flex; flex-direction: column; gap: 10px; }
.dialect-choice { padding: 14px 20px; background: var(--card); border: 2px solid var(--muted); border-radius: 12px; font-size: 1.3rem; cursor: pointer; text-align: center; transition: all 0.2s; }
.dialect-choice:hover { border-color: var(--accent); }
.dialect-choice.selected-correct { background: var(--accent2); color: #000; border-color: var(--accent2); }
.dialect-choice.selected-wrong { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ── 游戏4: 填字 ── */
.word-chain-starters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }
.starter-btn { padding: 6px 16px; background: var(--card); border: 2px solid var(--cyan); border-radius: 20px; color: var(--cyan); cursor: pointer; font-weight: 600; }
.starter-btn:hover { background: var(--cyan); color: #000; }
.word-chain-display { width: 100%; max-width: 650px; margin-bottom: 12px; }
.word-chain-text { font-size: 1.8rem; line-height: 2; padding: 16px; background: var(--bg); border-radius: 12px; border-left: 4px solid var(--cyan); min-height: 60px; }
.added-word { display: inline-block; background: rgba(6,182,212,0.2); padding: 2px 8px; border-radius: 6px; margin: 2px; color: var(--cyan); }

/* ── 游戏5: 绕口令 ── */
.twister-text { font-size: 2.2rem; font-weight: 700; text-align: center; line-height: 1.8; max-width: 750px; margin-bottom: 12px; }
.twister-progress { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; }
.twister-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 2px solid var(--muted); }
.twister-dot.done { background: var(--accent2); border-color: var(--accent2); }

/* ── 游戏6: 看字说颜色 ── */
.stroop-card { width: 100%; max-width: 550px; padding: 24px; border-radius: 20px; background: var(--bg); border: 3px solid var(--accent); text-align: center; }
.stroop-word { font-size: 5rem; font-weight: 900; margin-bottom: 20px; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.stroop-color-options { display: flex; gap: 12px; justify-content: center; }
.stroop-btn { width: 56px; height: 56px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: all 0.2s; }
.stroop-btn:hover { transform: scale(1.15); }
.stroop-btn:active { transform: scale(0.9); }
.stroop-btn.selected { border-color: #fff; box-shadow: 0 0 20px rgba(255,255,255,0.4); }
.stroop-score { font-size: 1.1rem; color: var(--muted); margin-top: 10px; }

.hidden { display: none !important; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── 侧栏动态面板 ── */
.sidebar-panel {
    background: var(--panel); border-radius: 14px; padding: 12px;
    border: 1px solid var(--card); display: none;
}
.sidebar-panel.visible { display: block; }
.panel-header { font-size: 0.95rem; color: var(--accent); font-weight: 700; margin-bottom: 6px; letter-spacing: 1px; }
.leaderboard { margin-top: 8px; border-top: 1px solid var(--card); padding-top: 8px; }
.lb-header { font-size: 0.85rem; color: var(--accent2); font-weight: 700; margin-bottom: 6px; }
.lb-list { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.lb-empty { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 10px; }
.lb-item {
    display: flex; align-items: center; gap: 6px; padding: 4px 8px;
    border-radius: 8px; font-size: 0.8rem; background: var(--card);
}
.lb-item .rank { font-weight: 700; min-width: 22px; text-align: center; font-size: 0.9rem; }
.lb-item .team { font-size: 0.85rem; }
.lb-item .nick { flex: 1; font-weight: 600; }
.lb-item .id { color: var(--muted); font-size: 0.75rem; }
.lb-item .time { font-family: monospace; font-size: 0.8rem; color: var(--accent); min-width: 45px; text-align: right; }
.lb-item .penalty { color: var(--danger); font-size: 0.75rem; font-weight: 600; }
.lb-item.first { background: rgba(245,158,11,0.15); border: 1px solid var(--accent); }
.lb-item.penalized { opacity: 0.6; }
