:root {
    --primary: #6c5ce7; --primary-light: #a29bfe; --primary-dark: #4834d4;
    --accent: #fd79a8; --accent-light: #fab1a0;
    --success: #00b894; --danger: #d63031; --warning: #fdcb6e; --info: #74b9ff;
    --gold: #ffd700; --silver: #c0c0c0; --bronze: #cd7f32;
    --bg: #0a0a23; --bg2: #16163a; --card: #1e1e4a; --card2: #252560;
    --text: #dfe6e9; --muted: #636e72;
    --radius: 18px; --radius-sm: 12px;
    --transition: 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
}
* { box-sizing: border-box; margin: 0; padding: 0; }

/* === MOBILE TOUCH FIX === */
[onclick], button, a, .avatar-opt, .learning-style-card, .love-btn, .mood-btn,
.shop-item, .world-portal, .quest-node, .rgb-chip, .slide-card, .badge-item,
.aw-tab, .nav-pill, .beh-action-btn, .tier-btn, .room-cell, .inv-slot {
    -webkit-tap-highlight-color: rgba(108,92,231,0.2);
    touch-action: manipulation;
}
body { font-family: 'Rubik', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }

/* === PARTICLES === */
#particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.particle { position: absolute; border-radius: 50%; opacity: 0.12; animation: floatUp linear infinite; }
@keyframes floatUp { 0%{transform:translateY(100vh) scale(0.5);opacity:0} 10%{opacity:0.12} 90%{opacity:0.12} 100%{transform:translateY(-50px) scale(1);opacity:0} }

/* === TWINKLING STARS === */
.star {
    position: fixed; pointer-events: none; z-index: 0;
    width: 3px; height: 3px; border-radius: 50%;
    background: white;
    animation: twinkle ease-in-out infinite;
}
@keyframes twinkle {
    0%, 100% { opacity: 0.1; transform: scale(0.8); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* === HEADER === */
header { position: sticky; top: 0; z-index: 100; display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background: rgba(10,10,35,0.9); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(108,92,231,0.15); }
.logo { font-size: 1.5rem; font-weight: 900; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: flex; align-items: center; gap: 8px; }
.logo .mascot { font-size: 1.8rem; -webkit-text-fill-color: initial; animation: bounce 2s ease infinite; }
.agent-alert-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 184, 148, 0.16);
    color: #b8ffe8;
    border: 1px solid rgba(0, 184, 148, 0.28);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    -webkit-text-fill-color: initial;
    box-shadow: 0 0 18px rgba(0, 184, 148, 0.12);
}
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.nav-pills { display: flex; gap: 4px; background: rgba(255,255,255,0.05); padding: 3px; border-radius: 30px; }
.nav-pill { border: none; background: none; padding: 8px 20px; border-radius: 30px; font-weight: 700; font-size: 0.85rem; cursor: pointer; color: var(--muted); transition: var(--transition); font-family: inherit; display: flex; align-items: center; gap: 6px; }
.nav-pill.active { background: var(--primary); color: white; box-shadow: 0 0 15px rgba(108,92,231,0.3); }
.nav-pill:hover:not(.active) { color: var(--text); }

/* === VIEWS === */
#app { position: relative; min-height: calc(100vh - 56px); }
.view { position: absolute; inset: 0; padding: 24px; overflow-y: auto; transition: transform 0.5s ease, opacity 0.4s ease; }
.view.hidden-l { transform: translateX(-100%); opacity: 0; pointer-events: none; }
.view.hidden-r { transform: translateX(100%); opacity: 0; pointer-events: none; }
.view.active { transform: translateX(0); opacity: 1; z-index: 10; }

/* === YAZOO CHARACTER === */
.yazoo-bubble { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; animation: fadeSlide 0.6s ease; }
@keyframes fadeSlide { from{opacity:0;transform:translateY(15px)} to{opacity:1;transform:translateY(0)} }
.yazoo-avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 2.2rem; flex-shrink: 0; box-shadow: 0 0 20px rgba(108,92,231,0.3); animation: breathe 6s ease infinite; }
@keyframes breathe { 0%,100%{transform:scale(1)} 50%{transform:scale(1.015)} }
.yazoo-text { background: var(--card); border-radius: var(--radius); border-radius: 4px 18px 18px 18px; padding: 16px 20px; font-size: 1.05rem; line-height: 1.6; border: 1px solid rgba(108,92,231,0.15); max-width: 600px; }
.yazoo-text strong { color: var(--primary-light); }

/* === ONBOARDING WIZARD === */
.wizard-step { display: none; flex-direction: column; align-items: center; text-align: center; padding: 20px; animation: wizardIn 0.5s ease; }
.wizard-step.active { display: flex; }
@keyframes wizardIn { from{opacity:0;transform:scale(0.95)} to{opacity:1;transform:scale(1)} }
.step-title { font-size: 1.8rem; font-weight: 900; margin-bottom: 6px; }
.step-subtitle { color: var(--muted); margin-bottom: 30px; }

/* Gender selection */
.gender-select { display: flex; gap: 12px; margin-top: 8px; }
.gender-opt { flex: 1; padding: 14px 10px; text-align: center; border-radius: var(--radius-sm); border: 2px solid rgba(255,255,255,0.1); background: var(--card); color: var(--text); cursor: pointer; font-size: 1.1rem; font-weight: 700; transition: var(--transition); touch-action: manipulation; -webkit-tap-highlight-color: rgba(108,92,231,0.3); user-select: none; font-family: inherit; appearance: none; -webkit-appearance: none; }
.gender-opt:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.gender-opt.sel { border-color: var(--primary); background: rgba(108,92,231,0.15); box-shadow: 0 0 18px rgba(108,92,231,0.3); }

/* Avatars */
.avatar-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin: 20px 0 30px; }
.avatar-opt { font-size: 3.8rem; padding: 24px; background: var(--card); border-radius: 50%; cursor: pointer; transition: var(--transition); border: 3px solid transparent; position: relative; -webkit-tap-highlight-color: rgba(108,92,231,0.3); touch-action: manipulation; user-select: none; }
.avatar-opt:hover { transform: scale(1.12); border-color: var(--primary-light); }
.avatar-opt.sel { border-color: var(--primary); box-shadow: 0 0 25px rgba(108,92,231,0.4); animation: pulseRing 2s infinite; }
@keyframes pulseRing { 0%,100%{box-shadow:0 0 10px rgba(108,92,231,0.3)} 50%{box-shadow:0 0 30px rgba(108,92,231,0.5)} }

/* Subject mapping game */
.game-zone { width: 100%; max-width: 700px; margin: 20px auto; }
.subject-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 10px; transition: var(--transition); }
.subject-row i { font-size: 1.4rem; width: 32px; text-align: center; }
.subject-row .name { flex: 1; font-weight: 600; }
.love-meter { display: flex; gap: 6px; }
.love-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.1); background: none; cursor: pointer; font-size: 1.1rem; transition: var(--transition); display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: rgba(108,92,231,0.3); touch-action: manipulation; }
.love-btn:hover { transform: scale(1.2); }
.love-btn.hate.sel { border-color: var(--danger); background: rgba(214,48,49,0.15); }
.love-btn.meh.sel { border-color: var(--warning); background: rgba(253,203,110,0.15); }
.love-btn.love.sel { border-color: var(--success); background: rgba(0,184,148,0.15); }

/* Profile form */
.form-group { width: 100%; max-width: 400px; margin-bottom: 16px; text-align: right; }
.form-group label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.form-group input, .form-group select { width: 100%; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.1); background: var(--card); color: var(--text); font-family: inherit; font-size: 1rem; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); }

/* === MOOD CHECK === */
.mood-check { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; text-align: center; border: 1px solid rgba(108,92,231,0.15); animation: fadeSlide 0.6s ease; }
.mood-check h3 { font-size: 1.1rem; margin-bottom: 12px; color: var(--primary-light); }
.mood-options { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.mood-btn { font-size: 2rem; width: 56px; height: 56px; border-radius: 50%; border: 3px solid transparent; background: var(--bg2); cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; touch-action: manipulation; -webkit-tap-highlight-color: rgba(108,92,231,0.3); }
.mood-btn:hover { transform: scale(1.15); border-color: var(--primary-light); }
.mood-btn.sel { border-color: var(--primary); box-shadow: 0 0 15px rgba(108,92,231,0.4); background: rgba(108,92,231,0.15); }
.mood-response { margin-top: 12px; font-size: 0.95rem; color: var(--primary-light); animation: fadeSlide 0.4s ease; }

/* === STUDENT DASHBOARD === */
.dash-top { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--card); border-radius: var(--radius); margin-bottom: 20px; border: 1px solid rgba(108,92,231,0.1); flex-wrap: wrap; }
.dash-avatar { font-size: 3rem; background: var(--bg2); padding: 12px; border-radius: 50%; }
.dash-name { font-size: 1.3rem; font-weight: 700; }
.dash-level { font-size: 0.8rem; color: var(--primary-light); }

/* DUAL BANK DISPLAY */
.banks-container { display: flex; gap: 16px; margin-right: auto; }
.bank-display { text-align: center; padding: 8px 16px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.03); min-width: 120px; }
.bank-amount { font-size: 1.8rem; font-weight: 900; transition: var(--transition); }
.bank-label { font-size: 0.7rem; color: var(--muted); }
.bank-display.academic .bank-amount { color: var(--gold); }
.bank-display.behavior .bank-amount { color: var(--info); }
.bank-display.up .bank-amount { color: var(--success); transform: scale(1.15); }
.bank-display.down .bank-amount { color: var(--danger); transform: scale(0.9); }

/* XP Bar */
.xp-bar { height: 6px; background: rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden; margin: 8px 0 20px; position: relative; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 10px; transition: width 0.8s ease; position: relative; }
.xp-fill::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: xpSparkle 2s ease-in-out infinite;
}
@keyframes xpSparkle {
    0% { transform: translateX(30px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(-100px); opacity: 0; }
}

/* Standard Score Meter */
.std-score-meter { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; border: 1px solid rgba(108,92,231,0.1); }
.std-meter-bar { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.std-meter-track { flex: 1; height: 14px; background: rgba(255,255,255,0.05); border-radius: 10px; position: relative; overflow: hidden; }
.std-meter-fill { height: 100%; border-radius: 10px; transition: width 0.8s ease, background 0.5s ease; }
.std-meter-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); }
.std-meter-value { font-size: 1.8rem; font-weight: 900; min-width: 60px; text-align: center; }

/* Behavior banner */
.behavior-bar { display: flex; gap: 12px; margin-bottom: 20px; }
.beh-card { flex: 1; background: var(--card); border-radius: var(--radius-sm); padding: 14px; text-align: center; border-top: 3px solid; }
.beh-card.pos { border-color: var(--success); }
.beh-card.neg { border-color: var(--danger); }
.beh-card .beh-num { font-size: 1.6rem; font-weight: 900; }
.beh-card .beh-label { font-size: 0.75rem; color: var(--muted); }

/* Schedule builder */
.section-head { font-size: 1.2rem; font-weight: 900; margin: 24px 0 12px; display: flex; align-items: center; gap: 8px; }
.schedule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.slot { background: var(--card); border: 2px dashed rgba(255,255,255,0.08); border-radius: var(--radius); min-height: 90px; padding: 12px; transition: var(--transition); display: flex; flex-direction: column; gap: 8px; }
.slot.drag-over { border-color: var(--primary); background: rgba(108,92,231,0.08); }
.slot.live { border-color: var(--success); background: rgba(0,184,148,0.06); animation: liveGlow 2s infinite; }
@keyframes liveGlow { 0%,100%{box-shadow:none} 50%{box-shadow:0 0 20px rgba(0,184,148,0.2)} }
.slot.done { border-color: var(--success); border-style: solid; opacity: 0.7; }
.slot-num { font-size: 0.8rem; color: var(--muted); }
.task-chip { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,0.05); font-weight: 500; cursor: grab; transition: var(--transition); border: 1px solid rgba(255,255,255,0.05); }
.task-chip:hover { background: rgba(255,255,255,0.08); }
.task-chip.hi { border-color: var(--gold); }
.task-chip .pts { margin-right: auto; padding: 3px 10px; border-radius: 20px; background: var(--primary); color: white; font-size: 0.75rem; font-weight: 700; }
.task-chip.hi .pts { background: var(--gold); color: #333; }

/* Standard score feedback */
.std-feedback { padding: 16px; background: var(--card); border-radius: var(--radius-sm); margin: 16px 0; border-right: 4px solid; text-align: center; animation: fadeSlide 0.5s ease; }
.std-feedback.high { border-color: var(--success); }
.std-feedback.mid { border-color: var(--info); }
.std-feedback.low { border-color: var(--warning); }

/* Live day */
.live-slot { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--card); border-radius: var(--radius-sm); margin-bottom: 10px; border-right: 4px solid var(--muted); transition: var(--transition); }
.live-slot.now { border-color: var(--success); background: rgba(0,184,148,0.06); }
.live-slot.completed { border-color: var(--gold); }
.live-slot.approved { border-color: var(--success); opacity: 0.7; }
.live-timer { font-family: monospace; font-weight: 900; font-size: 1.2rem; color: var(--success); margin-right: auto; }

/* === SHOP === */
.shop-tiers { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tier-btn { padding: 8px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); background: none; color: var(--muted); font-family: inherit; font-weight: 600; cursor: pointer; transition: var(--transition); font-size: 0.85rem; }
.tier-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.shop-item { background: var(--card); border-radius: var(--radius); padding: 20px; text-align: center; cursor: pointer; transition: var(--transition); border: 2px solid transparent; }
.shop-item:hover { border-color: var(--success); transform: translateY(-4px); }
.shop-item.locked { opacity: 0.35; cursor: not-allowed; }
.shop-item .item-icon { font-size: 2.2rem; margin-bottom: 10px; }
.shop-item .item-name { font-weight: 600; margin-bottom: 6px; }
.shop-item .item-price { color: var(--gold); font-weight: 900; }
.shop-item .item-tier { font-size: 0.7rem; color: var(--muted); }

/* === TEACHER DASHBOARD === */
.teacher-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-box { background: var(--card); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 900; }
.stat-label { font-size: 0.75rem; color: var(--muted); }
.alert-list { margin-bottom: 20px; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border-radius: 10px; margin-bottom: 8px; border-right: 3px solid; animation: fadeSlide 0.4s ease; }
.alert-item.crisis { border-color: var(--danger); background: rgba(214,48,49,0.06); }
.alert-item.systemic { border-color: #e17055; background: rgba(225,112,85,0.06); }
.alert-item.growth { border-color: var(--success); background: rgba(0,184,148,0.06); }
.alert-item.warn { border-color: var(--warning); }
.alert-item.good { border-color: var(--success); }
.alert-item.bad { border-color: var(--danger); }
.monitor-list .m-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--card); border-radius: 10px; margin-bottom: 8px; border-right: 3px solid var(--muted); }
.m-item.pending { border-color: var(--warning); background: rgba(253,203,110,0.04); }
.m-item.ok { border-color: var(--success); }
.btn-approve { background: var(--success); color: white; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 700; cursor: pointer; font-family: inherit; transition: var(--transition); }
.btn-approve:hover { transform: scale(1.05); }
.feed { max-height: 280px; overflow-y: auto; }
.feed-item { padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; font-size: 0.85rem; background: rgba(255,255,255,0.02); display: flex; align-items: center; gap: 8px; }
.feed-item .ftime { color: var(--primary-light); font-weight: 700; font-size: 0.8rem; }

/* Teacher Behavior Panel */
.teacher-beh-panel { background: var(--card); border-radius: var(--radius-sm); padding: 16px; margin-top: 16px; border: 1px solid rgba(108,92,231,0.1); }
.teacher-beh-panel h4 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.beh-action-btn { padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); cursor: pointer; font-family: inherit; font-size: 0.85rem; font-weight: 600; transition: var(--transition); display: inline-flex; align-items: center; gap: 6px; margin: 4px; }
.beh-action-btn:hover { transform: scale(1.03); }
.beh-action-btn.pos { background: rgba(0,184,148,0.12); color: var(--success); border-color: rgba(0,184,148,0.3); }
.beh-action-btn.neg { background: rgba(214,48,49,0.12); color: var(--danger); border-color: rgba(214,48,49,0.3); }

/* Score History Graph */
.score-graph { background: var(--card); border-radius: var(--radius-sm); padding: 16px; margin-top: 16px; }
.score-graph-canvas { width: 100%; height: 120px; }

/* === BUTTONS === */
.btn { border: none; padding: 14px 28px; border-radius: var(--radius-sm); font-weight: 800; font-size: 1rem; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: inherit; touch-action: manipulation; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(108,92,231,0.3); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { transform: translateY(-2px); }
.btn-full { width: 100%; }
.btn:disabled, .btn.disabled { background: rgba(255,255,255,0.08); color: var(--muted); cursor: not-allowed; transform: none !important; }
.btn-warm { background: linear-gradient(135deg, var(--accent), #e17055); color: white; }
.btn-warm:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(253,121,168,0.3); }
.btn-danger { background: var(--danger); color: white; }

/* === CONFETTI === */
.confetti { position: fixed; z-index: 9999; pointer-events: none; animation: confettiFall 3s ease forwards; }
@keyframes confettiFall { 0%{transform:translateY(-100px) rotate(0);opacity:1} 100%{transform:translateY(100vh) rotate(720deg);opacity:0} }

/* === TOAST === */
#toasts { position: fixed; top: 70px; left: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--card); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.3); border: 1px solid rgba(108,92,231,0.15); animation: toastIn 0.4s ease; min-width: 280px; }
@keyframes toastIn { from{transform:translateX(-100%);opacity:0} to{transform:translateX(0);opacity:1} }
.toast-icon { font-size: 1.2rem; }
.toast.success .toast-icon { color: var(--success); }
.toast.info .toast-icon { color: var(--info); }
.toast.warning .toast-icon { color: var(--warning); }

/* === CONTRACT === */
.contract {
    background: var(--card); border-radius: var(--radius); padding: 28px;
    border: 3px solid var(--primary); margin: 16px 0; position: relative; overflow: hidden;
    box-shadow: 0 0 30px rgba(108,92,231,0.1);
}
.contract::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(108,92,231,0.03) 20px, rgba(108,92,231,0.03) 21px),
        repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(108,92,231,0.03) 20px, rgba(108,92,231,0.03) 21px);
    pointer-events: none;
}
.contract::after {
    content: ''; position: absolute; top: 8px; left: 8px; right: 8px; bottom: 8px;
    border: 1px solid rgba(108,92,231,0.15); border-radius: calc(var(--radius) - 4px); pointer-events: none;
}
.contract-title { font-size: 1.2rem; font-weight: 900; color: var(--primary-light); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; position: relative; text-align: center; justify-content: center; }
.contract-items { list-style: none; position: relative; }
.contract-items li { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; align-items: center; gap: 10px; }
.contract-items li:last-child { border: none; }
.contract-sign { margin-top: 20px; text-align: center; position: relative; padding-top: 16px; border-top: 1px dashed rgba(108,92,231,0.2); }
.contract-stamp {
    position: absolute; top: 20px; left: 20px; width: 100px; height: 100px;
    border: 4px solid var(--success); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 900; color: var(--success);
    transform: rotate(-15deg); opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    text-align: center; line-height: 1.2; z-index: 2;
}
.contract-stamp.show {
    opacity: 0.85; animation: stampIn 0.5s cubic-bezier(0.17, 0.67, 0.29, 1.35);
}
@keyframes stampIn {
    0% { transform: rotate(-15deg) scale(3); opacity: 0; }
    60% { transform: rotate(-15deg) scale(0.9); opacity: 0.9; }
    100% { transform: rotate(-15deg) scale(1); opacity: 0.85; }
}

/* === FLOATING ANIMATIONS === */
.floating-points {
    position: fixed; z-index: 9999; pointer-events: none;
    font-weight: 900; font-size: 1.4rem; color: var(--gold);
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
    animation: floatPoints 1.5s ease-out forwards;
}
@keyframes floatPoints {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    20% { transform: translateY(-10px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-80px) scale(0.8); opacity: 0; }
}
.floating-item {
    position: fixed; z-index: 9999; pointer-events: none; font-size: 2.5rem;
    animation: floatItem 1.8s ease-out forwards;
}
@keyframes floatItem {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-60px) scale(1.3); opacity: 0.8; }
    100% { transform: translateY(-120px) scale(0.5); opacity: 0; }
}
.ding-anim {
    position: fixed; z-index: 9999; pointer-events: none;
    font-size: 1rem; font-weight: 700; color: var(--gold);
    animation: dingPop 1.2s ease-out forwards;
}
@keyframes dingPop {
    0% { transform: scale(0); opacity: 0; }
    30% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.8) translateY(-30px); opacity: 0; }
}
.sparkle-anim {
    position: fixed; z-index: 9999; pointer-events: none; font-size: 1.5rem;
    animation: sparklePop 1s ease-out forwards;
}
@keyframes sparklePop {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    40% { transform: scale(1.4) rotate(180deg); opacity: 1; }
    100% { transform: scale(0.5) rotate(360deg) translateY(-40px); opacity: 0; }
}

/* === BADGES === */
.badges-section { margin-bottom: 20px; }
.badges-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-item {
    background: var(--card); border-radius: var(--radius-sm); padding: 12px 16px;
    display: flex; align-items: center; gap: 10px;
    border: 1px solid rgba(108,92,231,0.1); transition: var(--transition); min-width: 160px;
    position: relative; overflow: hidden;
}
.badge-item.earned { border-color: var(--gold); background: rgba(255,215,0,0.06); box-shadow: 0 0 15px rgba(255,215,0,0.1); }
.badge-item.locked { opacity: 0.35; }
.badge-art {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    background-size: cover; background-position: center;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.25);
    opacity: 0.9;
}
.badge-icon { font-size: 1.6rem; }
.badge-info { display: flex; flex-direction: column; }
.badge-name { font-weight: 700; font-size: 0.85rem; }
.badge-desc { font-size: 0.7rem; color: var(--muted); }

/* === FLOATING YAZOO HELPER === */
.yazoo-helper {
    position: fixed; bottom: 20px; right: 20px; z-index: 500;
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; cursor: pointer;
    box-shadow: 0 4px 20px rgba(108,92,231,0.4);
    transition: var(--transition); animation: breathe 6s ease infinite;
}
.yazoo-helper:hover { transform: scale(1.1); }
.yazoo-helper-tip {
    position: fixed; bottom: 86px; right: 20px; z-index: 500;
    background: var(--card); border: 1px solid rgba(108,92,231,0.2);
    border-radius: var(--radius-sm); padding: 14px 18px; max-width: 280px;
    font-size: 0.9rem; line-height: 1.5; box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    animation: fadeSlide 0.3s ease; display: none;
}
.yazoo-helper-tip.show { display: block; }
.yazoo-helper-tip::after {
    content: ''; position: absolute; bottom: -8px; right: 20px;
    width: 16px; height: 16px; background: var(--card);
    border: 1px solid rgba(108,92,231,0.2);
    border-top: none; border-left: none; transform: rotate(45deg);
}

.yazoo-chat-window {
    position: fixed;
    bottom: 92px;
    right: 20px;
    z-index: 2000;
    width: min(360px, calc(100vw - 24px));
    height: min(450px, calc(100vh - 140px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 28px;
    background: rgba(10, 12, 18, 0.82);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 24px 80px rgba(0,0,0,0.55);
    backdrop-filter: blur(22px);
    opacity: 0;
    transform: translateY(24px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.yazoo-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.yazoo-chat-window[data-rtl="true"] {
    direction: rtl;
}

.yazoo-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.yazoo-chat-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.yazoo-chat-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 12px rgba(0,184,148,0.5);
    animation: breathe 2.4s ease infinite;
}

.yazoo-chat-title {
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}

.yazoo-chat-window[data-rtl="true"] .yazoo-chat-title {
    letter-spacing: 0.04em;
    text-transform: none;
}

.yazoo-chat-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.yazoo-chat-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: rgba(255,255,255,0.32);
    cursor: pointer;
    transition: var(--transition);
}

.yazoo-chat-icon-btn:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.82);
}

.yazoo-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yazoo-chat-msg {
    max-width: 86%;
    padding: 12px 14px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.55;
    border: 1px solid rgba(255,255,255,0.06);
    animation: fadeSlide 0.25s ease;
    white-space: pre-wrap;
}

.yazoo-chat-msg.assistant {
    align-self: flex-start;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.92);
    border-top-right-radius: 8px;
}

.yazoo-chat-msg.user {
    align-self: flex-end;
    background: rgba(108,92,231,0.18);
    color: #ece8ff;
    border-color: rgba(108,92,231,0.26);
    border-top-left-radius: 8px;
}

.yazoo-chat-typing {
    padding: 0 16px 10px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.34);
    font-style: italic;
}

.yazoo-chat-input-wrap {
    padding: 14px 16px 16px;
    background: rgba(255,255,255,0.04);
    border-top: 1px solid rgba(255,255,255,0.06);
}

.yazoo-chat-input-row {
    position: relative;
}

.yazoo-chat-input {
    width: 100%;
    padding: 12px 48px 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
}

.yazoo-chat-input::placeholder {
    color: rgba(255,255,255,0.26);
}

.yazoo-chat-input:focus {
    outline: none;
    border-color: rgba(108,92,231,0.55);
    box-shadow: 0 0 0 3px rgba(108,92,231,0.12);
}

.yazoo-chat-send-btn {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: rgba(108,92,231,0.18);
    color: #d7d0ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.yazoo-chat-window[data-rtl="true"] .yazoo-chat-input {
    padding: 12px 14px 12px 48px;
    text-align: right;
}

.yazoo-chat-window[data-rtl="true"] .yazoo-chat-send-btn {
    left: auto;
    right: 8px;
}

.yazoo-chat-send-btn:hover {
    background: rgba(108,92,231,0.28);
    color: #f4f2ff;
}

/* === TEACHER ENCOURAGEMENT BUBBLE === */
.teacher-bubble {
    background: linear-gradient(135deg, rgba(108,92,231,0.15), rgba(253,121,168,0.1));
    border: 1px solid rgba(108,92,231,0.25); border-radius: var(--radius);
    padding: 16px 20px; margin-bottom: 20px; animation: fadeSlide 0.6s ease;
    display: flex; align-items: center; gap: 12px;
}
.teacher-bubble .tb-avatar { font-size: 2rem; flex-shrink: 0; }
.teacher-bubble .tb-text { flex: 1; }
.teacher-bubble .tb-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; padding: 4px; }

/* === DAILY SUMMARY === */
.daily-summary-overlay {
    position: fixed; inset: 0; background: rgba(10,10,35,0.9); backdrop-filter: blur(10px);
    z-index: 2000; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.5s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.daily-summary-card {
    background: var(--card); border-radius: var(--radius); padding: 30px;
    max-width: 480px; width: 90%; border: 2px solid var(--primary);
    box-shadow: 0 0 40px rgba(108,92,231,0.2); animation: wizardIn 0.5s ease; text-align: center;
}
.daily-summary-card h2 { font-size: 1.4rem; margin-bottom: 20px; color: var(--primary-light); }
.summary-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.summary-row:last-of-type { border: none; }
.summary-label { color: var(--muted); }
.summary-value { font-weight: 700; }
.summary-yazoo { margin-top: 16px; padding: 14px; background: rgba(108,92,231,0.08); border-radius: var(--radius-sm); font-size: 0.95rem; line-height: 1.5; }
.summary-quote { margin-top: 12px; font-style: italic; color: var(--muted); font-size: 0.85rem; }

/* === CERTIFICATES === */
.certificate-overlay {
    position: fixed; inset: 0; background: rgba(10,10,35,0.92); backdrop-filter: blur(10px);
    z-index: 2100; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.5s ease;
}
.certificate-card {
    background: linear-gradient(135deg, var(--card), var(--card2));
    border-radius: var(--radius); padding: 36px; max-width: 420px; width: 90%;
    border: 3px solid var(--gold); box-shadow: 0 0 60px rgba(255,215,0,0.15);
    text-align: center; position: relative; animation: wizardIn 0.6s ease;
}
.certificate-card::before {
    content: ''; position: absolute; inset: 6px;
    border: 2px solid rgba(255,215,0,0.2); border-radius: calc(var(--radius) - 3px); pointer-events: none;
}
.cert-icon { font-size: 3rem; margin-bottom: 12px; }
.cert-title { font-size: 1.3rem; font-weight: 900; color: var(--gold); margin-bottom: 8px; }
.cert-desc { color: var(--text); margin-bottom: 16px; font-size: 0.95rem; }
.cert-name { font-size: 1.1rem; font-weight: 900; color: var(--primary-light); margin-bottom: 4px; }

/* === ENCOURAGE PANEL === */
.encourage-panel {
    background: var(--card); border-radius: var(--radius-sm); padding: 16px; margin-top: 16px;
    border: 1px solid rgba(253,121,168,0.2);
}
.encourage-panel h4 { margin-bottom: 10px; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.encourage-btns { display: flex; flex-direction: column; gap: 8px; }
.encourage-btn {
    background: rgba(253,121,168,0.1); border: 1px solid rgba(253,121,168,0.2);
    border-radius: 10px; padding: 10px 14px; color: var(--text);
    cursor: pointer; font-family: inherit; font-size: 0.9rem;
    text-align: right; transition: var(--transition);
}
.encourage-btn:hover { background: rgba(253,121,168,0.2); border-color: var(--accent); }

/* === AVATAR WORLD === */
.avatar-world-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.aw-tab { padding: 10px 18px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); background: none; color: var(--muted); font-family: inherit; font-weight: 700; cursor: pointer; transition: var(--transition); font-size: 0.9rem; display: flex; align-items: center; gap: 6px; }
.aw-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.aw-tab:hover:not(.active) { color: var(--text); border-color: var(--primary-light); }

/* Avatar Speech Bubble */
.avatar-speech {
    background: linear-gradient(135deg, rgba(108,92,231,0.12), rgba(253,121,168,0.08));
    border: 1px solid rgba(108,92,231,0.2); border-radius: var(--radius);
    padding: 16px 20px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 14px; animation: fadeSlide 0.6s ease;
    position: relative;
}
.avatar-speech .av-face { font-size: 2.8rem; flex-shrink: 0; animation: breathe 6s ease infinite; }
.avatar-speech .av-msg { flex: 1; font-size: 1rem; line-height: 1.6; }
.avatar-speech .av-name { font-weight: 900; color: var(--primary-light); display: block; margin-bottom: 4px; font-size: 0.85rem; }

/* Flow / High halo polish */
body.emo-flow .avatar-speech,
body.emo-high .avatar-speech {
    border-color: rgba(0, 255, 102, 0.22);
    box-shadow: 0 8px 28px rgba(0, 255, 102, 0.08), 0 0 0 1px rgba(0, 255, 102, 0.08) inset;
}
body.emo-flow .avatar-speech .av-face,
body.emo-high .avatar-speech .av-face {
    filter: drop-shadow(0 0 12px rgba(0, 255, 102, 0.25));
}
body.emo-flow .avatar-speech::after,
body.emo-high .avatar-speech::after {
    content: '';
    position: absolute;
    inset: auto 18px -10px 18px;
    height: 24px;
    border-radius: 999px;
    background: radial-gradient(ellipse at center, rgba(0,255,102,0.18) 0%, rgba(0,255,102,0.04) 45%, transparent 75%);
    pointer-events: none;
    animation: avatarHaloPulse 3.2s ease-in-out infinite;
}
@keyframes avatarHaloPulse {
    0%, 100% { opacity: 0.35; transform: scaleX(0.96); }
    50% { opacity: 0.7; transform: scaleX(1.03); }
}

/* Avatar Needs Bars */
.needs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.need-card { background: var(--card); border-radius: var(--radius-sm); padding: 14px 16px; border: 1px solid rgba(108,92,231,0.1); }
.need-label { font-size: 0.85rem; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.need-bar { height: 10px; background: rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden; position: relative; }
.need-fill { height: 100%; border-radius: 10px; transition: width 0.8s ease; position: relative; }
.need-fill.knowledge { background: linear-gradient(90deg, #74b9ff, #0984e3); }
.need-fill.confidence { background: linear-gradient(90deg, #fdcb6e, #f39c12); }
.need-fill.happiness { background: linear-gradient(90deg, #55efc4, #00b894); }
.need-fill.comfort { background: linear-gradient(90deg, #a29bfe, #6c5ce7); }
.need-value { font-size: 0.75rem; color: var(--muted); margin-top: 4px; text-align: left; }
.need-warning { font-size: 0.75rem; color: var(--accent); margin-top: 4px; animation: fadeSlide 0.4s ease; }

/* Avatar Room */
.avatar-room {
    background: var(--card); border-radius: var(--radius); padding: 20px;
    margin-bottom: 20px; border: 1px solid rgba(108,92,231,0.1); position: relative; overflow: hidden;
}
.room-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.room-title { font-weight: 900; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.room-level-badge { padding: 4px 12px; border-radius: 20px; background: rgba(108,92,231,0.15); font-size: 0.75rem; font-weight: 700; color: var(--primary-light); }
.room-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(4, 1fr);
    gap: 4px; background: rgba(255,255,255,0.02); border-radius: var(--radius-sm);
    padding: 12px; min-height: 200px; border: 1px dashed rgba(255,255,255,0.06);
}
.room-cell {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; border-radius: 8px; transition: var(--transition);
    cursor: pointer; background: rgba(255,255,255,0.01);
}
.room-cell:hover { background: rgba(108,92,231,0.08); }
.room-cell.occupied { background: rgba(108,92,231,0.06); }
.room-cell.avatar-pos { background: rgba(253,121,168,0.1); border: 1px solid rgba(253,121,168,0.2); }

/* Avatar Room Shop */
.room-shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.room-shop-item {
    background: var(--card); border-radius: var(--radius-sm); padding: 14px;
    text-align: center; cursor: pointer; transition: var(--transition); border: 2px solid transparent;
}
.room-shop-item:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.room-shop-item.owned { border-color: var(--success); opacity: 0.6; }
.room-shop-item.locked { opacity: 0.3; cursor: not-allowed; }
.room-shop-item .rsi-emoji { font-size: 2rem; margin-bottom: 6px; }
.room-shop-item .rsi-name { font-size: 0.8rem; font-weight: 700; margin-bottom: 4px; }
.room-shop-item .rsi-price { font-size: 0.8rem; color: var(--gold); font-weight: 900; }

/* Avatar Wardrobe */
.wardrobe-display {
    background: var(--card); border-radius: var(--radius); padding: 24px;
    text-align: center; margin-bottom: 20px; border: 1px solid rgba(108,92,231,0.1);
}
.wardrobe-avatar { font-size: 4rem; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.wardrobe-equipped { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.wardrobe-slot { padding: 6px 14px; background: rgba(108,92,231,0.1); border-radius: 20px; font-size: 0.85rem; display: flex; align-items: center; gap: 4px; }
.wardrobe-category { margin-bottom: 16px; }
.wardrobe-category-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }

/* Avatar Diary */
.diary-entries { max-height: 400px; overflow-y: auto; }
.diary-entry {
    background: var(--card); border-radius: var(--radius-sm); padding: 14px 18px;
    margin-bottom: 10px; border-right: 3px solid var(--primary-light); animation: fadeSlide 0.4s ease;
}
.diary-date { font-size: 0.75rem; color: var(--muted); margin-bottom: 6px; }
.diary-text { font-size: 0.95rem; line-height: 1.6; }

/* Social Status */
.social-status {
    background: var(--card); border-radius: var(--radius); padding: 20px;
    margin-bottom: 20px; text-align: center; border: 1px solid rgba(108,92,231,0.1);
}
.social-rank { font-size: 1.8rem; font-weight: 900; margin-bottom: 8px; }
.social-rank-name { color: var(--primary-light); font-weight: 700; margin-bottom: 12px; }
.npc-comments { margin-top: 12px; }
.npc-comment {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; background: rgba(255,255,255,0.02);
    border-radius: 10px; margin-bottom: 6px; font-size: 0.85rem;
}
.npc-avatar { font-size: 1.3rem; }

/* Honesty Check */
.honesty-overlay {
    position: fixed; inset: 0; background: rgba(10,10,35,0.92); backdrop-filter: blur(10px);
    z-index: 1900; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.5s ease;
}
.honesty-card {
    background: var(--card); border-radius: var(--radius); padding: 30px;
    max-width: 450px; width: 90%; border: 2px solid var(--primary);
    text-align: center; animation: wizardIn 0.5s ease;
}

/* === INVESTIGATION WHEEL (גלגל חקירה) === */
.wheel-overview { margin-bottom: 24px; }
.wheel-section-title { font-size: 1.2rem; font-weight: 900; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; color: var(--primary-light); }
/* Scroll indicator for wheels view */
.scroll-indicator { text-align: center; padding: 18px; color: var(--muted); font-size: 0.9rem; animation: bounceDown 2s ease infinite; }
.scroll-indicator i { display: block; font-size: 1.4rem; margin-bottom: 4px; }
@keyframes bounceDown { 0%,100%{transform:translateY(0)} 50%{transform:translateY(8px)} }
.my-wheels-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.wheel-card {
    background: var(--card); border-radius: var(--radius); padding: 20px;
    border: 2px solid rgba(108,92,231,0.15); cursor: pointer; transition: var(--transition);
    text-align: center; position: relative; overflow: hidden;
}
.wheel-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 8px 30px rgba(108,92,231,0.15); }
.wheel-card.active-wheel { border-color: var(--gold); box-shadow: 0 0 25px rgba(255,215,0,0.1); }
.wheel-card .wc-subject { font-size: 1.1rem; font-weight: 900; margin-bottom: 6px; }
.wheel-card .wc-topic { font-size: 0.85rem; color: var(--muted); margin-bottom: 12px; }
.wheel-card .wc-position { font-size: 0.8rem; color: var(--primary-light); font-weight: 700; }
.wheel-card .wc-members { font-size: 0.75rem; color: var(--muted); margin-top: 6px; }

/* Circular Wheel Visualization */
.wheel-container {
    position: relative; width: 340px; height: 340px; margin: 30px auto;
}
.wheel-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 3px solid rgba(108,92,231,0.15);
    animation: wheelIdle 30s linear infinite;
}
.wheel-ring.spinning {
    animation: wheelSpin 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes wheelIdle { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes wheelSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.wheel-center {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 90px; height: 90px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 0 30px rgba(108,92,231,0.3); z-index: 5;
    font-size: 0.75rem; font-weight: 700; color: white; text-align: center;
}
.wheel-center .wc-icon { font-size: 1.8rem; margin-bottom: 2px; }
.wheel-slot {
    position: absolute; width: 56px; height: 56px; border-radius: 50%;
    background: var(--card); border: 3px solid rgba(255,255,255,0.1);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 700; transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translate(-50%, -50%); z-index: 3; cursor: pointer;
}
.wheel-slot:hover { transform: translate(-50%, -50%) scale(1.15); z-index: 10; filter: brightness(1.15); }
.wheel-slot .ws-num {
    position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
    border-radius: 50%; font-size: 0.6rem; font-weight: 900;
    display: flex; align-items: center; justify-content: center; color: white;
}
.wheel-slot .ws-avatar { font-size: 1.3rem; }
.wheel-slot .ws-name { font-size: 0.55rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50px; }
.wheel-slot.my-slot {
    border-color: var(--gold); box-shadow: 0 0 20px rgba(255,215,0,0.3);
    animation: mySlotGlow 2s ease infinite;
}
@keyframes mySlotGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(255,215,0,0.2); }
    50% { box-shadow: 0 0 25px rgba(255,215,0,0.5); }
}

/* Slot colors: 10=cool blue -> 1=gold */
.wheel-slot[data-pos="10"] { border-color: #74b9ff; }
.wheel-slot[data-pos="10"] .ws-num { background: #74b9ff; }
.wheel-slot[data-pos="9"] { border-color: #81ecec; }
.wheel-slot[data-pos="9"] .ws-num { background: #81ecec; color: #333; }
.wheel-slot[data-pos="8"] { border-color: #55efc4; }
.wheel-slot[data-pos="8"] .ws-num { background: #55efc4; color: #333; }
.wheel-slot[data-pos="7"] { border-color: #00b894; }
.wheel-slot[data-pos="7"] .ws-num { background: #00b894; }
.wheel-slot[data-pos="6"] { border-color: #a29bfe; }
.wheel-slot[data-pos="6"] .ws-num { background: #a29bfe; }
.wheel-slot[data-pos="5"] { border-color: #6c5ce7; }
.wheel-slot[data-pos="5"] .ws-num { background: #6c5ce7; }
.wheel-slot[data-pos="4"] { border-color: #fd79a8; }
.wheel-slot[data-pos="4"] .ws-num { background: #fd79a8; }
.wheel-slot[data-pos="3"] { border-color: #e17055; }
.wheel-slot[data-pos="3"] .ws-num { background: #e17055; }
.wheel-slot[data-pos="2"] { border-color: #f39c12; }
.wheel-slot[data-pos="2"] .ws-num { background: #f39c12; }
.wheel-slot[data-pos="1"] { border-color: var(--gold); }
.wheel-slot[data-pos="1"] .ws-num { background: var(--gold); color: #333; }

/* Wheel Detail Panel */
.wheel-detail {
    background: var(--card); border-radius: var(--radius); padding: 24px;
    border: 2px solid rgba(108,92,231,0.15); margin-bottom: 20px;
}
.wheel-detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.wheel-detail-title { font-size: 1.3rem; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.wheel-detail-topic { font-size: 0.9rem; color: var(--muted); margin-bottom: 20px; }

/* Position Role Card */
.position-role-card {
    background: var(--bg2); border-radius: var(--radius-sm); padding: 16px 20px;
    margin-bottom: 16px; border-right: 4px solid var(--primary);
    animation: fadeSlide 0.5s ease;
}
.prc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.prc-position-num {
    width: 36px; height: 36px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-weight: 900; font-size: 1.1rem; color: white;
}
.prc-role-name { font-weight: 900; font-size: 1rem; }
.prc-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.prc-task { margin-top: 10px; padding: 10px 14px; background: rgba(108,92,231,0.08); border-radius: 10px; font-size: 0.85rem; }
.prc-task-btn {
    margin-top: 10px; padding: 10px 18px; border-radius: 10px;
    background: var(--primary); color: white; border: none;
    font-family: inherit; font-weight: 700; cursor: pointer;
    transition: var(--transition); font-size: 0.9rem;
}
.prc-task-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(108,92,231,0.3); }
.prc-task-btn:disabled { background: rgba(255,255,255,0.08); color: var(--muted); cursor: not-allowed; transform: none !important; }
.prc-task-btn.completed { background: var(--success); }

/* Available Wheels */
.available-wheels-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 24px; }
.avail-wheel-card {
    background: var(--card); border-radius: var(--radius-sm); padding: 18px;
    text-align: center; border: 2px solid rgba(255,255,255,0.06);
    transition: var(--transition); cursor: pointer;
}
.avail-wheel-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.avail-wheel-card.locked { opacity: 0.4; cursor: not-allowed; }
.avail-wheel-card .awc-icon { font-size: 2.2rem; margin-bottom: 8px; }
.avail-wheel-card .awc-name { font-weight: 700; margin-bottom: 4px; }
.avail-wheel-card .awc-info { font-size: 0.8rem; color: var(--muted); }
.avail-wheel-card .awc-join-btn {
    margin-top: 10px; padding: 8px 16px; border-radius: 20px;
    background: var(--primary); color: white; border: none;
    font-family: inherit; font-weight: 700; cursor: pointer;
    transition: var(--transition); font-size: 0.85rem;
}
.avail-wheel-card .awc-join-btn:hover { background: var(--primary-dark); }
.avail-wheel-card .awc-join-btn:disabled { background: var(--muted); cursor: not-allowed; }

/* Members list in wheel */
.wheel-members-list { margin-top: 16px; }
.wml-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    background: rgba(255,255,255,0.02); border-radius: 10px; margin-bottom: 6px;
    font-size: 0.9rem; transition: var(--transition);
}
.wml-item.is-me { background: rgba(255,215,0,0.06); border: 1px solid rgba(255,215,0,0.15); }
.wml-item .wml-pos { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.8rem; color: white; }
.wml-item .wml-avatar { font-size: 1.3rem; }
.wml-item .wml-name { font-weight: 700; flex: 1; }
.wml-item .wml-role { font-size: 0.75rem; color: var(--muted); }

/* Leader badge */
.leader-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,215,0,0.05));
    color: var(--gold); font-size: 0.8rem; font-weight: 900;
    border: 1px solid rgba(255,215,0,0.3);
}

/* Wheel teacher view */
.wheel-teacher-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.wheel-teacher-card {
    background: var(--card); border-radius: var(--radius-sm); padding: 16px;
    border: 1px solid rgba(108,92,231,0.1);
}
.wheel-teacher-card .wtc-title { font-weight: 900; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.wheel-teacher-card .wtc-members { font-size: 0.85rem; color: var(--muted); }

/* === STATION TOOLS === */
.station-view { background: var(--card); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; border: 2px solid rgba(108,92,231,0.15); }
.station-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.station-num { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.3rem; color: white; }
.station-name { font-size: 1.2rem; font-weight: 900; }
.station-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.station-tier-badge { padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; background: rgba(108,92,231,0.15); color: var(--primary-light); }

.station-tools-panel { background: var(--bg2); border-radius: var(--radius-sm); padding: 20px; margin-bottom: 16px; border: 1px dashed rgba(108,92,231,0.2); }
.station-tools-title { font-weight: 900; font-size: 1rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; color: var(--primary-light); }

.station-task-area { background: rgba(108,92,231,0.06); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; border: 1px solid rgba(108,92,231,0.12); }
.station-task-title { font-weight: 900; font-size: 0.95rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.station-task-desc { font-size: 0.9rem; color: var(--muted); margin-bottom: 12px; }

/* Tool: Text Input */
.tool-textarea { width: 100%; min-height: 80px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.1); background: var(--card); color: var(--text); font-family: inherit; font-size: 0.95rem; resize: vertical; transition: border-color 0.3s; }
.tool-textarea:focus { outline: none; border-color: var(--primary); }
.tool-input { width: 100%; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.1); background: var(--card); color: var(--text); font-family: inherit; font-size: 0.95rem; }
.tool-input:focus { outline: none; border-color: var(--primary); }

/* Tool: Question Builder */
.question-builder { display: flex; flex-direction: column; gap: 10px; }
.question-row { display: flex; gap: 8px; align-items: center; }
.question-prefix { padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; cursor: pointer; border: 2px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); transition: var(--transition); white-space: nowrap; }
.question-prefix:hover { border-color: var(--primary-light); }
.question-prefix.active { border-color: var(--primary); background: rgba(108,92,231,0.15); color: var(--primary-light); }

/* Tool: Sorting Board */
.sorting-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.sort-category { background: var(--card); border-radius: var(--radius-sm); padding: 14px; min-height: 120px; border: 2px dashed rgba(255,255,255,0.08); transition: var(--transition); }
.sort-category.drag-over { border-color: var(--primary); background: rgba(108,92,231,0.06); }
.sort-category-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 10px; text-align: center; padding: 4px 10px; border-radius: 20px; }
.sort-item { padding: 8px 12px; margin-bottom: 6px; background: rgba(255,255,255,0.04); border-radius: 8px; font-size: 0.85rem; cursor: grab; border: 1px solid rgba(255,255,255,0.06); transition: var(--transition); }
.sort-item:hover { background: rgba(255,255,255,0.08); }

/* Tool: Hypothesis Builder */
.hypothesis-builder { display: flex; flex-direction: column; gap: 12px; }
.hyp-row { display: flex; align-items: center; gap: 10px; }
.hyp-label { font-weight: 700; font-size: 0.9rem; min-width: 40px; color: var(--primary-light); }

/* Tool: Mind Map */
.mindmap-container { position: relative; min-height: 250px; background: rgba(0,0,0,0.2); border-radius: var(--radius-sm); overflow: hidden; border: 1px solid rgba(108,92,231,0.1); }
.mindmap-node { position: absolute; padding: 10px 16px; background: var(--card); border: 2px solid var(--primary); border-radius: 30px; cursor: move; font-size: 0.85rem; font-weight: 700; z-index: 2; transition: box-shadow 0.3s; user-select: none; }
.mindmap-node:hover { box-shadow: 0 0 15px rgba(108,92,231,0.3); }
.mindmap-node.center { background: var(--primary); color: white; border-color: var(--primary-light); }
.mindmap-add-btn { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); padding: 8px 16px; border-radius: 20px; background: var(--primary); color: white; border: none; font-family: inherit; font-weight: 700; cursor: pointer; font-size: 0.85rem; z-index: 3; }

/* Tool: Slide Builder */
.slide-builder { display: flex; flex-direction: column; gap: 12px; }
.slide-preview { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0; }
.slide-card { min-width: 200px; background: var(--card); border-radius: var(--radius-sm); padding: 16px; border: 2px solid rgba(255,255,255,0.06); cursor: pointer; transition: var(--transition); flex-shrink: 0; }
.slide-card:hover { border-color: var(--primary-light); }
.slide-card.active { border-color: var(--primary); box-shadow: 0 0 15px rgba(108,92,231,0.2); }
.slide-card .slide-num { font-size: 0.7rem; color: var(--muted); margin-bottom: 6px; }
.slide-card .slide-title-input { width: 100%; padding: 6px; border: none; border-bottom: 1px solid rgba(255,255,255,0.1); background: transparent; color: var(--text); font-family: inherit; font-weight: 700; font-size: 0.9rem; }
.slide-card .slide-content-input { width: 100%; min-height: 60px; padding: 6px; border: none; background: transparent; color: var(--text); font-family: inherit; font-size: 0.8rem; resize: none; }

/* Tool: Observation Log */
.obs-log { display: flex; flex-direction: column; gap: 12px; }
.obs-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.obs-label { font-weight: 700; font-size: 0.85rem; padding-top: 8px; white-space: nowrap; }

/* Tool: Leader Dashboard */
.leader-dashboard { background: var(--bg2); border-radius: var(--radius); padding: 20px; border: 2px solid rgba(255,215,0,0.15); margin-bottom: 16px; }
.leader-dashboard-title { font-weight: 900; font-size: 1.1rem; color: var(--gold); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.leader-member-card { background: var(--card); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 8px; border-right: 3px solid var(--muted); }
.leader-member-card.completed { border-color: var(--success); }
.leader-member-card.pending { border-color: var(--warning); }
.leader-feedback-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.leader-feedback-btn { padding: 4px 12px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); cursor: pointer; font-family: inherit; font-size: 0.8rem; transition: var(--transition); }
.leader-feedback-btn:hover { border-color: var(--gold); background: rgba(255,215,0,0.1); }

/* Station progress indicator */
.station-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.station-progress-step { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 900; border: 2px solid rgba(255,255,255,0.1); color: var(--muted); transition: var(--transition); }
.station-progress-step.current { border-color: var(--primary); color: var(--primary-light); background: rgba(108,92,231,0.15); }
.station-progress-step.done { border-color: var(--success); color: var(--success); background: rgba(0,184,148,0.1); }
.station-progress-line { flex: 1; height: 2px; background: rgba(255,255,255,0.05); }

/* Teacher wheel monitor */
.teacher-wheel-monitor { background: var(--card); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px; }
.twm-student-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.9rem; }
.twm-student-row:last-child { border: none; }
.twm-stuck { color: var(--danger); font-size: 0.75rem; font-weight: 700; animation: fadeSlide 0.4s ease; }

/* Tool: Drawing Canvas */
.drawing-canvas-container { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid rgba(108,92,231,0.15); }
.drawing-canvas { width: 100%; height: 200px; background: rgba(0,0,0,0.3); cursor: crosshair; display: block; border-radius: var(--radius-sm); }
.drawing-toolbar { display: flex; gap: 6px; padding: 8px; background: rgba(0,0,0,0.2); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.drawing-tool-btn { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.1); cursor: pointer; transition: var(--transition); }
.drawing-tool-btn:hover { border-color: var(--primary-light); }
.drawing-tool-btn.active { border-color: var(--primary); box-shadow: 0 0 8px rgba(108,92,231,0.3); }

/* Station submission success */
.station-submitted { text-align: center; padding: 20px; animation: fadeSlide 0.5s ease; }
.station-submitted .submitted-icon { font-size: 3rem; margin-bottom: 12px; }
.station-submitted .submitted-msg { font-size: 1.1rem; font-weight: 700; color: var(--success); margin-bottom: 8px; }
.station-submitted .submitted-credits { font-size: 0.9rem; color: var(--gold); }

/* === STATION CONVERSATION CHAT UI === */
.station-chat-container {
    background: var(--bg2); border-radius: var(--radius); padding: 0; margin-bottom: 16px;
    border: 2px solid rgba(108,92,231,0.2); overflow: hidden; max-width: 700px; margin-left: auto; margin-right: auto;
}
.station-chat-header {
    display: flex; align-items: center; gap: 10px; padding: 14px 18px;
    background: linear-gradient(135deg, rgba(108,92,231,0.15), rgba(253,121,168,0.08));
    border-bottom: 1px solid rgba(108,92,231,0.12);
}
.station-chat-header .sch-avatar { font-size: 1.6rem; animation: breathe 6s ease infinite; }
.station-chat-header .sch-title { font-weight: 900; font-size: 1rem; }
.station-chat-header .sch-subtitle { font-size: 0.8rem; color: var(--muted); }
.station-chat-messages {
    padding: 16px; min-height: 200px; max-height: 420px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth;
}
.chat-msg {
    display: flex; gap: 10px; max-width: 85%; animation: fadeSlide 0.4s ease;
}
.chat-msg.yazoo { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.child { align-self: flex-start; }
.chat-msg .cm-avatar {
    width: 36px; height: 36px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.chat-msg.yazoo .cm-avatar { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.chat-msg.child .cm-avatar { background: rgba(0,184,148,0.15); }
.chat-msg .cm-bubble {
    padding: 12px 16px; border-radius: 16px; font-size: 0.95rem; line-height: 1.6;
    position: relative;
}
.chat-msg.yazoo .cm-bubble {
    background: linear-gradient(135deg, rgba(108,92,231,0.18), rgba(108,92,231,0.08));
    border: 1px solid rgba(108,92,231,0.15); border-radius: 16px 4px 16px 16px;
}
.chat-msg.child .cm-bubble {
    background: rgba(0,184,148,0.1); border: 1px solid rgba(0,184,148,0.15);
    border-radius: 4px 16px 16px 16px;
}
.chat-msg .cm-name { font-size: 0.7rem; font-weight: 700; color: var(--muted); margin-bottom: 2px; display: block; }
.chat-typing {
    display: flex; align-items: center; gap: 10px; padding: 8px 16px;
    color: var(--muted); font-size: 0.85rem; animation: fadeSlide 0.3s ease;
}
.chat-typing .typing-dots { display: flex; gap: 4px; }
.chat-typing .typing-dots span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--primary-light);
    animation: typingBounce 1.2s ease infinite;
}
.chat-typing .typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing .typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}
.station-chat-input {
    display: flex; gap: 8px; padding: 12px 16px;
    background: rgba(0,0,0,0.15); border-top: 1px solid rgba(108,92,231,0.1);
}
.station-chat-input input {
    flex: 1; padding: 12px 16px; border-radius: 30px; border: 1px solid rgba(255,255,255,0.1);
    background: var(--card); color: var(--text); font-family: inherit; font-size: 0.95rem;
}
.station-chat-input input:focus { outline: none; border-color: var(--primary); }
.station-chat-input .chat-send-btn {
    width: 44px; height: 44px; border-radius: 50%; border: none;
    background: var(--primary); color: white; font-size: 1.1rem;
    cursor: pointer; transition: var(--transition); display: flex;
    align-items: center; justify-content: center;
}
.station-chat-input .chat-send-btn:hover { transform: scale(1.1); background: var(--primary-dark); }
.station-chat-input .chat-send-btn:disabled { background: rgba(255,255,255,0.08); color: var(--muted); cursor: not-allowed; transform: none !important; }
.chat-choices {
    display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 16px 12px;
    background: rgba(0,0,0,0.1); border-top: 1px solid rgba(108,92,231,0.08);
}
.chat-choice-btn {
    padding: 10px 18px; border-radius: 30px; border: 2px solid rgba(108,92,231,0.2);
    background: rgba(108,92,231,0.06); color: var(--text); font-family: inherit;
    font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.chat-choice-btn:hover { border-color: var(--primary); background: rgba(108,92,231,0.15); transform: translateY(-2px); }
.station-chat-complete {
    text-align: center; padding: 20px; animation: fadeSlide 0.5s ease;
    background: linear-gradient(135deg, rgba(0,184,148,0.08), rgba(108,92,231,0.06));
    border-top: 1px solid rgba(0,184,148,0.15);
}
.station-chat-complete .scc-icon { font-size: 2.5rem; margin-bottom: 8px; }
.station-chat-complete .scc-msg { font-size: 1.05rem; font-weight: 700; color: var(--success); margin-bottom: 4px; }
.station-chat-complete .scc-sub { font-size: 0.85rem; color: var(--muted); }
.avatar-convo-bar {
    display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin: 0 16px 12px;
    background: rgba(253,121,168,0.06); border-radius: 12px; border: 1px solid rgba(253,121,168,0.12);
    font-size: 0.85rem; color: var(--accent); animation: fadeSlide 0.4s ease;
}
.avatar-convo-bar .acb-face { font-size: 1.3rem; animation: breathe 6s ease infinite; }

/* === RPG LAYER === */
.world-portals { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 24px; }
.world-portal { border-radius: var(--radius); padding: 20px; text-align: center; cursor: pointer; transition: var(--transition); border: 2px solid transparent; position: relative; overflow: hidden; }
.world-portal:hover { transform: translateY(-4px); }
.world-portal.red { background: linear-gradient(135deg, rgba(214,48,49,0.15), rgba(214,48,49,0.05)); border-color: rgba(214,48,49,0.3); }
.world-portal.red:hover { box-shadow: 0 0 30px rgba(214,48,49,0.3); }
.world-portal.green { background: linear-gradient(135deg, rgba(0,184,148,0.15), rgba(0,184,148,0.05)); border-color: rgba(0,184,148,0.3); }
.world-portal.green:hover { box-shadow: 0 0 30px rgba(0,184,148,0.3); }
.world-portal.blue { background: linear-gradient(135deg, rgba(108,92,231,0.15), rgba(108,92,231,0.05)); border-color: rgba(108,92,231,0.3); }
.world-portal.blue:hover { box-shadow: 0 0 30px rgba(108,92,231,0.3); }
.world-portal .portal-icon { font-size: 2.5rem; margin-bottom: 8px; }
.world-portal .portal-title { font-weight: 900; font-size: 1.1rem; }
.world-portal .portal-sub { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.world-portal .portal-progress { height: 4px; background: rgba(255,255,255,0.1); border-radius: 10px; margin-top: 12px; overflow: hidden; }
.world-portal .portal-progress-fill { height: 100%; border-radius: 10px; transition: width 0.8s ease; }
.world-portal.red .portal-progress-fill { background: var(--danger); }
.world-portal.green .portal-progress-fill { background: var(--success); }
.world-portal.blue .portal-progress-fill { background: var(--primary); }

/* Boss Battle */
.boss-frame { background: var(--card); border-radius: var(--radius); padding: 20px; border: 2px solid var(--danger); margin-bottom: 16px; animation: bossGlow 2s infinite; }
@keyframes bossGlow { 0%,100%{box-shadow:0 0 10px rgba(214,48,49,0.2)} 50%{box-shadow:0 0 30px rgba(214,48,49,0.4)} }
.boss-frame .boss-name { font-size: 1.4rem; font-weight: 900; color: var(--danger); text-align: center; margin-bottom: 12px; }
.boss-frame .boss-hp { height: 12px; background: rgba(255,255,255,0.1); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.boss-frame .boss-hp-fill { height: 100%; background: linear-gradient(90deg, var(--danger), #ff6b6b); border-radius: 10px; transition: width 0.5s ease; }
.boss-frame .boss-hp-text { text-align: center; font-size: 0.8rem; color: var(--muted); }
.boss-frame.legendary { border-color: var(--gold); animation-name: legendaryGlow; }
@keyframes legendaryGlow { 0%,100%{box-shadow:0 0 10px rgba(255,215,0,0.2)} 50%{box-shadow:0 0 30px rgba(255,215,0,0.5)} }

/* Loot rarity */
.loot-common { border-color: rgba(255,255,255,0.2); }
.loot-rare { border-color: #3498db; box-shadow: 0 0 10px rgba(52,152,219,0.2); }
.loot-epic { border-color: #9b59b6; box-shadow: 0 0 10px rgba(155,89,182,0.2); }
.loot-legendary { border-color: var(--gold); box-shadow: 0 0 15px rgba(255,215,0,0.3); }
.loot-stash {
    margin-bottom: 16px;
    padding: 16px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(9,132,227,0.12), rgba(108,92,231,0.10));
    border: 1px solid rgba(116,185,255,0.22);
}
.loot-stash-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.loot-stash-title {
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
}
.loot-stash-count {
    color: var(--info);
    font-size: 0.85rem;
    font-weight: 700;
}
.loot-stash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.loot-drop-card {
    border-radius: 16px;
    padding: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
}
.loot-drop-card.claimed {
    opacity: 0.55;
    filter: grayscale(0.25);
}
.loot-drop-art {
    width: 100%;
    height: 74px;
    border-radius: 12px;
    margin-bottom: 12px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.08);
    opacity: 0.9;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.loot-drop-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.loot-drop-rarity {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
}
.loot-drop-source {
    color: var(--muted);
    font-size: 0.78rem;
}
.loot-drop-reward {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
}
.loot-drop-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.loot-drop-time {
    color: var(--muted);
    font-size: 0.74rem;
}
.loot-claim-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    color: white;
    background: linear-gradient(135deg, #0984e3, #6c5ce7);
}
.loot-claim-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* Quest card */
.quest-card { background: var(--card); border-radius: var(--radius-sm); padding: 14px; border-right: 4px solid var(--success); margin-bottom: 8px; }
.quest-card.active { border-color: var(--warning); background: rgba(253,203,110,0.05); }
.quest-card.done { border-color: var(--success); opacity: 0.7; }

/* Quest Map */
.quest-map { position: relative; padding: 20px 0; }
.quest-path { display: flex; flex-direction: column; gap: 0; position: relative; }
.quest-node { display: flex; align-items: center; gap: 16px; padding: 14px 18px; position: relative; transition: var(--transition); cursor: pointer; border-radius: var(--radius-sm); }
.quest-node:hover { background: rgba(255,255,255,0.03); backdrop-filter: blur(4px); }
.quest-node .qn-marker { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 900; flex-shrink: 0; border: 3px solid; position: relative; z-index: 2; transition: var(--transition); }
.quest-node.locked .qn-marker { border-color: rgba(255,255,255,0.1); background: var(--bg2); color: var(--muted); }
.quest-node.active .qn-marker { border-color: var(--warning); background: rgba(253,203,110,0.15); color: var(--warning); animation: questPing 4s infinite; }
@keyframes questPing { 0%,100%{box-shadow:0 0 0 0 rgba(253,203,110,0.25)} 50%{box-shadow:0 0 0 12px rgba(253,203,110,0)} }
.quest-node.done .qn-marker { border-color: var(--success); background: rgba(0,184,148,0.15); color: var(--success); }
.quest-node .qn-line { position: absolute; right: 39px; top: 58px; width: 3px; height: calc(100% - 14px); background: rgba(255,255,255,0.06); z-index: 1; }
.quest-node.done .qn-line { background: var(--success); }
.quest-node.active .qn-line { background: linear-gradient(to bottom, var(--warning), rgba(255,255,255,0.06)); }
.quest-node:last-child .qn-line { display: none; }
.quest-node .qn-info { flex: 1; }
.quest-node .qn-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.quest-node.locked .qn-title { color: var(--muted); }
.quest-node.active .qn-title { color: var(--warning); }
.quest-node.done .qn-title { color: var(--success); }
.quest-node .qn-desc { font-size: 0.8rem; color: var(--muted); }
.quest-node .qn-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 700; }
.quest-node.locked .qn-badge { background: rgba(255,255,255,0.05); color: var(--muted); }
.quest-node.active .qn-badge { background: rgba(253,203,110,0.15); color: var(--warning); }
.quest-node.done .qn-badge { background: rgba(0,184,148,0.15); color: var(--success); }

/* Quest reward strip */
.quest-rewards { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.quest-reward { padding: 8px 14px; border-radius: 10px; font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.quest-reward.earned { background: rgba(0,184,148,0.1); color: var(--success); border: 1px solid rgba(0,184,148,0.2); }
.quest-reward.locked { background: rgba(255,255,255,0.03); color: var(--muted); border: 1px solid rgba(255,255,255,0.05); }

/* Reading style accessibility */
body.reading-compact { font-size: 1.15rem; }
body.reading-compact .yazoo-text, body.reading-compact .chat-msg { line-height: 2; letter-spacing: 0.02em; }
body.reading-visual .yazoo-text { font-weight: 600; }
body.reading-audio .tts-indicator { display: inline-block; }
.tts-indicator { display: none; cursor: pointer; margin-right: 6px; }

/* === RGB RPG LAYER === */
.rgb-world-strip {
    margin-bottom: 18px;
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.08), transparent 28%),
        linear-gradient(135deg, rgba(108,92,231,0.18), rgba(37,37,96,0.94));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}
.rgb-chip-row, .learning-style-grid, .rgb-world-nav, .rgb-quest-grid, .rgb-stat-grid {
    display: grid;
    gap: 12px;
}
.rgb-chip-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 18px 0 0;
}
.rgb-chip, .learning-style-card, .rgb-stat-card, .rgb-quest-card {
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
}
.rgb-chip {
    padding: 14px;
    text-align: right;
}
.rgb-chip strong { display: block; margin-bottom: 4px; font-size: 1rem; }
.rgb-chip small { color: rgba(223,230,233,0.85); }
.rgb-chip.red { border-color: rgba(214,48,49,0.35); }
.rgb-chip.green { border-color: rgba(0,184,148,0.35); }
.rgb-chip.blue { border-color: rgba(116,185,255,0.35); }
.rpg-onboard-panel {
    width: 100%;
    max-width: 880px;
    margin-top: 18px;
    padding: 18px;
    background: rgba(255,255,255,0.03);
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.08);
}
.rpg-onboard-panel h3 { margin-bottom: 8px; font-size: 1.15rem; }
.rpg-onboard-panel p { color: var(--muted); margin-bottom: 14px; }
.learning-style-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
}
.learning-style-card {
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    -webkit-tap-highlight-color: rgba(108,92,231,0.3);
    touch-action: manipulation;
    user-select: none;
}
.learning-style-card:hover {
    transform: translateY(-3px);
    border-color: rgba(162,155,254,0.5);
}
.learning-style-card.selected {
    border-color: var(--gold);
    background: rgba(255,215,0,0.08);
    box-shadow: 0 0 18px rgba(255,215,0,0.12);
}
.style-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}
.learning-style-card strong {
    display: block;
    margin-bottom: 8px;
}
.learning-style-card p {
    margin: 0;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
}
.rgb-rpg-strip {
    margin-bottom: 18px;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.12), transparent 25%),
        linear-gradient(135deg, rgba(22,22,58,0.96), rgba(30,30,74,0.96));
    border: 1px solid rgba(162,155,254,0.18);
    border-radius: 22px;
    padding: 20px;
}
.rgb-rpg-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 16px;
}
.rgb-kicker {
    color: rgba(255,255,255,0.65);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    margin-bottom: 8px;
}
.rgb-rpg-header h3 {
    font-size: 1.7rem;
    margin-bottom: 6px;
}
.rgb-rpg-header p {
    color: rgba(223,230,233,0.85);
    max-width: 680px;
}
.rgb-style-pill {
    white-space: nowrap;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text);
}
.rgb-world-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
}
.rgb-world-btn {
    border: none;
    color: white;
    border-radius: 18px;
    padding: 14px 16px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    text-align: right;
    transition: var(--transition);
}
.rgb-world-btn small {
    display: block;
    margin-top: 4px;
    opacity: 0.85;
    font-weight: 500;
}
.rgb-world-btn:hover { transform: translateY(-2px); }
.rgb-world-btn.active { box-shadow: 0 0 0 2px rgba(255,255,255,0.22); }
.rgb-world-btn.red { background: linear-gradient(135deg, #d63031, #7f1d1d); }
.rgb-world-btn.green { background: linear-gradient(135deg, #00b894, #14532d); }
.rgb-world-btn.blue { background: linear-gradient(135deg, #0984e3, #1d4ed8); }
.rgb-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 14px;
}
.rgb-mission-panel, .rgb-world-panel {
    background: rgba(255,255,255,0.04);
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.08);
}
.rgb-mission-panel strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-light);
}
.rgb-world-panel h4 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}
.rgb-world-panel p {
    color: var(--muted);
    margin-bottom: 14px;
}
.rgb-quest-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.rgb-quest-card {
    padding: 14px;
}
.rgb-quest-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 10px;
    margin-bottom: 10px;
    font-size: 0.72rem;
    font-weight: 800;
}
.rgb-quest-badge.red { background: rgba(214,48,49,0.12); color: #ff8f8f; }
.rgb-quest-badge.green { background: rgba(0,184,148,0.12); color: #7fffd4; }
.rgb-quest-badge.blue { background: rgba(116,185,255,0.12); color: #b9e2ff; }
.rgb-quest-card h5 {
    margin-bottom: 8px;
    font-size: 0.98rem;
}
.rgb-quest-card p {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
}
.rgb-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
}
.rgb-stat-card {
    padding: 14px;
}
.rgb-stat-card strong {
    display: block;
    margin: 6px 0 4px;
    font-size: 1.25rem;
}
.rgb-stat-card small {
    color: var(--muted);
    line-height: 1.5;
}
.rgb-stat-card.red { border-color: rgba(214,48,49,0.28); }
.rgb-stat-card.green { border-color: rgba(0,184,148,0.28); }
.rgb-stat-card.blue { border-color: rgba(116,185,255,0.28); }

/* === BOSS BATTLE SYSTEM === */
.boss-entry-overlay {
    position: fixed; inset: 0; z-index: 600;
    background: rgba(0,0,0,0.92); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.5s ease;
}
.boss-entry-card {
    text-align: center; max-width: 420px; width: 90%; padding: 40px 30px;
    background: radial-gradient(ellipse at center, rgba(214,48,49,0.12), transparent 70%), var(--card);
    border-radius: var(--radius); border: 3px solid var(--danger);
    box-shadow: 0 0 60px rgba(214,48,49,0.25);
    animation: bossZoomIn 0.8s cubic-bezier(0.17, 0.67, 0.29, 1.35);
}
.boss-entry-card.legendary {
    border-color: var(--gold);
    background: radial-gradient(ellipse at center, rgba(255,215,0,0.12), transparent 70%), var(--card);
    box-shadow: 0 0 80px rgba(255,215,0,0.3);
}
@keyframes bossZoomIn { 0%{transform:scale(0.3);opacity:0} 50%{transform:scale(1.08);opacity:1} 100%{transform:scale(1)} }
.boss-entry-portrait {
    width: 138px;
    height: 138px;
    margin: 0 auto 14px;
    border-radius: 28px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    opacity: 0.94;
}
.boss-entry-emoji { font-size: 5rem; margin-bottom: 12px; animation: bossBounce 1s ease infinite; }
@keyframes bossBounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
.boss-entry-name { font-size: 1.8rem; font-weight: 900; color: var(--danger); margin-bottom: 4px; }
.boss-entry-card.legendary .boss-entry-name { color: var(--gold); }
.boss-entry-appear { font-size: 1rem; color: var(--muted); margin-bottom: 16px; }
.boss-entry-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px;
    padding: 12px; background: rgba(0,0,0,0.2); border-radius: var(--radius-sm);
}
.boss-entry-stat { text-align: center; }
.boss-entry-stat .bes-label { font-size: 0.7rem; color: var(--muted); display: block; }
.boss-entry-stat .bes-value { font-weight: 900; font-size: 0.95rem; }
.boss-entry-dialogue {
    padding: 10px 16px; margin-bottom: 16px;
    background: rgba(214,48,49,0.08); border-radius: var(--radius-sm);
    border-right: 3px solid var(--danger); font-style: italic; font-size: 0.9rem; color: var(--text);
}
.boss-entry-card.legendary .boss-entry-dialogue { border-color: var(--gold); background: rgba(255,215,0,0.06); }
.golden-particle {
    position: absolute; pointer-events: none; font-size: 1rem;
    animation: goldenFloat 2s ease-out forwards;
}
@keyframes goldenFloat { 0%{transform:translateY(0) scale(0.5);opacity:0} 20%{opacity:1} 100%{transform:translateY(-120px) scale(0.3) rotate(360deg);opacity:0} }

/* Combat HUD */
.combat-hud {
    background: linear-gradient(135deg, rgba(214,48,49,0.12), rgba(214,48,49,0.04));
    border: 2px solid rgba(214,48,49,0.25); border-radius: var(--radius);
    padding: 16px 20px; margin-bottom: 12px; position: relative; overflow: hidden;
    animation: fadeSlide 0.5s ease;
}
.combat-hud.legendary { border-color: rgba(255,215,0,0.35); background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(214,48,49,0.04)); }
.combat-hud-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.combat-boss-emoji { font-size: 2rem; animation: breathe 6s ease infinite; }
.combat-boss-name { font-weight: 900; font-size: 1.1rem; color: var(--danger); flex: 1; }
.combat-hud.legendary .combat-boss-name { color: var(--gold); }
.combat-hp-bar { height: 16px; background: rgba(255,255,255,0.08); border-radius: 10px; overflow: hidden; position: relative; margin-bottom: 6px; }
.combat-hp-fill {
    height: 100%; border-radius: 10px;
    background: linear-gradient(90deg, #d63031, #ff6b6b);
    transition: width 1s ease; position: relative;
}
.combat-hp-fill.low { animation: hpPulse 0.8s infinite; }
@keyframes hpPulse { 0%,100%{opacity:1} 50%{opacity:0.6} }
.combat-hp-fill::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 60%, rgba(255,255,255,0.15)); border-radius: 10px;
}
.combat-hp-text { text-align: center; font-size: 0.75rem; color: var(--muted); }
.combat-attack-text {
    position: absolute; z-index: 10; font-weight: 900; font-size: 1.3rem;
    pointer-events: none; animation: attackFloat 1.8s ease-out forwards;
    text-shadow: 0 0 15px rgba(214,48,49,0.6);
}
@keyframes attackFloat { 0%{transform:translateY(0) scale(0.5);opacity:0} 15%{transform:translateY(-10px) scale(1.3);opacity:1} 100%{transform:translateY(-80px) scale(0.7);opacity:0} }
.combat-dialogue {
    display: flex; gap: 8px; align-items: flex-start; margin-top: 10px;
    padding: 8px 12px; border-radius: 10px; font-size: 0.85rem;
    animation: fadeSlide 0.4s ease;
}
.combat-dialogue.boss-says { background: rgba(214,48,49,0.08); }
.combat-dialogue.yazoo-says { background: rgba(108,92,231,0.08); }

/* Combo Counter */
.combo-counter {
    position: fixed; top: 70px; right: 20px; z-index: 150;
    background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(214,48,49,0.1));
    border: 2px solid var(--gold); border-radius: 16px; padding: 10px 18px;
    text-align: center; box-shadow: 0 4px 20px rgba(255,215,0,0.2);
    animation: comboIn 0.5s cubic-bezier(0.17, 0.67, 0.29, 1.35);
    display: none;
}
.combo-counter.active { display: block; }
.combo-counter.mega { animation: megaCombo 0.8s ease infinite; border-color: var(--danger); }
@keyframes comboIn { 0%{transform:scale(0);opacity:0} 100%{transform:scale(1);opacity:1} }
@keyframes megaCombo { 0%,100%{box-shadow:0 0 10px rgba(255,215,0,0.3)} 50%{box-shadow:0 0 30px rgba(255,215,0,0.6), 0 0 60px rgba(214,48,49,0.3)} }
.combo-count { font-size: 1.8rem; font-weight: 900; color: var(--gold); }
.combo-label { font-size: 0.7rem; color: var(--muted); }
.combo-mult { font-size: 0.85rem; font-weight: 800; color: var(--success); }

/* Boss Gallery */
.boss-gallery-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px;
}
.boss-gallery-card {
    background: var(--card); border-radius: var(--radius-sm); padding: 14px;
    text-align: center; border: 2px solid rgba(255,255,255,0.06);
    transition: var(--transition); position: relative; overflow: hidden;
}
.boss-gallery-card.defeated { border-color: var(--success); }
.boss-gallery-card.legendary-boss { border-color: var(--gold); box-shadow: 0 0 15px rgba(255,215,0,0.1); }
.boss-gallery-card.locked-boss { filter: grayscale(1) brightness(0.4); opacity: 0.5; }
.boss-gallery-art {
    height: 88px;
    margin: -14px -14px 10px;
    background-size: cover, cover;
    background-position: center, center;
    background-blend-mode: screen;
    opacity: 0.55;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.boss-gallery-card .bg-emoji { font-size: 2.2rem; margin-bottom: 6px; }
.boss-gallery-card .bg-name { font-weight: 700; font-size: 0.85rem; margin-bottom: 4px; }
.boss-gallery-card .bg-defeats { font-size: 0.7rem; color: var(--success); }
.boss-gallery-card .bg-weakness { font-size: 0.65rem; color: var(--muted); margin-top: 2px; }
.boss-gallery-card .bg-loot { font-size: 0.65rem; margin-top: 2px; }

/* Victory overlay */
.victory-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(10,10,35,0.92); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; animation: fadeIn 0.5s ease; }
.victory-card { background: var(--card); border-radius: 24px; padding: 40px; text-align: center; border: 2px solid var(--gold); max-width: 440px; width: 90%; box-shadow: 0 0 60px rgba(255,215,0,0.15); animation: victoryBounce 0.8s cubic-bezier(0.17,0.67,0.29,1.35); }
@keyframes victoryBounce { 0%{transform:scale(0.4) rotate(-5deg);opacity:0} 60%{transform:scale(1.05) rotate(1deg)} 100%{transform:scale(1) rotate(0)} }
.victory-card.legendary-victory { border-color: var(--gold); box-shadow: 0 0 80px rgba(255,215,0,0.3); }
.victory-card .loot-item { display: inline-block; padding: 8px 16px; border-radius: 10px; margin: 4px; font-weight: 600; }
.loot-inline-art {
    display: inline-block;
    width: 28px;
    height: 28px;
    margin-left: 8px;
    vertical-align: middle;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.16);
}
.victory-power-stats {
    display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin: 12px 0;
    padding: 12px; background: rgba(0,0,0,0.15); border-radius: var(--radius-sm);
}
.victory-power-stat { text-align: center; }
.victory-power-stat .vps-label { font-size: 0.7rem; color: var(--muted); }
.victory-power-stat .vps-value { font-weight: 900; font-size: 1rem; }
.victory-power-stat .vps-change { font-size: 0.75rem; color: var(--success); }
.loot-reveal { animation: lootReveal 1s ease; display: inline-block; }
@keyframes lootReveal { 0%{transform:scale(0) rotate(-180deg);opacity:0} 50%{transform:scale(1.3) rotate(10deg);opacity:1} 100%{transform:scale(1) rotate(0)} }

.hidden { display: none !important; }
@media (max-width: 768px) {
    .world-portals { grid-template-columns: 1fr; }
    .avatar-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .schedule-grid { grid-template-columns: 1fr 1fr; }
    .behavior-bar { flex-direction: column; }
    .teacher-stats { grid-template-columns: 1fr 1fr; }
    .badges-grid { gap: 8px; }
    .badge-item { min-width: 140px; padding: 10px 12px; }
    .needs-grid { grid-template-columns: 1fr 1fr; }
    .room-grid { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); }
    .avatar-world-tabs { gap: 4px; }
    .aw-tab { padding: 8px 12px; font-size: 0.8rem; }
    .banks-container { flex-direction: column; gap: 8px; }
    .dash-top { justify-content: center; }
    .rgb-chip-row, .learning-style-grid, .rgb-world-nav, .rgb-quest-grid, .rgb-stat-grid, .rgb-summary-grid { grid-template-columns: 1fr; }
    .rgb-rpg-header { flex-direction: column; }
    .boss-entry-card { padding: 30px 20px; }
    .boss-entry-portrait { width: 112px; height: 112px; border-radius: 24px; }
    .boss-entry-emoji { font-size: 3.5rem; }
    .boss-entry-name { font-size: 1.4rem; }
    .boss-entry-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .boss-gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .victory-power-stats { grid-template-columns: repeat(2, 1fr); }
    .combo-counter { top: 60px; right: 10px; padding: 8px 12px; }
    .combo-count { font-size: 1.4rem; }
    .wheel-container { width: 280px; height: 280px; }
    .wheel-slot { width: 46px; height: 46px; }
    .wheel-slot .ws-avatar { font-size: 1rem; }
    .wheel-center { width: 70px; height: 70px; }
    .my-wheels-grid { grid-template-columns: 1fr; }
    .available-wheels-grid { grid-template-columns: 1fr 1fr; }
    .wheel-teacher-grid { grid-template-columns: 1fr; }
}
/* === EMOTIONAL STATE MIRROR === */
.emo-widget {
    position: fixed; bottom: 20px; left: 20px; z-index: 500;
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #00b894, #0984e3);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,184,148,0.4);
    transition: var(--transition); animation: breathe 6s ease infinite;
}
.emo-widget:hover { transform: scale(1.1); }
.emo-widget .emo-badge {
    position: absolute; top: -4px; right: -4px; width: 18px; height: 18px;
    border-radius: 50%; background: var(--accent); color: white;
    font-size: 0.6rem; font-weight: 900; display: flex; align-items: center; justify-content: center;
}

/* Mini meters on the widget */
.emo-widget-meters {
    position: fixed; bottom: 82px; left: 20px; z-index: 500;
    background: var(--card); border: 1px solid rgba(0,184,148,0.2);
    border-radius: var(--radius-sm); padding: 10px 14px; width: 200px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4); display: none;
}
.emo-widget-meters.show { display: block; animation: fadeSlide 0.3s ease; }
.emo-mini-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 0.8rem; }
.emo-mini-row:last-child { margin-bottom: 0; }
.emo-mini-label { width: 24px; text-align: center; }
.emo-mini-track { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 10px; overflow: hidden; }
.emo-mini-fill { height: 100%; border-radius: 10px; transition: width 0.8s ease; }
.emo-mini-fill.focus { background: linear-gradient(90deg, #fdcb6e, #e17055); }
.emo-mini-fill.calm { background: linear-gradient(90deg, #ff6b6b, #00b894); }
.emo-mini-fill.energy { background: linear-gradient(90deg, #74b9ff, #ffd700); }
.emo-mini-fill.mood { background: linear-gradient(90deg, #fd79a8, #6c5ce7); }
.emo-mini-val { width: 28px; text-align: left; font-weight: 700; font-size: 0.7rem; color: var(--muted); }

/* Full check-in overlay */
.emo-checkin-overlay {
    position: fixed; inset: 0; background: rgba(10,10,35,0.92); backdrop-filter: blur(10px);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.5s ease; padding: 20px;
}
.emo-checkin-card {
    background: var(--card); border-radius: var(--radius); padding: 28px;
    max-width: 480px; width: 100%; border: 2px solid rgba(0,184,148,0.3);
    box-shadow: 0 0 40px rgba(0,184,148,0.15); animation: wizardIn 0.5s ease;
}
.emo-checkin-card h2 { text-align: center; margin-bottom: 6px; color: var(--primary-light); font-size: 1.2rem; }
.emo-checkin-card .emo-subtitle { text-align: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 20px; }
.emo-step { display: none; animation: fadeSlide 0.4s ease; }
.emo-step.active { display: block; }
.emo-step-q {
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(108,92,231,0.12), rgba(0,184,148,0.08));
    border-radius: var(--radius-sm); padding: 14px 18px;
    border: 1px solid rgba(108,92,231,0.12);
}
.emo-step-q .eq-avatar { font-size: 1.6rem; animation: breathe 6s ease infinite; }
.emo-step-q .eq-text { font-size: 0.95rem; line-height: 1.5; }
.emo-slider-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.emo-slider-row .esr-emoji { font-size: 1.6rem; width: 36px; text-align: center; }
.emo-slider-row input[type="range"] {
    flex: 1; -webkit-appearance: none; appearance: none; height: 10px;
    border-radius: 10px; background: rgba(255,255,255,0.06); outline: none;
    direction: ltr;
}
.emo-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 24px; height: 24px;
    border-radius: 50%; cursor: pointer; border: 3px solid white;
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
}
.emo-slider-row input[type="range"].focus-slider::-webkit-slider-thumb { background: #e17055; }
.emo-slider-row input[type="range"].calm-slider::-webkit-slider-thumb { background: #00b894; }
.emo-slider-row input[type="range"].energy-slider::-webkit-slider-thumb { background: #ffd700; }
.emo-slider-row input[type="range"].mood-slider::-webkit-slider-thumb { background: #6c5ce7; }
.emo-slider-val { font-weight: 900; font-size: 1.1rem; min-width: 36px; text-align: center; }
.emo-advice {
    background: linear-gradient(135deg, rgba(0,184,148,0.1), rgba(108,92,231,0.08));
    border: 1px solid rgba(0,184,148,0.2); border-radius: var(--radius-sm);
    padding: 16px 20px; margin-top: 16px; text-align: center; font-size: 0.95rem; line-height: 1.6;
    animation: fadeSlide 0.5s ease;
}

/* Trend sparkline */
.emo-trend { margin-top: 16px; }
.emo-trend-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; color: var(--primary-light); }
.emo-sparkline { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.emo-spark-bar { width: 8px; border-radius: 4px 4px 0 0; transition: height 0.5s ease; min-height: 2px; }

/* Regulation tools */
.emo-reg-tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.emo-reg-btn {
    background: var(--card); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm);
    padding: 14px; text-align: center; cursor: pointer; transition: var(--transition); font-family: inherit; color: var(--text);
}
.emo-reg-btn:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.emo-reg-btn .erb-icon { font-size: 1.5rem; margin-bottom: 6px; }
.emo-reg-btn .erb-label { font-size: 0.8rem; font-weight: 700; }

/* Breathing exercise */
.emo-breathing-overlay {
    position: fixed; inset: 0; background: rgba(10,10,35,0.95); z-index: 2100;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    animation: fadeIn 0.5s ease;
}
.emo-breath-circle {
    width: 150px; height: 150px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0,184,148,0.3), rgba(108,92,231,0.2));
    border: 3px solid rgba(0,184,148,0.5);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 700; color: var(--text);
    transition: transform 4s ease-in-out, border-color 4s ease-in-out;
}
.emo-breath-circle.inhale { transform: scale(1.6); border-color: rgba(0,184,148,0.8); }
.emo-breath-circle.exhale { transform: scale(1); border-color: rgba(108,92,231,0.5); }
.emo-breath-label { margin-top: 20px; font-size: 1.1rem; font-weight: 700; color: var(--primary-light); }
.emo-breath-counter { margin-top: 8px; font-size: 0.85rem; color: var(--muted); }

/* Journal */
.emo-journal-overlay {
    position: fixed; inset: 0; background: rgba(10,10,35,0.92); backdrop-filter: blur(10px);
    z-index: 2100; display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.5s ease; padding: 20px;
}
.emo-journal-card {
    background: var(--card); border-radius: var(--radius); padding: 24px;
    max-width: 420px; width: 100%; border: 2px solid rgba(253,121,168,0.3);
}

/* Teacher emotional view */
.emo-teacher-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.emo-teacher-card {
    background: var(--card); border-radius: var(--radius-sm); padding: 14px;
    border-right: 4px solid var(--muted); transition: var(--transition);
}
.emo-teacher-card.state-green { border-color: var(--success); }
.emo-teacher-card.state-yellow { border-color: var(--warning); }
.emo-teacher-card.state-red { border-color: var(--danger); }
.emo-teacher-state { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.emo-teacher-dot { width: 12px; height: 12px; border-radius: 50%; }
.emo-teacher-dot.green { background: var(--success); box-shadow: 0 0 8px rgba(0,184,148,0.4); }
.emo-teacher-dot.yellow { background: var(--warning); box-shadow: 0 0 8px rgba(253,203,110,0.4); }
.emo-teacher-dot.red { background: var(--danger); box-shadow: 0 0 8px rgba(214,48,49,0.4); }
.emo-teacher-encourage-btn {
    margin-top: 8px; padding: 6px 14px; border-radius: 20px; border: 1px solid rgba(253,121,168,0.3);
    background: rgba(253,121,168,0.1); color: var(--accent); font-family: inherit;
    font-weight: 700; font-size: 0.8rem; cursor: pointer; transition: var(--transition);
}
.emo-teacher-encourage-btn:hover { background: rgba(253,121,168,0.2); }

/* Movement break timer */
.emo-movement-overlay {
    position: fixed; inset: 0; background: rgba(10,10,35,0.95); z-index: 2100;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    animation: fadeIn 0.5s ease;
}
.emo-movement-timer {
    font-size: 4rem; font-weight: 900; color: var(--success);
    text-shadow: 0 0 20px rgba(0,184,148,0.4);
    margin-bottom: 12px;
}

/* ============================================================
   YAZOO ART INTEGRATION — Visual asset overlays
   ============================================================ */

/* --- Onboarding: floating character accent --- */
.onboard-character {
    position: absolute;
    right: clamp(8px, 2vw, 20px);
    bottom: 0;
    top: auto;
    transform: none;
    width: clamp(210px, 24vw, 360px);
    max-height: min(62vh, 540px);
    object-fit: contain;
    object-position: bottom center;
    opacity: 0.96;
    pointer-events: none;
    z-index: 0;
    filter: drop-shadow(0 18px 40px rgba(16,20,56,0.55));
    animation: floatChar 4s ease-in-out infinite;
}
@keyframes floatChar {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-10px) translateX(-6px); }
}
.wizard-step[data-step="1"] {
    position: relative;
    overflow: hidden;
    min-height: 620px;
    justify-content: flex-start;
    padding-right: clamp(16px, 3vw, 28px);
}
.wizard-step[data-step="1"] > :not(.onboard-character) {
    position: relative;
    z-index: 1;
    max-width: min(560px, max(280px, calc(100% - 360px)));
}

/* --- World portal art backgrounds via ::before --- */
.world-portal { position: relative; overflow: hidden; }
.world-portal::before {
    content: '';
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    opacity: 0.12;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.4s ease;
}
.world-portal:hover::before { opacity: 0.2; }
.world-portal > * { position: relative; z-index: 1; }
.world-portal.red::before {
    background-image: url('../assets/yazoo/worlds/red-activation-chart.png');
}
.world-portal.green::before {
    background-image: url('../assets/yazoo/elements/knowledge-sparks-full.png');
}
.world-portal.blue::before {
    background-image: url('../assets/yazoo/worlds/blue-self-concept.png');
}

/* --- EmoState widget: cyber-heart accent when expanded --- */
.emo-widget-meters { position: relative; }
.emo-widget-meters.show::before {
    content: '';
    position: absolute; inset: 0;
    background-image: url('../assets/yazoo/elements/cyber-heart.png');
    background-size: cover; background-position: center;
    opacity: 0.1;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}
.emo-widget-meters > * { position: relative; z-index: 1; }

/* --- Header / RGB RPG strip: mandala watermark --- */
.rgb-rpg-strip { position: relative; overflow: hidden; }
.rgb-rpg-strip::before {
    content: '';
    position: absolute; inset: 0;
    background-image: url('../assets/yazoo/elements/mandala-neural.png');
    background-size: 400px; background-position: top right;
    background-repeat: no-repeat;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}
.rgb-rpg-strip > * { position: relative; z-index: 1; }

/* --- Investigation Wheels (#v-wheels): torus wireframe bg --- */
#v-wheels { position: relative; }
#v-wheels::before {
    content: '';
    position: absolute; inset: 0;
    background-image: url('../assets/yazoo/elements/torus-wireframe.png');
    background-size: 500px; background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
}
#v-wheels > * { position: relative; z-index: 1; }

/* --- Avatar World (#v-avatar): knowledge sparks bg --- */
#v-avatar { position: relative; }
#v-avatar::before {
    content: '';
    position: absolute; inset: 0;
    background-image: url('../assets/yazoo/elements/knowledge-sparks-full.png');
    background-size: cover; background-position: center;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}
#v-avatar > * { position: relative; z-index: 1; }

/* --- Utility: dark + sparks atmospheric bg --- */
.yazoo-art-bg { position: relative; overflow: hidden; }
.yazoo-art-bg::before {
    content: '';
    position: absolute; inset: 0;
    background:
        linear-gradient(rgba(10,10,35,0.85), rgba(10,10,35,0.9)),
        url('../assets/yazoo/elements/knowledge-sparks-full.png') center/cover no-repeat;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}
.yazoo-art-bg > * { position: relative; z-index: 1; }

/* --- Mobile: hide heavy art backgrounds on small screens --- */
@media (max-width: 600px) {
    .onboard-character { display: none; }
    .wizard-step[data-step="1"] {
        min-height: auto;
        padding-right: 20px;
    }
    .wizard-step[data-step="1"] > :not(.onboard-character) {
        max-width: 100%;
    }
    .world-portal::before { opacity: 0.06; }
    #v-wheels::before,
    #v-avatar::before,
    .rgb-rpg-strip::before { display: none; }
    .emo-widget-meters.show::before { display: none; }
}

/* --- Art integration: avatar collection thumbnails --- */
.aw-art-thumb,
.aw-art-medallion,
.aw-trophy-art {
    display: inline-block;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 10px 24px rgba(0,0,0,0.24);
}
.aw-art-thumb {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    flex-shrink: 0;
}
.aw-art-medallion {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    opacity: 0.9;
}
.aw-art-medallion--soft { opacity: 0.72; }
.aw-trophy-art {
    width: 100%;
    height: 42px;
    border-radius: 10px;
    margin-bottom: 8px;
    opacity: 0.72;
}

/* ============================================================
   PHASE 3: EMOTIONAL VISUAL SURFACES
   CSS vars set by transitions.js updateVisualIntensity():
   --emo-intensity, --emo-glow, --emo-speed, --emo-blur,
   --emo-bg-opacity, --emo-trail
   ============================================================ */

/* --- World Portals react to emotional state --- */
.world-portal {
    transition: filter 1s ease, box-shadow 1s ease;
    filter: saturate(var(--emo-intensity, 0.7));
}
.world-portal:hover {
    filter: saturate(calc(var(--emo-intensity, 0.7) + 0.2)) brightness(1.08);
}
.world-portal::before {
    transition: opacity 1s ease;
}

/* --- RGB RPG strip adapts glow --- */
.rgb-rpg-strip {
    transition: box-shadow 1.2s ease;
    box-shadow: 0 0 calc(20px * var(--emo-intensity, 0.7)) var(--emo-glow, rgba(108,92,231,0.15));
}

/* --- Boss battle overlay cards --- */
.boss-entry-overlay, .boss-combat-hud {
    transition: filter 0.8s ease, background 0.8s ease;
}

/* --- Quest map nodes glow with emotional energy --- */
.quest-node-active {
    box-shadow: 0 0 calc(15px * var(--emo-intensity, 0.7)) var(--emo-glow, rgba(108,92,231,0.4));
    transition: box-shadow 1s ease;
}

/* --- Collection/Trophy wall adapts saturation --- */
#aw-tab-collection, .trophy-wall {
    transition: filter 1s ease;
    filter: saturate(var(--emo-intensity, 0.7));
}

/* --- Emo widget reflects own state --- */
.emo-widget {
    transition: box-shadow 1s ease, transform 0.5s ease;
    box-shadow: 0 4px calc(20px * var(--emo-intensity, 0.7)) var(--emo-glow, rgba(0,184,148,0.4));
}

/* --- Badge cards glow with emotional energy --- */
.badge-card {
    transition: box-shadow 0.8s ease;
}
.badge-card.earned {
    box-shadow: 0 0 calc(12px * var(--emo-intensity, 0.7)) rgba(255,215,0, calc(0.3 + var(--emo-trail, 0.5) * 0.3));
}

/* --- Needs bars animate with trail strength --- */
.need-fill {
    transition: width calc(0.8s / var(--emo-speed, 1)) ease;
}

/* --- Global state effects via body class (set by JS) --- */
body.emo-overwhelmed .particle { animation-duration: 25s !important; opacity: 0.05 !important; }
body.emo-overwhelmed .star { animation-duration: 8s !important; }
body.emo-flow .particle { animation-duration: 8s !important; opacity: 0.18 !important; }
body.emo-flow .star { animation-duration: 1.5s !important; }
body.emo-high .particle { animation-duration: 6s !important; opacity: 0.22 !important; }
body.emo-high .star { animation-duration: 1s !important; }

/* --- Mobile: lighter emotional effects --- */
@media (max-width: 600px) {
    .world-portal { filter: none; }
    .rgb-rpg-strip { box-shadow: none; }
    body.emo-overwhelmed .particle,
    body.emo-flow .particle,
    body.emo-high .particle { animation-duration: 15s !important; }
}

/* ============================================================
   PHASE 5.5: NEURO-SAFE CORE
   Reduce Motion / Focus Mode / Safe Space / Predictability
   Activated via body classes set by JS
   ============================================================ */

/* --- Reduce Motion: honor OS preference + manual toggle --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .particle, .star, .confetti { display: none !important; }
    .onboard-character { animation: none !important; }
    .world-portal::before { transition: none !important; }
}

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.2s !important;
}
body.reduce-motion .particle, body.reduce-motion .star, body.reduce-motion .confetti { display: none !important; }
body.reduce-motion .onboard-character { animation: none !important; }

/* --- Focus Mode: strip visual noise, center content --- */
body.focus-mode header { opacity: 0.5; pointer-events: none; }
body.focus-mode .badges-section,
body.focus-mode .rgb-rpg-strip,
body.focus-mode .world-portals,
body.focus-mode #combo-counter,
body.focus-mode .yazoo-helper,
body.focus-mode .emo-widget-meters { display: none !important; }
body.focus-mode .view { padding: 32px 24px; }
body.focus-mode .btn { border-radius: 24px; font-size: 1.1rem; padding: 14px 28px; }

/* --- Safe Space: calming override — warm, low contrast, gentle --- */
html body.safe-space {
    --primary: #4aa89a !important; --primary-light: #7ec8bd !important; --primary-dark: #2d7a6e !important;
    --accent: #c4a0d0 !important; --accent-light: #d4b8de !important;
    --bg: #0d1117 !important; --bg2: #161b22 !important; --card: #1c222d !important; --card2: #242d3a !important;
}
body.safe-space .particle, body.safe-space .star { opacity: 0.03 !important; }
body.safe-space .confetti { display: none !important; }
body.safe-space .emo-widget { box-shadow: 0 4px 15px rgba(74,168,154,0.3); }

/* Soft Breathing Light — gentle ambient pulse in Safe Space (Ori's spec) */
body.safe-space::after {
    content: '';
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 120px;
    background: radial-gradient(ellipse at center bottom, rgba(74,168,154,0.08) 0%, transparent 70%);
    animation: safeBreathLight 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes safeBreathLight {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
    50% { opacity: 0.7; transform: scaleY(1.1); }
}
/* Breathing light respects reduce-motion */
body.safe-space.reduce-motion::after { animation: none !important; opacity: 0.4; }

/* --- Predictability: stable layout, no surprises --- */
body.predictable .view { animation: none !important; transform: none !important; }
body.predictable .toast { animation: none !important; }
body.predictable .wizard-step { animation: none !important; }
body.predictable .yazoo-bubble { animation: none !important; }
body.predictable .floating-points, body.predictable .floating-item,
body.predictable .ding-anim, body.predictable .sparkle-anim { display: none !important; }

/* ============================================================
   PHASE 7: AGE PROFILE FOUNDATION
   body.age-young (9-11) / body.age-mid (12-13) / body.age-teen (14-15)
   CSS vars: --age-font-size, --age-line-height, --age-intensity
   ============================================================ */

/* --- Young (9-11): spacious, playful, large targets --- */
body.age-young { font-size: var(--age-font-size, 1.1rem); line-height: var(--age-line-height, 1.8); }
body.age-young .btn { padding: 14px 28px; font-size: 1.1rem; border-radius: 24px; }
body.age-young .wizard-step, body.age-young .view { padding: 28px; }
body.age-young .yazoo-text { font-size: 1.15rem; line-height: 1.8; }
body.age-young .particle { animation-duration: 18s !important; }
body.age-young .slot, body.age-young .subject-row { padding: 18px 22px; }

/* --- Mid (12-13): balanced — default, minimal overrides --- */
body.age-mid { font-size: var(--age-font-size, 1rem); }

/* --- Teen (14-15): compact, direct, less hand-holding --- */
body.age-teen { font-size: var(--age-font-size, 0.95rem); line-height: var(--age-line-height, 1.5); }
body.age-teen .btn { padding: 8px 18px; font-size: 0.9rem; }
body.age-teen .yazoo-text { font-size: 0.95rem; line-height: 1.5; }
body.age-teen .yazoo-avatar { width: 56px; height: 56px; font-size: 1.6rem; }
body.age-teen .mood-check h3 { font-size: 0.95rem; }

/* --- Mobile age adjustments --- */
@media (max-width: 600px) {
    body.age-young .btn { padding: 12px 20px; font-size: 1rem; }
    body.age-teen .btn { padding: 8px 14px; }
}

/* ============================================================
   PHASE 9: AUTISM SUPPORT FOUNDATION
   Predictability messages, Calm mode, Safe recovery continuity
   ============================================================ */

/* --- Predictability Announcement Bar --- */
.yazoo-predictability-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: 10px 20px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-light, #a29bfe);
    background: linear-gradient(180deg, rgba(16, 20, 30, 0.95) 0%, rgba(16, 20, 30, 0.85) 100%);
    border-bottom: 2px solid rgba(108, 92, 231, 0.2);
    direction: rtl;
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}
.yazoo-predictability-bar.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Calm Mode: SENSORY reduction (different from safe-space EMOTIONAL) --- */
body.calm-mode {
    filter: saturate(0.7) !important;
}
body.calm-mode * {
    transition-duration: 1.4s !important;
}
body.calm-mode .particle,
body.calm-mode .star {
    opacity: 0.02 !important;
}
body.calm-mode .confetti,
body.calm-mode .floating-points,
body.calm-mode .floating-item,
body.calm-mode .sparkle-anim,
body.calm-mode .ding-anim {
    display: none !important;
}
body.calm-mode .world-portal::before,
body.calm-mode .world-portal::after,
body.calm-mode .btn::after {
    opacity: 0.15 !important;
}
/* Background art nearly invisible */
body.calm-mode .onboard-character,
body.calm-mode .world-bg-art,
body.calm-mode .bg-decor {
    opacity: 0.03 !important;
}
/* Glow effects minimized */
body.calm-mode .emo-widget {
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.1) !important;
}
body.calm-mode .btn {
    box-shadow: none !important;
}
body.calm-mode #yazoo-transition-overlay video {
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.15) !important;
}
/* Yazoo speech bubble: simplified */
body.calm-mode .yazoo-text,
body.calm-mode .av-speech-text {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
}
/* Calm mode respects reduce-motion too */
body.calm-mode.reduce-motion * {
    transition-duration: 0.2s !important;
}

/* --- Safe Recovery Bar --- */
.yazoo-recovery-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9500;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    background: linear-gradient(0deg, rgba(16, 20, 30, 0.97) 0%, rgba(16, 20, 30, 0.9) 100%);
    border-top: 2px solid rgba(0, 184, 148, 0.25);
    direction: rtl;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.yazoo-recovery-bar.visible {
    opacity: 1;
    transform: translateY(0);
}
.yazoo-recovery-bar .recovery-message {
    color: var(--primary-light, #7ec8bd);
    font-weight: 700;
    font-size: 1rem;
}
.yazoo-recovery-bar .recovery-stage {
    color: var(--muted, #6b7280);
    font-size: 0.85rem;
    font-weight: 600;
}
.yazoo-recovery-bar .recovery-skip-btn {
    background: rgba(108, 92, 231, 0.15);
    border: 1px solid rgba(108, 92, 231, 0.3);
    color: var(--primary-light, #a29bfe);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease;
}
.yazoo-recovery-bar .recovery-skip-btn:hover {
    background: rgba(108, 92, 231, 0.3);
}

/* --- Mobile adjustments for Phase 9 --- */
@media (max-width: 600px) {
    .yazoo-predictability-bar {
        font-size: 0.9rem;
        padding: 8px 14px;
    }
    .yazoo-recovery-bar {
        padding: 10px 14px;
        gap: 10px;
    }
    .yazoo-recovery-bar .recovery-message { font-size: 0.9rem; }
    .yazoo-recovery-bar .recovery-skip-btn { padding: 5px 12px; font-size: 0.8rem; }
}

/* === PHASE 10: Neuro-Accessibility Control Hub === */
.yazoo-control-hub {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99998;
    width: 92vw;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(18, 18, 42, 0.97);
    border: 1px solid rgba(108, 92, 231, 0.4);
    border-radius: 20px;
    padding: 24px;
    direction: rtl;
    font-family: inherit;
    color: #e0e0e0;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 60px rgba(108, 92, 231, 0.15);
    animation: fadeSlide 0.3s ease;
}

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

.ch-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #fff;
}

.ch-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
    transition: color 0.2s;
}
.ch-close:hover { color: #fff; }

.ch-section {
    margin-bottom: 18px;
}

.ch-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.ch-section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Toggle row */
.ch-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}
.ch-toggle-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ch-toggle-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ddd;
    user-select: none;
}

/* Toggle switch */
.ch-toggle {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ch-toggle-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    transition: background 0.3s;
    flex-shrink: 0;
}
.ch-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    background: #888;
    border-radius: 50%;
    transition: transform 0.3s, background 0.3s;
}

.ch-toggle:checked + .ch-toggle-slider {
    background: rgba(108, 92, 231, 0.5);
}
.ch-toggle:checked + .ch-toggle-slider::after {
    transform: translateX(-20px);
    background: #a29bfe;
}

/* Age profile buttons */
.ch-age-group {
    display: flex;
    gap: 8px;
}

.ch-age-btn {
    flex: 1;
    padding: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #bbb;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.ch-age-btn:hover {
    background: rgba(108, 92, 231, 0.15);
    border-color: rgba(108, 92, 231, 0.3);
}
.ch-age-btn.ch-age-active {
    background: rgba(108, 92, 231, 0.3);
    border-color: var(--primary, #6c5ce7);
    color: #fff;
}

/* Emotional state display */
.ch-emo-display {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-light, #a29bfe);
    padding: 8px 0;
    margin-bottom: 8px;
}

.ch-emo-group {
    display: flex;
    gap: 6px;
}

.ch-emo-btn {
    flex: 1;
    padding: 7px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #999;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.ch-emo-btn:hover {
    background: rgba(108, 92, 231, 0.12);
}
.ch-emo-btn.ch-emo-active {
    background: rgba(108, 92, 231, 0.25);
    border-color: var(--primary, #6c5ce7);
    color: #ddd;
}

/* Status line */
.ch-status {
    padding: 10px 12px;
    background: rgba(0, 184, 148, 0.08);
    border: 1px solid rgba(0, 184, 148, 0.15);
    border-radius: 12px;
    font-size: 0.82rem;
    color: rgba(0, 184, 148, 0.9);
    text-align: center;
    margin-bottom: 14px;
}

/* Close button (bottom) */
.ch-close-btn-bottom {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: #bbb;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.ch-close-btn-bottom:hover {
    background: rgba(108, 92, 231, 0.15);
    color: #fff;
}

.ch-agent-refresh {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.82);
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.ch-agent-refresh:hover {
    background: rgba(108, 92, 231, 0.16);
    border-color: rgba(108, 92, 231, 0.24);
}

.ch-agent-refresh:disabled {
    opacity: 0.6;
    cursor: wait;
}

.ch-agent-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.ch-agent-card {
    border-radius: 14px;
    padding: 12px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ch-agent-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    font-weight: 700;
}

.ch-agent-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 32px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 900;
    padding: 6px 10px;
}

.ch-agent-pill.ok {
    background: rgba(0, 184, 148, 0.14);
    color: #b8ffe8;
}

.ch-agent-pill.warn {
    background: rgba(214, 48, 49, 0.14);
    color: #ffd1d1;
}

.ch-agent-pill.neutral {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
}

.ch-agent-next {
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(108, 92, 231, 0.09);
    border: 1px solid rgba(108, 92, 231, 0.16);
}

.ch-agent-next-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.52);
    margin-bottom: 6px;
    font-weight: 800;
}

.ch-agent-next-copy {
    font-size: 0.84rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
}
.ch-agent-submission {
    margin-bottom: 12px;
    padding: 14px 14px 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.ch-submission-title {
    font-size: 0.78rem;
    font-weight: 900;
    color: var(--primary-light);
    margin-bottom: 6px;
}
.ch-submission-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.ch-submission-header-copy {
    min-width: 0;
    flex: 1;
}
.ch-submission-headline {
    font-size: 0.92rem;
    font-weight: 800;
    color: rgba(255,255,255,0.94);
    margin-bottom: 10px;
    line-height: 1.35;
}
.ch-submission-copy-btn {
    flex-shrink: 0;
    padding: 9px 13px;
    border-radius: 999px;
    border: 1px solid rgba(108,92,231,0.32);
    background: linear-gradient(135deg, rgba(108,92,231,0.22), rgba(108,92,231,0.12));
    color: var(--primary-light);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}
.ch-submission-copy-btn:hover {
    background: linear-gradient(135deg, rgba(108,92,231,0.34), rgba(108,92,231,0.18));
    border-color: rgba(108,92,231,0.5);
    color: #fff;
    transform: translateY(-1px);
}
.ch-submission-copy-btn:active {
    transform: translateY(0);
}
.ch-submission-feedback {
    min-height: 18px;
    margin-bottom: 10px;
    font-size: 0.72rem;
    font-weight: 800;
    color: rgba(255,255,255,0.46);
    transition: var(--transition);
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    gap: 8px;
}
.ch-submission-feedback.ok {
    color: #8ff3d3;
    background: rgba(0, 184, 148, 0.1);
    border-color: rgba(0, 184, 148, 0.2);
}
.ch-submission-feedback.warn {
    color: #ffb3b3;
    background: rgba(214, 48, 49, 0.1);
    border-color: rgba(214, 48, 49, 0.18);
}
.ch-submission-fields {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}
.ch-submission-line {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.76rem;
    align-items: start;
}
.ch-submission-key {
    color: rgba(255,255,255,0.56);
    font-weight: 700;
    padding-top: 1px;
    white-space: nowrap;
}
.ch-submission-value {
    color: rgba(255,255,255,0.9);
    overflow-wrap: anywhere;
    line-height: 1.45;
}
.ch-submission-notes {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
}
.ch-submission-notes-label {
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.48);
    margin-bottom: 6px;
}
.ch-submission-note {
    font-size: 0.74rem;
    line-height: 1.45;
    color: rgba(255,255,255,0.82);
}
.ch-submission-hint {
    font-size: 0.7rem;
    line-height: 1.45;
    color: rgba(255,255,255,0.48);
    margin-top: 2px;
}
.ch-submission-empty {
    padding: 6px 0;
    color: rgba(255,255,255,0.48);
    font-size: 0.75rem;
}
.ch-agent-actions {
    display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.ch-agent-run-btn {
    padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(108,92,231,0.25);
    background: rgba(108,92,231,0.1); color: var(--primary-light);
    font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer;
    transition: var(--transition);
}
.ch-agent-run-btn:hover { background: rgba(108,92,231,0.2); border-color: var(--primary); }
.ch-agent-run-btn:disabled { opacity: 0.5; cursor: wait; }
.ch-top-targets-title {
    font-size: 0.8rem; font-weight: 900; color: var(--primary-light);
    margin-bottom: 8px;
}
/* Submit Console */
.ch-submit-console { margin-bottom: 14px; }
.ch-submit-console-title {
    font-size: 0.85rem; font-weight: 900; color: #00b894;
    margin-bottom: 8px;
}
.ch-submit-console-list { display: flex; flex-direction: column; gap: 4px; }
.ch-submit-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-radius: 10px;
    background: rgba(0,184,148,0.08); border: 1px solid rgba(0,184,148,0.15);
    transition: background 0.2s;
}
.ch-submit-card:hover { background: rgba(0,184,148,0.15); }
.ch-submit-done { background: rgba(108,92,231,0.08); border-color: rgba(108,92,231,0.15); }
.ch-submit-done:hover { background: rgba(108,92,231,0.15); }
.ch-submit-card-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ch-submit-card { gap: 10px; }
.ch-submit-card-copy { flex: 1; min-width: 0; }
.ch-submit-card-icon { font-size: 1.1rem; }
.ch-submit-card-name { font-size: 0.8rem; font-weight: 700; color: #dfe6e9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-submit-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ch-submit-card-template,
.ch-submit-card-packet {
    font-size: 0.64rem;
    color: rgba(255,255,255,0.56);
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 999px;
}
.ch-submit-card-status {
    font-size: 0.65rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 2px 6px; border-radius: 4px;
}
.ch-submit-ready .ch-submit-card-status { background: rgba(0,184,148,0.2); color: #00b894; }
.ch-submit-done .ch-submit-card-status { background: rgba(108,92,231,0.2); color: #a29bfe; }
.ch-submit-empty {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.56);
    font-size: 0.74rem;
}
.ch-submit-card-btn {
    font-size: 0.75rem; font-weight: 700; color: #00b894;
    text-decoration: none; padding: 4px 10px; border-radius: 6px;
    background: rgba(0,184,148,0.12); border: 1px solid rgba(0,184,148,0.2);
    white-space: nowrap; transition: all 0.2s;
}
.ch-submit-card-btn:hover { background: rgba(0,184,148,0.25); color: #fff; }
.ch-submit-done .ch-submit-card-btn { color: #a29bfe; background: rgba(108,92,231,0.12); border-color: rgba(108,92,231,0.2); }
.ch-submit-done .ch-submit-card-btn:hover { background: rgba(108,92,231,0.25); color: #fff; }

.ch-agent-voices {
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
}

.ch-voice-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.ch-voice-title {
    font-size: 0.82rem;
    font-weight: 900;
    color: #ffeaa7;
}

.ch-voice-meta {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.55);
}

.ch-voice-validator {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.69rem;
}

.ch-voice-validator.is-ok {
    background: rgba(0, 184, 148, 0.08);
    border-color: rgba(0, 184, 148, 0.2);
}

.ch-voice-validator.is-warn {
    background: rgba(253, 203, 110, 0.08);
    border-color: rgba(253, 203, 110, 0.2);
}

.ch-voice-validator-label {
    color: #f5f6fa;
    font-weight: 800;
}

.ch-voice-validator-meta {
    color: rgba(255,255,255,0.6);
}

.ch-voice-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ch-voice-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    font-size: 0.72rem;
    line-height: 1;
}

.ch-voice-chip.is-ready {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.ch-voice-chip.is-pending {
    opacity: 0.8;
    border-style: dashed;
}

.ch-voice-chip.is-partial {
    border-color: rgba(253, 203, 110, 0.24);
    background: rgba(253, 203, 110, 0.08);
}

.ch-voice-swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
    flex: 0 0 auto;
}

.ch-voice-emoji {
    font-size: 0.85rem;
}

.ch-voice-name {
    color: #f5f6fa;
    font-weight: 800;
}

.ch-voice-state {
    color: rgba(255,255,255,0.55);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ch-voice-empty {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.62);
    font-size: 0.75rem;
}

.ch-voice-pending {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.ch-voice-pending-label {
    margin-bottom: 6px;
    color: rgba(255,255,255,0.55);
    font-size: 0.68rem;
    font-weight: 700;
}

.ch-voice-pending-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ch-voice-pending-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.045);
    border: 1px dashed rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.68);
    font-size: 0.68rem;
}

.ch-agent-top-targets { margin-bottom: 12px; }
.ch-top-target {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px;
    background: rgba(255,255,255,0.03); border-radius: 8px; margin-bottom: 4px;
    font-size: 0.8rem;
}
.ch-top-target-name { font-weight: 700; flex: 1; }
.ch-top-target-score {
    background: rgba(0,184,148,0.15); color: var(--success);
    padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700;
}
.ch-top-target-notes { color: var(--muted); font-size: 0.72rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 480px) {
    .ch-submission-header {
        flex-direction: column;
    }

    .ch-submission-copy-btn {
        width: 100%;
    }
    .ch-submission-line {
        grid-template-columns: 1fr;
        gap: 3px;
    }
    .ch-submission-key {
        white-space: normal;
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .yazoo-control-hub {
        width: 96vw;
        padding: 16px;
        border-radius: 16px;
    }
    .ch-emo-group {
        flex-wrap: wrap;
    }
    .ch-emo-btn {
        flex: 0 0 calc(33% - 4px);
    }
    .ch-toggle-row {
        padding: 8px 8px;
    }
    .ch-toggle-label {
        font-size: 0.88rem;
    }
    .ch-agent-grid {
        grid-template-columns: 1fr;
    }
}

/* Top 3 target selection states */
.ch-agent-top-targets {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.ch-agent-scenes {
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.025));
    border: 1px solid rgba(255,255,255,0.08);
}

.ch-scenes-title {
    font-size: 0.82rem;
    font-weight: 900;
    color: #ffd98a;
    margin-bottom: 10px;
}

/* Horizontal scrollable row */
.ch-scenes-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(253,203,110,0.3) transparent;
}

.ch-scenes-scroll::-webkit-scrollbar {
    height: 5px;
}

.ch-scenes-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.ch-scenes-scroll::-webkit-scrollbar-thumb {
    background: rgba(253,203,110,0.25);
    border-radius: 999px;
}

.ch-scene-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
    min-width: 150px;
    max-width: 170px;
    flex-shrink: 0;
    padding: 14px 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    scroll-snap-align: start;
}

.ch-scene-card:hover {
    transform: translateY(-2px);
    border-color: rgba(253,203,110,0.34);
    background: linear-gradient(135deg, rgba(253,203,110,0.13), rgba(255,255,255,0.04));
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.ch-scene-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: rgba(255,255,255,0.94);
    line-height: 1.35;
}

.ch-scene-size-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(253,203,110,0.14);
    color: #ffe9b5;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.ch-scene-play-btn {
    margin-top: auto;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(253,203,110,0.35);
    background: linear-gradient(135deg, rgba(253,203,110,0.22), rgba(253,203,110,0.12));
    color: #fff3d1;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
    text-align: center;
}

.ch-scene-play-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(253,203,110,0.56);
    background: linear-gradient(135deg, rgba(253,203,110,0.34), rgba(253,203,110,0.18));
}

.ch-top-targets-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--primary-light);
    margin-bottom: 2px;
}

.ch-top-target {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "name score"
        "notes notes";
    gap: 4px 10px;
    padding: 12px 12px 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    font-size: 0.8rem;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.ch-top-target::before {
    content: '';
    position: absolute;
    inset: 10px auto 10px 0;
    width: 3px;
    border-radius: 999px;
    background: rgba(108, 92, 231, 0.4);
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

.ch-top-target:hover {
    transform: translateY(-2px);
    border-color: rgba(108, 92, 231, 0.32);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.14), rgba(255, 255, 255, 0.04));
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(108, 92, 231, 0.12);
}

.ch-top-target:focus-visible {
    outline: none;
    border-color: rgba(108, 92, 231, 0.55);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.28), 0 8px 22px rgba(0, 0, 0, 0.18);
}

.ch-top-target:active {
    transform: translateY(0) scale(0.997);
}

.ch-top-target.selected,
.ch-top-target.is-selected,
.ch-top-target.active,
.ch-top-target[aria-pressed="true"],
.ch-top-target[data-selected="true"] {
    border-color: rgba(108, 92, 231, 0.6);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.22), rgba(255, 255, 255, 0.06));
    box-shadow: 0 10px 26px rgba(108, 92, 231, 0.18), 0 0 0 1px rgba(108, 92, 231, 0.16);
    transform: translateY(-1px);
}

.ch-top-target.selected::before,
.ch-top-target.is-selected::before,
.ch-top-target.active::before,
.ch-top-target[aria-pressed="true"]::before,
.ch-top-target[data-selected="true"]::before {
    background: linear-gradient(180deg, var(--primary), var(--accent));
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.35);
}

.ch-top-target.selected .ch-top-target-name,
.ch-top-target.is-selected .ch-top-target-name,
.ch-top-target.active .ch-top-target-name,
.ch-top-target[aria-pressed="true"] .ch-top-target-name,
.ch-top-target[data-selected="true"] .ch-top-target-name {
    color: #fff;
}

.ch-top-target.selected .ch-top-target-score,
.ch-top-target.is-selected .ch-top-target-score,
.ch-top-target.active .ch-top-target-score,
.ch-top-target[aria-pressed="true"] .ch-top-target-score,
.ch-top-target[data-selected="true"] .ch-top-target-score {
    background: rgba(108, 92, 231, 0.22);
    color: #f3efff;
}

.ch-top-target-name {
    grid-area: name;
    min-width: 0;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.94);
}

.ch-top-target-score {
    grid-area: score;
    justify-self: end;
    align-self: start;
}

.ch-top-target-notes {
    grid-area: notes;
    max-width: none;
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.35;
}

@media (max-width: 480px) {
    .ch-scenes-scroll {
        gap: 8px;
    }

    .ch-scene-card {
        min-width: 130px;
        max-width: 150px;
    }

    .ch-voice-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ch-voice-validator {
        flex-direction: column;
        align-items: flex-start;
    }

    .ch-agent-top-targets {
        gap: 8px;
    }

    .ch-top-target {
        padding: 14px 12px 13px 14px;
        gap: 4px 8px;
    }

    .ch-top-target-name {
        font-size: 0.84rem;
    }

    .ch-top-target-score {
        font-size: 0.66rem;
    }

    .ch-top-target-notes {
        max-width: none;
        font-size: 0.74rem;
        line-height: 1.4;
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }
}
