/**
 * 🎮 互动剧场 - 响应式样式
 * 支持：手机 · 平板 · 电脑
 */

/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #0f0f23;
    --bg-card: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #64748b;
    --border-radius: 16px;
    --transition: all 0.3s ease;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
}

body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ===== 容器布局 ===== */
#app {
    width: 100%;
    height: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* ===== 游戏选择界面 ===== */
#game-selector {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    overflow-y: auto;
    justify-content: center;
    padding: 20px;
}

.selector-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 0;
}

.game-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.game-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* ===== 游戏卡片 ===== */
.game-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lobby-game-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.5s ease forwards;
}

.lobby-game-card:nth-child(1) { animation-delay: 0.1s; }
.lobby-game-card:nth-child(2) { animation-delay: 0.2s; }
.lobby-game-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lobby-game-card:hover, .lobby-game-card:active {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
}

.lobby-game-image {
    height: 140px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.game-screenshot {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1f3d 100%);
}

.game-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

.lobby-game-card:hover .game-screenshot img {
    transform: scale(1.05);
}

.game-screenshot::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
}

.game-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    background: var(--primary);
}

.game-badge.new {
    background: var(--success);
}

.lobby-game-info {
    padding: 16px;
}

.lobby-game-info h3, .lobby-game-info h4 {
    font-size: 1.25rem;
    margin-bottom: 5px;
}

.lobby-game-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.game-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.tag {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.tag.horror { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.tag.escape { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.tag.sci-fi { background: rgba(99, 102, 241, 0.2); color: var(--primary); }
.tag.romance { background: rgba(236, 72, 153, 0.2); color: var(--secondary); }
.tag.growth { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.tag.story { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.tag.cute { background: rgba(236, 72, 153, 0.2); color: var(--secondary); }
.tag.adventure { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.tag.casual { background: rgba(16, 185, 129, 0.2); color: var(--success); }

.game-stats {
    display: flex;
    gap: 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-info {
    text-align: center;
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* ===== 游戏容器 ===== */
#game-container {
    background: var(--bg-dark);
}

#game-scene {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ===== 顶部栏 ===== */
#top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: linear-gradient(180deg, rgba(15, 15, 35, 0.95) 0%, transparent 100%);
    z-index: 100;
}

.back-btn, .menu-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-btn:hover, .menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.game-info {
    font-weight: bold;
}

/* ===== 场景视觉区域 ===== */
#scene-visual {
    flex: 1;
    position: relative;
    min-height: 200px;
    overflow: hidden;
}

#scene-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease;
}

#scene-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: linear-gradient(180deg, transparent 30%, rgba(15, 15, 35, 0.8) 70%, var(--bg-dark) 100%);
}

.character-display {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ===== 叙述面板 ===== */
#narrative-panel {
    background: linear-gradient(180deg, transparent 0%, rgba(15, 15, 35, 0.95) 20%);
    padding: 20px;
    min-height: 120px;
}

#speaker-name {
    color: var(--primary);
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#narrative-text {
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.7;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.text-content {
    margin: 0;
}

/* ===== 倒计时 ===== */
#countdown-timer {
    position: absolute;
    top: 70px;
    right: 20px;
    z-index: 150;
}

.timer-ring {
    width: 60px;
    height: 60px;
    position: relative;
}

.timer-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 4;
}

.timer-progress {
    fill: none;
    stroke: var(--warning);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--warning);
}

/* ===== 选项面板 ===== */
#choice-panel {
    background: var(--bg-dark);
    padding: 16px;
    min-height: 180px;
}

#choices-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.choice-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
    transform: translateX(-20px);
}

.choice-btn.visible {
    opacity: 1;
    transform: translateX(0);
}

.choice-btn:hover, .choice-btn:active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    transform: translateX(5px);
}

.choice-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.choice-text {
    text-align: left;
    flex: 1;
}

/* ===== 视频播放器 ===== */
#video-player {
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    max-width: 100%;
    position: relative;
}

#game-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
}

.skip-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid white;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.skip-btn:hover {
    background: white;
    color: black;
}

/* ===== 加载画面 ===== */
#loading-screen {
    background: var(--bg-dark);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader {
    text-align: center;
}

.cat-loader {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* ===== 结局画面 ===== */
#ending-screen {
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.98) 0%, rgba(26, 26, 46, 0.98) 100%);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ending-content {
    text-align: center;
    max-width: 400px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.ending-type {
    color: var(--warning);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.ending-title {
    font-size: 2rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ending-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 30px;
}

.ending-stats {
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
}

.ending-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border-radius: 30px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: bold;
}

.btn.primary {
    background: var(--primary);
    color: white;
}

.btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.condition-failed {
    text-align: center;
    padding: 20px;
}

.condition-failed p {
    color: var(--danger);
    margin-bottom: 20px;
}

/* ===== 设置菜单 ===== */
#settings-menu {
    background: rgba(0, 0, 0, 0.9);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 25px;
    width: 90%;
    max-width: 350px;
}

.settings-content h3 {
    margin-bottom: 20px;
    text-align: center;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.setting-item input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    appearance: none;
    outline: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.setting-item select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
}

.setting-actions {
    margin-top: 25px;
}

.setting-actions .btn {
    width: 100%;
}

/* ===== 工具类 ===== */
.hidden {
    display: none !important;
}

/* ===== 响应式适配 ===== */

/* 手机竖屏 */
@media (max-width: 480px) {
    .game-title {
        font-size: 2rem;
    }
    
    .lobby-game-info {
        padding: 14px;
    }
    
    .lobby-game-info h3 {
        font-size: 1.1rem;
    }
    
    #narrative-panel {
        padding: 16px;
    }
    
    #narrative-text {
        font-size: 1rem;
    }
    
    .choice-btn {
        padding: 14px 16px;
    }
    
    .ending-title {
        font-size: 1.6rem;
    }
}

/* 手机横屏 */
@media (max-height: 500px) and (orientation: landscape) {
    #scene-visual {
        min-height: 120px;
    }
    
    #narrative-panel {
        min-height: 80px;
        padding: 10px 16px;
    }
    
    #choice-panel {
        min-height: 100px;
        padding: 10px;
    }
    
    .choice-btn {
        padding: 10px 14px;
    }
    
    .choice-text {
        font-size: 0.9rem;
    }
}

/* 平板 */
@media (min-width: 481px) and (max-width: 768px) {
    .game-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .lobby-game-card:nth-child(3) {
        grid-column: span 2;
        max-width: 50%;
        margin: 0 auto;
    }
    
    #choices-container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .choice-btn {
        flex: 1 1 calc(50% - 6px);
        min-width: 200px;
    }
}

/* 电脑 */
@media (min-width: 769px) {
    .game-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .lobby-game-card:nth-child(3) {
        grid-column: span 1;
    }
    
    #choices-container {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: 700px;
    }
    
    .choice-btn {
        flex: 1 1 calc(50% - 6px);
        min-width: 280px;
    }
    
    .choice-btn:hover {
        transform: translateX(10px) scale(1.02);
    }
    
    #game-scene {
        max-width: 100%;
    }
    
    #scene-visual {
        max-height: 50vh;
    }
}

/* ===== 触摸优化 ===== */
@media (hover: none) {
    .choice-btn:active {
        background: rgba(99, 102, 241, 0.3);
    }
    
    .back-btn:active, .menu-btn:active {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* ===== 模态框/弹窗样式 ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.overlay:not(.hidden) .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-right: 30px;
}

.modal-header h3 {
    font-size: 1.3rem;
    margin: 0;
}

/* 认证弹窗 */
.auth-modal-content {
    max-width: 380px;
}

.auth-form h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.auth-form .btn {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* 注册表单密码强度 */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}

.password-strength-fill.weak { width: 33%; background: var(--danger); }
.password-strength-fill.medium { width: 66%; background: var(--warning); }
.password-strength-fill.strong { width: 100%; background: var(--success); }

/* 验证码 */
.verification-code-group {
    display: flex;
    gap: 10px;
}

.verification-code-group input {
    flex: 1;
}

.verification-code-group .btn {
    width: auto;
    padding: 12px 16px;
    flex-shrink: 0;
}

/* 用户面板 */
.user-panel-content {
    max-width: 400px;
}

.user-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.user-panel-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.user-panel-info h3 {
    margin-bottom: 4px;
}

.user-panel-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.user-stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.user-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.user-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 排行榜弹窗 */
.leaderboard-modal-content {
    max-width: 480px;
}

.leaderboard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.leaderboard-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.leaderboard-tab.active {
    background: var(--primary);
    color: white;
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 8px;
}

.leaderboard-item:nth-child(1) { background: rgba(255, 215, 0, 0.15); }
.leaderboard-item:nth-child(2) { background: rgba(192, 192, 192, 0.1); }
.leaderboard-item:nth-child(3) { background: rgba(205, 127, 50, 0.1); }

.leaderboard-rank {
    font-size: 1.2rem;
    font-weight: bold;
    width: 32px;
    text-align: center;
}

.leaderboard-rank.gold { color: #ffd700; }
.leaderboard-rank.silver { color: #c0c0c0; }
.leaderboard-rank.bronze { color: #cd7f32; }

.leaderboard-user-info {
    flex: 1;
}

.leaderboard-user-name {
    font-weight: 500;
}

.leaderboard-user-game {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.leaderboard-time {
    font-weight: bold;
    color: var(--success);
}

/* 商店弹窗 */
.shop-modal-content {
    max-width: 500px;
}

.shop-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.shop-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.shop-tab.active {
    background: var(--primary);
    color: white;
}

.shop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.shop-item:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.shop-item-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.shop-item-info {
    flex: 1;
}

.shop-item-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.shop-item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.shop-item-price {
    text-align: right;
}

.shop-item-price .price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--warning);
}

.shop-item-price .unit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.shop-item .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* 赞赏弹窗 */
.donate-modal-content {
    max-width: 400px;
    text-align: center;
}

.donate-modal-content h3 {
    margin-bottom: 10px;
}

.donate-modal-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.donate-qrcode {
    background: white;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.donate-qrcode img {
    width: 200px;
    height: 200px;
    display: block;
    margin: 0 auto;
}

.donate-amount {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.donate-amount-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.donate-amount-btn:hover,
.donate-amount-btn.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
}

/* 分享弹窗 */
.share-modal-content {
    max-width: 400px;
}
.share-poster-wrapper {
    text-align: center;
    margin: 16px 0 8px;
}
.share-poster-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.35);
    background: #1a1a2e;
    /* 关键：让长按图片能弹出微信的"发送给朋友" */
    -webkit-touch-callout: default;
    pointer-events: auto;
}
.share-poster-hint {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    font-size: 0.82rem;
    color: #c7d2fe;
    line-height: 1.55;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.share-btn.wechat { background: #07c160; color: white; }
.share-btn.weibo { background: #e6162d; color: white; }
.share-btn.douyin { background: #161616; color: white; }
.share-btn.copy { background: var(--primary); color: white; }

/* 复活弹窗 */
.revive-modal-content {
    max-width: 360px;
    text-align: center;
}

.revive-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.revive-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.revive-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.revive-option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.revive-option-icon {
    font-size: 1.5rem;
}

.revive-option-info {
    flex: 1;
    text-align: left;
}

.revive-option-title {
    font-weight: 500;
}

.revive-option-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 游戏结束弹窗 */
.ending-modal-content {
    max-width: 420px;
    text-align: center;
}

.ending-badge {
    font-size: 3rem;
    margin-bottom: 16px;
}

.ending-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ending-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.ending-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.ending-stat {
    text-align: center;
}

.ending-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.ending-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ending-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== 大厅区域（lobby） ===== */
#game-lobby {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px 32px;
}

#game-lobby > * {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* 顶部 */
.lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(180deg, rgba(15,15,35,0.92) 70%, rgba(15,15,35,0) 100%);
    backdrop-filter: blur(8px);
}

.lobby-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
}

.logo-icon { font-size: 1.5rem; }

.lobby-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.guest-area { display: flex; gap: 8px; }

.btn-login, .btn-register {
    border: 1px solid rgba(255,255,255,0.18);
    background: transparent;
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-login:hover, .btn-register:hover { border-color: var(--primary); color: var(--primary); }
.btn-register { background: linear-gradient(135deg, var(--primary), var(--secondary)); border-color: transparent; }

.user-area { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-avatar { font-size: 1.4rem; }
.user-name { font-size: 0.95rem; }

/* 横幅 */
.lobby-banner {
    margin: 16px 0 24px;
    padding: 28px 24px;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, rgba(99,102,241,0.25) 0%, rgba(236,72,153,0.25) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}
.banner-content h2 {
    font-size: 1.6rem;
    margin-bottom: 6px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.banner-content p { color: var(--text-secondary); font-size: 0.95rem; }

/* 排行榜预览 */
.leaderboard-preview {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 16px 18px;
    margin-bottom: 24px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.06);
}
.leaderboard-preview:hover { border-color: var(--primary); transform: translateY(-2px); }
.leaderboard-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.leaderboard-icon { font-size: 1.2rem; }
.leaderboard-title { font-weight: 600; }
.leaderboard-top3 {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.leaderboard-top3 .no-records { color: var(--text-muted); text-align: center; padding: 8px 0; }
.leaderboard-more { display: block; margin-top: 10px; text-align: right; font-size: 0.85rem; color: var(--primary); }

/* 游戏列表区 */
.lobby-games { margin-bottom: 24px; }
.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 14px;
    padding-left: 4px;
}

/* 游戏卡信息区 */
.lobby-game-info { padding: 14px 16px 16px; }
.lobby-game-info h4 {
    font-size: 1.15rem;
    margin-bottom: 6px;
    font-weight: 600;
}
.game-genre {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 10px;
}
.game-meta {
    display: flex;
    gap: 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.game-players {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* 赞赏入口 */
.support-section {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: var(--transition);
}
.support-section:hover { border-color: var(--warning); transform: translateY(-2px); }
.support-icon { font-size: 1.6rem; }
.support-info { flex: 1; }
.support-info h4 { font-size: 0.95rem; margin-bottom: 2px; }
.support-info p { font-size: 0.8rem; color: var(--text-muted); }
.support-arrow { color: var(--warning); font-size: 1.2rem; }

/* lobby 内部响应式 */
@media (max-width: 480px) {
    .lobby-banner { padding: 22px 18px; }
    .banner-content h2 { font-size: 1.35rem; }
    .game-screenshot { height: 160px; }
}

/* ===== 赞赏码 ===== */
.donate-qr {
    background: white;
    padding: 16px;
    border-radius: 12px;
    margin: 0 auto 20px;
    text-align: center;
    max-width: 240px;
}
.donate-qr .qr-image {
    width: 200px;
    height: 200px;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}
.donate-qr .qr-hint {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.donate-hint {
    margin-top: 6px;
    padding: 10px 14px;
    background: rgba(245, 158, 11, 0.12);
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #fbbf24;
    line-height: 1.5;
    text-align: left;
}
    color: #64748b;
}

# ===== 多帧静态开场动画（视频替代） =====
.frame-sequence {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.frame-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.4s ease-in-out, transform 0.6s ease-in-out;
    transform: scale(1.05);
}
.frame-image.fade-in {
    opacity: 1;
    transform: scale(1);
}
.frame-image.fade-out {
    opacity: 0;
    transform: scale(0.95);
}
.frame-text {
    position: absolute;
    left: 50%;
    bottom: 14%;
    transform: translateX(-50%);
    max-width: 88%;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out 0.3s;
}
.frame-text.visible {
    opacity: 1;
}
.frame-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
}
.frame-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width linear;
}

# ===== 广告系统样式 =====
.ad-overlay-mock {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
.ad-overlay-mock.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.ad-overlay-content {
    text-align: center;
    color: #fff;
}
.ad-overlay-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 1.5s infinite;
}
.ad-overlay-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.ad-overlay-slot {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.ad-overlay-timer {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--warning);
    margin-bottom: 1rem;
    font-variant-numeric: tabular-nums;
}
.ad-overlay-tip {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
}
.ad-overlay-skip {
    margin-top: 1rem;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: not-allowed;
}

.ad-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border-radius: 8px;
    margin: 8px;
    font-size: 0.85rem;
    position: relative;
}
.ad-banner.mock { border: 1px dashed rgba(255, 255, 255, 0.2); }
.ad-label {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    color: var(--text-muted);
}
.ad-label.small { font-size: 0.6rem; }
.ad-banner-content { flex: 1; }
.ad-banner-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
}

.native-ad-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 10px;
    margin: 12px 0;
}
.native-ad-icon { font-size: 1.5rem; }
.native-ad-body { flex: 1; }
.native-ad-brand { font-weight: 600; font-size: 0.9rem; }
.native-ad-copy { font-size: 0.8rem; color: var(--text-secondary); }
.native-ad-cta {
    padding: 6px 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.hint-highlight {
    border-color: var(--warning) !important;
    box-shadow: 0 0 0 2px var(--warning) !important;
}
.hint-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background: var(--warning);
    color: #000;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
}


/* ===== 视频加载占位 / 错误 / 进入游戏过渡 ===== */

#video-loading {
    background: #000;
    z-index: 1010; /* 高于 #video-player */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
}

#video-loading.hidden,
#video-error.hidden,
#video-to-game.hidden {
    display: none !important;
}

.video-loading-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(24px) brightness(0.35) saturate(1.4);
    transform: scale(1.15);  /* 防边缘露馅 */
    transition: opacity 0.4s ease;
    z-index: 0;
}

.video-loading-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 24px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 18px;
    backdrop-filter: blur(8px);
    min-width: 280px;
    max-width: 88vw;
}

.video-loading-text {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
}

.video-progress {
    width: 240px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.video-progress .progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.video-loading-tip {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin: 0;
}

/* ----- 视频加载失败 ----- */
#video-error {
    background: rgba(0, 0, 0, 0.85);
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-error-card {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.95), rgba(20, 20, 30, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 32px 28px;
    text-align: center;
    color: #fff;
    min-width: 320px;
    max-width: 88vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-error-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.video-error-card h3 {
    font-size: 20px;
    margin: 0 0 8px;
    font-weight: 700;
}

.video-error-msg {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin: 0 0 20px;
}

.video-error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.video-error-actions .btn-primary,
.video-error-actions .btn-secondary {
    padding: 10px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.video-error-actions .btn-primary {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.video-error-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
}

.video-error-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.video-error-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ----- 视频结束过渡 ----- */
#video-to-game {
    background: rgba(0, 0, 0, 0.7);
    z-index: 1015;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.25s ease;
}

.video-to-game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 24px 36px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 16px;
}

.video-to-game-text {
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ----- 帧序列 / 多帧开场 loading 一致性 ----- */
.frame-sequence-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 14px;
}


/* ===== 肉鸽商店 ===== */
#rogue-shop-modal {
    background: rgba(0, 0, 0, 0.85);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    animation: fadeIn 0.3s ease;
    padding: 16px;
}

#rogue-shop-modal.hidden { display: none !important; }

.rogue-shop-content {
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.95), rgba(15, 15, 30, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 28px 22px;
    max-width: 480px;
    width: 100%;
    color: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.rogue-shop-title {
    font-size: 22px;
    margin: 0 0 4px;
    text-align: center;
    font-weight: 700;
}

.rogue-shop-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    text-align: center;
    margin: 0 0 14px;
}

.rogue-shop-points {
    text-align: center;
    color: #ffd166;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 18px;
}

.rogue-shop-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 480px) {
    .rogue-shop-grid { grid-template-columns: repeat(3, 1fr); }
}

.rogue-shop-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: default;
}

.rogue-shop-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-3px);
}

.rogue-shop-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.rogue-shop-name {
    font-size: 15px;
    margin: 0 0 6px;
    font-weight: 700;
}

.rogue-shop-effect {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 12px;
    line-height: 1.4;
    min-height: 30px;
}

.rogue-shop-price {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
}

.rogue-shop-coin {
    font-size: 18px;
    font-weight: 800;
    color: #ffd166;
}

.rogue-shop-coin-icon { font-size: 16px; }

.rogue-shop-buy {
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.rogue-shop-buy:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
}

.rogue-shop-buy:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.4);
}

.rogue-shop-actions {
    margin-top: 16px;
    text-align: center;
}

.rogue-shop-skip {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    -webkit-tap-highlight-color: transparent;
}

.rogue-shop-skip:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ===== 章节结算 ===== */
#chapter-end-modal {
    background: rgba(0, 0, 0, 0.75);
    z-index: 4900;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    animation: fadeIn 0.35s ease;
    padding: 16px;
}

#chapter-end-modal.hidden { display: none !important; }

.chapter-end-content {
    background: linear-gradient(135deg, rgba(40, 40, 60, 0.95), rgba(20, 20, 35, 0.95));
    border: 1px solid rgba(255, 215, 102, 0.3);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 420px;
    width: 100%;
    color: #fff;
    text-align: center;
    box-shadow: 0 24px 60px rgba(255, 215, 102, 0.2);
}

.chapter-end-icon { font-size: 56px; margin-bottom: 12px; }

.chapter-end-title {
    font-size: 22px;
    margin: 0 0 4px;
    font-weight: 800;
    color: #ffd166;
}

.chapter-end-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin: 0 0 20px;
}

.chapter-end-rewards {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.chapter-end-rewards h3 {
    font-size: 13px;
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.chapter-end-coins {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.chapter-end-coin-icon { font-size: 22px; }
.chapter-end-coin-value { font-size: 26px; font-weight: 800; color: #ffd166; }

.chapter-end-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 0;
    color: #fff;
    font-weight: 600;
}

.chapter-end-item-icon { font-size: 20px; }
.chapter-end-item-qty { color: #ffd166; font-weight: 700; }

.chapter-end-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.chapter-end-shop, .chapter-end-continue {
    padding: 10px 18px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.chapter-end-shop {
    background: rgba(255, 215, 102, 0.15);
    color: #ffd166;
    border: 1px solid rgba(255, 215, 102, 0.3);
}

.chapter-end-shop:hover {
    background: rgba(255, 215, 102, 0.25);
}

.chapter-end-continue {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.chapter-end-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
}


/* ============ 硬核模式失败弹窗 ============ */
#hardcore-fail-modal {
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(8px);
    z-index: 999;
}

.hardcore-fail-content {
    background: linear-gradient(180deg, #1f1f3a 0%, #16162b 100%);
    border-radius: 20px;
    padding: 30px 36px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 99, 99, 0.2);
}

.hardcore-fail-icon { font-size: 64px; margin-bottom: 12px; }

.hardcore-fail-title {
    color: #fff;
    font-size: 24px;
    margin: 0 0 8px;
    font-weight: 800;
}

.hardcore-fail-sub {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.5;
}

.hardcore-fail-wallet {
    display: flex;
    justify-content: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 20px;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.hardcore-fail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hardcore-btn {
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.hardcore-btn-primary {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.hardcore-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
}

.hardcore-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hardcore-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}


/* ==================== 用户中心：xp 进度条 / 称号墙 / 11 款统计 ==================== */
.xp-bar-wrap {
    margin: 12px 0 6px 0;
}
.xp-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}
.xp-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #ec4899, #f59e0b);
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(236, 72, 153, 0.4);
}
.xp-bar-meta {
    text-align: right;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.panel-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}
.panel-section-title {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 称号墙 */
.title-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}
.title-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.title-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}
.title-card.locked {
    opacity: 0.32;
    cursor: not-allowed;
    filter: grayscale(0.6);
}
.title-card.locked:hover { transform: none; }
.title-card.equipped {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}
.title-card-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 4px;
}
.title-card-name {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.2;
}
.title-card.locked .title-card-name {
    color: rgba(255, 255, 255, 0.4);
}
.title-card.equipped::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 4px;
    color: #f59e0b;
    font-size: 12px;
    font-weight: 700;
}

/* 11 款游戏统计 */
.game-stats-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.game-stat-row {
    display: grid;
    grid-template-columns: 1fr 50px 50px 50px;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}
.game-stat-row.empty { color: rgba(255, 255, 255, 0.4); }
.game-stat-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.game-stat-num {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
}
.game-stat-num.completed { color: #10b981; font-weight: 600; }
.game-stat-header {
    display: grid;
    grid-template-columns: 1fr 50px 50px 50px;
    gap: 8px;
    padding: 0 10px 4px 10px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.game-stat-header span:nth-child(n+2) { text-align: center; }

/* 升级 toast */
.levelup-toast {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(236, 72, 153, 0.95));
    color: #fff;
    padding: 22px 36px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 12px 40px rgba(236, 72, 153, 0.5);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    min-width: 220px;
}
.levelup-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.levelup-toast .levelup-emoji { font-size: 40px; display: block; margin-bottom: 8px; }
.levelup-toast .levelup-level { font-size: 24px; font-weight: 800; display: block; margin: 4px 0; }
.levelup-toast .levelup-detail { font-size: 12px; opacity: 0.85; font-weight: 400; }

.exp-toast-mini {
    position: fixed;
    top: 80px;
    right: 16px;
    background: rgba(99, 102, 241, 0.95);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    z-index: 99998;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s;
}
.exp-toast-mini.show {
    opacity: 1;
    transform: translateX(0);
}


/* ==================== M1 用户中心 Tab 化 ==================== */
.uc-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}
.uc-tab {
    flex: 1;
    padding: 10px 6px;
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.55);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.uc-tab:hover { color: rgba(255,255,255,0.85); }
.uc-tab.active {
    color: #fbbf24;
    border-bottom-color: #fbbf24;
}
.uc-panes {
    padding: 12px 16px 4px;
    max-height: 55vh;
    overflow-y: auto;
}
.uc-pane { display: none; }
.uc-pane.active { display: block; }
.pane-loading { color: rgba(255,255,255,0.4); font-size: 13px; padding: 24px; text-align: center; }

/* 总览卡片 */
.overview-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.overview-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.overview-card:hover {
    border-color: #fbbf24;
    background: rgba(251,191,36,0.06);
}
.overview-card-label {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.overview-card-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.overview-card-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}
.overview-card-bar {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.overview-card-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    width: 0%;
    transition: width .3s;
}

/* 成就墙 */
.achv-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.achv-cat-chip {
    padding: 4px 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    font-size: 11px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
}
.achv-cat-chip.active {
    background: rgba(251,191,36,0.15);
    border-color: #fbbf24;
    color: #fbbf24;
}
.achv-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
.achv-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    transition: border-color .15s;
}
.achv-card.locked { opacity: 0.55; }
.achv-card.completed { border-color: #10b981; background: rgba(16,185,129,0.08); }
.achv-card.claimed { border-color: #6b7280; opacity: 0.7; }
.achv-icon { font-size: 28px; flex-shrink: 0; }
.achv-body { flex: 1; min-width: 0; }
.achv-name { font-size: 13px; font-weight: 700; color: #fff; }
.achv-desc { font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 2px; }
.achv-progress {
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.achv-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    width: 0%;
}
.achv-progress-text {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}
.achv-tier {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: 700;
}
.achv-tier.bronze { background: rgba(205,127,50,0.2); color: #cd7f32; }
.achv-tier.silver { background: rgba(192,192,192,0.2); color: #c0c0c0; }
.achv-tier.gold { background: rgba(255,215,0,0.2); color: #ffd700; }
.achv-tier.platinum { background: rgba(185,242,255,0.2); color: #b9f2ff; }
.achv-reward {
    font-size: 11px;
    color: #fbbf24;
    margin-top: 2px;
}
.achv-action {
    flex-shrink: 0;
    padding: 6px 12px;
    background: #fbbf24;
    color: #1f2937;
    border: 0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.achv-action:disabled {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    cursor: default;
}

/* 角色养成 */
.char-card {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(168,85,247,0.1));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    text-align: center;
}
.char-avatar-big {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 8px;
    display: inline-block;
    padding: 12px 20px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    border: 2px solid rgba(251,191,36,0.4);
}
.char-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.char-archetype {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(168,85,247,0.2);
    color: #c4b5fd;
    border-radius: 10px;
    margin-bottom: 8px;
}
.char-exp-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 4px;
}
.char-exp-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}
.char-exp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #a78bfa, #c084fc);
    width: 0%;
    transition: width .3s;
}
.char-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.char-stat {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 10px 4px;
    text-align: center;
}
.char-stat-icon { font-size: 18px; }
.char-stat-val {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-top: 4px;
}
.char-stat-name {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}
.char-section-title {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    letter-spacing: 1px;
    margin: 12px 0 8px;
    font-weight: 700;
}
.char-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.char-slot {
    aspect-ratio: 1;
    background: rgba(255,255,255,0.04);
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    padding: 4px;
    font-size: 10px;
    color: rgba(255,255,255,0.5);
}
.char-slot.filled {
    border-style: solid;
    border-color: #fbbf24;
    background: rgba(251,191,36,0.1);
}
.char-slot.locked { opacity: 0.35; cursor: not-allowed; }
.char-slot-icon { font-size: 22px; }
.char-slot-name { font-size: 10px; margin-top: 2px; text-align: center; }
.char-bag {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.char-bag-cell {
    aspect-ratio: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 2px;
}
.char-bag-cell:hover { border-color: rgba(255,255,255,0.25); }
.char-bag-cell.empty { opacity: 0.3; cursor: default; }
.char-bag-cell-icon { font-size: 18px; }
.char-bag-cell-qty {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
}
.char-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.char-action-btn {
    flex: 1;
    padding: 8px;
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.3);
    color: #c4b5fd;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}
.char-init-form {
    text-align: center;
    padding: 24px 12px;
}
.char-init-form h4 { color: #fff; margin-bottom: 12px; }
.char-init-form select, .char-init-form input {
    width: 100%;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 6px;
    margin-bottom: 8px;
}
.char-init-form .btn {
    width: 100%;
    padding: 10px;
    background: #fbbf24;
    color: #1f2937;
    border: 0;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}
.char-empty {
    text-align: center;
    padding: 32px 12px;
    color: rgba(255,255,255,0.5);
}


/* ==================== PC 端用户面板适配（min-width: 768px）==================== */
/* 触发条件: 浮层 .overlay 显示时，body 同时也会被加 .show-user-panel 等标识 */
/* 这里直接以 .modal-content 为锚点（PC 端 .user-panel 用的就是这个类） */

@media (min-width: 768px) {

  /* 浮层本体：宽度顶满到 760，居中 */
  .modal-content {
    max-width: 760px !important;
    width: 70% !important;
    padding: 28px 32px !important;
    max-height: 86vh;
  }

  /* 用户面板：解除内部 400px 死宽限制 */
  .user-panel-content {
    max-width: 100% !important;
  }

  /* 用户面板头部：大头像 + 名字 / 称号横向铺开 */
  .user-panel-header {
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .user-panel-avatar {
    width: 76px !important;
    height: 76px !important;
    font-size: 2.4rem !important;
  }
  .user-panel-info h3 {
    font-size: 1.4rem;
  }

  /* 5 个 tab：横排 + 下划线 active */
  .uc-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .uc-tab {
    padding: 10px 18px !important;
    font-size: 14px !important;
    border-radius: 0 !important;
    border-bottom: 2px solid transparent !important;
    transition: color 0.18s ease, border-color 0.18s ease;
  }
  .uc-tab.active {
    color: #fff !important;
    background: transparent !important;
    border-bottom-color: #6b46c1 !important;
  }

  /* pane 内边距统一 */
  .uc-pane {
    padding-top: 8px;
  }

  /* 总览卡：3 列网格 */
  .overview-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px !important;
  }
  .overview-card {
    padding: 16px 18px !important;
  }
  .overview-card-value {
    font-size: 22px !important;
  }
  .overview-card-label {
    font-size: 12px !important;
  }

  /* 成就：左侧筛选栏 + 右侧卡片列表两栏；卡片网格 2 列 */
  .achv-categories {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-bottom: 18px !important;
  }
  .achv-cat-chip {
    padding: 6px 14px !important;
    font-size: 12px !important;
  }
  /* 任务 A: PC 端让浮层自然撑开, 不要 modal 内部滚动条 */
  .modal-content {
    max-height: none !important;
    overflow: visible !important;
  }
  /* 成就 grid: auto-fit 让列数随高度自适应, min 280px 一卡 */
  .achv-list {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 10px !important;
    max-height: none !important;
    overflow: visible !important;
  }
  /* 紧凑模式: 每行 56px 高, 22 张卡 3 列 ≈ 480px 总高 */
  .achv-card {
    padding: 8px 12px !important;
    align-items: center !important;
    gap: 10px !important;
  }
  .achv-icon {
    font-size: 22px !important;
  }
  .achv-name {
    font-size: 12px !important;
    line-height: 1.2 !important;
  }
  .achv-desc {
    font-size: 10px !important;
    line-height: 1.3 !important;
    margin-top: 1px !important;
  }
  .achv-progress {
    height: 3px !important;
    margin-top: 4px !important;
  }
  .achv-progress-text {
    font-size: 9px !important;
    margin-top: 2px !important;
  }
  .achv-tier {
    font-size: 9px !important;
    padding: 1px 4px !important;
  }
  .achv-action {
    padding: 4px 10px !important;
    font-size: 10px !important;
  }

  /* 角色养成：保持竖排（不改 HTML），仅放大 + 居中 */
  .char-card {
    padding: 24px 20px !important;
    text-align: center;
  }
  .char-avatar-big {
    width: 88px !important;
    height: 88px !important;
    font-size: 2.6rem !important;
    margin: 0 auto 12px !important;
  }
  .char-name {
    font-size: 20px !important;
    margin-bottom: 6px !important;
    text-align: center;
  }
  .char-archetype {
    font-size: 12px !important;
    margin-bottom: 12px !important;
    text-align: center;
  }
  .char-exp-row {
    max-width: 320px;
    margin: 0 auto 12px !important;
  }
  .char-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px !important;
    margin-top: 14px !important;
  }
  .char-stat {
    padding: 10px 12px !important;
    text-align: center;
  }
  .char-stat-val {
    font-size: 18px !important;
  }

  .char-section-title {
    font-size: 13px !important;
    margin: 20px 0 12px !important;
    padding-left: 0 !important;
  }

  .char-slots {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px !important;
  }
  .char-slot {
    padding: 14px 10px !important;
  }
  .char-slot-icon {
    font-size: 26px !important;
  }
  .char-slot-name {
    font-size: 11px !important;
  }


  .char-bag {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 10px !important;
    padding: 12px !important;
  }
  .char-bag-cell {
    padding: 10px 6px !important;
  }
  .char-bag-cell-icon {
    font-size: 22px !important;
  }

  .char-actions {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap;
    margin-top: 18px !important;
  }
  .char-action-btn {
    padding: 8px 18px !important;
    font-size: 13px !important;
  }

  .char-init-form {
    padding: 20px !important;
  }
  .char-init-form select,
  .char-init-form input {
    padding: 10px 14px !important;
    font-size: 14px !important;
  }

  /* 战绩（11 款游戏统计）：放宽单行 + 表头横向铺开 */
  .game-stats-list {
    max-height: none !important;
    gap: 8px !important;
  }
  .game-stat-row {
    grid-template-columns: 1.4fr 50px 60px 50px auto !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    align-items: center !important;
  }
  .game-stat-header {
    grid-template-columns: 1.4fr 50px 60px 50px auto !important;
    padding: 0 12px 6px !important;
    font-size: 10px !important;
  }
  .game-stat-rewards {
    display: flex !important;
    gap: 4px !important;
    justify-content: flex-end !important;
  }
  .stat-reward-btn {
    padding: 3px 8px !important;
    font-size: 10px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    background: rgba(255,255,255,0.05) !important;
    color: rgba(255,255,255,0.45) !important;
    cursor: not-allowed !important;
    transition: all 0.15s ease !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
  }
  .stat-reward-btn.locked { color: rgba(255,255,255,0.35); }
  .stat-reward-btn.eligible {
    background: linear-gradient(90deg, #fbbf24, #f59e0b) !important;
    color: #1f2937 !important;
    border-color: #fbbf24 !important;
    cursor: pointer !important;
    animation: pulse-glow 1.6s ease-in-out infinite !important;
  }
  .stat-reward-btn.eligible:hover { transform: scale(1.05); }
  .stat-reward-btn.claimed {
    background: rgba(16,185,129,0.15) !important;
    color: #10b981 !important;
    border-color: rgba(16,185,129,0.4) !important;
    cursor: default !important;
  }
  @keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(251,191,36,0); }
  }

  /* modal 关闭按钮在 PC 端放右上 */
  .modal-close {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.7rem !important;
    top: 16px !important;
    right: 16px !important;
  }
}

/* 大屏（≥ 1200px）进一步放宽 */
@media (min-width: 1200px) {
  .modal-content {
    max-width: 880px !important;
    width: 60% !important;
  }
  .achv-list {
    grid-template-columns: 1fr 1fr 1fr !important;
  }
  .char-bag {
    grid-template-columns: repeat(8, 1fr) !important;
  }
}


/* 战绩节点奖励按钮（全局默认 / 移动端）*/
.stat-reward-btn {
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.4);
    cursor: not-allowed;
    font-weight: 600;
    white-space: nowrap;
}
.stat-reward-btn.locked { color: rgba(255,255,255,0.35); }
.stat-reward-btn.eligible {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    color: #1f2937;
    border-color: #fbbf24;
    cursor: pointer;
}
.stat-reward-btn.claimed {
    background: rgba(16,185,129,0.15);
    color: #10b981;
    border-color: rgba(16,185,129,0.4);
    cursor: default;
}
.game-stat-rewards {
    display: flex;
    gap: 4px;
    align-items: center;
}
/* ===== Round 7: 结局图鉴样式 ===== */
.gallery-grand {
    float: right;
    font-size: 13px;
    color: #5a8bff;
    font-weight: 600;
}
.ending-gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px 0;
}
.gallery-loading {
    text-align: center;
    color: #888;
    padding: 30px 0;
}
.gallery-game {
    background: rgba(20, 28, 50, 0.6);
    border: 1px solid #2a3a5a;
    border-radius: 8px;
    padding: 12px;
}
.gallery-game-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.gallery-game-icon {
    font-size: 22px;
}
.gallery-game-title {
    flex: 1;
    color: #eee;
    font-weight: 600;
    font-size: 15px;
}
.gallery-game-count {
    color: #5a8bff;
    font-size: 12px;
    font-weight: 600;
}
.gallery-bar {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}
.gallery-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #5a8bff, #b25cff);
    transition: width 0.6s ease;
}
.gallery-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
    gap: 4px;
}
.gallery-tile {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 14px;
    transition: transform 0.2s ease;
}
.gallery-tile:hover {
    transform: scale(1.15);
}
.gallery-tile.unlocked {
    background: linear-gradient(135deg, #2a4a8a, #1a2a5a);
    border: 1px solid #5a8bff;
}
.gallery-tile.locked {
    background: rgba(255,255,255,0.04);
    border: 1px solid #333;
    opacity: 0.45;
    filter: grayscale(0.8);
}

/* ===== Round 7: rewind 时间倒流特效 ===== */
.rewind-flash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(circle at center, rgba(180, 220, 255, 0.5), rgba(20, 30, 80, 0.95) 70%);
    animation: rewindFlash 1.6s ease-out forwards;
}
.rewind-flash::before {
    content: '';
    position: absolute;
    inset: 0;
    background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.15), transparent 50%, rgba(255,255,255,0.15), transparent);
    animation: rewindSpin 1.6s linear forwards;
    mix-blend-mode: screen;
}
.rewind-flash::after {
    content: '⏪ 时间倒流…';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(180, 220, 255, 0.9), 0 0 40px rgba(180, 220, 255, 0.6);
    animation: rewindText 1.6s ease-out forwards;
    letter-spacing: 2px;
}
@keyframes rewindFlash {
    0% { opacity: 0; filter: hue-rotate(0deg) blur(0); }
    20% { opacity: 1; filter: hue-rotate(180deg) blur(8px); }
    60% { opacity: 0.85; filter: hue-rotate(360deg) blur(4px) saturate(1.5); }
    100% { opacity: 0; filter: hue-rotate(720deg) blur(0) saturate(1); }
}
@keyframes rewindSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(-720deg); }
}
@keyframes rewindText {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); letter-spacing: 8px; }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); letter-spacing: 4px; }
    70% { opacity: 1; transform: translate(-50%, -50%) scale(1); letter-spacing: 2px; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); letter-spacing: 6px; }
}
