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

/* 鍏ㄥ睆鑳屾櫙灞?*/
#game-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-image: url('assets/images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.8s ease-in-out,
        filter 0.3s ease;
    /* 榛樿娓愬彉鑳屾櫙锛堝浘鐗囧姞杞藉墠鎴栧け璐ユ椂鏄剧ず锛?*/
    background-color: #1a1a2e;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #020817;
    /* 鍏滃簳鑳屾櫙鑹?*/
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.container {
    text-align: center;
    position: relative;
}

h1 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.music-btn {
    position: absolute;
    top: 0;
    left: 0;
    padding: 8px 16px;
    font-size: 14px;
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
    color: #888;
    border: 1px solid #444;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.music-btn:hover {
    background: linear-gradient(145deg, #3a3a5a, #2a2a4a);
    color: #aaa;
}

.music-btn.playing {
    color: #a855f7;
    border-color: #a855f7;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(168, 85, 247, 0.6);
    }
}

.game-info {
    margin-bottom: 20px;
    color: #fff;
}

.player-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.player {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1em;
}

.black-player {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.white-player {
    background: linear-gradient(145deg, #f0f0f0, #d0d0d0);
    color: #333;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.vs {
    font-size: 1.5em;
    font-weight: bold;
    color: #ffd700;
}

.current-turn {
    font-size: 1.2em;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: inline-block;
}

.game-mode-display {
    margin-top: 10px;
    font-size: 1.1em;
    color: #00d4ff;
}

.game-timer {
    margin-top: 12px;
    font-size: 1.3em;
    color: #ffd700;
    font-weight: bold;
    padding: 8px 20px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    display: inline-block;
    border: 1px solid rgba(255, 215, 0, 0.3);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    font-family: 'Courier New', monospace;
}

.game-stats {
    margin-top: 12px;
    font-size: 0.95em;
    color: #a0a0a0;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== CINEMATIC UI: VISUAL NOVEL STYLE ========== */
.game-layout {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
    /* Compact Gap */
    margin-top: 20px;
}

.game-container {
    padding: 0;
    /* Dimensions controlled by Base Widths & Zoom */
}

/* 1. Character Card (Cinematic Container) */
.character-wrapper {
    position: relative;
    width: 300px;
    max-width: 100%;
    height: 600px;
    /* Locked Height */

    background: #0f0f1a;
    border-radius: 15px;
    /* Enhanced Shadow for Depth */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 212, 255, 0.2);
    overflow: hidden;
    /* Clips image and overlays */
}

/* 2. Portrait Layer (Full Canvas) */
.char-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: linear-gradient(180deg, #1a1a2e 0%, #000 100%);
    z-index: 1;
}

.char-sprite {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.5s ease;
}

/* Hover Effect: Gentle Zoom */
.character-wrapper:hover .char-sprite {
    transform: scale(1.03);
}

/* 3. Dialogue Overlay (Glass Effect) */
.dialogue-box {
    position: absolute;
    bottom: 20px;
    left: 15px;
    right: 15px;
    height: 120px;
    /* Fixed Height */

    background: rgba(10, 16, 30, 0.85);
    /* Dark Glass */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    border: 1px solid rgba(0, 212, 255, 0.25);
    border-top: 1px solid rgba(0, 212, 255, 0.5);
    /* Highlight Top Edge */
    border-radius: 12px;

    /* Top padding allows name badge to sit comfortably if needed, but we position badge outside */
    padding: 25px 15px 15px 15px;

    z-index: 10;

    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;

    animation: slideUp 0.5s ease-out;
}

.dialogue-box p {
    margin: 0;
    color: #e0e0e0;
    font-size: 0.95em;
    line-height: 1.6;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* 4. Name Badge (Floating) */
.char-name {
    position: absolute;
    bottom: 130px;
    /* Overlaps Dialogue Box Top Edge (120+20=140 bottom) */
    left: 25px;
    z-index: 20;
    width: auto;
    height: auto;

    background: #00d4ff;
    color: #000;
    font-size: 0.9em;
    font-weight: 800;
    /* Extra Bold */
    padding: 4px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.4);
    letter-spacing: 1px;
    margin: 0;
    text-transform: uppercase;
}

/* Status Dot */
.char-name::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    margin-bottom: 2px;
    background: #00ff00;
    /* Active */
    border-radius: 50%;
    animation: breathe 2s infinite;
}

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

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

@keyframes breathe {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 4px rgba(0, 255, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0);
    }
}

/* Ensure VFX sits between */
.vfx-overlay {
    z-index: 5;
}

@keyframes dialogueFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* --- 瑙掕壊鐘舵€佺壒鏁堢被 --- */

/* 1. 寰呮満/闃插尽锛氳交寰懠鍚?*/
.state-idle .char-sprite {
    animation: breathe 4s infinite ease-in-out;
}

/* 2. 娣卞害杩愮畻锛氳摑鑹叉护闀?+ 绋嶅井鏀惧ぇ */
.state-calc .char-sprite {
    filter: drop-shadow(0 0 15px rgba(0, 150, 255, 0.8)) brightness(1.2);
    transform: scale(1.05);
}

.state-calc .vfx-overlay {
    opacity: 1;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 150, 255, 0.15) 100%);
    animation: calcPulse 1.5s infinite;
}

@keyframes calcPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* 3. 缁濇潃/鏀诲嚮锛氱灛闂撮渿鍔?+ 绾㈣壊闂厜 */
.state-attack .char-sprite {
    filter: drop-shadow(0 0 20px rgba(255, 50, 50, 0.8)) brightness(1.3) contrast(1.1);
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.state-attack .vfx-overlay {
    opacity: 1;
    background: radial-gradient(circle at center, rgba(255, 50, 50, 0.3) 0%, transparent 70%);
    animation: attackFlash 0.2s ease-out;
}

@keyframes attackFlash {
    0% {
        opacity: 1;
        background: rgba(255, 255, 255, 0.5);
    }

    100% {
        opacity: 0.5;
    }
}

/* 4. 鑳滃埄锛氶噾鑹插厜杈?+ 鍘嬭揩鎰?*/
.state-win .char-sprite {
    filter: brightness(1.3) contrast(1.2) drop-shadow(0 0 25px gold);
    transform: scale(1.08);
}

.state-win .vfx-overlay {
    opacity: 1;
    background: radial-gradient(circle at 50% 30%, rgba(255, 215, 0, 0.3) 0%, transparent 60%);
    animation: winGlow 2s infinite;
}

@keyframes winGlow {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.state-win .char-name {
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: nameGlow 1s infinite;
}

@keyframes nameGlow {

    0%,
    100% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }

    50% {
        text-shadow: 0 0 35px rgba(255, 215, 0, 1);
    }
}

/* 5. 鎴樿触锛氭晠闅滄晥鏋?(Glitch) */
.state-lose .char-sprite {
    filter: grayscale(80%) contrast(150%) brightness(0.8);
    animation: glitch-anim 0.15s infinite;
}

.state-lose .vfx-overlay {
    opacity: 1;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(255, 0, 0, 0.1) 2px,
            rgba(255, 0, 0, 0.1) 4px);
    animation: scanlines 0.1s infinite;
}

.state-lose .char-name {
    color: #ff4444;
    animation: glitchText 0.3s infinite;
}

@keyframes glitchText {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-2px);
        color: #ff0000;
    }

    40% {
        transform: translateX(2px);
        color: #00ff00;
    }

    60% {
        transform: translateX(-1px);
    }

    80% {
        transform: translateX(1px);
        color: #0000ff;
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes scanlines {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 4px;
    }
}

/* --- 绠€鍗曠殑鍏抽敭甯у姩鐢?--- */
@keyframes breathe {

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

    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(3px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-5px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(5px, 0, 0);
    }
}

@keyframes glitch-anim {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-3px, 2px);
    }

    40% {
        transform: translate(-3px, -2px);
    }

    60% {
        transform: translate(3px, 2px);
    }

    80% {
        transform: translate(3px, -2px);
    }

    100% {
        transform: translate(0);
    }
}

#board {
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(145deg, #3a86ff, #2563eb);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(58, 134, 255, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(58, 134, 255, 0.5);
}

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

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(145deg, #1e1e3f, #151530);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #fff;
    margin-bottom: 30px;
    font-size: 1.8em;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mode-btn {
    padding: 20px 40px;
    font-size: 1.2em;
    background: linear-gradient(145deg, #2a2a5a, #1a1a4a);
    border: 2px solid transparent;
    transition: all 0.3s;
}

.mode-btn:hover {
    border-color: #00d4ff;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

/* RPS */
.rps-content {
    min-width: 500px;
}

.rps-game {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 30px 0;
}

.rps-player {
    background: linear-gradient(145deg, #252550, #1a1a40);
    padding: 25px;
    border-radius: 15px;
    min-width: 150px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.rps-player.active {
    border-color: #00d4ff;
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.4);
}

.rps-player.winner {
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    animation: winnerGlow 1s infinite;
}

@keyframes winnerGlow {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
    }
}

.rps-label {
    font-size: 1.2em;
    color: #fff;
    margin-bottom: 15px;
    font-weight: bold;
}

.rps-choices {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.rps-btn {
    font-size: 2.5em;
    padding: 15px;
    background: linear-gradient(145deg, #3a3a6a, #2a2a5a);
    border: 2px solid #444;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.rps-btn:hover:not(:disabled) {
    transform: scale(1.15);
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.rps-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rps-vs {
    font-size: 2em;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.rps-selected {
    font-size: 4em;
    margin-top: 15px;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.rps-result {
    font-size: 1.4em;
    color: #00ff88;
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 10px;
    animation: fadeIn 0.5s;
}

.rps-result.draw {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.rps-waiting {
    color: #888;
    margin-top: 15px;
    font-size: 1.1em;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* 鍊掕鏃?*/
.countdown-content {
    text-align: center;
}

.countdown-number {
    font-size: 8em;
    font-weight: bold;
    color: #00d4ff;
    text-shadow: 0 0 50px rgba(0, 212, 255, 0.8), 0 0 100px rgba(0, 212, 255, 0.5);
    animation: countPop 0.5s ease-out;
}

@keyframes countPop {
    0% {
        transform: scale(1.5);
        opacity: 0;
    }

    50% {
        transform: scale(0.9);
    }

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

/* 鑾疯儨寮圭獥 */
.winner-content {
    min-width: 350px;
}

.winner-content h2 {
    font-size: 2em;
    margin-bottom: 30px;
    animation: winText 0.5s ease-out;
}

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

    50% {
        transform: scale(1.2);
    }

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

.winner-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.winner-btn {
    padding: 15px 30px;
    font-size: 1.1em;
}

.winner-btn.secondary {
    background: linear-gradient(145deg, #4a4a6a, #3a3a5a);
    box-shadow: 0 4px 15px rgba(100, 100, 150, 0.3);
}

.winner-btn.secondary:hover {
    box-shadow: 0 6px 20px rgba(100, 100, 150, 0.5);
}

/* AI鎬濊€?*/
.ai-thinking {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #2a2a5a, #1a1a4a);
    color: #00d4ff;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1em;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    animation: thinking 1.5s infinite;
    z-index: 100;
}

@keyframes thinking {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.hidden {
    display: none !important;
}

/* ========== 鏂版ā寮忛€夋嫨UI鏍峰紡 ========== */

.mode-select-content {
    min-width: 450px;
    max-width: 550px;
}

.mode-section {
    margin-bottom: 25px;
}

.section-title {
    color: #888;
    font-size: 0.9em;
    letter-spacing: 2px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 鏁呬簨妯″紡鎸夐挳 */
.story-mode-buttons,
.free-mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.story-main-btn,
.free-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    text-align: left;
    background: linear-gradient(145deg, #2a2a5a, #1a1a4a);
    border: 2px solid transparent;
    transition: all 0.3s;
}

.story-main-btn {
    background: linear-gradient(145deg, #3a2a5a, #2a1a4a);
}

.story-main-btn:hover {
    border-color: #a855f7;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.4);
    transform: translateX(5px);
}

.free-btn:hover {
    border-color: #00d4ff;
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.4);
    transform: translateX(5px);
}

.btn-icon {
    font-size: 2em;
    width: 50px;
    text-align: center;
}

.btn-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btn-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
}

.btn-subtitle {
    font-size: 0.85em;
    color: #888;
    font-weight: normal;
}

/* ========== 娓╂晠鐭ユ柊鍏冲崱閫夋嫨寮圭獥 ========== */

.mission-select-content {
    min-width: 500px;
    max-width: 650px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.mission-select-header {
    position: relative;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.mission-select-header h2 {
    margin-bottom: 10px;
}

.progress-text {
    color: #a855f7;
    font-size: 1em;
    margin: 0;
}

.close-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #888;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255, 100, 100, 0.3);
    color: #ff6666;
}

.mission-list {
    overflow-y: auto;
    max-height: 50vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 10px;
}

/* 婊氬姩鏉℃牱寮?*/
.mission-list::-webkit-scrollbar {
    width: 6px;
}

.mission-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.mission-list::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.5);
    border-radius: 3px;
}

/* 鍏冲崱鍗＄墖 */
.mission-card {
    display: flex;
    align-items: stretch;
    background: linear-gradient(145deg, #252545, #1a1a35);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
}

.mission-card.unlocked:hover {
    border-color: #a855f7;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    transform: translateX(5px);
}

.mission-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(50%);
}

.mission-thumb {
    width: 120px;
    min-height: 80px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.mission-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 50%, rgba(26, 26, 53, 0.9) 100%);
}

.mission-info {
    flex: 1;
    padding: 12px 15px;
    padding-right: 80px;
    /* 涓虹姸鎬佹爣绛鹃鐣欑┖闂?*/
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.mission-title {
    font-size: 1em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.mission-card.locked .mission-title::before {
    content: '馃敀 ';
}

.mission-tagline {
    font-size: 0.85em;
    color: #888;
    line-height: 1.4;
}

.mission-card.locked .mission-tagline {
    color: #666;
}

/* 闅惧害鏄熸槦 */
.mission-difficulty {
    display: flex;
    gap: 2px;
    margin-top: 8px;
}

.star {
    color: #ffd700;
    font-size: 0.8em;
}

.star.empty {
    color: #444;
}

/* 鐘舵€佹爣绛?*/
.mission-status {
    position: absolute;
    top: 8px;
    right: 10px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
}

.mission-status.finished {
    background: rgba(0, 200, 100, 0.2);
    color: #00c864;
    border: 1px solid rgba(0, 200, 100, 0.3);
}

.mission-status.current {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
    animation: statusPulse 2s infinite;
}

.mission-status.locked {
    background: rgba(100, 100, 100, 0.2);
    color: #666;
    border: 1px solid rgba(100, 100, 100, 0.3);
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* 閲嶆柊浣撻獙鎸夐挳 */
.mission-action {
    display: flex;
    align-items: center;
    padding: 0 15px;
    background: rgba(168, 85, 247, 0.1);
    border-left: 1px solid rgba(168, 85, 247, 0.2);
}

.mission-action-btn {
    padding: 8px 15px;
    font-size: 0.85em;
    background: linear-gradient(145deg, #a855f7, #8b3fd1);
    border: none;
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.mission-action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
}

.mission-card.locked .mission-action {
    background: rgba(100, 100, 100, 0.1);
    border-left-color: rgba(100, 100, 100, 0.2);
}

.mission-card.locked .mission-action-btn {
    background: linear-gradient(145deg, #555, #444);
    cursor: not-allowed;
}

.mission-card.locked .mission-action-btn:hover {
    transform: none;
    box-shadow: none;
}

/* ========== 鏁呬簨妯″紡鏍峰紡 ========== */

/* 鏁呬簨瀵硅瘽妗嗘牱寮?*/
/* 鏁呬簨瀵硅瘽鍖呰鍣紙鍚珛缁橈級 */
.story-dialog-wrapper {
    position: fixed;
    bottom: 10vh;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

/* 绔嬬粯鍖哄煙 - 灞呬腑鏄剧ず鍦ㄥ璇濇涓婃柟 */
.story-portrait-area {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 1001;
    margin-bottom: -30px;
}

.story-portrait-area.hidden {
    display: none;
}

/* 绔嬬粯鍥剧墖 - 瓒呭ぇ灏哄鏄剧溂鏄剧ず锛屽睍鐜板ぇ甯堣寖 */
.story-portrait {
    width: auto;
    height: 55vh;
    min-height: 400px;
    max-height: 600px;
    max-width: 95vw;
    object-fit: contain;
    filter: drop-shadow(0 0 50px rgba(0, 212, 255, 0.7)) drop-shadow(0 0 100px rgba(0, 212, 255, 0.3)) drop-shadow(0 15px 60px rgba(0, 0, 0, 0.9));
    animation: portraitFadeIn 0.5s ease-out;
}

.story-portrait.hidden {
    display: none;
}

@keyframes portraitFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

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

/* 瀵硅瘽妗嗗唴瀹?*/
.story-dialog-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    background: linear-gradient(180deg, rgba(10, 10, 20, 0.95) 0%, rgba(20, 20, 40, 0.98) 100%);
    padding: 25px 40px;
    border-top: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px 15px 0 0;
    min-height: 150px;
    cursor: pointer;
    animation: slideUp 0.3s ease-out;
    pointer-events: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

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

.story-dialog-speaker {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 5px 15px;
    border-radius: 5px;
    display: inline-block;
}

.story-dialog-speaker.speaker-sys {
    color: #888;
    background: rgba(100, 100, 100, 0.2);
}

.story-dialog-speaker.speaker-plr {
    color: #4FC3F7;
    background: rgba(79, 195, 247, 0.15);
    border-left: 3px solid #4FC3F7;
}

.story-dialog-speaker.speaker-yi {
    color: #00FFFF;
    background: rgba(0, 255, 255, 0.15);
    border-left: 3px solid #00FFFF;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.story-dialog-text {
    font-size: 1.2em;
    color: #e0e0e0;
    line-height: 1.8;
    margin-bottom: 15px;
    animation: textFade 0.3s ease-out;
}

@keyframes textFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.story-dialog-hint {
    position: absolute;
    bottom: 15px;
    right: 30px;
    color: #666;
    font-size: 0.9em;
    animation: blink 1.5s infinite;
}

/* 璺宠繃瀵硅瘽鎸夐挳 */
.skip-dialog-btn {
    position: absolute;
    top: 15px;
    right: 30px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: #888;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.skip-dialog-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    border-color: rgba(255, 100, 100, 0.4);
    color: #ff6b6b;
}

@keyframes blink {

    0%,
    50%,
    100% {
        opacity: 1;
    }

    25%,
    75% {
        opacity: 0.3;
    }
}

/* 鏁呬簨妯″紡鑳屾櫙瑕嗙洊灞傦紙鍙€夛紝璁╄儗鏅洿绐佸嚭锛?*/
body.story-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: -1;
}

/* 鏁呬簨妯″紡涓嬮殣钘忎竴浜涗笉闇€瑕佺殑UI */
body.story-mode .game-stats,
body.story-mode .game-timer {
    opacity: 0.5;
}

@media (max-width: 650px) {
    #board {
        width: 95vw;
        height: 95vw;
        max-width: 500px;
        max-height: 500px;
    }

    h1 {
        font-size: 1.8em;
    }

    .player {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .rps-content {
        min-width: auto;
        width: 95vw;
        padding: 20px;
    }

    .rps-game {
        flex-direction: column;
        gap: 15px;
    }

    .rps-btn {
        font-size: 2em;
        padding: 10px;
    }

    .countdown-number {
        font-size: 5em;
    }

    /* 鏁呬簨妯″紡绉诲姩绔€傞厤 */
    .story-dialog-content {
        padding: 20px;
        min-height: 150px;
    }

    .story-dialog-text {
        font-size: 1em;
    }
}

/* ========== 璋冭瘯闈㈡澘鏍峰紡 ========== */

.debug-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2147483647;
    pointer-events: auto !important;
    isolation: isolate;
}

.debug-toggle {
    width: 50px;
    height: 50px;
    pointer-events: auto !important;
    position: relative;
    z-index: 2147483647;
    border-radius: 50%;
    background: linear-gradient(145deg, #ff6b35, #e55a2b);
    border: 2px solid #ffa07a;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    transition: all 0.3s;
}

.debug-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
}

.debug-toggle.active {
    background: linear-gradient(145deg, #00c853, #00a844);
    border-color: #69f0ae;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
}

.debug-menu {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 280px;
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid rgba(255, 107, 53, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: debugMenuIn 0.3s ease-out;
}

@keyframes debugMenuIn {
    from {
        transform: translateY(20px) scale(0.9);
        opacity: 0;
    }

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

.debug-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #ff6b35;
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 107, 53, 0.3);
}

.debug-section {
    margin-bottom: 15px;
}

.debug-label {
    display: block;
    font-size: 0.9em;
    color: #888;
    margin-bottom: 10px;
}

.debug-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.debug-btn {
    padding: 8px 12px;
    font-size: 0.85em;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(145deg, #3a3a6a, #2a2a5a);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.debug-btn:hover {
    background: linear-gradient(145deg, #4a4a7a, #3a3a6a);
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

.debug-btn.full {
    grid-column: span 4;
    padding: 12px;
    font-size: 0.95em;
}

.debug-btn.full:first-of-type {
    background: linear-gradient(145deg, #00c853, #00a844);
    border-color: rgba(0, 200, 83, 0.5);
}

.debug-btn.full:first-of-type:hover {
    box-shadow: 0 0 15px rgba(0, 200, 83, 0.4);
}

.debug-btn.danger {
    background: linear-gradient(145deg, #d32f2f, #b71c1c);
    border-color: rgba(255, 100, 100, 0.5);
}

.debug-btn.danger:hover {
    box-shadow: 0 0 15px rgba(255, 100, 100, 0.4);
}

.debug-info {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 0.85em;
    color: #888;
    text-align: center;
}

.debug-menu.hidden {
    display: none;
}

/* ========== 鎹愯禒寮圭獥鏍峰紡 ========== */

.donate-content {
    min-width: 380px;
    max-width: 450px;
    text-align: center;
}

.donate-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: coffeeFloat 2s infinite ease-in-out;
}

@keyframes coffeeFloat {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.donate-content h2 {
    color: #ffd700;
    font-size: 1.6em;
    margin-bottom: 15px;
}

.donate-text {
    color: #ccc;
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 25px;
}

.donate-text .highlight {
    color: #ff6b35;
    font-size: 1.3em;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.donate-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.donate-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    border-radius: 25px;
    transition: all 0.3s;
}

.donate-btn.yes {
    background: linear-gradient(145deg, #ff6b35, #e55a2b);
    border: 2px solid #ffa07a;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

.donate-btn.yes:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(255, 107, 53, 0.6);
}

.donate-btn.no {
    background: linear-gradient(145deg, #4a4a6a, #3a3a5a);
    border: 2px solid #5a5a7a;
    color: #888;
}

.donate-btn.no:hover {
    background: linear-gradient(145deg, #5a5a7a, #4a4a6a);
    color: #aaa;
}

/* ========== 寰俊浜岀淮鐮佸脊绐楁牱寮?========== */

.wechat-content {
    min-width: 350px;
    max-width: 420px;
    text-align: center;
}

.wechat-header h2 {
    color: #ff6b35;
    font-size: 1.8em;
    margin-bottom: 20px;
    animation: heartBeat 1.5s infinite;
}

@keyframes heartBeat {

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

    15% {
        transform: scale(1.1);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.1);
    }

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

.wechat-info {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.wechat-info p {
    color: #ccc;
    font-size: 1em;
    margin: 8px 0;
}

.author-name {
    color: #00d4ff;
    font-weight: bold;
    font-size: 1.1em;
}

.wechat-id {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.2em;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.wechat-qr {
    background: #fff;
    padding: 15px;
    border-radius: 15px;
    display: inline-block;
    margin: 15px 0;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

.qr-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 8px;
}

.wechat-tip {
    color: #888;
    font-size: 0.95em;
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    border: 1px dashed rgba(255, 215, 0, 0.3);
}

.wechat-ok-btn {
    padding: 15px 60px;
    font-size: 1.2em;
    background: linear-gradient(145deg, #00c853, #00a844);
    border: 2px solid #69f0ae;
    border-radius: 30px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0, 200, 83, 0.4);
    margin-top: 10px;
}

.wechat-ok-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(0, 200, 83, 0.6);
}

/* ========== 浠诲姟绠€鎶ラ潰鏉挎牱寮?========== */

.mission-brief-content {
    min-width: 420px;
    max-width: 520px;
    text-align: left;
}

.mission-brief-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
}

.mission-brief-header h2 {
    color: #a855f7;
    font-size: 1.5em;
    margin-bottom: 8px;
}

.mission-subtitle {
    color: #888;
    font-size: 1em;
    margin: 0;
}

.mission-brief-body {
    margin-bottom: 25px;
}

.brief-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 3px solid #a855f7;
}

.brief-section h3 {
    color: #a855f7;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.brief-section p {
    color: #ccc;
    font-size: 0.95em;
    line-height: 1.6;
    margin: 0;
}

.mission-brief-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.mission-btn {
    padding: 12px 30px;
    font-size: 1em;
    border-radius: 25px;
    transition: all 0.3s;
}

.mission-btn.primary {
    background: linear-gradient(145deg, #a855f7, #8b3fd1);
    border: 2px solid #c084fc;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

.mission-btn.primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(168, 85, 247, 0.6);
}

.mission-btn.secondary {
    background: linear-gradient(145deg, #4a4a6a, #3a3a5a);
    border: 2px solid #5a5a7a;
    color: #aaa;
}

.mission-btn.secondary:hover {
    background: linear-gradient(145deg, #5a5a7a, #4a4a6a);
    color: #ccc;
}

/* ========== 娈典綅鏅嬪崌闈㈡澘鏍峰紡 ========== */

.rank-up-content {
    min-width: 380px;
    max-width: 450px;
    text-align: center;
}

.rank-up-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: trophyBounce 1s infinite;
}

@keyframes trophyBounce {

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

    50% {
        transform: translateY(-15px) scale(1.1);
    }
}

.rank-up-content h2 {
    color: #ffd700;
    font-size: 1.8em;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.rank-up-title {
    font-size: 2em;
    font-weight: bold;
    color: #a855f7;
    margin-bottom: 15px;
    padding: 15px 30px;
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
    border-radius: 15px;
    border: 2px solid rgba(168, 85, 247, 0.4);
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
    animation: rankGlow 2s infinite;
}

@keyframes rankGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(168, 85, 247, 0.6);
    }
}

.rank-up-desc {
    color: #ccc;
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 25px;
}

.rank-up-btn {
    padding: 15px 50px;
    font-size: 1.1em;
    background: linear-gradient(145deg, #ffd700, #ffaa00);
    border: 2px solid #ffcc00;
    border-radius: 30px;
    color: #1a1a2e;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.rank-up-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
}

/* ========== 鎻愮ずToast鏍峰紡 ========== */

.toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #ff6b35, #e55a2b);
    color: #fff;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1em;
    font-weight: bold;
    box-shadow: 0 5px 25px rgba(255, 107, 53, 0.5);
    z-index: 2000;
    animation: toastIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes toastIn {
    from {
        transform: translateX(-50%) translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.toast-icon {
    font-size: 1.3em;
}

.toast-text {
    max-width: 400px;
}

.toast.hidden {
    display: none;
}

/* ========== 鍘嗗彶浠嬬粛鍏ュ彛鎸夐挳鏍峰紡 ========== */

.history-mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    text-align: left;
    background: linear-gradient(145deg, #2a3a4a, #1a2a3a);
    border: 2px solid transparent;
    transition: all 0.3s;
}

.history-btn:hover {
    border-color: #ffd700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.3);
    transform: translateX(5px);
}

/* ========== 鍘嗗彶浠嬬粛闈㈡澘鏍峰紡 ========== */

.history-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a0a15 0%, #1a1a2e 50%, #0f0f1a 100%);
    z-index: 2000;
    overflow-y: auto;
    animation: historyFadeIn 0.5s ease-out;
}

@keyframes historyFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.history-header {
    text-align: center;
    padding: 60px 20px 40px;
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.history-header h1 {
    font-size: 2.5em;
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    margin-bottom: 15px;
    letter-spacing: 3px;
}

.history-subtitle {
    font-size: 1.2em;
    color: #888;
    margin: 0;
    letter-spacing: 5px;
}

.history-content {
    max-width: 900px;
    background: linear-gradient(180deg, rgba(30, 30, 50, 0.95) 0%, rgba(20, 20, 35, 0.98) 100%);
    border-radius: 20px;
    padding: 40px 50px 120px;
    margin: 20px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* 鏂囩珷鎺掔増浼樺寲 */
.history-content h1 {
    color: #ffd700;
    font-size: 2em;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.history-content h2 {
    color: #ffd700;
    font-size: 1.5em;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.history-content h2 small {
    display: block;
    font-size: 0.7em;
    color: #00d4ff;
    margin-top: 5px;
}

.history-content h3 {
    color: #00d4ff;
    font-size: 1.2em;
    margin-top: 25px;
    margin-bottom: 15px;
}

.history-content p {
    color: #e8e8e8;
    font-size: 1.1em;
    line-height: 2;
    margin-bottom: 18px;
    text-align: justify;
}

.history-content p.intro {
    font-size: 1.2em;
    color: #ffd700;
    font-style: italic;
    text-align: center;
    margin-bottom: 30px;
}

.history-content p.highlight {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid #ffd700;
    color: #fff;
    font-weight: 500;
}

.history-content p.ending {
    font-size: 1.3em;
    color: #ffd700;
    text-align: center;
    margin-top: 40px;
    font-weight: bold;
}

.history-content strong {
    color: #ffd700;
    font-weight: bold;
}

.history-content ul {
    margin: 20px 0;
    padding-left: 30px;
}

.history-content li {
    color: #e0e0e0;
    font-size: 1.05em;
    line-height: 1.9;
    margin-bottom: 12px;
    position: relative;
}

.history-content li::marker {
    color: #ffd700;
}

/* 鍒嗛殧绾?*/
.history-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.4), transparent);
    margin: 40px 0;
    margin: 0 auto;
    padding: 40px 30px 100px;
}

/* 鍘嗗彶绔犺妭鏍峰紡 */
.history-chapter {
    margin-bottom: 60px;
    animation: chapterFadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.history-chapter:nth-child(1) {
    animation-delay: 0.1s;
}

.history-chapter:nth-child(2) {
    animation-delay: 0.2s;
}

.history-chapter:nth-child(3) {
    animation-delay: 0.3s;
}

.history-chapter:nth-child(4) {
    animation-delay: 0.4s;
}

.history-chapter:nth-child(5) {
    animation-delay: 0.5s;
}

.history-chapter:nth-child(6) {
    animation-delay: 0.6s;
}

.history-chapter:nth-child(7) {
    animation-delay: 0.7s;
}

.history-chapter:nth-child(8) {
    animation-delay: 0.8s;
}

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

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

.chapter-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.chapter-icon {
    font-size: 2.5em;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.chapter-title-wrap {
    flex: 1;
}

.chapter-era {
    font-size: 0.9em;
    color: #ffd700;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.chapter-title {
    font-size: 1.5em;
    color: #fff;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.chapter-body {
    padding-left: 20px;
    border-left: 3px solid rgba(255, 215, 0, 0.2);
}

.chapter-body p {
    color: #ccc;
    font-size: 1.05em;
    line-height: 1.9;
    margin-bottom: 15px;
    text-align: justify;
}

.chapter-body p:last-child {
    margin-bottom: 0;
}

/* 鍏抽敭淇℃伅楂樹寒 */
.history-highlight {
    color: #ffd700;
    font-weight: bold;
}

.history-emphasis {
    color: #00d4ff;
    font-style: italic;
}

/* 寮曠敤鍧楁牱寮?*/
.history-quote {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
    padding: 20px 25px;
    border-radius: 10px;
    border-left: 4px solid #ffd700;
    margin: 20px 0;
    font-style: italic;
    color: #e0e0e0;
}

.history-quote cite {
    display: block;
    margin-top: 10px;
    color: #888;
    font-size: 0.9em;
    text-align: right;
}

/* 鏃堕棿绾胯妭鐐?*/
.timeline-point {
    display: inline-block;
    background: linear-gradient(145deg, #ffd700, #ffaa00);
    color: #1a1a2e;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    margin-right: 10px;
}

/* 鍘嗗彶椤佃剼 */
.history-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(0deg, rgba(10, 10, 21, 0.98) 0%, rgba(10, 10, 21, 0.9) 80%, transparent 100%);
    text-align: center;
}

.history-close-btn {
    padding: 15px 40px;
    font-size: 1.1em;
    background: linear-gradient(145deg, #ffd700, #ffaa00);
    border: 2px solid #ffcc00;
    border-radius: 30px;
    color: #1a1a2e;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.history-close-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
}

/* 绉诲姩绔€傞厤 */
@media (max-width: 650px) {
    .history-header h1 {
        font-size: 1.6em;
        letter-spacing: 1px;
    }

    .history-subtitle {
        font-size: 0.95em;
        letter-spacing: 2px;
    }

    .history-content {
        padding: 30px 20px 120px;
    }

    .chapter-header {
        flex-direction: column;
        text-align: center;
    }

    .chapter-title {
        font-size: 1.2em;
    }

    .chapter-body {
        padding-left: 15px;
    }

    .chapter-body p {
        font-size: 0.95em;
    }
}

/* ========== Toast瀹瑰櫒鏍峰紡 ========== */

#toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

#toast-container .toast {
    position: relative;
    top: 0;
    left: 0;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
    max-width: 500px;
    text-align: center;
}

#toast-container .toast.show {
    transform: translateY(0);
    opacity: 1;
}

#toast-container .toast-info {
    background: linear-gradient(145deg, #00d4ff, #00a8cc);
    color: #fff;
}

#toast-container .toast-warning {
    background: linear-gradient(145deg, #ff9800, #e68a00);
    color: #fff;
    border: 2px solid #ffcc80;
}

#toast-container .toast-error {
    background: linear-gradient(145deg, #f44336, #d32f2f);
    color: #fff;
    border: 2px solid #ff8a80;
}

#toast-container .toast-success {
    background: linear-gradient(145deg, #4caf50, #388e3c);
    color: #fff;
    border: 2px solid #a5d6a7;
}

/* ========== 绂佹墜鏁欏寮圭獥鏍峰紡 ========== */

.forbidden-modal .modal-content {
    min-width: 400px;
    max-width: 500px;
}

.forbidden-tutorial-content {
    text-align: center;
}

.forbidden-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.forbidden-title {
    color: #ff9800;
    font-size: 1.6em;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(255, 152, 0, 0.5);
}

.forbidden-body {
    text-align: left;
    background: rgba(255, 152, 0, 0.1);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #ff9800;
    margin-bottom: 20px;
}

.forbidden-body p {
    color: #e0e0e0;
    font-size: 1em;
    line-height: 1.8;
    margin-bottom: 10px;
}

.forbidden-body p:last-child {
    margin-bottom: 0;
}

.forbidden-point-info {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 20px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    display: inline-block;
}

.forbidden-confirm-btn {
    padding: 15px 40px;
    font-size: 1.1em;
    background: linear-gradient(145deg, #ff9800, #e68a00);
    border: 2px solid #ffcc80;
    border-radius: 30px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(255, 152, 0, 0.4);
}

.forbidden-confirm-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(255, 152, 0, 0.6);
}

/* ========== 绂佹墜鍒よ礋闈㈡澘鏍峰紡 ========== */

.forbidden-lose-content {
    text-align: center;
}

.forbidden-level-name {
    color: #888;
    font-size: 1em;
    margin-bottom: 10px;
}

.forbidden-lose-content .forbidden-title {
    color: #f44336;
    text-shadow: 0 0 15px rgba(244, 67, 54, 0.5);
}

.forbidden-reason {
    text-align: left;
    background: rgba(244, 67, 54, 0.1);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #f44336;
    margin-bottom: 15px;
}

.forbidden-reason p {
    color: #e0e0e0;
    font-size: 1em;
    line-height: 1.8;
    margin-bottom: 8px;
}

.forbidden-reason p:last-child {
    margin-bottom: 0;
}

.forbidden-extra {
    margin-bottom: 15px;
}

.forbidden-extra .extra-line {
    color: #ff9800;
    font-style: italic;
    font-size: 0.95em;
    padding: 10px 15px;
    background: rgba(255, 152, 0, 0.1);
    border-radius: 8px;
    margin: 0;
}

.forbidden-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.forbidden-retry-btn {
    padding: 12px 30px;
    font-size: 1em;
    background: linear-gradient(145deg, #4caf50, #388e3c);
    border: 2px solid #a5d6a7;
    border-radius: 25px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.forbidden-retry-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.6);
}

.forbidden-menu-btn {
    padding: 12px 30px;
    font-size: 1em;
    background: linear-gradient(145deg, #4a4a6a, #3a3a5a);
    border: 2px solid #5a5a7a;
    border-radius: 25px;
    color: #aaa;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.forbidden-menu-btn:hover {
    background: linear-gradient(145deg, #5a5a7a, #4a4a6a);
    color: #ccc;
}

/* ========== 鏁呬簨妯″紡HUD鏍峰紡 - 鏂颁笁鏍忓紡甯冨眬 ========== */

.story-hud {
    background: linear-gradient(145deg, rgba(20, 20, 40, 0.95), rgba(15, 15, 30, 0.98));
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(168, 85, 247, 0.05);
}

/* 宸︿晶锛氬叧鍗′俊鎭?*/
.story-hud-left {
    flex: 0 0 auto;
    text-align: left;
    min-width: 180px;
}

.story-hud-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #a855f7;
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.story-hud-subtitle {
    font-size: 0.85em;
    color: #888;
    letter-spacing: 2px;
}

/* 涓棿锛氳鍒欐爣绛?*/
.story-hud-center {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.rule-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.8em;
    color: #ccc;
    white-space: nowrap;
    transition: all 0.3s;
}

.rule-tag .tag-icon {
    font-size: 1em;
}

/* 绂佹墜涓ユ牸妯″紡鏍囩鐗规畩鏍峰紡 */
.rule-tag.tag-forbidden-strict {
    background: rgba(244, 67, 54, 0.15);
    border-color: rgba(244, 67, 54, 0.4);
    color: #ff6b6b;
}

/* 绂佹墜鏁欏妯″紡鏍囩 */
.rule-tag.tag-forbidden-teaching {
    background: rgba(255, 152, 0, 0.15);
    border-color: rgba(255, 152, 0, 0.4);
    color: #ffb74d;
}

/* 璁℃椂妯″紡鏍囩 */
.rule-tag.tag-time-pressure {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.4);
    color: #ffd700;
}

/* 鎶€鑳芥爣绛?*/
.rule-tag.tag-skill {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.4);
    color: #00d4ff;
}

/* 鍙充晶锛氳鏃舵樉绀?*/
.story-hud-right {
    flex: 0 0 auto;
    text-align: right;
    min-width: 150px;
}

.timer-main {
    font-size: 1.4em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    font-family: 'Courier New', monospace;
}

.timer-sub {
    font-size: 0.9em;
    color: #888;
    margin-top: 2px;
}

.timer-badge {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.3), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 15px;
    font-size: 0.8em;
    color: #c084fc;
    margin-top: 8px;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
    }

    50% {
        opacity: 0.8;
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
    }
}

.timer-warning {
    font-size: 0.85em;
    color: #ff6b6b;
    margin-top: 5px;
    padding: 4px 10px;
    background: rgba(244, 67, 54, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(244, 67, 54, 0.3);
    animation: warningPulse 1s infinite;
}

@keyframes warningPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* 璁℃椂鍣ㄧ揣鎬ョ姸鎬?*/
.timer-main.urgent {
    color: #ff4444;
    animation: timerUrgent 0.5s infinite;
}

@keyframes timerUrgent {

    0%,
    100% {
        color: #ff4444;
        text-shadow: 0 0 15px rgba(255, 68, 68, 0.8);
    }

    50% {
        color: #ff8888;
        text-shadow: 0 0 25px rgba(255, 68, 68, 1);
    }
}

/* 璁℃椂鍣ㄨ繘搴︽潯 */
.timer-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.timer-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #ffd700);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.timer-progress-bar.warning {
    background: linear-gradient(90deg, #ffd700, #ff9800);
}

.timer-progress-bar.danger {
    background: linear-gradient(90deg, #ff9800, #ff4444);
    animation: progressDanger 0.5s infinite;
}

@keyframes progressDanger {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* 鏁版嵁瑙嗗浘鎶€鑳芥寜閽牱寮?*/
.data-view-skill {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.skill-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 25px;
    background: linear-gradient(145deg, #1a3a5a, #0f2a4a);
    border: 2px solid rgba(0, 212, 255, 0.4);
    border-radius: 25px;
    color: #00d4ff;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
}

.skill-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.4);
    border-color: #00d4ff;
}

.skill-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #444;
    color: #666;
}

.skill-icon {
    font-size: 1.3em;
}

.skill-count {
    padding: 2px 8px;
    background: rgba(0, 212, 255, 0.2);
    border-radius: 10px;
    font-size: 0.85em;
    font-weight: bold;
}

.skill-count.empty {
    background: rgba(100, 100, 100, 0.2);
    color: #666;
}

/* 绉诲姩绔€傞厤 */
@media (max-width: 800px) {
    .story-hud {
        flex-direction: column;
        gap: 12px;
        padding: 12px 15px;
    }

    .story-hud-left,
    .story-hud-right {
        text-align: center;
        min-width: auto;
    }

    .story-hud-center {
        justify-content: center;
    }

    .rule-tag {
        font-size: 0.75em;
        padding: 4px 10px;
    }

    .timer-main {
        font-size: 1.2em;
    }
}

/* ========== 涓昏彍鍗曟浣嶆樉绀烘牱寮?========== */

.story-rank-display {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 10px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.story-rank-display .rank-icon {
    font-size: 1.5em;
}

.story-rank-display .rank-label {
    font-size: 1em;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* ========== 绂佹墜鏁欏璇剧▼闈㈡澘鏍峰紡 ========== */

#forbidden-lesson-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

#forbidden-lesson-panel.hidden {
    display: none;
}

.lesson-modal {
    background: linear-gradient(145deg, #1a1a35, #12122a);
    border: 2px solid rgba(100, 200, 255, 0.3);
    border-radius: 20px;
    padding: 30px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 0 40px rgba(100, 200, 255, 0.2);
    animation: lessonFadeIn 0.3s ease-out;
}

@keyframes lessonFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

.lesson-header {
    text-align: center;
    margin-bottom: 20px;
}

.lesson-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: #64c8ff;
    box-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
    transform: scale(1.2);
}

.progress-dot.done {
    background: rgba(100, 200, 255, 0.5);
}

.lesson-title {
    font-size: 1.5em;
    color: #fff;
    margin: 0;
    text-shadow: 0 0 15px rgba(100, 200, 255, 0.3);
}

.lesson-body {
    margin-bottom: 25px;
}

.lesson-speaker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.speaker-icon {
    font-size: 1.8em;
}

.speaker-name {
    font-size: 1.1em;
    color: #64c8ff;
    font-weight: bold;
}

.lesson-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 0.95em;
}

.lesson-content p {
    margin: 0 0 12px 0;
}

.lesson-content p:last-child {
    margin-bottom: 0;
}

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

.lesson-demo canvas {
    border: 2px solid rgba(100, 200, 255, 0.3);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lesson-demo-annotation {
    margin-top: 12px;
    font-size: 0.85em;
    color: rgba(255, 200, 100, 0.9);
    font-style: italic;
}

.lesson-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.lesson-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lesson-btn-prev {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lesson-btn-prev:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.lesson-btn-prev.hidden {
    visibility: hidden;
}

.lesson-btn-next {
    background: linear-gradient(145deg, #4a9eff, #2a7edf);
    color: #fff;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
}

.lesson-btn-next:hover {
    background: linear-gradient(145deg, #5aafff, #3a8eff);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
}

/* ==========================================================================
   SAFETY FIX & MISSING STYLES RESTORATION
   ========================================================================== */

/* Closing potential unclosed blocks from original file to prevent layout leakage */
}
}
}

.mission-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.mission-card {
    display: flex;
    flex-direction: row;
    /* Horizontal by default */
    background: rgba(255, 255, 255, 0.08);
    /* Dark theme */
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 100px;
    width: 100%;
}

.mission-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.mission-thumb {
    width: 120px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    background-color: #222;
}

.mission-info {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    /* Critical for flex text wrapping */
}

.mission-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
}

.mission-tagline {
    font-size: 0.9em;
    color: #aaa;
    line-height: 1.4;
    white-space: normal;
    /* Allow text wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Limit to 2 lines */
    -webkit-box-orient: vertical;
}

.mission-difficulty {
    font-size: 0.8em;
    color: #ffd700;
}

.mission-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    min-width: 90px;
}

.mission-action-btn {
    padding: 6px 12px;
    border-radius: 20px;
    border: none;
    font-size: 0.85em;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
    transition: all 0.2s;
}

.mission-card:hover .mission-action-btn {
    background: #a855f7;
    color: #fff;
}

/* Status Badges */
.mission-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-top: 4px;
    width: fit-content;
}

.mission-status.locked {
    background: #333;
    color: #777;
}

.mission-status.current {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.mission-status.finished {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}


/* ========== Laptop / Small Desktop Adaptations (769px - 1200px) ========== */
@media screen and (min-width: 769px) and (max-width: 1200px) {
    .container {
        width: 100%;
        max-width: 100%;
        padding: 5px;
    }

    .game-layout {
        gap: 10px;
        justify-content: space-evenly;
    }

    /* Shrink board to fit height/width */
    .game-container {
        width: auto;
        max-width: 45vh;
        /* Scale based on viewport height to avoid scrolling */
        aspect-ratio: 1/1;
    }

    .game-info {
        width: 320px;
        /* Constrain sidebar width */
        min-width: 300px;
    }

    /* Adjust headers */
    h1 {
        font-size: 1.8em;
        margin-top: 10px;
    }
}



/* ========== DESKTOP BASE CONSTRAINTS (Restoring Widths) ========== */
/* These rules provide the default wide layout for Desktop. */
/* Mobile.css is isolated and will ignore these or override them via responsive logic in another file. */

.modal-content,
.mode-select-content,
.mission-select-content {
    width: 600px;
    max-width: 90%;
}

.game-container {
    width: 600px;
    /* Default logic size */
    /* Note: Laptop adapter's max-width will constrain this if needed */
}

.game-layout {
    flex-direction: row;
    /* Force horizontal */
    justify-content: center;
    gap: 40px;
}





/* ========== GLOBAL INTERFACE SCALING (Laptop Optimization) ========== */
/* Scales the entire UI down on shorter screens to prevent scrolling */
/* Does not change layout relative positions, only size */

@media screen and (min-width: 769px) and (max-height: 860px) {

    .container,
    .modal,
    .lesson-modal,
    #message-toast {
        zoom: 0.8;
        /* Scale to 80% */

        /* Firefox Fallback */
        -moz-transform: scale(0.8);
        -moz-transform-origin: center center;
    }
}

@media screen and (min-width: 769px) and (max-height: 720px) {

    .container,
    .modal,
    .lesson-modal,
    #message-toast {
        zoom: 0.75;
        /* Scale to 75% for very short screens (e.g. 1366x768) */

        -moz-transform: scale(0.75);
    }
}

/* ========== 加载屏幕样式 ========== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a1a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
}

.loading-screen.hidden {
    display: none;
}

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

.loading-logo {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 40px;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.8);
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {

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

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.loading-stones {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.stone {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    animation: stoneBounce 1.4s ease-in-out infinite;
}

.stone-black {
    background: radial-gradient(circle at 30% 30%, #555, #111);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5), inset 0 -5px 15px rgba(0, 0, 0, 0.8);
    animation-delay: 0s;
}

.stone-white {
    background: radial-gradient(circle at 30% 30%, #fff, #ccc);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3), inset 0 -5px 15px rgba(0, 0, 0, 0.1);
    animation-delay: 0.7s;
}

@keyframes stoneBounce {

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

    50% {
        transform: translateY(-20px) scale(1.1);
    }
}

.loading-text {
    font-size: 1.2em;
    color: #00d4ff;
    margin-bottom: 20px;
}

.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }

    100% {
        content: '';
    }
}

.loading-bar {
    width: 250px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 0 auto 15px;
    overflow: hidden;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #a855f7);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.loading-tip {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.6);
}

/* ========== 玩家姓名输入弹窗样式 ========== */
.name-input-content {
    max-width: 400px;
    padding: 40px 35px;
    text-align: center;
    background: linear-gradient(145deg, rgba(20, 20, 50, 0.98), rgba(30, 30, 70, 0.95));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 50px rgba(0, 212, 255, 0.15);
}

.name-input-header {
    margin-bottom: 30px;
}

.welcome-icon {
    font-size: 3em;
    margin-bottom: 15px;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.name-input-header h2 {
    color: #fff;
    font-size: 1.6em;
    margin-bottom: 10px;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.welcome-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95em;
}

.name-input-body {
    margin-bottom: 25px;
}

.name-input-body label {
    display: block;
    color: #00d4ff;
    font-size: 0.95em;
    margin-bottom: 12px;
    text-align: left;
}

.name-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.name-input:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.name-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.name-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85em;
    margin-top: 10px;
    text-align: left;
}

.start-btn {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 25px rgba(0, 212, 255, 0.4);
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(0, 212, 255, 0.5);
}

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

/* ========== 个人战绩弹窗样式 ========== */
.stats-modal-content {
    max-width: 500px;
    padding: 30px;
    background: linear-gradient(145deg, rgba(15, 15, 35, 0.98), rgba(25, 25, 55, 0.95));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    position: relative;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.stats-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.5em;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

/* 覆盖 stats 和 leaderboard 弹窗中的关闭按钮定位 */
.stats-header .close-btn,
.leaderboard-header .close-btn {
    position: static;
    flex-shrink: 0;
}

/* 玩家信息卡片 */
.stats-player-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-avatar {
    font-size: 2.5em;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #00d4ff, #a855f7);
    border-radius: 50%;
}

.player-info {
    flex: 1;
}

.stats-player-card .player-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.player-rank {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #00d4ff;
    font-size: 0.95em;
}

.player-total {
    text-align: center;
}

.total-games {
    font-size: 2em;
    font-weight: bold;
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.total-label {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
}

/* 总胜率 */
.stats-winrate-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.winrate-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95em;
    min-width: 60px;
}

.winrate-bar-container {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.winrate-bar {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.winrate-value {
    color: #00ff88;
    font-size: 1.2em;
    font-weight: bold;
    min-width: 50px;
    text-align: right;
}

/* 分模式统计 */
.stats-modes-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stats-mode-card {
    padding: 15px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.stats-mode-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-3px);
}

.stats-mode-card .mode-icon {
    font-size: 1.8em;
    margin-bottom: 8px;
}

.stats-mode-card .mode-name {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.stats-mode-card .mode-stats {
    display: flex;
    justify-content: center;
    gap: 6px;
    font-size: 0.75em;
    margin-bottom: 8px;
}

.stats-mode-card .wins {
    color: #00ff88;
}

.stats-mode-card .losses {
    color: #ff6b6b;
}

.stats-mode-card .draws {
    color: #ffd93d;
}

.stats-mode-card .mode-winrate {
    font-size: 1.1em;
    font-weight: bold;
    color: #00d4ff;
}

/* 段位进度 */
.stats-rank-progress {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.rank-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
}

.rank-progress-label #stats-next-rank {
    color: #a855f7;
}

.rank-progress-bar-container {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.rank-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #00d4ff);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* 统计按钮样式 */
.stats-btn {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(0, 212, 255, 0.2)) !important;
    border-color: rgba(168, 85, 247, 0.4) !important;
}

.stats-btn:hover {
    border-color: #a855f7 !important;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.4) !important;
}

/* 玩家名称行 */
.player-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rename-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    opacity: 0.6;
    transition: all 0.2s ease;
    padding: 3px 6px;
    border-radius: 5px;
}

.rename-btn:hover {
    opacity: 1;
    background: rgba(0, 212, 255, 0.2);
}

/* 改名表单 */
.rename-form {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.rename-form.hidden {
    display: none;
}

.rename-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1em;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    outline: none;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.rename-input:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.rename-actions {
    display: flex;
    gap: 10px;
}

.rename-confirm {
    flex: 1;
    padding: 10px 20px;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.rename-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.rename-cancel {
    flex: 1;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rename-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========== 世界排行榜样式 ========== */
.leaderboard-btn {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.3), rgba(255, 152, 0, 0.2)) !important;
    border-color: rgba(255, 193, 7, 0.4) !important;
}

.leaderboard-btn:hover {
    border-color: #ffc107 !important;
    box-shadow: 0 0 25px rgba(255, 193, 7, 0.4) !important;
}

.leaderboard-modal-content {
    max-width: 480px;
    padding: 25px;
    background: linear-gradient(145deg, rgba(15, 15, 35, 0.98), rgba(25, 25, 55, 0.95));
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 20px;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.leaderboard-header h2 {
    margin: 0;
    color: #ffc107;
    font-size: 1.4em;
    text-shadow: 0 0 15px rgba(255, 193, 7, 0.5);
}

.leaderboard-actions {
    display: flex;
    gap: 10px;
}

.refresh-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    opacity: 1;
    transform: rotate(180deg);
}

.leaderboard-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85em;
    margin-bottom: 15px;
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-loading,
.leaderboard-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1em;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.leaderboard-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.leaderboard-item.is-me {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.3);
}

.leaderboard-item.rank-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), transparent);
    border-color: rgba(255, 215, 0, 0.3);
}

.leaderboard-item.rank-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.15), transparent);
    border-color: rgba(192, 192, 192, 0.3);
}

.leaderboard-item.rank-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.15), transparent);
    border-color: rgba(205, 127, 50, 0.3);
}

.lb-rank {
    font-size: 1.3em;
    min-width: 40px;
    text-align: center;
}

.lb-player {
    flex: 1;
}

.lb-name {
    font-weight: bold;
    color: #fff;
    font-size: 1em;
    margin-bottom: 2px;
}

.lb-tier {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
}

.lb-stats {
    text-align: right;
}

.lb-winrate {
    font-size: 1.1em;
    font-weight: bold;
    color: #00ff88;
}

.lb-games {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.5);
}