/* ==========================================================================
   EYE ANIMATION STUDIO PRO — STYLESHEET
   Next-Generation CSS & JS Eye Animation Engine
   ========================================================================== */

:root {
    /* Color Palette — Warm Default Theme */
    --bg-gradient: radial-gradient(circle at 50% 40%, #fff7f2 0%, #fae8df 60%, #eed1c2 100%);
    --ambient-glow: rgba(255, 180, 160, 0.4);
    --surface-glass: rgba(255, 255, 255, 0.65);
    --surface-glass-border: rgba(255, 255, 255, 0.8);
    --surface-glass-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    --text-primary: #1e1b18;
    --text-secondary: #645e57;
    --accent-color: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.35);

    /* Character 1: Kai Tone Variables */
    --kai-skin-base: #a67c52;
    --kai-skin-shadow: #875e38;
    --kai-skin-highlight: #ba9166;
    --kai-hair: #181514;
    --kai-hair-highlight: #2c2522;
    --kai-iris-default: #6366f1;
    --kai-iris-accent: #a855f7;

    /* Character 2: Maya Tone Variables */
    --maya-skin-base: #eec590;
    --maya-skin-shadow: #d4a974;
    --maya-skin-highlight: #f8dab3;
    --maya-hair: #1f1d1d;
    --maya-hair-accent: #332d2c;
    --maya-blush: rgba(244, 63, 94, 0.35);
    --maya-lips: #e11d48;
    --maya-iris-default: #ec4899;
    --maya-iris-accent: #f43f5e;

    /* Eyeball & Cornea Globals */
    --sclera-base: #fcfbfa;
    --sclera-shadow: #d8d3cd;
    --pupil-scale: 1.0;
    --glint-opacity: 0.95;

    /* Font Families */
    --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Transitions */
    --transition-theme: background 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

/* Dark Theme Overrides */
body.theme-dark {
    --bg-gradient: radial-gradient(circle at 50% 40%, #151419 0%, #0d0c0f 60%, #050507 100%);
    --ambient-glow: rgba(99, 102, 241, 0.25);
    --surface-glass: rgba(26, 25, 33, 0.75);
    --surface-glass-border: rgba(255, 255, 255, 0.1);
    --surface-glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --sclera-base: #f1f3f5;
    --sclera-shadow: #b0b5bd;
}

/* Cyber Theme Tweaks when in Cyber Mode */
body[data-mode="cyber"] {
    --bg-gradient: radial-gradient(circle at 50% 50%, #050c17 0%, #02060d 70%, #000205 100%);
    --ambient-glow: rgba(6, 182, 212, 0.25);
    --surface-glass: rgba(8, 20, 36, 0.85);
    --surface-glass-border: rgba(6, 182, 212, 0.3);
    --text-primary: #e0f2fe;
    --text-secondary: #38bdf8;
    --accent-color: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.5);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-ui);
    color: var(--text-primary);
    background: var(--bg-gradient);
    transition: var(--transition-theme);
    user-select: none;
    -webkit-user-select: none;
}

/* Background Ambient Lighting Glow */
.ambient-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--ambient-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
    transition: background 0.6s ease;
}

/* Subtle Cursor Glow / Follower */
.cursor-follower {
    position: fixed;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: width 0.2s, height 0.2s, opacity 0.2s;
    mix-blend-mode: overlay;
}

/* ==========================================================================
   TOP FLOATING HEADER
   ========================================================================== */
.top-nav {
    position: fixed;
    top: 20px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none;
}

.brand-badge, .status-chip, .quick-toggles {
    pointer-events: auto;
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-glass-border);
    border-radius: 999px;
    box-shadow: var(--surface-glass-shadow);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: pulseGlow 2s infinite ease-in-out;
}

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

.brand-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}

.badge-pro {
    display: inline-block;
    padding: 2px 7px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, #6366f1, #d946ef);
    color: #fff;
    border-radius: 6px;
    margin-left: 4px;
}

.status-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--surface-glass);
    backdrop-filter: blur(14px);
    border: 1px solid var(--surface-glass-border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: var(--surface-glass-shadow);
}

.quick-toggles {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-glass);
    backdrop-filter: blur(14px);
    border: 1px solid var(--surface-glass-border);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--surface-glass-shadow);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, border-color 0.2s;
}

.icon-btn:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(255, 255, 255, 0.85);
}

.icon-btn:active {
    transform: translateY(0) scale(0.95);
}

body.theme-dark .icon-btn:hover {
    background: rgba(45, 43, 58, 0.85);
}

/* ==========================================================================
   MAIN VIEWPORT & 3D STAGE
   ========================================================================== */
.stage-viewport {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
    perspective-origin: center center;
    z-index: 10;
    padding-bottom: 70px; /* Space for bottom dock */
}

.mode-view {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   MODE 1: THE DUO (ORIGINAL ELEVATED)
   ========================================================================== */
.characters-container {
    display: flex;
    gap: clamp(40px, 8vw, 120px);
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

.character-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-style: preserve-3d;
    cursor: grab;
}

.character-card:active {
    cursor: grabbing;
}

/* Drop Shadow on Floor */
.character-shadow {
    position: absolute;
    bottom: -30px;
    width: 180px;
    height: 35px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.22) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(8px);
    z-index: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* 3D Head Rig Container */
.head-rig {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.08s ease-out;
    will-change: transform;
}

/* Label Below Characters */
.character-label {
    margin-top: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3px;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.character-card:hover .character-label {
    opacity: 1;
}

.label-name {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--text-primary);
}

.label-sub {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   KAI (MALE CHARACTER)
   -------------------------------------------------------------------------- */
.kai-face {
    position: relative;
    width: 190px;
    height: 230px;
    background: linear-gradient(165deg, var(--kai-skin-highlight) 0%, var(--kai-skin-base) 50%, var(--kai-skin-shadow) 100%);
    border-radius: 46% 46% 44% 44% / 48% 48% 40% 40%;
    box-shadow: 
        0 18px 45px rgba(0, 0, 0, 0.18),
        inset 0 4px 10px rgba(255, 255, 255, 0.25),
        inset 0 -8px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-style: preserve-3d;
    z-index: 10;
}

/* Kai Hair */
.kai-hair-back {
    position: absolute;
    top: -18px;
    left: -14px;
    width: 218px;
    height: 160px;
    background: var(--kai-hair);
    border-radius: 50% 50% 30% 30% / 60% 60% 30% 30%;
    z-index: 5;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.kai-hair-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    overflow: hidden;
    border-radius: 46% 46% 0 0;
    z-index: 25;
    pointer-events: none;
}

.kai-hair-front::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -15px;
    width: 220px;
    height: 75px;
    background: linear-gradient(180deg, var(--kai-hair) 70%, #2a2422 100%);
    border-radius: 0 0 50% 50% / 0 0 60% 40%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.kai-hair-front .strand-1 {
    position: absolute;
    top: 35px;
    left: 45px;
    width: 32px;
    height: 25px;
    background: var(--kai-hair);
    border-radius: 0 0 100% 0;
    transform: rotate(-15deg);
}

.kai-hair-front .strand-2 {
    position: absolute;
    top: 38px;
    left: 90px;
    width: 40px;
    height: 20px;
    background: var(--kai-hair);
    border-radius: 0 0 0 100%;
    transform: rotate(10deg);
}

/* Ears */
.ear {
    position: absolute;
    top: 95px;
    width: 28px;
    height: 48px;
    border-radius: 50% 30% 30% 50%;
    z-index: 4;
}

.kai-ear-left {
    left: -20px;
    background: linear-gradient(to right, var(--kai-skin-shadow), var(--kai-skin-base));
}

.kai-ear-right {
    right: -20px;
    border-radius: 30% 50% 50% 30%;
    background: linear-gradient(to left, var(--kai-skin-shadow), var(--kai-skin-base));
}

/* --------------------------------------------------------------------------
   MAYA (FEMALE CHARACTER)
   -------------------------------------------------------------------------- */
.maya-face {
    position: relative;
    width: 184px;
    height: 226px;
    background: linear-gradient(165deg, var(--maya-skin-highlight) 0%, var(--maya-skin-base) 50%, var(--maya-skin-shadow) 100%);
    border-radius: 46% 46% 48% 48% / 46% 46% 44% 44%;
    box-shadow: 
        0 18px 45px rgba(0, 0, 0, 0.16),
        inset 0 4px 12px rgba(255, 255, 255, 0.35),
        inset 0 -8px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-style: preserve-3d;
    z-index: 10;
}

/* Maya Voluminous Hair */
.maya-hair-back {
    position: absolute;
    top: -55px;
    left: -55px;
    width: 294px;
    height: 310px;
    background: radial-gradient(circle at 50% 30%, #353030 0%, var(--maya-hair) 65%, #111010 100%);
    border-radius: 48% 48% 42% 42% / 55% 55% 40% 40%;
    z-index: 5;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.maya-hair-back .wave-1 {
    position: absolute;
    bottom: 10px;
    left: -15px;
    width: 80px;
    height: 120px;
    background: var(--maya-hair);
    border-radius: 50%;
    transform: rotate(-15deg);
}

.maya-hair-back .wave-2 {
    position: absolute;
    bottom: 10px;
    right: -15px;
    width: 80px;
    height: 120px;
    background: var(--maya-hair);
    border-radius: 50%;
    transform: rotate(15deg);
}

.maya-hair-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    overflow: hidden;
    border-radius: 46% 46% 0 0;
    z-index: 25;
    pointer-events: none;
}

.maya-hair-front::before {
    content: '';
    position: absolute;
    top: -30px;
    left: -20px;
    width: 224px;
    height: 75px;
    background: linear-gradient(180deg, var(--maya-hair) 60%, #302b2a 100%);
    border-radius: 0 0 50% 50% / 0 0 70% 35%;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.maya-ear-left {
    left: -18px;
    background: linear-gradient(to right, var(--maya-skin-shadow), var(--maya-skin-base));
}

.maya-ear-right {
    right: -18px;
    border-radius: 30% 50% 50% 30%;
    background: linear-gradient(to left, var(--maya-skin-shadow), var(--maya-skin-base));
}

.earring {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff 0%, #ffd700 60%, #b8860b 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   FACIAL FEATURES (BROWS, CHEEKS, NOSE, MOUTH)
   ========================================================================== */
.eyebrows-group {
    display: flex;
    justify-content: space-between;
    width: 128px;
    margin-top: 68px;
    margin-bottom: 8px;
    z-index: 20;
}

.eyebrow {
    width: 44px;
    height: 8px;
    background: #181514;
    border-radius: 4px;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center center;
}

.eyebrow-left {
    transform: rotate(4deg);
}

.eyebrow-right {
    transform: rotate(-4deg);
}

/* Maya Arched Brows */
.eyebrow.arched {
    height: 6px;
    border-radius: 50% 50% 0 0;
    background: #1e1b1b;
}

.eyebrow.arched.eyebrow-left {
    transform: rotate(8deg) translateY(-2px);
}

.eyebrow.arched.eyebrow-right {
    transform: rotate(-8deg) translateY(-2px);
}

/* Cheeks & Blush */
.cheeks {
    position: absolute;
    top: 135px;
    display: flex;
    justify-content: space-between;
    width: 140px;
    pointer-events: none;
    z-index: 12;
}

.blush {
    width: 32px;
    height: 18px;
    background: rgba(220, 80, 80, 0.18);
    border-radius: 50%;
    filter: blur(5px);
    transition: background 0.3s ease, transform 0.3s ease;
}

.maya-blush {
    background: var(--maya-blush);
    width: 36px;
    height: 20px;
    filter: blur(6px);
}

/* Noses */
.nose {
    position: relative;
    margin-top: 10px;
    z-index: 20;
    pointer-events: none;
}

.kai-nose .nose-bridge {
    width: 8px;
    height: 18px;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.12));
    margin: 0 auto;
    border-radius: 4px;
}

.kai-nose .nose-tip {
    width: 18px;
    height: 10px;
    background: linear-gradient(180deg, var(--kai-skin-highlight) 0%, var(--kai-skin-shadow) 100%);
    border-radius: 8px 8px 10px 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.maya-nose .nose-bridge {
    width: 6px;
    height: 16px;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.08));
    margin: 0 auto;
}

.maya-nose .nose-tip {
    width: 14px;
    height: 8px;
    background: linear-gradient(180deg, var(--maya-skin-highlight) 0%, var(--maya-skin-shadow) 100%);
    border-radius: 50%;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

/* Mouths */
.mouth {
    position: relative;
    margin-top: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), height 0.2s ease, width 0.2s ease;
}

.kai-mouth {
    width: 58px;
    height: 16px;
    background: #6a3434;
    border-radius: 4px 4px 14px 14px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid rgba(0, 0, 0, 0.15);
}

.kai-mouth .mouth-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

.kai-mouth .mouth-teeth {
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 5px;
    background: #ffffff;
    border-radius: 0 0 4px 4px;
}

.kai-mouth .mouth-tongue {
    position: absolute;
    bottom: -6px;
    left: 14px;
    right: 14px;
    height: 12px;
    background: #e06c75;
    border-radius: 50%;
}

.maya-mouth {
    width: 52px;
    height: 20px;
    background: linear-gradient(180deg, #f43f5e 0%, var(--maya-lips) 100%);
    border-radius: 20% 20% 50% 50% / 30% 30% 60% 60%;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.4);
    position: relative;
}

.maya-mouth .lip-highlight {
    position: absolute;
    top: 3px;
    left: 16px;
    width: 20px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    filter: blur(1px);
}

.maya-mouth .mouth-inner {
    width: 32px;
    height: 6px;
    background: #470e17;
    border-radius: 0 0 6px 6px;
    margin-top: 4px;
    display: flex;
    justify-content: center;
}

.maya-mouth .mouth-teeth {
    width: 18px;
    height: 3px;
    background: #fff;
    border-radius: 0 0 2px 2px;
}

/* Mouth interactive hover/smile */
.mouth:hover {
    transform: scale(1.1);
}

/* ==========================================================================
   EYES ARCHITECTURE & OCULAR MECHANICS
   ========================================================================== */
.eyes-cluster {
    display: flex;
    gap: 34px;
    z-index: 15;
}

.eye-socket {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    cursor: pointer;
    transform-style: preserve-3d;
}

/* Female Eyelash Curve & Eyeliner */
.female-socket {
    width: 54px;
    height: 52px;
}

.eyelash-top-curve {
    position: absolute;
    top: -7px;
    left: -4px;
    right: -4px;
    height: 18px;
    border-top: 5px solid #141212;
    border-radius: 50% 50% 0 0;
    z-index: 30;
    pointer-events: none;
}

.eyelash-corner {
    position: absolute;
    top: -3px;
    right: -8px;
    width: 12px;
    height: 10px;
    border-top: 4px solid #141212;
    border-right: 4px solid #141212;
    border-radius: 0 80% 0 0;
    transform: rotate(20deg);
    z-index: 31;
    pointer-events: none;
}

/* Eye Socket for Kai */
#charKai .eye-socket {
    border-top: 3px solid rgba(0, 0, 0, 0.7);
    border-radius: 50%;
}

/* Sclera (The White of the Eye) */
.sclera {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--sclera-base);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.15),
        inset 0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 -3px 6px rgba(255, 255, 255, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateZ(0); /* Hardware acceleration */
}

/* Ambient Sclera Shadow under Upper Lid */
.sclera-depth-shadow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.05) 60%, transparent 100%);
    pointer-events: none;
    z-index: 5;
    border-radius: 50% 50% 0 0;
}

/* Eyelids for Real Blinking Mechanics */
.eyelid {
    position: absolute;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, var(--kai-skin-shadow) 0%, var(--kai-skin-base) 100%);
    z-index: 10;
    transition: transform 0.08s ease-out;
    pointer-events: none;
}

#charMaya .eyelid {
    background: linear-gradient(180deg, var(--maya-skin-shadow) 0%, var(--maya-skin-base) 100%);
}

.eyelid-top {
    top: 0;
    height: 100%;
    transform: translateY(-100%);
    border-bottom: 2px solid rgba(0, 0, 0, 0.35);
}

.eyelid-bottom {
    bottom: 0;
    height: 100%;
    transform: translateY(100%);
    border-top: 1px solid rgba(0, 0, 0, 0.2);
}

/* Blink Animation Trigger Class */
.eye-socket.blink .eyelid-top,
.cyber-eye-frame.blink .eyelid-top {
    transform: translateY(0%) !important;
    transition: transform 0.07s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.eye-socket.blink .eyelid-bottom,
.cyber-eye-frame.blink .eyelid-bottom {
    transform: translateY(0%) !important;
    transition: transform 0.07s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

/* ==========================================================================
   IRIS & PUPIL (HIGH-FIDELITY OPTICS)
   ========================================================================== */
.iris-assembly {
    position: absolute;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    will-change: transform;
    z-index: 4;
}

.iris {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, var(--iris-accent) 0%, var(--iris-base) 70%, #151126 100%);
    box-shadow: 
        0 0 10px rgba(0, 0, 0, 0.35),
        inset 0 0 6px rgba(0, 0, 0, 0.6),
        inset 0 0 12px rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Iris Radial Fiber Texture */
.iris-pattern {
    position: absolute;
    inset: 0;
    background: repeating-conic-gradient(
        from 0deg,
        rgba(255, 255, 255, 0.12) 0deg 8deg,
        rgba(0, 0, 0, 0.15) 8deg 16deg
    );
    border-radius: 50%;
    mix-blend-mode: overlay;
    opacity: 0.65;
}

.iris-inner-ring {
    position: absolute;
    width: 65%;
    height: 65%;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.35);
    pointer-events: none;
    opacity: 0.5;
}

/* Pupil */
.pupil {
    position: relative;
    width: 18px;
    height: 18px;
    background: #09080d;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    transform: scale(var(--pupil-scale));
    transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.12s, height 0.12s;
    z-index: 2;
}

/* Specular Corneal Glints (3D Glass Highlights) */
.glint {
    position: absolute;
    border-radius: 50%;
    background: #ffffff;
    pointer-events: none;
    z-index: 8;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
}

.glint-primary {
    top: 6px;
    left: 7px;
    width: 7px;
    height: 7px;
    opacity: var(--glint-opacity);
}

.glint-secondary {
    bottom: 7px;
    right: 8px;
    width: 3.5px;
    height: 3.5px;
    opacity: 0.75;
}

.glint-sparkle {
    top: 8px;
    right: 8px;
    width: 3px;
    height: 3px;
    opacity: 0.8;
}

/* ==========================================================================
   MODE 2: CYBERPUNK MECHA OCULUS
   ========================================================================== */
.cyber-rig {
    position: relative;
    width: 580px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(2, 6, 23, 0.95) 100%);
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: 24px;
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(6, 182, 212, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

.cyber-hud-top {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #38bdf8;
    letter-spacing: 0.08em;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(6, 182, 212, 0.3);
}

.cyber-eyes-mount {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
    padding: 15px 0;
}

.cyber-eye-frame {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, #0b1522 0%, #030712 100%);
    border: 3px solid rgba(6, 182, 212, 0.4);
    box-shadow: 
        0 0 25px rgba(6, 182, 212, 0.25),
        inset 0 0 20px rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hud-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed rgba(6, 182, 212, 0.5);
    pointer-events: none;
}

.ring-outer {
    width: 125px;
    height: 125px;
    animation: rotateClockwise 20s linear infinite;
}

.ring-middle {
    width: 95px;
    height: 95px;
    border: 1px solid rgba(245, 158, 11, 0.4);
    animation: rotateCounter 14s linear infinite;
}

@keyframes rotateClockwise {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateCounter {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.cyber-lens {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, #0e2a47 0%, #020617 80%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.cyber-lens .iris-assembly {
    width: 55px;
    height: 55px;
}

.cyber-iris {
    position: relative;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: radial-gradient(circle, #06b6d4 0%, #0284c7 60%, #0f172a 100%);
    box-shadow: 0 0 20px #06b6d4, inset 0 0 10px #38bdf8;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cyber-pupil {
    width: 22px;
    height: 22px;
    background: #020617;
    border: 2px solid #38bdf8;
    box-shadow: 0 0 10px #38bdf8;
}

.cyber-center-sensor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.laser-scanner {
    width: 2px;
    height: 50px;
    background: #f43f5e;
    box-shadow: 0 0 12px #f43f5e;
    animation: scanLaser 2s ease-in-out infinite alternate;
}

@keyframes scanLaser {
    0% { transform: translateY(-15px) scaleY(0.7); opacity: 0.4; }
    100% { transform: translateY(15px) scaleY(1.2); opacity: 1; }
}

.sensor-readout {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #10b981;
    font-weight: 700;
}

.cyber-hud-bottom {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #64748b;
}

.bar-meter {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.meter-fill {
    width: 75%;
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #10b981);
    border-radius: 2px;
}

/* ==========================================================================
   MODE 3: MYSTIC FELINE
   ========================================================================== */
.feline-rig {
    position: relative;
    width: 320px;
    height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cat-ear {
    position: absolute;
    top: -20px;
    width: 60px;
    height: 70px;
    background: #1c1917;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cat-ear.ear-left {
    left: 30px;
    transform: rotate(-18deg);
}

.cat-ear.ear-right {
    right: 30px;
    transform: rotate(18deg);
}

.cat-ear .ear-inner {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 45px;
    background: #f472b6;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    opacity: 0.8;
}

.cat-face {
    position: relative;
    width: 250px;
    height: 200px;
    background: radial-gradient(circle at 50% 40%, #292524 0%, #1c1917 80%);
    border-radius: 48% 48% 45% 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    padding-top: 40px;
}

.cat-iris {
    background: radial-gradient(circle, #fde047 0%, #eab308 50%, #854d0e 90%, #000 100%) !important;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.6), inset 0 0 8px rgba(0, 0, 0, 0.7);
}

.slit-pupil {
    width: 5px !important;
    height: 24px !important;
    border-radius: 50% / 80% !important;
    background: #09090b !important;
    transition: width 0.15s ease, transform 0.15s ease;
}

.cat-socket:hover .slit-pupil {
    width: 18px !important; /* Pupil dilates when excited! */
}

.cat-nose {
    width: 14px;
    height: 10px;
    background: #f472b6;
    clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
    margin-top: 15px;
    border-radius: 2px;
}

.cat-whiskers {
    position: absolute;
    top: 130px;
    width: 220px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.whisker-group span {
    display: block;
    width: 45px;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    margin: 4px 0;
    border-radius: 2px;
}

.whisker-group.left span:nth-child(1) { transform: rotate(10deg); }
.whisker-group.left span:nth-child(2) { transform: rotate(0deg); }
.whisker-group.left span:nth-child(3) { transform: rotate(-10deg); }

.whisker-group.right span:nth-child(1) { transform: rotate(-10deg); }
.whisker-group.right span:nth-child(2) { transform: rotate(0deg); }
.whisker-group.right span:nth-child(3) { transform: rotate(10deg); }

/* ==========================================================================
   MODE 4: MINIMALIST MODERN
   ========================================================================== */
.minimal-rig {
    display: flex;
    align-items: center;
    gap: 50px;
}

.minimal-orb {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.12),
        inset 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.minimal-orb .iris-assembly {
    width: 60px;
    height: 60px;
}

.minimal-orb .iris {
    width: 60px;
    height: 60px;
    background: #6366f1;
}

.minimal-orb .pupil {
    width: 26px;
    height: 26px;
    background: #0f172a;
}

.minimal-bridge {
    width: 20px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

/* ==========================================================================
   BOTTOM STUDIO DOCK (CONTROLS & CUSTOMIZER)
   ========================================================================== */
.studio-dock {
    position: fixed;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
}

.dock-inner {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-glass-border);
    border-radius: 999px;
    box-shadow: var(--surface-glass-shadow);
    max-width: 90vw;
    overflow-x: auto;
}

.dock-divider {
    width: 1px;
    height: 26px;
    background: rgba(0, 0, 0, 0.1);
}

body.theme-dark .dock-divider {
    background: rgba(255, 255, 255, 0.12);
}

.dock-section {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mode Chip Buttons */
.mode-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.mode-chip:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
}

body.theme-dark .mode-chip:hover {
    background: rgba(255, 255, 255, 0.06);
}

.mode-chip.active {
    background: var(--text-primary);
    color: var(--sclera-base);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.theme-dark .mode-chip.active {
    background: #ffffff;
    color: #0f172a;
}

/* Action Trigger Buttons */
.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--surface-glass-border);
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
    white-space: nowrap;
}

body.theme-dark .action-btn {
    background: rgba(255, 255, 255, 0.05);
}

.action-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.9);
}

body.theme-dark .action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

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

.settings-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(217, 70, 239, 0.15));
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent-color);
}

body.theme-dark .settings-btn {
    color: #a5b4fc;
}

/* ==========================================================================
   STUDIO CONTROLS DRAWER
   ========================================================================== */
.settings-drawer {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 360px;
    max-height: 80vh;
    background: var(--surface-glass);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--surface-glass-border);
    border-radius: 24px;
    box-shadow: var(--surface-glass-shadow), 0 30px 60px rgba(0, 0, 0, 0.15);
    z-index: 150;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.settings-drawer.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-dark .drawer-header {
    border-color: rgba(255, 255, 255, 0.08);
}

.drawer-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-drawer-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.drawer-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.group-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.color-presets {
    display: flex;
    gap: 8px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--c);
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: #fff;
    outline: 2px solid var(--c);
}

.control-row {
    display: flex;
    gap: 16px;
}

.control-sub {
    flex: 1;
}

.control-sub label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.control-sub input[type="color"] {
    width: 100%;
    height: 36px;
    border: 1px solid var(--surface-glass-border);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    padding: 2px;
}

/* Sliders */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}

.slider-val {
    font-family: var(--font-mono);
    color: var(--accent-color);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.1);
    outline: none;
}

body.theme-dark input[type="range"] {
    background: rgba(255, 255, 255, 0.15);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Toggles */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-dark .toggle-group {
    border-color: rgba(255, 255, 255, 0.08);
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Switch UI */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider.round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.15);
    transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 34px;
}

body.theme-dark .slider.round {
    background-color: rgba(255, 255, 255, 0.15);
}

.slider.round:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider.round {
    background-color: var(--accent-color);
}

input:checked + .slider.round:before {
    transform: translateX(18px);
}

/* Reset Button */
.drawer-footer {
    margin-top: 10px;
}

.reset-btn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--surface-glass-border);
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

body.theme-dark .reset-btn {
    background: rgba(255, 255, 255, 0.05);
}

.reset-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 768px) {
    .characters-container {
        flex-direction: column;
        gap: 30px;
    }

    .character-shadow {
        display: none;
    }

    .kai-face, .maya-face {
        transform: scale(0.85);
    }

    .settings-drawer {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 80px;
    }

    .dock-inner {
        max-width: 95vw;
        padding: 6px 8px;
    }

    .mode-name {
        display: none;
    }

    .mode-chip {
        padding: 8px 10px;
    }

    .action-btn span {
        display: none;
    }

    .action-btn {
        padding: 8px 10px;
    }
}
