/* ==========================================================================
   WEREWOLF LOBBY - PREMIUM CHARACTER CREATOR WIZARD STYLES
   ========================================================================== */

:root {
    --purple: #a855f7;
    --purple-glow: rgba(168, 85, 247, 0.4);
    --pink: #ec4899;
    --gold: #f3c26a;
    --gold-glow: rgba(243, 194, 106, 0.4);
    --cyan: #5eead4;
    --cyan-glow: rgba(94, 234, 212, 0.4);
    --danger: #ef4444;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --bg-deep: #0f0f14;
    --border-color: rgba(255, 255, 255, 0.08);
    --success-green: #4ade80;
    --warning-yellow: #eab308;
    --error-red: #ef4444;
}

/* === Wizard Overlay Setup === */
#createCharacterOverlay {
    z-index: 10200;
}

.creator-wizard-card {
    width: 92vw;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    padding: 0;
    border-radius: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(20, 20, 28, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 40px rgba(168, 85, 247, 0.08);
}

.creator-wizard-card::-webkit-scrollbar {
    width: 4px;
}

.creator-wizard-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* === Step Progress === */
.wizard-steps {
    display: flex;
    align-items: center;
    padding: 24px 28px 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.wizard-step span {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color 0.3s;
}

.step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wizard-step.active .step-dot {
    background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 0 20px var(--purple-glow);
    transform: scale(1.08);
}

.wizard-step.active span {
    color: var(--text-primary);
}

.wizard-step.completed .step-dot {
    background: rgba(94, 234, 212, 0.15);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 10px rgba(94, 234, 212, 0.1);
}

.wizard-step.completed span {
    color: var(--cyan);
}

.wizard-step-connector {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0 6px;
    margin-bottom: 18px;
    border-radius: 2px;
    transition: background 0.4s;
    position: relative;
    overflow: hidden;
}

.wizard-step-connector.filled::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    animation: fillBar 0.5s ease forwards;
}

@keyframes fillBar {
    from { width: 0; }
    to { width: 100%; }
}

/* === Panel Base === */
.wizard-panel {
    display: none;
    padding: 20px 28px 24px;
    animation: wizardFadeIn 0.35s ease forwards;
}

.wizard-panel.active {
    display: block;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

@keyframes wizardFadeIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.wizard-panel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.wizard-panel-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px 0;
}

.wizard-panel-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.panel-icon-ring {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ==========================================================================
   STEP 1: SOUL SCANNING STYLES
   ========================================================================== */
.dna-ring {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
    color: var(--purple);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.15);
}

.soul-source-selector {
    display: flex;
    gap: 6px;
    padding: 3px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 16px;
}

.soul-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.soul-tab i {
    font-size: 1.05rem;
}

.soul-tab.active {
    background: rgba(168, 85, 247, 0.15);
    color: #e9d5ff;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.soul-inputs {
    margin-bottom: 18px;
}

.soul-input-box {
    display: none;
}

.soul-input-box.active {
    display: block;
}

.soul-textarea {
    width: 100%;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.soul-textarea:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}

.soul-textarea::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.soul-drop-zone {
    border: 2px dashed rgba(168, 85, 247, 0.25);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(168, 85, 247, 0.02);
}

.soul-drop-zone:hover {
    border-color: rgba(168, 85, 247, 0.45);
    background: rgba(168, 85, 247, 0.06);
}

.soul-drop-icon {
    font-size: 2rem;
    color: var(--purple);
    opacity: 0.7;
}

.soul-drop-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.soul-drop-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.soul-file-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(94, 234, 212, 0.06);
    border: 1px solid rgba(94, 234, 212, 0.2);
    border-radius: 10px;
    color: var(--cyan);
    font-size: 0.8rem;
    font-weight: 500;
    box-sizing: border-box;
}

.soul-file-badge span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soul-file-clear {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 2px 4px;
    outline: none;
    font-size: 0.85rem;
}

.soul-file-clear:hover {
    color: var(--danger);
}

.soul-url-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.soul-url-icon {
    color: var(--purple);
    opacity: 0.7;
}

.soul-url-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    flex: 1;
    padding: 0;
    margin: 0;
}

.soul-url-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin: 4px 0 0 0;
}

.btn-soul-scan {
    width: 100%;
    background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
    outline: none;
}

.btn-soul-scan:hover {
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.btn-soul-scan:disabled {
    opacity: 0.6;
    cursor: wait;
}

.discovery-title i {
    color: var(--purple);
}

/* ==========================================================================
   MULTI-PERSONA DISCOVERY UI
   ========================================================================== */
.multi-persona-selector {
    margin-top: 16px;
    padding: 12px;
    background: rgba(168, 85, 247, 0.04);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 12px;
}

.discovery-header {
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.discovery-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f3e8ff;
    margin: 0 0 2px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.discovery-subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
}

.persona-discovery-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.persona-discovery-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.persona-discovery-card:hover {
    background: rgba(168, 85, 247, 0.06);
    border-color: rgba(168, 85, 247, 0.2);
}

.persona-discovery-card .persona-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--purple) 0%, #7e22ce 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.persona-discovery-info {
    flex: 1;
    min-width: 0;
}

.persona-discovery-info h5 {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 0 2px 0;
    color: white;
}

.persona-discovery-info .persona-occu {
    font-size: 0.65rem;
    color: var(--purple);
    font-weight: 500;
    margin-bottom: 2px;
}

.persona-discovery-info .persona-desc {
    font-size: 0.65rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.persona-discovery-card .select-indicator {
    opacity: 0;
    color: var(--purple);
    font-size: 0.8rem;
    transition: opacity 0.2s;
    margin-left: auto;
}

.persona-discovery-card:hover .select-indicator {
    opacity: 1;
}

/* ==========================================================================
   STEP 2: IDENTITY STYLES
   ========================================================================== */
.identity-ring {
    background: linear-gradient(135deg, rgba(243, 194, 106, 0.15), rgba(255, 140, 0, 0.15));
    color: var(--gold);
    box-shadow: 0 0 16px rgba(243, 194, 106, 0.15);
}

.identity-hero-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.avatar-preview-box {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-preview-box:hover {
    border-color: var(--purple);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.avatar-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.2);
}

.identity-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.identity-field-group {
    display: flex;
    flex-direction: column;
}

.identity-field-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.field-required {
    color: var(--pink);
    margin-left: 2px;
}

.identity-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.identity-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(243, 194, 106, 0.1);
}

/* Avatar Source Picker Setup */
.char-avatar-picker-section {
    margin-bottom: 16px;
}

.avatar-src-tabs {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.25);
    padding: 2px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.avatar-tab {
    flex: 1;
    text-align: center;
    padding: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.avatar-tab.active {
    background: rgba(243, 194, 106, 0.15);
    color: var(--gold);
    border: 1px solid rgba(243, 194, 106, 0.2);
}

.avatar-picker-content {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.avatar-ai-panel {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.avatar-ai-panel.active {
    display: flex;
}

.avatar-ai-prompt {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px;
    color: var(--text-primary);
    font-size: 0.8rem;
    line-height: 1.4;
    resize: none;
    min-height: 60px;
    box-sizing: border-box;
    font-family: inherit;
}

.avatar-ai-prompt:focus {
    border-color: var(--purple);
    outline: none;
}

.avatar-ai-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.avatar-style-selector {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px;
    border-radius: 8px;
}

.avatar-style-chip {
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.avatar-style-chip.active {
    background: var(--purple);
    color: white;
}

.avatar-ref-upload-label {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.68rem;
    color: var(--text-secondary);
    cursor: pointer;
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.avatar-ref-upload-label:hover {
    border-color: var(--purple);
}

.btn-avatar-gen {
    margin-left: auto;
    background: linear-gradient(135deg, var(--purple) 0%, #7e22ce 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-avatar-gen:hover {
    box-shadow: 0 4px 10px rgba(168, 85, 247, 0.3);
}

.btn-avatar-gen:disabled {
    opacity: 0.5;
}

.avatar-upload-zone {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.avatar-upload-zone.active {
    display: flex;
}

.avatar-upload-zone:hover {
    border-color: var(--purple);
    background: rgba(168, 85, 247, 0.04);
}

.avatar-upload-zone i {
    font-size: 1.5rem;
    opacity: 0.6;
}

.avatar-drop-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0;
}

/* Gender Pills */
.gender-pill-row {
    display: flex;
    gap: 6px;
}

.gender-pill {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    text-align: center;
}

.gender-pill.active {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    color: #e9d5ff;
}

/* Role Selector Piles */
.role-pill-row {
    display: flex;
    gap: 8px;
}

.role-pill {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.role-pill i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.role-pill-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: left;
}

.role-pill-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: inherit;
}

.role-pill-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.role-pill.active[data-role="participant"] {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    color: #e9d5ff;
}

.role-pill.active[data-role="director"] {
    background: rgba(243, 194, 106, 0.15);
    border-color: rgba(243, 194, 106, 0.45);
    color: var(--gold);
}

.role-pill.active .role-pill-desc {
    color: var(--text-secondary);
}

/* Advanced Setup Details */
.advanced-setup {
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
    overflow: hidden;
}

.advanced-setup-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    list-style: none;
    user-select: none;
}

.advanced-setup-toggle::-webkit-details-marker {
    display: none;
}

.advanced-setup[open] .advanced-setup-toggle {
    color: var(--gold);
    border-bottom: 1px solid rgba(243, 194, 106, 0.15);
}

.advanced-chevron {
    margin-left: auto;
    font-size: 0.65rem;
    transition: transform 0.2s;
}

.advanced-setup[open] .advanced-chevron {
    transform: rotate(180deg);
}

.advanced-setup-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.age-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.age-input {
    width: 60px !important;
    text-align: center;
}

.age-presets {
    display: flex;
    gap: 4px;
}

.age-chip,
.era-chip {
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.age-chip.active,
.era-chip.active {
    background: rgba(94, 234, 212, 0.15);
    border-color: var(--cyan);
    color: var(--cyan);
}

.char-context-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.context-icon {
    font-size: 0.75rem;
    opacity: 0.6;
}

.era-chips {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

/* Personality block */
.personality-block {
    margin-bottom: 16px;
}

.personality-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.ai-filled-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--purple);
    background: rgba(168, 85, 247, 0.1);
    padding: 2px 6px;
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.15);
    display: flex;
    align-items: center;
    gap: 3px;
}

.personality-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    min-height: 90px;
    box-sizing: border-box;
}

.personality-textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(243, 194, 106, 0.1);
}

/* ==========================================================================
   STEP 3: VOICE CLONING STYLES
   ========================================================================== */
.voice-ring {
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.15), rgba(59, 130, 246, 0.15));
    color: var(--cyan);
    box-shadow: 0 0 16px rgba(94, 234, 212, 0.15);
}

.voice-source-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.voice-source-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

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

.voice-source-item.active {
    background: rgba(94, 234, 212, 0.08);
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(94, 234, 212, 0.1);
}

.voice-source-item i {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.voice-source-item.active i {
    color: var(--cyan);
}

.voice-source-item p {
    margin: 0;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.voice-source-item.active p {
    color: var(--text-primary);
    font-weight: 600;
}

.voice-file-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(94, 234, 212, 0.05);
    border: 1px solid rgba(94, 234, 212, 0.15);
    border-radius: 10px;
    color: var(--cyan);
    font-size: 0.78rem;
    margin-bottom: 12px;
}

/* Audio Recording UI */
.recording-ui {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px;
    border-radius: 14px;
    box-sizing: border-box;
}

.rec-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.rec-dot.recording {
    animation: recPulse 1.5s infinite;
}

@keyframes recPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.voice-reading-script {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 8px 0;
    box-sizing: border-box;
}

.voice-reading-script .script-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cyan);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.voice-reading-script .script-content {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.voice-reading-script .script-timer-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
}

/* Audio WaveSurfer & Clipper UI */
.voice-analysis-panel {
    background: rgba(10, 10, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px;
    margin-top: 14px;
}

.analysis-header {
    display: flex;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.analysis-header i {
    color: var(--cyan);
}

.analysis-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 4px;
}

.analysis-quality-badge {
    margin-left: auto;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}

#transcriptContainer {
    max-height: 180px !important;
}

/* Custom STT Word Bubbles */
.stt-bubble-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    margin-bottom: 6px;
}

.stt-bubble-row.disabled {
    opacity: 0.35;
}

.stt-bubble-play {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(94, 234, 212, 0.1);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    outline: none;
}

.stt-bubble-content {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.stt-word {
    display: inline-block;
    padding: 0px 2px;
    margin: 0px 1px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.stt-word:hover {
    background: rgba(255, 255, 255, 0.08);
}

.stt-word.active {
    color: var(--text-primary);
}

.stt-word.active.playing {
    background-color: rgba(94, 234, 212, 0.3);
    color: #fff;
}

.stt-word.inactive {
    color: rgba(255, 255, 255, 0.25);
    text-decoration: line-through;
}

/* Transliteration details toggle switch */
.stt-toggle {
    position: relative;
    width: 32px;
    height: 18px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    transition: all 0.2s;
}

.stt-toggle.active {
    background: var(--cyan);
    border-color: var(--cyan);
}

.stt-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.stt-toggle.active::after {
    transform: translateX(14px);
}

/* Visibility toggle switch styles */
.visibility-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 10px;
}

.visibility-toggle-row input[type="checkbox"] {
    display: none;
}

.toggle-track {
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 2px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.visibility-toggle-row input:checked+.toggle-track {
    background: var(--purple);
}

.toggle-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.visibility-toggle-row input:checked+.toggle-track .toggle-thumb {
    transform: translateX(16px);
}

.visibility-toggle-row span {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   WIZARD FOOTER & COMMON NAV BUTTONS
   ========================================================================== */
.wizard-nav-footer {
    text-align: center;
    margin-top: 18px;
}

.wizard-nav-footer.two-col {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.wizard-nav-footer button {
    outline: none;
}

.btn-wizard-cancel {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text-secondary) !important;
    padding: 10px 18px !important;
    border-radius: 10px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    white-space: nowrap !important;
}

.btn-wizard-cancel:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: white !important;
}

.btn-wizard-back {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-wizard-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.btn-wizard-next {
    flex: 1;
    background: linear-gradient(135deg, var(--gold) 0%, #e88c00 100%);
    color: #111;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-wizard-next:hover {
    box-shadow: 0 4px 14px rgba(243, 194, 106, 0.25);
}

.skip-link {
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.skip-link:hover {
    color: var(--text-secondary);
}

#confirmCreateCharBtn {
    background: #5eead4 !important;
    color: #111 !important;
    border: none !important;
    padding: 10px 18px !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    cursor: pointer !important;
}

#confirmCreateCharBtn:disabled {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed !important;
}

.wizard-status {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 10px;
    text-align: center;
}

/* === Responsive adjustments === */
@media (max-width: 600px) {
    .creator-wizard-card {
        max-height: 90vh;
        width: 95vw;
    }

    .wizard-panel {
        padding: 16px 20px;
    }

    .wizard-steps {
        padding: 18px 20px 14px;
    }

    .wizard-nav-footer.two-col {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .wizard-nav-footer.two-col > div {
        justify-content: space-between;
        width: 100%;
    }

    .btn-wizard-next, #confirmCreateCharBtn {
        width: 100%;
    }

    .char-context-row {
        grid-template-columns: 1fr;
    }

    .voice-source-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   VOICE PRESET PICKER (iOS Native App)
   ========================================================================== */

.voice-picker-filters {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    padding: 3px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.voice-filter-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 7px;
    padding: 8px 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

.voice-filter-btn.active {
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.15), rgba(94, 234, 212, 0.08));
    color: var(--cyan);
    border: 1px solid rgba(94, 234, 212, 0.25);
}

.voice-preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.voice-preset-grid::-webkit-scrollbar {
    width: 3px;
}

.voice-preset-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.voice-preset-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.voice-preset-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(94, 234, 212, 0.03));
    opacity: 0;
    transition: opacity 0.3s;
}

.voice-preset-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(94, 234, 212, 0.2);
    transform: translateY(-1px);
}

.voice-preset-card:hover::before {
    opacity: 1;
}

.voice-preset-card.selected {
    background: rgba(94, 234, 212, 0.06);
    border-color: var(--cyan);
    box-shadow: 0 0 16px rgba(94, 234, 212, 0.15), inset 0 0 20px rgba(94, 234, 212, 0.03);
}

.voice-preset-card.selected::after {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 6px;
    right: 6px;
    color: var(--cyan);
    font-size: 0.75rem;
}

.voice-card-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.voice-card-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
}

.voice-card-style {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
}

.voice-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.voice-lang-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.voice-lang-badge.lang-en {
    background: rgba(59, 130, 246, 0.15);
    color: #93bbfd;
}

.voice-lang-badge.lang-zh {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.voice-lang-badge.lang-ja {
    background: rgba(168, 85, 247, 0.15);
    color: #d8b4fe;
}

.voice-lang-badge.lang-yue {
    background: rgba(243, 194, 106, 0.15);
    color: var(--gold);
}

.voice-card-play {
    background: rgba(94, 234, 212, 0.1);
    border: 1px solid rgba(94, 234, 212, 0.2);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.voice-card-play:hover {
    background: rgba(94, 234, 212, 0.2);
    transform: scale(1.1);
}

.voice-card-play.playing {
    background: var(--cyan);
    color: #0f0f14;
    animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(94, 234, 212, 0); }
}

.voice-picker-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    background: rgba(94, 234, 212, 0.06);
    border: 1px solid rgba(94, 234, 212, 0.15);
    border-radius: 10px;
    color: var(--cyan);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Mobile adjustments */
@media (max-width: 360px) {
    .voice-preset-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .voice-preset-card {
        padding: 10px 6px;
    }
    
    .voice-card-name {
        font-size: 0.72rem;
    }
}
