﻿/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #333;
}

.screen {
    display: none;
    min-height: 100vh;
    width: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ==================== 开始界面 ==================== */
.start-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 40px 30px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.logo-emoji {
    font-size: 64px;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

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

.game-title {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.game-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 30px;
}

.player-select h3,
.mode-select h3 {
    font-size: 16px;
    color: #555;
    margin-bottom: 12px;
    text-align: left;
}

.player-count-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.count-btn {
    width: 60px;
    height: 44px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.count-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.count-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-color: transparent;
    transform: scale(1.05);
}

.player-names {
    margin-bottom: 20px;
}

.player-name-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.player-name-input label {
    font-size: 14px;
    color: #666;
    min-width: 50px;
    text-align: left;
}

.player-name-input input {
    flex: 1;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.player-name-input input:focus {
    border-color: #667eea;
}

.mode-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 25px;
}

.mode-btn {
    padding: 10px 24px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-color: transparent;
}

.start-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 26px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.start-btn:active {
    transform: translateY(0);
}

.start-btn.secondary {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: none;
    margin-top: 12px;
}

.start-btn:disabled,
.start-btn.disabled {
    opacity: 0.55;
    transform: none !important;
    cursor: not-allowed;
    box-shadow: none;
}

.rules-toggle {
    margin-top: 20px;
    padding: 12px;
    cursor: pointer;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    border: 1px dashed #667eea;
    border-radius: 10px;
    transition: all 0.2s;
}

.rules-toggle:hover {
    background: rgba(102, 126, 234, 0.05);
}

.rules-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.rules-panel.open {
    max-height: 500px;
    margin-top: 15px;
}

.rules-content {
    text-align: left;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.8;
    color: #555;
}

.rules-content h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.rules-content ol,
.rules-content ul {
    padding-left: 20px;
}

/* ==================== 游戏界面 ==================== */
#gameScreen {
    justify-content: flex-start;
    padding: 15px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 480px;
    padding: 10px 5px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-badge {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.score-display {
    color: #ffd700;
    font-size: 18px;
    font-weight: 800;
}

.level-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-badge {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.round-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

/* 圆形进度条 */
.timer-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 10px auto;
}

.timer-svg {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 6;
}

.timer-progress {
    fill: none;
    stroke: #4ade80;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear, stroke 0.3s;
}

.timer-progress.warning {
    stroke: #f59e0b;
}

.timer-progress.danger {
    stroke: #ef4444;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-number {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.timer-unit {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* 水果展示 */
.fruit-display {
    text-align: center;
    margin: 10px 0;
}

.fruit-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 15px;
    display: inline-block;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fruit-card img {
    width: min(88vw, 420px);
    max-height: 340px;
    object-fit: contain;
    border-radius: 8px;
}

.fruit-name {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin-top: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 绕口令区域 */
.tongue-twister-area {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 15px 20px;
    margin: 10px 0;
    max-width: 480px;
    width: 100%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.twister-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-bottom: 6px;
}

.twister-text {
    color: #ffd700;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* 语音识别显示 */
.speech-display {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 12px;
    padding: 10px 15px;
    margin: 10px 0;
    max-width: 480px;
    width: 100%;
    min-height: 50px;
}

.speech-label {
    color: #4ade80;
    font-size: 12px;
    margin-bottom: 4px;
}

.speech-text {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    word-break: break-all;
}

/* 连击显示 */
.combo-display {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 100;
}

.combo-text {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5);
    animation: comboPulse 0.5s ease;
}

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

/* 控制按钮 */
.controls {
    margin: 15px 0;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.action-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.start-read-btn {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #fff;
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
}

.start-read-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.6);
}

.confirm-btn {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: #fff;
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.4);
    animation: pulse 1.5s infinite;
}

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

/* 红色警告遮罩 */
.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(239, 68, 68, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: errorFlash 0.5s ease;
}

.error-overlay.show {
    display: flex;
}

@keyframes errorFlash {
    0% { opacity: 0; }
    30% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

.error-content {
    text-align: center;
    color: #fff;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 10px;
}

.error-text {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 5px;
}

.error-sub {
    font-size: 20px;
    font-weight: 600;
    opacity: 0.9;
}

/* 正确反馈遮罩 */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(74, 222, 128, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: successFlash 0.6s ease;
}

.success-overlay.show {
    display: flex;
}

@keyframes successFlash {
    0% { opacity: 0; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0; transform: scale(1); }
}

.success-content {
    text-align: center;
    color: #fff;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 10px;
}

.success-text {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 5px;
}

.success-sub {
    font-size: 20px;
    font-weight: 600;
    opacity: 0.9;
}

/* ==================== 关卡过渡界面 ==================== */
.level-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 40px 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.level-emoji {
    font-size: 72px;
    margin-bottom: 15px;
    animation: bounce 1s ease infinite;
}

.level-container h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.level-container p {
    color: #666;
    font-size: 15px;
    margin-bottom: 20px;
}

.level-scores {
    margin-bottom: 25px;
}

.level-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9ff;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.level-score-item .name {
    font-weight: 600;
    color: #333;
}

.level-score-item .score {
    font-weight: 800;
    color: #667eea;
}

/* ==================== 结果界面 ==================== */
.result-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 40px 30px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.result-emoji {
    font-size: 72px;
    margin-bottom: 10px;
}

.result-container h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
}

.result-ranking {
    margin-bottom: 20px;
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.rank-item.first {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
}

.rank-item.second {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border: 2px solid #9ca3af;
}

.rank-item.third {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    border: 2px solid #f97316;
}

.rank-item.other {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.rank-medal {
    font-size: 24px;
    margin-right: 12px;
    min-width: 30px;
}

.rank-name {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    text-align: left;
}

.rank-score {
    font-size: 20px;
    font-weight: 800;
    color: #667eea;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 12px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #667eea;
}

.stat-label {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.result-btns {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ==================== 响应式 ==================== */
@media (max-width: 480px) {
    .start-container,
    .level-container,
    .result-container {
        padding: 30px 20px;
    }

    .game-title {
        font-size: 30px;
    }

    .twister-text {
        font-size: 17px;
    }

    .fruit-card img {
        width: 88vw;
        max-height: 240px;
    }
}

/* ==================== 动画 ==================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s ease;
}

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

.slide-up {
    animation: slideUp 0.4s ease;
}

/* 麦克风动画 */
.mic-active {
    animation: micPulse 1s infinite;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
}
/* ==================== 准备遮罩 ==================== */
.ready-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 26, 46, 0.97);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.ready-overlay.show {
    display: flex;
}

.ready-content {
    text-align: center;
    color: #fff;
    padding: 30px;
}

.ready-emoji {
    font-size: 72px;
    margin-bottom: 15px;
    animation: bounce 1.5s infinite;
}

.ready-content h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #ffd700;
}

.ready-content p {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 8px;
}

.ready-tip {
    font-size: 13px !important;
    color: rgba(255,255,255,0.5) !important;
    margin-bottom: 25px !important;
}

.ready-content .start-btn {
    max-width: 260px;
}

/* 隐藏答案样式 */
.hidden-answer {
    color: rgba(255, 255, 255, 0.35) !important;
    letter-spacing: 4px;
}

.hidden-answer.revealed {
    color: #f87171 !important;
    letter-spacing: 1px;
    animation: revealFlash 0.4s ease;
}

@keyframes revealFlash {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
/* 回首页按钮 */
.home-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.home-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}
/* 每题限时选择 */
.time-select h3 {
    font-size: 16px;
    color: #555;
    margin-bottom: 12px;
    text-align: left;
}

.time-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 22px;
}

.time-btn {
    flex: 1;
    max-width: 100px;
    height: 44px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.time-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.time-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-color: transparent;
    transform: scale(1.05);
}

/* 准备遮罩中的示例图 */
.ready-content {
    max-height: 92vh;
    overflow-y: auto;
}

.ready-example {
    margin: 15px 0;
}

.ready-example img {
    width: min(88vw, 480px);
    max-height: 38vh;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: #fff;
}

.ready-example-cap {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 8px;
}
/* 璇婚敊瀵圭収锛?0绉掑€掕鏃?+ 涓嬩竴棰樻寜閽?*/
.wrong-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.wrong-countdown {
    color: #f87171;
    font-size: 15px;
    font-weight: 600;
}

.wrong-countdown #wrongCountdownNum {
    font-size: 20px;
    font-weight: 700;
}

.skip-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 26px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.skip-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.45);
}

/* ==================== 模式切换（单机/联机） ==================== */
.mode-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
    background: #f1f3fb;
    border-radius: 14px;
    padding: 5px;
}

.mode-switch-btn {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-switch-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

/* ==================== 联机选项 ==================== */
.online-join-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.online-join-row input {
    flex: 1;
    height: 44px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 4px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.online-join-row input:focus {
    border-color: #667eea;
}

.join-btn {
    height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.join-btn:active {
    transform: scale(0.96);
}

.online-tip {
    font-size: 12px;
    color: #999;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* ==================== 联机大厅 ==================== */
.lobby-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 36px 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lobby-emoji {
    font-size: 56px;
    margin-bottom: 8px;
    animation: bounce 2s infinite;
}

.lobby-container h2 {
    font-size: 26px;
    color: #333;
    margin-bottom: 18px;
}

.room-code-box {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 18px;
    color: #fff;
}

.room-code-label {
    font-size: 13px;
    opacity: 0.85;
}

.room-code {
    font-size: 44px;
    font-weight: 900;
    letter-spacing: 10px;
    line-height: 1.3;
    text-indent: 10px;
}

.room-code-tip {
    font-size: 12px;
    opacity: 0.8;
}

.lobby-players {
    margin-bottom: 18px;
}

.lobby-player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9ff;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.lobby-player-item .name {
    font-weight: 600;
    color: #333;
}

.lobby-player-item .tag {
    font-size: 12px;
    color: #667eea;
    font-weight: 700;
}

.lobby-wait {
    color: #888;
    font-size: 14px;
    padding: 12px 0;
    animation: pulse 1.5s infinite;
}

/* ==================== 联机玩家状态栏（游戏中） ==================== */
.online-players-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 480px;
    padding: 6px 0;
}

.op-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 4px 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.3s;
}

.op-chip.me {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.12);
}

.op-chip .op-status {
    font-size: 13px;
}

.op-chip.done-correct {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
}

.op-chip.done-wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* ==================== 手机竖屏优化 ==================== */
body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    -webkit-tap-highlight-color: transparent;
}

button {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

/* 小屏手机：压缩纵向布局，保证一屏内展示完整题目界面 */
@media (max-width: 480px) {
    #gameScreen {
        padding: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .timer-container,
    .timer-svg {
        width: 88px;
        height: 88px;
    }

    .timer-container {
        margin: 4px auto;
    }

    .timer-number {
        font-size: 26px;
    }

    .fruit-display {
        margin: 6px 0;
    }

    .fruit-card {
        padding: 8px;
    }

    .fruit-card img {
        max-height: 32vh;
    }

    .tongue-twister-area {
        padding: 10px 14px;
        margin: 6px 0;
    }

    .speech-display {
        padding: 8px 12px;
        margin: 6px 0;
        min-height: 44px;
    }

    .start-container {
        width: 94%;
    }

    .room-code {
        font-size: 38px;
    }
}

/* 矮屏手机（高度有限）：进一步压缩 */
@media (max-height: 700px) and (max-width: 480px) {
    .timer-container,
    .timer-svg {
        width: 68px;
        height: 68px;
    }

    .timer-number {
        font-size: 22px;
    }

    .fruit-card img {
        max-height: 28vh;
    }

    .twister-text {
        font-size: 15px;
    }

    .speech-display {
        min-height: 38px;
    }
}