/* 海边日出蓝调时刻主题�?*/
:root {
    --blue-hour-dark: #1a2f4a;
    /* 深海�?- 黎明前的海面 */
    --blue-hour-medium: #2c4a6e;
    /* 海洋�?*/
    --blue-hour-light: #6b8caf;
    /* 钢青�?- 天空 */
    --blue-hour-sky: #87ceeb;
    /* 天蓝�?*/
    --sunrise-gold: #ffa500;
    /* 金橙�?- 日出光芒 */
    --sunrise-orange: #ff8c42;
    /* 柔和橙色 */
    --sunrise-warm: #ffb347;
    /* 暖橙�?*/
    --sunrise-light: #ffd89b;
    /* 浅金�?- 晨光 */
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-image: url(https://lettersfrommars.cn/GuessSongs/phone_bg.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
}

/* 电脑和平板横屏使用横版背�?*/
@media (min-width: 768px) and (orientation: landscape) {
    body {
        background-image: url(https://lettersfrommars.cn/GuessSongs/bgU.png);
    }
}

/* 平板竖屏也使用竖版背�?*/
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    body {
        background-image: url(https://lettersfrommars.cn/GuessSongs/phone_bg.png);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 40px;
    font-size: 1.2rem;
    color: white;
    font-weight: 500;
}

/* 欢迎界面 */
.welcome-screen,
.room-options,
.room-waiting {
    text-align: center;
}

.welcome-screen h2,
.room-options h2,
.room-waiting h2 {
    font-size: 2rem;
    margin-bottom: 40px;
    color: #333;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #555;
}

.input-group input {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1rem;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    background: rgba(255, 255, 255, 0.42);
}

.back-btn {
    background: #f1f1f1;
    color: #555;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.back-btn:hover {
    background: #e0e0e0;
}

/* 房间等待界面 */
.room-info {
    background: rgba(255, 255, 255, 0.42);
    ;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    display: inline-block;
    text-align: left;
}

.room-info p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.players-list {
    background: rgba(255, 255, 255, 0.42);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.players-list ul {
    list-style-type: none;
    max-width: 420px;
    margin: 0 auto;
    padding: 0;
}

.players-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.players-list .player-name {
    font-weight: 600;
}

.players-list .badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.players-list .badge.ready {
    background: #e6ffed;
    color: #1e7e34;
    border: 1px solid #b7f0c0;
}

.players-list .badge.not-ready {
    background: #fff8e1;
    color: #b26a00;
    border: 1px solid #ffe29a;
}

.start-btn {
    background: linear-gradient(135deg, #d4896b 0%, #b8876d 30%, #8b7a7a 60%, #5b7a9f 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.start-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 123, 167, 0.4);
}

.countdown {
    font-size: 3rem;
    font-weight: bold;
    color: #6b8caf;
    margin: 20px 0;
}

/* 游戏模式选择 */
.mode-selection {
    text-align: center;
}

.mode-selection h2 {
    font-size: 2rem;
    margin-bottom: 40px;
    color: #333;
}

.mode-buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.mode-btn {
    background: linear-gradient(176.4deg, #dd9347 0%, #ce8158 27%, #ceb5b5 84.2%, #6a809a 100%);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 30px 40px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(45, 90, 123, 0.3);
    min-width: 200px;
}

.mode-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(45, 90, 123, 0.4);
}

.mode-icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.mode-text {
    display: block;
}

/* 游戏界面 */
.game-interface {
    text-align: center;
}

.game-header {
    margin-bottom: 40px;
}

.game-header h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #333;
}

.progress {
    font-size: 1.2rem;
    color: #666;
    font-weight: 500;
}

.timer {
    font-size: 1.2rem;
    color: #e74c3c;
    font-weight: 600;
    margin-top: 10px;
}

.players-status {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

#playersStatus {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 14px;
    justify-content: center;
    align-items: start;
    margin-top: 15px;
}

.player-status-item {
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.player-status-item.correct {
    border: 2px solid #28a745;
}

.player-status-item.incorrect {
    border: 2px solid #dc3545;
}

.player-status-item.pending {
    border: 2px solid #6b8caf;
}

.player-status-item.answered {
    border: 2px solid #ffc107;
    background: #fff3cd;
    color: #856404;
}

.player-status-item .player-name {
    font-weight: 600;
}

.player-status-item .player-score {
    font-size: 0.9rem;
    opacity: 0.8;
}

.player-status-item .status-icon {
    font-size: 1.2rem;
}

.player-status-item .ps-row1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.player-status-item .ps-row2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
    opacity: .95;
    font-size: .95em;
}

.question-area {
    margin-bottom: 40px;
}

.lyrics-display,
.song-display {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.lyrics-display h3,
.song-display h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

.lyrics-text {
    font-size: 2.7rem;
    line-height: 1.8;
    color: #555;
    font-style: italic;
    background: white;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #6b8caf;
    white-space: pre-line;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.audio-player {
    margin: 20px 0;
}

.audio-player audio {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    background: linear-gradient(176.4deg, #dd9347 0%, #ce8158 27%, #ceb5b5 84.2%, #6a809a 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
    outline: none;
}

/* 自定义 audio 控件样式 - WebKit (Chrome, Safari, Edge) */
.audio-player audio::-webkit-media-controls-panel {
    background: linear-gradient(176.4deg, #dd9347 0%, #ce8158 27%, #ceb5b5 84.2%, #6a809a 100%);
    border: none;
}

.audio-player audio::-webkit-media-controls-enclosure {
    background: linear-gradient(176.4deg, #dd9347 0%, #ce8158 27%, #ceb5b5 84.2%, #6a809a 100%);
    border: none;
    border-radius: 10px;
    overflow: hidden;
}

.audio-player audio::-webkit-media-controls-current-time-display,
.audio-player audio::-webkit-media-controls-time-remaining-display {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.audio-player audio::-webkit-media-controls-timeline {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    margin: 0 10px;
}

.audio-player audio::-webkit-media-controls-timeline::-webkit-slider-thumb {
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 自定义 audio 控件样式 - Firefox */
.audio-player audio::-moz-range-track {
    background: linear-gradient(176.4deg, #dd9347 0%, #ce8158 27%, #ceb5b5 84.2%, #6a809a 100%);
    border-radius: 25px;
}

.audio-player audio::-moz-range-thumb {
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.audio-player audio::-moz-range-progress {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 25px;
}

/* 选项区域 */
.options-area {
    margin-bottom: 40px;
}

/* 让主体区域为底部导航留出安全间距 */
.main {
    background: rgba(255, 255, 255, 0.42);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding-bottom: 100px;
    /* 为底部导航预留空�?*/
}

/* 底部导航的安全区域处理（适配 iOS 安全区） */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(220, 230, 240, 0.9);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 0, 0, .06);
    z-index: 999;
}

/* 选项宫格在小屏时更紧凑，避免需要下拉才能看到所有选项 */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-width: 842px;
    margin: 0 auto;
}

.option-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.option-btn:hover {
    border-color: #6b8caf;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.option-btn.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.option-btn.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.option-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 答案反馈 */
.answer-feedback {
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.answer-feedback.correct {
    background: #d4edda;
    color: #155724;
}

.answer-feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
}

/* 游戏控制按钮 */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.next-btn,
.restart-btn {
    background: linear-gradient(176.4deg, #dd9347 0%, #ce8158 27%, #ceb5b5 84.2%, #6a809a 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

/* 结果界面 */
.result-interface {
    text-align: center;
}

.result-interface h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
}

.result-summary {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-summary p {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #555;
}

.result-summary span {
    font-weight: 700;
    color: #6b8caf;
}

.ranking {
    margin-bottom: 40px;
}

.ranking table {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ranking th,
.ranking td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ranking th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.ranking tr:first-child td {
    background-color: #fff3cd;
    font-weight: bold;
}

.result-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.result-btn {
    background: linear-gradient(135deg, #d4896b 0%, #b8876d 30%, #8b7a7a 60%, #5b7a9f 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

/* 响应式设�?*/
@media (max-width: 768px) {
    .container {
        padding: 8px;
    }

    .header {
        padding: 12px 10px;
        margin-bottom: 10px;
    }

    .title {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }

    .score-board {
        gap: 8px;
        font-size: 0.9rem;
    }

    .main {
        padding: 12px;
        padding-bottom: 88px;
    }

    /* 游戏头部更紧凑：标题、进度、计时同一�?*/
    .game-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .game-header .header-back {
        order: 0;
    }

    .game-header h2 {
        order: 1;
        flex: 1;
        text-align: center;
        margin: 0;
    }

    .game-header .progress {
        order: 2;
    }

    .game-header .timer {
        order: 3;
    }

    @media (max-width: 768px) {
        .game-header {
            gap: 6px;
        }

        .game-header h2 {
            font-size: 1.1rem;
        }

        .game-header .header-back {
            padding: 6px 10px;
        }
    }

    /* 玩家状态更紧凑，隐藏标�?*/
    .players-status {
        padding: 10px;
        margin-bottom: 10px;
    }

    .players-status h3 {
        display: none;
    }

    #playersStatus {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        gap: 8px;
    }

    .player-status-item {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    /* 题面与歌词更紧凑 */
    .lyrics-display,
    .song-display {
        padding: 12px;
        margin-bottom: 10px;
    }

    .lyrics-display h3,
    .song-display h3 {
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .lyrics-text {
        font-size: 1.27rem;
        line-height: 1.4;
        padding: 12px;
    }

    /* 把选项固定为两列更宽松，避免四人时挤压到需要下�?*/
    .options-area {
        margin-bottom: 10px;
    }

    .options-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 10px;
    }

    .option-btn {
        padding: 12px;
        font-size: 0.98rem;
    }

    /* 结果区更紧凑 */
    .result-interface h2 {
        font-size: 1.4rem;
    }

    .result-summary {
        padding: 12px;
        margin-bottom: 12px;
    }

    .result-summary p {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .ranking table {
        max-width: 100%;
        font-size: 0.85rem;
    }

    .ranking th,
    .ranking td {
        padding: 8px;
    }

    .start-btn,
    .result-btn,
    .back-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        margin-top: 10px;
    }

    /* 大倒计时缩�?*/
    .countdown {
        font-size: 2rem;
        margin: 8px 0;
    }
}

@media (max-width: 360px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

/* 多人游戏相关样式 */
.input-group select {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1rem;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    background: rgba(255, 255, 255, 0.42);
}

.timer {
    font-size: 2rem;
    font-weight: bold;
    color: #e74c3c;
    margin: 10px 0;
    padding: 10px 20px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 10px;
    display: inline-block;
}

.timer.warning {
    color: #f39c12;
    animation: pulse 1s infinite;
}

.timer.danger {
    color: #e74c3c;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.players-status {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.players-status h3 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

#playersStatus {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 14px;
    justify-content: center;
    align-items: start;
    margin-top: 15px;
}

.player-status-item {
    background: white;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 1rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    display: block;
    min-width: 0;
    transition: all 0.3s ease;
    text-align: center;
}

.player-status-item .ps-row1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.player-status-item .ps-row2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
    opacity: .95;
    font-size: .95em;
}

@media (max-width: 768px) {
    #playersStatus {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 10px;
    }

    .player-status-item {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
}

.player-status-item.correct {
    border: 2px solid #28a745;
    background: #d4edda;
    color: #155724;
}

.player-status-item.incorrect {
    border: 2px solid #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.player-status-item.pending {
    border: 2px solid #6b8caf;
    background: #e3f2fd;
    color: #1976d2;
}

.player-status-item.answered {
    border: 2px solid #ffc107;
    background: #fff3cd;
    color: #856404;
}

.player-status-item .player-name {
    font-weight: 600;
}

.player-status-item .player-score {
    font-size: 0.9rem;
    opacity: 0.8;
}

.player-status-item .status-icon {
    font-size: 1.2rem;
}

.ranking {
    margin-bottom: 40px;
}

.ranking h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.ranking table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ranking th,
.ranking td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ranking th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.ranking tr:first-child td {
    background-color: #fff3cd;
    font-weight: bold;
}

.ranking tr:nth-child(2) td {
    background-color: #f8f9fa;
}

.ranking tr:nth-child(3) td {
    background-color: #fff8e1;
}

.ranking .rank-1 {
    color: #ffd700;
    font-weight: bold;
}

.ranking .rank-2 {
    color: #c0c0c0;
    font-weight: bold;
}

.ranking .rank-3 {
    color: #cd7f32;
    font-weight: bold;
}

/* 倒计时动�?*/
.countdown {
    font-size: 4rem;
    font-weight: bold;
    color: #6b8caf;
    margin: 20px 0;
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* 玩家加入动画 */
.player-joined {
    animation: playerJoined 0.5s ease-out;
}

@keyframes playerJoined {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 答题反馈动画 */
.answer-feedback {
    animation: answerFeedback 0.3s ease-out;
}

@keyframes answerFeedback {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-interface,
.result-interface,
.room-waiting {
    animation: fadeIn 0.5s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #6b8caf;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.room-waiting .actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 结果统计�?居中 */
#resultTimes {
    display: flex;
    justify-content: center;
}

#resultTimes .time-stats {
    text-align: center;
}

#resultTimes table {
    margin: 0 auto;
}

#resultTimes .total-time {
    text-align: center;
    margin-top: 10px;
}

/* 头像圆环效果 */
.avatar-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    vertical-align: middle;
    background: transparent;
    display: inline-block;
}

.avatar-icon.ring-green {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, .25);
}

.avatar-icon.ring-gold {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, .28);
}

.game-header {
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .game-header {
        margin-bottom: 8px;
    }

    .question-area {
        margin-bottom: 8px;
    }

    .lyrics-display,
    .song-display {
        padding: 10px;
        margin-bottom: 8px;
    }

    .options-area {
        margin-top: 6px;
    }
}

/* 你画我猜布局 */
.pictionary-wrap {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.pictionary-left {
    flex: 1 1 auto;
    min-width: 0;
}

.pictionary-right {
    width: 340px;
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pictionary-canvas-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .1);
    padding: 12px;
}

#pictionaryCanvas {
    width: 100%;
    height: auto;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    touch-action: none;
}

.pictionary-toolbar {
    background: rgba(255, 255, 255, .9);
    border-radius: 12px;
    padding: 10px;
    margin-top: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
}

.pictionary-toolbar .tool-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pictionary-toolbar .colors {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pictionary-toolbar .colors .color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.pictionary-toolbar .colors .color-dot.active {
    outline: 3px solid rgba(102, 126, 234, .35);
}

.pictionary-toolbar .divider {
    width: 1px;
    height: 22px;
    background: #e5e7eb;
    margin: 0 4px;
}

.pictionary-toolbar .tool-group {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #555;
}

.pictionary-toolbar .tool-btn {
    background: #6b8caf;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

.pictionary-toolbar .tool-btn:hover {
    box-shadow: 0 8px 20px rgba(102, 126, 234, .3);
    transform: translateY(-1px);
}

.pictionary-controls,
.pictionary-guess {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .06);
}

.pictionary-controls .keyword-row,
.pictionary-guess .guess-row {
    display: flex;
    gap: 8px;
}

.pictionary-controls input[type="text"],
.pictionary-guess input[type="text"],
.pictionary-controls input[type="number"],
.pictionary-right select {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    flex: 1;
}

.pictionary-players {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.pictionary-player {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pictionary-player .name {
    font-weight: 600;
}

.pictionary-player .score {
    font-size: .95rem;
    opacity: .9;
}

.pict-ring {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
}

.pict-name.vip {
    color: #f59e0b;
}

.pict-name.correct {
    color: #10b981;
}

@media (max-width: 1024px) {
    .pictionary-right {
        width: 100%;
        flex: 1 1 auto;
    }

    .pictionary-wrap {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    #pictionaryCanvas {
        height: 300px;
    }

    .pictionary-players {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

.fs-on .pictionary-canvas-wrap,
.fs-on #cv {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    aspect-ratio: unset !important;
}

/* 移动端语音控制面板优�?*/
@media (max-width: 768px) {

    #voiceControls,
    #voiceControlsGame,
    #voiceControlsFloating {
        position: fixed !important;
        top: 10px !important;
        left: calc(100vw - 110px) !important;
        width: 100px !important;
        height: 100px !important;
        padding: 8px !important;
        border-radius: 8px !important;
        z-index: 1000 !important;
        touch-action: none !important;
    }

    #voiceControls h4,
    #voiceControlsGame h4,
    #voiceControlsFloating h4 {
        font-size: 12px !important;
        margin: 0 0 8px 0 !important;
    }

    #voiceControls button,
    #voiceControlsGame button,
    #voiceControlsFloating button {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
        margin: 2px !important;
    }

    #voiceStatus {
        font-size: 10px !important;
        margin-top: 4px !important;
    }


}

/* 语音控制面板基础样式 */
#voiceControls,
#voiceControlsGame,
#voiceControlsFloating {
    touch-action: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    cursor: move !important;
}

/* 分享弹窗样式 */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.share-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-card h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.share-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.share-qr-section {
    text-align: center;
}

.qr-code {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 10px;
    min-height: 180px;
}

.qr-code canvas {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

.qr-tip {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.share-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.share-btn.wechat {
    background: #07c160;
    color: white;
}

.share-btn.moments {
    background: #1aad19;
    color: white;
}

.share-btn.copy {
    background: #6b8caf;
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.share-icon {
    font-size: 1.5rem;
}

.share-link {
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-link input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #f8f9fa;
}

.copy-btn {
    padding: 12px 16px;
    background: #6b8caf;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #5a6fd8;
}

.actions {
    margin-top: 20px;
    text-align: center;
}

.back-btn {
    background: #f1f1f1;
    color: #555;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #e0e0e0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .share-card {
        padding: 20px;
        margin: 20px;
    }

    .share-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .share-btn {
        padding: 12px;
        flex-direction: row;
        justify-content: center;
    }

    .share-link {
        flex-direction: column;
        gap: 8px;
    }

    .copy-btn {
        width: 100%;
    }
}

/* 个人中心页面样式 */
.profile-detail-view {
    background: transparent !important;
    padding: 0 !important;
}

.detail-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.detail-header h2 {
    color: white;
    margin: 0;
    flex: 1;
    text-align: center;
}

.header-back {
    margin: 0 !important;
}

.profile-form {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.avatar-section {
    text-align: center;
    margin-bottom: 30px;
}

.avatar-box {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.avatar-box img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.avatar-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #6b8caf;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-overlay:hover {
    background: #5a6fd8;
    transform: scale(1.1);
}

.avatar-upload-btn {
    color: white;
    font-size: 18px;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.profile-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 4px solid #6b8caf;
}

.profile-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

.profile-section .input-group {
    margin-bottom: 15px;
}

.profile-section .input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
    font-weight: 500;
}

.profile-section .input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: rgba(255, 255, 255, 0.42);
}

.profile-section .input-group input:focus {
    outline: none;
    border-color: #6b8caf;
}

/* 头像上传样式 */
.avatar-upload-section {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.avatar-preview {
    position: relative;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.3s ease;
}

.avatar-preview:hover {
    transform: scale(1.05);
}

.avatar-preview img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.avatar-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.avatar-preview:hover .avatar-upload-overlay {
    opacity: 1;
}

.avatar-upload-overlay span {
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* 头像上传模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.close {
    font-size: 24px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.upload-area {
    text-align: center;
    padding: 40px 20px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #6b8caf;
    background: #f0f4ff;
}

.upload-placeholder {
    cursor: pointer;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #999;
}

.upload-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.upload-hint {
    font-size: 14px;
    color: #666;
}

.upload-preview {
    text-align: center;
}

.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.upload-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.upload-actions .back-btn,
.upload-actions .start-btn {
    min-width: 100px;
    height: 40px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .avatar-preview img {
        width: 80px;
        height: 80px;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .upload-area {
        padding: 30px 15px;
    }

    .upload-icon {
        font-size: 36px;
    }

    .upload-text {
        font-size: 16px;
    }

    .upload-hint {
        font-size: 12px;
    }

    .upload-preview img {
        max-height: 200px;
    }

    .upload-actions {
        flex-direction: column;
        gap: 8px;
    }

    .upload-actions .back-btn,
    .upload-actions .start-btn {
        width: 100%;
        height: 44px;
    }
}

.profile-section .input-group input[readonly] {
    background: rgba(255, 255, 255, 0.42);
    color: #666;
}

.change-btn {
    background: #6b8caf;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.change-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.profile-actions {
    text-align: center;
    margin-top: 30px;
}

.profile-actions .back-btn,
.profile-actions .start-btn {
    margin: 0 10px;
    padding: 12px 30px;
    font-size: 1rem;
}

/* 换绑邮箱弹窗样式 */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.auth-card h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 1.3rem;
}

.code-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.code-input-group input {
    flex: 1;
}

.send-code-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.send-code-btn:hover {
    background: #218838;
}

.send-code-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .profile-form {
        margin: 20px;
        padding: 20px;
    }

    .profile-section {
        padding: 15px;
    }

    .avatar-box img {
        width: 100px;
        height: 100px;
    }

    .avatar-overlay {
        width: 32px;
        height: 32px;
    }

    .auth-card {
        margin: 20px;
        padding: 20px;
    }

    .code-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .send-code-btn {
        width: 100%;
    }
}