/* ==========================================
   游戏界面UI样式
   ========================================== */

/* 时间模式分数显示 */
.time-score-display {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffdd00;
    font-size: 42px;
    font-weight: bold;
    padding: 10px 25px;
    border-radius: 20px;
    z-index: 1010;
    text-shadow: 0 0 8px rgba(255, 221, 0, 0.8);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.time-score-display span {
    min-width: 80px;
    text-align: center;
}

/* 分数更新动画 */
@keyframes scoreUpdated {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
    100% { transform: translateX(-50%) scale(1); }
}

.time-score-display.score-updated {
    animation: scoreUpdated 0.4s ease-out;
}

/* 浮动分数动画 */
@keyframes floatUp {
    0% { 
        opacity: 0;
        transform: translateY(10px) scale(0.8);
    }
    20% { 
        opacity: 1;
        transform: translateY(0) scale(1.2);
    }
    80% { 
        opacity: 1;
        transform: translateY(-40px) scale(1);
    }
    100% { 
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

/* 浮动分数样式 */
.floating-points {
    position: absolute;
    left: 50%;
    top: -20px;
    transform: translateX(-50%);
    font-size: 28px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    animation: floatUp 1.5s ease-out forwards;
    z-index: 1020;
}

/* 得分显示 - 绿色 */
.floating-points.gain {
    color: #4eff4e;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

/* 失分显示 - 红色 */
.floating-points.loss {
    color: #ff4e4e;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

/* Combo文本样式 */
.combo-text {
    font-size: 22px;
    color: #ffdd00;
    text-shadow: 0 0 8px rgba(255, 221, 0, 0.8);
    margin-left: 8px;
    font-style: italic;
    display: block;
    margin-top: 5px;
}

/* 无限生命图标样式 */
.time-life-icon.infinite {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #32CD32;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 0 10px #32CD32, 0 0 20px #32CD32;
    width: 70px;
}

/* 主操作按钮垂直排列容器 */
.main-actions-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    order: 2;
    margin-top: 30px;
    margin-bottom: 30px;
}

/* 顶部操作按钮组 (开始按钮 + 教程按钮) */
.top-actions-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* 词库管理按钮样式 */
.dictionary-manager-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 150px;
}

.dictionary-manager-button:hover {
    background: #5a6268;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(108, 117, 125, 0.4);
}

/* 错字本按钮样式 */
.wrong-char-log-btn {
    background: #ff6347;
}

.wrong-char-log-btn:hover {
    background: #e55337;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 99, 71, 0.5);
}

/* 首页排行榜按钮样式 */
.menu-leaderboard-btn {
    background: #285ad9;
}

.menu-leaderboard-btn:hover {
    background: #2138ab;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(76, 43, 226, 0.5);
}

/* 教程按钮容器 */
.tutorial-container {
    display: inline-block;
    position: absolute;
    margin-bottom: 730px;
    margin-left: 300px;
}

/* settings 图标样式 */
.settings-icon {
    width: 50px; 
    height: 50px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, opacity 0.2s;
    opacity: 0.8;
    position: absolute;
    bottom: 595px;
    right: 120px;  
}

.settings-icon:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* 游戏界面移动端优化 */
.time-ui-container {
    padding: 10px;
    flex-direction: column;
    gap: 10px;
}

.time-status-bar {
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.time-lives-container,
.time-score-container {
    justify-content: center;
    margin: 5px 0;
}

/* 时间模式相关样式已移动到time-mode.css */

/* 排行榜界面样式 */
.leaderboard-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2600; /* 排行榜界面层级，高于游戏结束界面 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.leaderboard-screen.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.leaderboard-content {
    background: linear-gradient(to bottom, rgba(25, 45, 25, 0.98), rgba(10, 30, 10, 0.98));
    border-radius: 15px;
    padding: 30px 40px;
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5), 0 0 80px rgba(51, 180, 51, 0.2);
    border: 1px solid rgba(51, 204, 51, 0.4);
    display: flex;
    flex-direction: column;
    color: #e0e0e0;
}

/* 排行榜选项卡容器 */
.leaderboard-tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(51, 204, 51, 0.2);
}

/* 排行榜选项卡按钮 */
.leaderboard-tab {
    flex-grow: 1;
    padding: 12px 10px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(238, 238, 238, 0.7);
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
    margin-bottom: -2px;
}

.leaderboard-tab:hover {
    color: #eeffee;
    background-color: rgba(51, 204, 51, 0.1);
}

.leaderboard-tab.active {
    color: #eeffee;
    font-weight: 600;
    border-bottom: 3px solid #33cc33;
    background-color: rgba(51, 204, 51, 0.05);
}

#leaderboardTitle {
    color: #eeffee;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(51, 204, 51, 0.3);
    text-shadow: 0 0 8px rgba(51, 204, 51, 0.3);
}

.leaderboard-score-list {
    list-style-type: none;
    padding: 0;
    margin: 0 0 25px 0;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(51, 204, 51, 0.4) rgba(0,0,0,0.2);
}

.leaderboard-score-list::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-score-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

.leaderboard-score-list::-webkit-scrollbar-thumb {
    background: rgba(51, 204, 51, 0.4);
    border-radius: 4px;
}

.leaderboard-score-list::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 204, 51, 0.6);
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 17px;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

.leaderboard-rank {
    flex-basis: 10%;
    font-weight: bold;
    color: #a0a0a0;
}

.leaderboard-name {
    flex-grow: 1;
    text-align: left;
    padding-left: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-score {
    flex-basis: 20%;
    text-align: right;
    font-weight: bold;
    color: #ffdd00;
}

.leaderboard-no-scores {
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
}

.leaderboard-close-btn {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    align-self: center;
    min-width: 150px;
    box-shadow: 0 0 10px rgba(108, 117, 125, 0.4);
}

.leaderboard-close-btn:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(108, 117, 125, 0.6);
}

/* 错字本界面样式 */
.wrong-char-log-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2600;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.wrong-char-log-screen.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.wrong-char-log-content {
    background: linear-gradient(to bottom, rgba(30, 55, 30, 0.98), rgba(15, 35, 15, 0.98));
    border-radius: 15px;
    padding: 30px 35px;
    width: 90%;
    max-width: 600px; 
    max-height: 85vh;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6), 0 0 90px rgba(71, 180, 51, 0.25);
    border: 1px solid rgba(61, 204, 51, 0.45);
    display: flex;
    flex-direction: column;
    color: #e8e8e8;
}

#wrongCharLogTitle {
    color: #f0f0f0;
    font-size: 26px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(61, 204, 51, 0.35);
    text-shadow: 0 0 7px rgba(61, 204, 51, 0.3);
}

.wrong-char-list-container {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(61, 204, 51, 0.5) rgba(0,0,0,0.25);
}

.wrong-char-list-container::-webkit-scrollbar {
    width: 8px;
}

.wrong-char-list-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.25);
    border-radius: 4px;
}

.wrong-char-list-container::-webkit-scrollbar-thumb {
    background: rgba(61, 204, 51, 0.5);
    border-radius: 4px;
}

.wrong-char-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(61, 204, 51, 0.7);
}

.wrong-char-log-empty-msg {
    text-align: center;
    padding: 50px 20px;
    font-style: italic;
    color: rgba(255,255,255,0.6);
    font-size: 18px;
}

.wrong-char-items-ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.wrong-char-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 18px;
    transition: background-color 0.2s ease;
}

.wrong-char-item:last-child {
    border-bottom: none;
}

.wrong-char-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.wrong-char-item-text {
    flex-grow: 1;
    color: #f0f0f0;
}

.wrong-char-item-remove-btn {
    background: transparent;
    color: #ff8a80;
    border: 1px solid #ff8a80;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.wrong-char-item-remove-btn:hover {
    background: #ff8a80;
    color: white;
}

.wrong-char-item-search-btn {
    background: transparent;
    color: #81c784;
    border: 1px solid #81c784;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.wrong-char-item-search-btn:hover {
    background: #81c784;
    color: white;
}

.wrong-char-log-close-btn {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: center;
    min-width: 150px;
    box-shadow: 0 0 10px rgba(108, 117, 125, 0.4);
}

.wrong-char-log-close-btn:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(108, 117, 125, 0.6);
}