/* ═══════════════════════════════════════════
   lobby.css — AI 狼人杀 Premium Dark Theme
   ═══════════════════════════════════════════ */

/* ── Global ── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #07070a;
    color: #e8e8ef;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after { box-sizing: border-box; }

/* ── Atmospheric Background ── */
.ww-atmosphere {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ww-fog {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%; left: -50%;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
}

.ww-fog-1 {
    background: radial-gradient(circle at 30% 40%, #dc2626 0%, transparent 50%);
    animation: fogDrift1 25s ease-in-out infinite;
}

.ww-fog-2 {
    background: radial-gradient(circle at 70% 60%, #7c3aed 0%, transparent 50%);
    animation: fogDrift2 30s ease-in-out infinite;
}

@keyframes fogDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(5%, -3%) scale(1.05); }
    66% { transform: translate(-3%, 5%) scale(0.95); }
}

@keyframes fogDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-5%, 3%) scale(1.08); }
}

/* ── Lobby Layout ── */
.ww-lobby {
    position: relative;
    z-index: 1;
    height: 100vh;
    height: 100dvh;
    padding: env(safe-area-inset-top) 0 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Top Bar ── */
.ww-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(7,7,10,0.7);
}

.ww-topbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #ccc;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}

.ww-topbar-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

.ww-topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #ccc;
}

.ww-user-avatar-mini {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #fff;
}

.ww-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ww-lang-switch {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}

.ww-lang-switch button {
    padding: 5px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ww-lang-switch button.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* ── Hero Section ── */
.ww-hero {
    text-align: center;
    padding: 12px 20px 8px;
    position: relative;
}

.ww-wolf-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 8px;
    position: relative;
    animation: wolfPulse 4s ease-in-out infinite;
}

.ww-wolf-icon::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(220,38,38,0.25) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 3s ease-in-out infinite;
}

.ww-wolf-icon svg {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 20px rgba(220,38,38,0.4));
}

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

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

.ww-title {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ff4466 0%, #e83e8c 40%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 6px;
    line-height: 1.2;
}

.ww-subtitle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* ── CTA Quick Start ── */
.ww-cta-area {
    padding: 16px 20px 8px;
}

.ww-cta-quick {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(220,38,38,0.12), rgba(124,58,237,0.12));
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.ww-cta-quick::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(220,38,38,0.2), rgba(124,58,237,0.2));
    opacity: 0;
    transition: opacity 0.3s;
}

.ww-cta-quick:hover::before,
.ww-cta-quick:active::before {
    opacity: 1;
}

.ww-cta-quick i {
    font-size: 1.1rem;
    color: #fbbf24;
}

.ww-cta-quick small {
    font-size: 0.7rem;
    font-weight: 400;
    color: rgba(255,255,255,0.4);
    margin-left: 4px;
}

.ww-cta-quick:active {
    transform: scale(0.97);
}

/* ── Section Layout ── */
.ww-section {
    padding: 0 20px;
    margin-bottom: 8px;
}

.ww-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 10px;
}

.ww-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #e8e8ef;
}

.ww-section-icon {
    font-size: 1.1rem;
}

.ww-player-badge {
    display: flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    transition: all 0.3s;
}

.ww-player-badge.valid {
    background: rgba(34,197,94,0.15);
    border-color: rgba(34,197,94,0.3);
    color: #22c55e;
    box-shadow: 0 0 20px rgba(34,197,94,0.1);
}

.ww-player-badge.over {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
    color: #ef4444;
}

.ww-player-max {
    color: rgba(255,255,255,0.3);
    font-weight: 400;
}

/* ── Role Preference ── */
.ww-role-chips {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ww-chip-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    white-space: nowrap;
}

.ww-role-select {
    flex: 1;
    max-width: 200px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: #e8e8ef;
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

/* ── Character Grid ── */
.ww-char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 10px;
    max-height: 55vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0 12px;
    margin: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
    touch-action: pan-y;
}

.ww-char-grid::-webkit-scrollbar { width: 3px; }
.ww-char-grid::-webkit-scrollbar-track { background: transparent; }
.ww-char-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.ww-char-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 6px 10px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.ww-char-card:active {
    transform: scale(0.93);
}

.ww-char-card.selected {
    border-color: #dc2626;
    background: rgba(220,38,38,0.08);
    box-shadow: 
        0 0 0 1px rgba(220,38,38,0.3),
        0 0 30px rgba(220,38,38,0.12),
        inset 0 0 20px rgba(220,38,38,0.05);
}

.ww-char-card.selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: checkPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.ww-char-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 8px;
    border: 2.5px solid rgba(255,255,255,0.1);
    transition: all 0.25s;
    background: rgba(255,255,255,0.05);
}

.ww-char-card.selected .ww-char-avatar {
    border-color: #dc2626;
    box-shadow: 0 0 16px rgba(220,38,38,0.35);
}

.ww-char-avatar img,
.ww-char-avatar picture,
.ww-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ww-char-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.3;
}

.ww-char-desc {
    display: none; /* Hide desc for cleaner look */
}

/* ── Bottom Sticky Bar ── */
.ww-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(7,7,10,0.98) 60%, transparent);
    z-index: 200;
    backdrop-filter: blur(12px);
}

.ww-start-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    color: #fff;
    background: linear-gradient(135deg, #dc2626 0%, #b91c5c 50%, #7c3aed 100%);
    box-shadow: 0 4px 24px rgba(220,38,38,0.25), 0 0 0 1px rgba(220,38,38,0.2);
}

.ww-start-btn:disabled {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.3);
    box-shadow: none;
    cursor: not-allowed;
}

.ww-start-btn:not(:disabled):active {
    transform: scale(0.97);
}

.ww-start-btn:not(:disabled):hover {
    box-shadow: 0 6px 32px rgba(220,38,38,0.35), 0 0 0 1px rgba(220,38,38,0.3);
}

.ww-start-btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

.ww-start-btn:disabled .ww-start-btn-glow {
    display: none;
}

@keyframes shimmer {
    0% { transform: rotate(0deg) translate(-30%, -30%); }
    100% { transform: rotate(0deg) translate(30%, 30%); }
}

.ww-start-btn-text {
    position: relative;
    z-index: 1;
}

/* ── History Section ── */
.ww-section-history {
    padding-bottom: 20px;
}

.ww-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.ww-history-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.ww-history-card:active {
    transform: scale(0.97);
    background: rgba(255,255,255,0.08);
}

.ww-history-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ww-history-date {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
}

.ww-history-result {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.ww-history-result.good {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.ww-history-result.wolf {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}

.ww-history-meta {
    display: flex;
    gap: 10px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
}

/* ── Empty State ── */
.ww-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
}

.ww-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.ww-empty-text {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 4px;
}

.ww-empty-hint {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.2);
}

/* ── Modals ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.ww-modal-card {
    background: rgba(20,20,28,0.98);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 32px 24px;
    max-width: 380px;
    width: 90%;
    position: relative;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.ww-modal-lg {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.ww-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,0.06);
    border: none;
    color: rgba(255,255,255,0.5);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

/* 全屏弹窗里，关闭按钮必须自己避开安全区。
   .ww-modal-fullscreen 的 padding-top 是 env(safe-area-inset-top)，但绝对定位的
   containing block 是 padding box——top:14px 量的是边框内侧，也就是落在那块 padding
   里面。iOS 上刘海/状态栏约 47-59px，按钮整个被盖住；桌面上 env() 回退成 16px，
   所以只在真机上看不见。设置页除了这个按钮没有别的出口，于是它在 iOS 上是死路。 */
.ww-modal-fullscreen .ww-modal-close {
    top: calc(var(--ww-safe-top, 0px) + 14px);
    z-index: 2;
}

.ww-modal-close:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.ww-modal-icon {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.ww-modal-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #e8e8ef;
    margin: 0 0 16px;
}

.ww-modal-msg {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin: 0 0 24px;
    line-height: 1.5;
}

.ww-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.ww-btn-ghost {
    padding: 10px 24px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ww-btn-ghost:hover {
    background: rgba(255,255,255,0.06);
}

.ww-btn-danger {
    padding: 10px 24px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #dc2626, #b91c5c);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.ww-replay-content {
    text-align: left;
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.7);
}

/* ── Toast ── */
.premium-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    border-radius: 14px;
    background: rgba(20,20,28,0.95);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(16px);
    color: #e8e8ef;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.premium-toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.toast-success i { color: #22c55e; }
.toast-warn i { color: #fbbf24; }
.toast-error i { color: #ef4444; }
.toast-info i { color: #60a5fa; }

/* ── Settings Card (legacy compat) ── */
.settings-card {
    background: rgba(20,20,28,0.98);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 24px;
    max-width: 380px;
    width: 90%;
    position: relative;
}

.modal-close-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1.1rem;
    cursor: pointer;
}

/* ── Ambient Background (for game room) ── */
.ambient-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-glow {
    width: 100%;
    height: 100%;
    transition: all 1.5s ease;
}

/* ── Login bar (legacy compat) ── */
.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
}

/* ── Desktop Tweaks ── */
@media (min-width: 768px) {
    .ww-lobby {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .ww-bottom-bar {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .ww-hero {
        padding-top: 20px;
    }
    
    .ww-wolf-icon {
        width: 80px;
        height: 80px;
    }
    
    .ww-title {
        font-size: 2.4rem;
    }
}

/* ═══════════════════════════════════════
   CHARACTER BROWSER — In-App Marketplace
   ═══════════════════════════════════════ */

.ww-modal-fullscreen {
    width: 100%;
    max-width: 100vw;
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    /* 安全区只在这里读一次，下面所有要避开刘海的东西都用这个变量。
       写成变量不只是为了少重复：env() 在桌面浏览器里恒等于回退值，所以「按钮
       有没有躲开刘海」在开发机上根本测不出来——而覆盖一个变量可以。 */
    --ww-safe-top: env(safe-area-inset-top, 0px);
    padding: calc(var(--ww-safe-top) + 16px) 0 env(safe-area-inset-bottom, 0) 0;
    overflow: hidden;
}

.char-browser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px 8px;
    flex-shrink: 0;
}

.char-browser-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.char-browser-back:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.15);
}

.char-browser-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 8px 12px;
    flex: 1;
    max-width: 240px;
}

.char-browser-search i {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

.char-browser-search input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 0.9rem;
    width: 100%;
    -webkit-user-select: auto;
    user-select: auto;
}

.char-browser-search input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.char-browser-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 20px 12px;
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.char-tab {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.char-tab.active {
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.2), rgba(168, 85, 247, 0.15));
    border-color: rgba(94, 234, 212, 0.4);
    color: #5eead4;
}

.char-browser-grid {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    align-content: start;
    -webkit-overflow-scrolling: touch;
}

.char-browser-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}

.char-browser-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.char-browser-item:active {
    transform: scale(0.95);
}

.char-browser-item.in-game {
    border-color: rgba(94, 234, 212, 0.4);
    background: rgba(94, 234, 212, 0.08);
}

.char-browser-item .cb-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.char-browser-item .cb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.char-browser-item .cb-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.char-browser-item .cb-desc {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.char-browser-item .cb-badge {
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(94, 234, 212, 0.15);
    color: #5eead4;
    font-weight: 600;
}

.char-browser-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* ── Custom Character Row List (My Souls Tab) ── */
.char-browser-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px;
    width: 100%;
    box-sizing: border-box;
}

.char-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    gap: 14px;
    transition: all 0.25s ease;
    box-sizing: border-box;
    width: 100%;
}

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

.char-list-item.in-game {
    background: rgba(94, 234, 212, 0.03);
    border-color: rgba(94, 234, 212, 0.25);
}

.char-list-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.char-list-left .char-list-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.char-list-left .char-list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.char-list-left .char-list-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.char-list-left .char-list-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.char-list-left .char-list-role-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    font-weight: 500;
    align-self: flex-start;
}

.char-list-mid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 0;
}

.char-list-mid .char-list-stats-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.cosmic-tier-badge {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    flex-shrink: 0;
}

.char-list-mid .char-list-stats-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.char-list-mid .char-list-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
}

.char-list-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Action Buttons inside rows */
.btn-char-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    outline: none;
}

.btn-char-action i {
    font-size: 0.8rem;
}

.btn-char-redeem {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.btn-char-redeem:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

.btn-char-redeem.glowing-redeem {
    animation: goldPulse 2s infinite alternate;
}

@keyframes goldPulse {
    0% {
        box-shadow: 0 0 4px rgba(245, 158, 11, 0.3);
    }
    100% {
        box-shadow: 0 0 14px rgba(245, 158, 11, 0.8);
    }
}

.btn-char-edit {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.btn-char-edit:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-char-select {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.4);
}

.btn-char-select:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
}

.char-list-item.in-game .btn-char-select {
    background: rgba(94, 234, 212, 0.15);
    border-color: rgba(94, 234, 212, 0.3);
    color: #5eead4;
}

/* ── Leaderboard UI ── */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 16px 20px;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}

.leaderboard-item .leaderboard-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
    border-radius: 50%;
    font-family: 'JetBrains Mono', monospace;
}

.leaderboard-item .leaderboard-rank-1 {
    background: linear-gradient(135deg, #ffe066, #f59e0b);
    color: #1e1b4b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.leaderboard-item .leaderboard-rank-2 {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #0f172a;
    box-shadow: 0 0 8px rgba(148, 163, 184, 0.3);
}

.leaderboard-item .leaderboard-rank-3 {
    background: linear-gradient(135deg, #fed7aa, #ea580c);
    color: #451a03;
    box-shadow: 0 0 8px rgba(234, 88, 12, 0.3);
}

.leaderboard-item .leaderboard-rank-other {
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.03);
}

.leaderboard-item .leaderboard-creator {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 1px;
}

/* ── Read-only Stats & Experience ── */
.stats-experience-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    word-break: break-all;
    white-space: pre-wrap;
    min-height: 48px;
}

.role-mastery-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    width: 100%;
}

.role-mastery-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 10px 12px;
    gap: 10px;
}

.role-mastery-medal-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.role-mastery-medal-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.role-mastery-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.role-mastery-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.role-mastery-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.role-mastery-tier {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 6px;
    font-weight: 700;
}

.role-mastery-stats {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Read-only Profile Card ── */
.readonly-profile-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

.profile-header-card {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 16px;
    gap: 16px;
}

.profile-avatar-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(94, 234, 212, 0.3);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.profile-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-meta-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.profile-role-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.3);
    font-weight: 600;
}

.profile-occupation {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
}

.profile-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.profile-chip i {
    font-size: 0.65rem;
}

/* Sections */
.profile-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.profile-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #5eead4;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-section-title i {
    font-size: 0.8rem;
    opacity: 0.8;
}

.profile-description-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid rgba(94, 234, 212, 0.5);
    padding: 8px 12px;
    margin: 0;
    border-radius: 0 10px 10px 0;
    line-height: 1.6;
}

.profile-experience-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    word-break: break-all;
    white-space: pre-wrap;
    min-height: 50px;
}

.profile-play-voice-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(94, 234, 212, 0.1);
    border: 1px solid rgba(94, 234, 212, 0.3);
    border-radius: 20px;
    color: #5eead4;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.profile-play-voice-btn:hover {
    background: rgba(94, 234, 212, 0.2);
    border-color: #5eead4;
    transform: translateY(-1px);
}

.profile-play-voice-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.profile-play-voice-btn i {
    font-size: 0.8rem;
}


/* ═══ 个人设置页：主持人选择 ═══
   卡片式而不是下拉：可选主持从 8 个放开到 86 个，下拉框里滚 86 项没法比较，
   而试听是这个功能的主体——头像 + 名字 + 播放按钮，一眼能扫过去。 */
.settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.settings-row-block { flex-direction: column; align-items: flex-start; gap: 4px; border-bottom: none; }
.settings-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.9rem; font-weight: 600; color: #e8e8ef; white-space: nowrap;
}
.settings-label i { color: rgba(255,255,255,0.4); }
.settings-select {
    flex: 1; max-width: 220px; padding: 8px 12px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.06);
    color: #e8e8ef; font-size: 0.85rem; cursor: pointer; outline: none;
}
.settings-hint { font-size: 0.75rem; color: rgba(255,255,255,0.35); line-height: 1.5; }
.settings-hostlist { flex: 1; overflow-y: auto; width: 100%; padding-bottom: 20px; }

.host-section-title {
    font-size: 0.8rem; font-weight: 700; color: rgba(255,255,255,0.45);
    margin: 18px 0 10px; letter-spacing: 0.04em;
}
.host-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 12px;
}
.host-card {
    position: relative; padding: 10px 6px; border-radius: 14px; cursor: pointer;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
    text-align: center; transition: background .15s ease, border-color .15s ease;
    outline: none;
}
.host-card:hover, .host-card:focus-visible { background: rgba(255,255,255,0.07); }
/* 选中态用边框而不是背景：86 张卡片里要一眼找到当前那张。 */
.host-card.is-selected {
    border-color: #5eead4;
    background: rgba(94,234,212,0.10);
    box-shadow: 0 0 0 1px rgba(94,234,212,0.35);
}
.host-card-avatar { position: relative; width: 56px; height: 56px; margin: 0 auto 8px; }
.host-card-avatar img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
    background: rgba(255,255,255,0.06);
}
.host-card-play {
    position: absolute; right: -2px; bottom: -2px;
    width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.15); background: rgba(10,10,14,0.9);
    color: #e8e8ef; font-size: 0.55rem; line-height: 1; padding: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s ease, transform .15s ease;
}
.host-card-play:hover { background: rgba(94,234,212,0.25); }
.host-card-play:active { transform: scale(0.9); }
/* 正在播的那张要有明确状态，否则连点两下不知道是没响应还是在播。 */
.host-card.is-playing .host-card-play { background: #5eead4; color: #000; }
.host-card.is-playing .host-card-avatar img { box-shadow: 0 0 0 2px #5eead4; }
.host-card-name {
    font-size: 0.75rem; color: #e8e8ef; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.host-card-tag {
    position: absolute; top: 4px; left: 4px;
    font-size: 0.55rem; padding: 1px 5px; border-radius: 6px;
    background: rgba(94,234,212,0.16); color: #5eead4;
}
.host-empty {
    padding: 30px 10px; text-align: center;
    font-size: 0.85rem; color: rgba(255,255,255,0.35);
}

/* 主持人行。做成一整块可点区域而不是「标签 + 小按钮」：手机窄屏上把标签和控件拆成
   两个兄弟节点，换行时标签会被甩下去落单——房间设置那一行就这么错过一次。 */
.ww-host-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: #e8e8ef;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.ww-host-chip:hover,
.ww-host-chip:focus-visible {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    outline: none;
}

.ww-host-chip-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.08);
}

.ww-host-chip-name {
    flex: 1;
    font-weight: 500;
    /* 名字可能很长（「至尊宝 · 星爷音色」这类），挤走箭头不如自己截断。 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ww-host-chip-arrow {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
}

/* AI casting row: the player's own line plus the button */
.dr-castme { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.dr-castme .dr-search { flex: 1; margin: 0; }
.dr-castme .dr-chip { white-space: nowrap; }
.dr-castme .dr-select { flex: none; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #fff; border-radius: 10px; padding: 9px 10px; font-size: .9rem; }

/* The cast the director designed: one card per role, tap to make it the target for the grid below */
.dr-roles { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.dr-logline { font-size: .9rem; color: rgba(255,255,255,.85); line-height: 1.4; }
.dr-role { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); cursor: pointer; }
.dr-role.is-active { border-color: #6fcf97; background: rgba(111,207,151,.08); }
.dr-role-avatar .dr-avatar-img, .dr-role-empty { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.dr-role-empty { display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.08); color: var(--dr-dim, #9aa); font-weight: 700; }
.dr-role-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: .82rem; }
.dr-role-head b { font-size: .95rem; }
.dr-role-slot { font-size: .68rem; padding: 1px 6px; border-radius: 8px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.75); margin-right: 4px; }
.dr-role-actor { color: rgba(255,255,255,.6); font-size: .78rem; }
.dr-role-who { color: rgba(255,255,255,.9); }
.dr-role-bg { color: rgba(255,255,255,.62); line-height: 1.4; }
.dr-role-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Home feed: live episodes, your relationships, popular badge */
.dr-live { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.dr-live-item { position: relative; flex: 0 0 220px; height: 120px; border: 0; border-radius: 14px; overflow: hidden; padding: 0; text-align: left; background: #1a2029 center / cover no-repeat; color: #fff; cursor: pointer; font: inherit; }
.dr-live-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.85)); }
.dr-live-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.dr-live-title { font-size: .9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-live-meta { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: rgba(255,255,255,.85); }
/* renderAvatar also adds .avatar-img, whose size would win otherwise */
.dr-live-meta .dr-live-face { width: 20px !important; height: 20px !important; border-radius: 50%; object-fit: cover; border: 1.5px solid rgba(0,0,0,.6); margin-right: -6px; }
.dr-live-foot { font-size: .7rem; color: rgba(255,255,255,.7); display: flex; align-items: center; gap: 5px; }
.dr-live-foot b { margin-left: auto; color: #6fcf97; }
.dr-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff5f5f; box-shadow: 0 0 0 0 rgba(255,95,95,.6); animation: dr-live-pulse 1.4s infinite; }
@keyframes dr-live-pulse { 70% { box-shadow: 0 0 0 6px rgba(255,95,95,0); } 100% { box-shadow: 0 0 0 0 rgba(255,95,95,0); } }
.dr-mine { display: flex; flex-direction: column; gap: 8px; }
/* Replays: a scrolling row of finished episodes */
.dr-replays { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.dr-replay-item { flex: 0 0 112px; color: inherit; text-decoration: none; }
.dr-replay-cover { position: relative; width: 112px; height: 150px; border-radius: 10px; background: rgba(255,255,255,.06) center/cover no-repeat; }
.dr-replay-cover span { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center; font-size: 12px; }
.dr-replay-title { margin-top: 6px; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dr-replay-date { font-size: 11px; opacity: .55; margin-top: 2px; }
.dr-mine-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.dr-mine-item .dr-mine-face { width: 44px !important; height: 44px !important; border-radius: 50%; object-fit: cover; flex: 0 0 44px; }
.dr-mine-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: .8rem; }
.dr-mine-title { font-size: .9rem; font-weight: 600; }
.dr-mine-genre { font-size: .68rem; padding: 1px 6px; border-radius: 8px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.75); }
.dr-mine-head { color: rgba(255,255,255,.85); }
.dr-mine-hook { color: #e9c46a; }
.dr-mine-next { white-space: nowrap; }
.dr-prog-hot { margin-left: 6px; font-size: .64rem; padding: 1px 6px; border-radius: 8px; background: rgba(255,120,60,.25); color: #ffb28a; }

/* The script as editable cards (home page): logline, then each person's fields; lengths mirror the server's limits */
.dr-logline-edit { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: rgba(255,255,255,.6); }
.dr-logline-edit textarea, .dr-role-edit { width: 100%; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #fff; border-radius: 8px; padding: 6px 8px; font-size: .85rem; font-family: inherit; resize: vertical; box-sizing: border-box; }
.dr-role-edit:focus, .dr-logline-edit textarea:focus { outline: none; border-color: #6fcf97; }
.dr-role { cursor: default; }
.dr-role-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dr-role-name { flex: 1; min-width: 90px; font-weight: 700; }
.dr-role-age { width: 64px; }
select.dr-role-edit { width: auto; }
.dr-logline-edit, .dr-role-foot { grid-column: 1 / -1; }
.dr-script-go { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.dr-script-go .dr-picked { flex: 1; min-width: 160px; }
.dr-script-go .dr-start { min-width: 200px; }

/* A card's replays (briefing): everyone's shared episodes and your own, each labelled by how it ended */
.dr-card-replays { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.dr-card-replays::-webkit-scrollbar { display: none; }
.dr-card-replay { flex: 0 0 112px; color: inherit; text-decoration: none; }
.dr-card-replay-kind { font-size: 12px; font-weight: 600; margin-top: 6px; }
.dr-card-replay-kind.is-success { color: #f3c26a; }
.dr-card-replay-kind.is-lost_to_antagonist, .dr-card-replay-kind.is-failed, .dr-card-replay-kind.is-rejected { color: #f08a8a; }
.dr-card-replay-head { font-size: 12px; line-height: 1.35; opacity: .8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dr-card-replay-mine { font-weight: 600; margin-right: 4px; opacity: 1; }
