/* ═══════════════════════════════════════════════════════════════
   LLOS.ai — Character Casting V2 (page-specific styles only)
   Nav styles are in v2-shared.css
   ═══════════════════════════════════════════════════════════════ */

:root {
    --cv2-blue:        #3b82f6;
    --cv2-blue-light:  #eff6ff;
    --cv2-blue-border: #bfdbfe;
    --cv2-blue-deep:   #2563eb;
    --cv2-blue-glow:   rgba(59,130,246,0.2);

    --cv2-surface:     #ffffff;
    --cv2-bg:          #f1f5f9;
    --cv2-border:      #e2e8f0;
    --cv2-border-light:#f1f5f9;

    --cv2-text:        #0f172a;
    --cv2-text-mid:    #475569;
    --cv2-text-muted:  #94a3b8;
    --cv2-text-light:  #cbd5e1;

    --cv2-nav-h:       52px;
    --cv2-bottom-h:    60px;
    --cv2-radius:      12px;
    --cv2-radius-lg:   14px;
}

.cv2-body-lock {
    overflow: hidden;
    height: 100vh;
}


/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */

.cv2-main {
    height: calc(100vh - var(--cv2-nav-h) - var(--cv2-bottom-h) - 28px);
    overflow-y: auto;
    scroll-behavior: smooth;
}
.cv2-container {
    max-width: 920px;
    margin: 0 auto;
    padding: 16px 16px 20px;
}

/* Header — purpose-driven */
.cv2-header {
    text-align: center;
    margin-bottom: 16px;
}
.cv2-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--cv2-text);
    margin-bottom: 6px;
}
.cv2-subtitle {
    font-size: 13px;
    color: var(--cv2-text-muted);
    line-height: 1.5;
    max-width: 520px;
    margin: 0 auto;
}
.cv2-subtitle strong { color: var(--cv2-text-mid); }


/* ═══════════════════════════════════════════════════════════════
   SELECTED CHARACTERS — Two Slots
   ═══════════════════════════════════════════════════════════════ */

.cv2-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 8px;
}

.cv2-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    background: var(--cv2-surface);
    border: 2px solid var(--cv2-border);
    border-radius: var(--cv2-radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 150px;
    position: relative;
}
.cv2-slot:hover {
    border-color: var(--cv2-blue-border);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.cv2-slot.active {
    border-color: var(--cv2-blue);
    background: var(--cv2-blue-light);
    box-shadow: 0 0 0 3px var(--cv2-blue-glow), 0 4px 16px rgba(59,130,246,0.1);
}
.cv2-slot.filled { border-color: var(--cv2-blue-border); }
.cv2-slot.filled.active { border-color: var(--cv2-blue); }

/* Slot badge */
.cv2-slot-badge {
    position: absolute;
    top: -9px; left: 50%;
    transform: translateX(-50%);
    font-size: 9px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 10px;
    border-radius: 10px;
    background: var(--cv2-surface);
    border: 1px solid var(--cv2-border);
    color: var(--cv2-text-muted);
    white-space: nowrap;
}
.cv2-slot.active .cv2-slot-badge {
    background: var(--cv2-blue);
    border-color: var(--cv2-blue);
    color: white;
}

/* Slot avatar */
.cv2-slot-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 800;
    color: white;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.cv2-slot-avatar img {
    width: 100%; height: 100%;
    object-fit: cover; border-radius: 50%;
}
.cv2-slot-avatar.empty {
    background: var(--cv2-border);
    color: var(--cv2-text-light);
    border: 2px dashed var(--cv2-text-light);
    font-size: 18px;
}
.cv2-slot.active .cv2-slot-avatar.empty {
    border-color: var(--cv2-blue-border);
    color: var(--cv2-blue);
    background: white;
}

.cv2-slot-name {
    font-size: 14px; font-weight: 700;
    color: var(--cv2-text);
}
.cv2-slot-role {
    font-size: 10px; font-weight: 600;
    color: var(--cv2-text-muted);
    font-style: italic;
}

/* VS divider */
.cv2-versus {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0 10px;
    flex-shrink: 0;
}
.cv2-vs-line { width: 1px; height: 14px; background: var(--cv2-border); }
.cv2-vs-circle {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--cv2-surface);
    border: 1px solid var(--cv2-border);
    display: flex; align-items: center; justify-content: center;
    color: var(--cv2-text-light);
    font-size: 11px;
}


/* ═══════════════════════════════════════════════════════════════
   CASTING GUIDANCE — tells user what to do next
   ═══════════════════════════════════════════════════════════════ */

.cv2-casting-for {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--cv2-blue);
    background: var(--cv2-blue-light);
    border: 1px solid var(--cv2-blue-border);
    border-radius: 8px;
    animation: cv2-pulseGlow 2s ease-in-out infinite;
}
.cv2-casting-for i { font-size: 13px; }
.cv2-casting-for strong { font-weight: 700; }

@keyframes cv2-pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 var(--cv2-blue-glow); }
    50% { box-shadow: 0 0 0 6px transparent; }
}


/* ═══════════════════════════════════════════════════════════════
   CHARACTER GRID
   ═══════════════════════════════════════════════════════════════ */

.cv2-available { margin-top: 2px; }

.cv2-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* Character Card */
.cv2-char-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px 12px;
    background: var(--cv2-surface);
    border: 2px solid var(--cv2-border);
    border-radius: var(--cv2-radius);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    text-align: center;
}
.cv2-char-card:hover {
    border-color: var(--cv2-blue-border);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
}
.cv2-char-card.selected {
    border-color: var(--cv2-blue);
    background: var(--cv2-blue-light);
    box-shadow: 0 0 0 3px var(--cv2-blue-glow);
}

/* Selected badge */
.cv2-char-card .cv2-assigned-badge {
    display: none;
    position: absolute;
    top: 6px; right: 6px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--cv2-blue);
    color: white;
    font-size: 9px; font-weight: 800;
    align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(59,130,246,0.3);
}
.cv2-char-card.selected .cv2-assigned-badge { display: flex; }

/* Character Avatar */
.cv2-char-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800;
    color: white;
    margin-bottom: 8px;
    transition: transform 0.3s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    position: relative;
}
.cv2-char-avatar img {
    width: 100%; height: 100%;
    object-fit: cover; border-radius: 50%;
    position: absolute; inset: 0;
}
.cv2-char-card:hover .cv2-char-avatar { transform: scale(1.06); }

/* Character Info */
.cv2-char-name {
    font-size: 13px; font-weight: 700;
    color: var(--cv2-text);
    margin-bottom: 3px;
}

.cv2-char-type {
    font-size: 9px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 4px;
}
.cv2-type-energetic  { background: #dbeafe; color: #2563eb; }
.cv2-type-measured   { background: #e0e7ff; color: #4338ca; }
.cv2-type-friendly   { background: #cffafe; color: #0e7490; }
.cv2-type-thoughtful { background: #f3e8ff; color: #7c3aed; }
.cv2-type-bright     { background: #fce7f3; color: #be185d; }
.cv2-type-poised     { background: #e0e7ff; color: #4338ca; }
.cv2-type-warm       { background: #fef3c7; color: #b45309; }
.cv2-type-patient    { background: #dcfce7; color: #15803d; }

.cv2-char-desc {
    font-size: 11px;
    color: var(--cv2-text-muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.cv2-char-voice {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px; font-weight: 600;
    color: var(--cv2-text-light);
}
.cv2-char-voice i { font-size: 9px; }

/* Gender indicator */
.cv2-gender-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    position: absolute;
    bottom: 2px; right: 2px;
    border: 2px solid white;
}
.cv2-gender-male   { background: #3b82f6; }
.cv2-gender-female { background: #ec4899; }


/* ═══════════════════════════════════════════════════════════════
   BOTTOM BAR
   ═══════════════════════════════════════════════════════════════ */

.cv2-bottom {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--cv2-bottom-h);
    background: var(--cv2-surface);
    border-top: 1px solid var(--cv2-border);
    z-index: 40;
}
.cv2-bottom-inner {
    max-width: 920px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 12px;
}

.cv2-scenario-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--cv2-text-muted);
    min-width: 0;
}
.cv2-scenario-info i { color: var(--cv2-text-light); }
.cv2-scenario-info strong { color: var(--cv2-text-mid); }

.cv2-diff-badge {
    font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 8px;
    text-transform: capitalize; flex-shrink: 0;
}
.cv2-diff-beginner     { background: #dcfce7; color: #166534; }
.cv2-diff-intermediate { background: #fef3c7; color: #92400e; }
.cv2-diff-advanced     { background: #fce7f3; color: #9d174d; }

.cv2-phrase-count {
    font-size: 11px;
    color: var(--cv2-text-light);
    flex-shrink: 0;
}

.cv2-bottom-actions {
    display: flex;
    gap: 8px; flex-shrink: 0;
}
.cv2-btn-back {
    display: flex; align-items: center; gap: 5px;
    padding: 8px 14px; border-radius: 8px;
    font-size: 12px; font-weight: 600;
    color: var(--cv2-text-mid);
    background: var(--cv2-bg);
    transition: all 0.2s;
}
.cv2-btn-back:hover { background: var(--cv2-border); color: var(--cv2-text); }

.cv2-btn-confirm {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 20px; border-radius: 8px;
    font-size: 12px; font-weight: 700;
    color: white;
    background: var(--cv2-blue);
    box-shadow: 0 3px 10px rgba(59,130,246,0.3);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cv2-btn-confirm:hover {
    background: var(--cv2-blue-deep);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(59,130,246,0.4);
}
.cv2-btn-confirm:active { transform: scale(0.97); }
.cv2-btn-confirm.disabled { opacity: 0.4; pointer-events: none; }
.cv2-btn-confirm.ready {
    animation: cv2-confirmPulse 2s ease-in-out infinite;
}
@keyframes cv2-confirmPulse {
    0%, 100% { box-shadow: 0 3px 10px rgba(59,130,246,0.3); }
    50% { box-shadow: 0 3px 18px rgba(59,130,246,0.5); }
}


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
    .cv2-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .cv2-container { padding: 12px 10px 16px; }
    .cv2-title { font-size: 20px; }
    .cv2-subtitle { font-size: 12px; }

    .cv2-slot { min-width: 120px; padding: 12px 14px; }
    .cv2-slot-avatar { width: 48px; height: 48px; font-size: 18px; }
    .cv2-versus { padding: 0 8px; }
    .cv2-vs-circle { width: 26px; height: 26px; font-size: 10px; }
    .cv2-vs-line { height: 10px; }

    .cv2-char-avatar { width: 48px; height: 48px; font-size: 16px; }
    .cv2-char-card { padding: 12px 8px 10px; }
    .cv2-char-name { font-size: 12px; }
    .cv2-char-desc { font-size: 10px; -webkit-line-clamp: 1; }
    .cv2-char-voice { display: none; }

    .cv2-scenario-info span:not(.cv2-diff-badge) { display: none; }
    .cv2-scenario-info i { display: none; }
}


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 479px) {
    .cv2-title { font-size: 18px; }
    .cv2-header { margin-bottom: 10px; }

    .cv2-selected { gap: 0; }
    .cv2-slot { min-width: 105px; padding: 10px 8px; }
    .cv2-slot-avatar { width: 44px; height: 44px; font-size: 16px; }
    .cv2-slot-avatar.empty { font-size: 14px; }
    .cv2-slot-name { font-size: 12px; }
    .cv2-slot-badge { font-size: 8px; padding: 2px 7px; }
    .cv2-versus { padding: 0 4px; }
    .cv2-vs-circle { width: 24px; height: 24px; }
    .cv2-vs-line { height: 8px; }

    .cv2-char-avatar { width: 42px; height: 42px; font-size: 14px; }
    .cv2-char-card { padding: 10px 6px 8px; }
    .cv2-char-name { font-size: 11px; }
    .cv2-char-desc { display: none; }

    .cv2-bottom-inner { padding: 0 10px; gap: 6px; }
    .cv2-btn-back { padding: 7px 12px; font-size: 11px; }
    .cv2-btn-confirm { padding: 7px 14px; font-size: 11px; }

    .cv2-attribution { font-size: 9px; padding: 4px 8px; }
}


/* ═══════════════════════════════════════════════════════════════
   WIDE DESKTOP
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 1100px) {
    .cv2-char-avatar { width: 64px; height: 64px; font-size: 22px; }
    .cv2-slot-avatar { width: 64px; height: 64px; font-size: 22px; }
    .cv2-slot { min-width: 170px; padding: 18px 24px; }
    .cv2-char-card { padding: 18px 10px 14px; }
}


/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.cv2-main::-webkit-scrollbar { width: 6px; }
.cv2-main::-webkit-scrollbar-thumb { background: var(--cv2-text-light); border-radius: 3px; }
.cv2-main::-webkit-scrollbar-track { background: transparent; }

/* Attribution */
.cv2-attribution {
    text-align: center;
    font-size: 10px;
    color: var(--cv2-text-light);
    padding: 6px 10px;
    line-height: 1.4;
    position: fixed;
    bottom: var(--cv2-bottom-h);
    left: 0; right: 0;
    background: var(--cv2-bg);
    z-index: 39;
}
.cv2-attribution a {
    color: var(--cv2-text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}
