*{margin:0;padding:0;box-sizing:border-box}html,body{width:100%;height:100%;overflow:hidden;background:#000;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}#app{width:100%;height:100%;position:relative}#canvas{width:100%;height:100%;display:block;touch-action:none}#character-panel{position:absolute;bottom:0;left:0;right:0;background:#140a1ef2;border-radius:20px 20px 0 0;transform:translateY(100%);transition:transform .3s ease-out;z-index:100;max-height:70vh;overflow-y:auto;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}#character-panel.visible{transform:translateY(0)}#character-panel.hidden{transform:translateY(100%)}.panel-handle{width:40px;height:4px;background:#ffffff4d;border-radius:2px;margin:12px auto;cursor:grab}.panel-content{padding:0 20px 30px}.panel-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;padding-bottom:10px;border-bottom:1px solid rgba(255,255,255,.1)}.panel-title{color:#fff;font-family:system-ui,-apple-system,sans-serif;font-size:1.2rem;font-weight:600}.panel-time{color:#ffffff80;font-family:system-ui,-apple-system,sans-serif;font-size:.9rem}.panel-section{margin-bottom:20px}.section-title{color:#fff9;font-family:system-ui,-apple-system,sans-serif;font-size:.75rem;text-transform:uppercase;letter-spacing:.1em;margin-bottom:10px}.phase-bars{display:flex;flex-direction:column;gap:8px}.phase-row{display:flex;align-items:center;gap:10px}.phase-label{width:80px;color:#ffffffb3;font-family:system-ui,-apple-system,sans-serif;font-size:.8rem}.phase-bar{flex:1;height:8px;background:#ffffff1a;border-radius:4px;overflow:hidden}.phase-fill{height:100%;border-radius:4px;transition:width .5s ease-out}.phase-fill.peace{background:linear-gradient(90deg,#4a9eff,#7eb8ff)}.phase-fill.listening{background:linear-gradient(90deg,#9b59b6,#c39bd3)}.phase-fill.tension{background:linear-gradient(90deg,#f39c12,#f5b041)}.phase-fill.bleeding{background:linear-gradient(90deg,#e74c3c,#ec7063)}.phase-fill.trauma{background:linear-gradient(90deg,#8b0000,#b22222)}.phase-fill.healing{background:linear-gradient(90deg,#2ecc71,#58d68d)}.phase-value{width:40px;text-align:right;color:#ffffff80;font-family:system-ui,-apple-system,sans-serif;font-size:.75rem}.trust-bar{position:relative;height:12px;background:#ffffff1a;border-radius:6px;overflow:hidden}.trust-fill{height:100%;background:linear-gradient(90deg,#8b5cf6,#a78bfa);border-radius:6px;transition:width .5s ease-out}.trust-value{position:absolute;right:10px;top:50%;transform:translateY(-50%);color:#fff;font-family:system-ui,-apple-system,sans-serif;font-size:.7rem;font-weight:600;text-shadow:0 1px 2px rgba(0,0,0,.5)}.gesture-stats{display:flex;flex-wrap:wrap;gap:8px}.gesture-tag{background:#ffffff1a;padding:6px 12px;border-radius:20px;color:#ffffffb3;font-family:system-ui,-apple-system,sans-serif;font-size:.75rem}.gesture-tag.dominant{background:#8b5cf64d;color:#a78bfa}#swipe-hint{position:absolute;bottom:10px;left:50%;transform:translate(-50%);z-index:50;opacity:.5;transition:opacity .3s}#swipe-hint.hidden{opacity:0;pointer-events:none}.hint-line{width:40px;height:4px;background:#ffffff4d;border-radius:2px}#sound-debug{position:absolute;top:70px;left:10px;background:#000c;border:1px solid rgba(255,255,255,.2);border-radius:8px;padding:10px;z-index:200;font-family:monospace;font-size:11px;min-width:140px}#sound-debug.hidden{display:none}.debug-title{color:#0f0;margin-bottom:8px;font-weight:700;text-transform:uppercase;letter-spacing:1px}.lfo-bars{display:flex;flex-direction:column;gap:4px}.lfo-row{display:flex;align-items:center;gap:6px}.lfo-row span{color:#fff9;width:50px;font-size:10px}.lfo-bar{flex:1;height:8px;background:#ffffff1a;border-radius:4px;overflow:hidden}.lfo-fill{height:100%;background:#0f0;border-radius:4px;transition:width .05s linear}#lfo-ocean .lfo-fill,#lfo-ocean{background:#00bcd4}#lfo-breath .lfo-fill,#lfo-breath{background:#4caf50}#lfo-pulse .lfo-fill,#lfo-pulse{background:#ff9800}#lfo-shimmer .lfo-fill,#lfo-shimmer{background:#e91e63}#lfo-drift .lfo-fill,#lfo-drift{background:#9c27b0}.lfo-bar{background:#ffffff1a!important}.debug-status{margin-top:8px;padding-top:6px;border-top:1px solid rgba(255,255,255,.1);color:#888;text-align:center}.debug-status.playing{color:#0f0}.emotion-fill{background:linear-gradient(90deg,#ff6b6b,#ffd93d)!important}.tension-fill{background:linear-gradient(90deg,#4ecdc4,#ff6b6b,#c44569)!important}.glitch-fill{background:linear-gradient(90deg,#6c5ce7,#fd79a8,#e17055)!important}.glitch-bar{position:relative}.threshold-mark{position:absolute;left:35%;top:0;width:2px;height:100%;background:#fff;opacity:.8}.emo-val{color:#fffc;font-size:9px;width:28px;text-align:right}#glitch-status{font-size:10px}#glitch-status.active{color:#fd79a8;animation:glitch-pulse .3s ease infinite}@keyframes glitch-pulse{0%,to{opacity:1}50%{opacity:.5}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media (prefers-reduced-motion: reduce){*{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}.ui-layer{position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:250;opacity:0;transition:opacity .5s ease}.ui-layer.visible{opacity:1}.ui-layer>*{pointer-events:auto}.ui-top-left{position:absolute;top:calc(16px + env(safe-area-inset-top,0px));left:16px}.ui-top-right{position:absolute;top:calc(16px + env(safe-area-inset-top,0px));right:16px}.ui-bottom-center{position:absolute;bottom:80px;left:50%;transform:translate(-50%)}.glass-button{width:44px;height:44px;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;outline:none;background:#ffffff14;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid rgba(255,255,255,.12);border-radius:12px;transition:opacity .2s,transform .15s,background .2s}.glass-button:hover{background:#ffffff1f}.glass-button:active{opacity:.7;transform:scale(.95)}.glass-button:focus-visible{outline:2px solid rgba(255,255,255,.4);outline-offset:2px}.glass-button svg{width:20px;height:20px;fill:#ffffffe6}.settings-modal{position:fixed;top:calc(56px + env(safe-area-inset-top,0px));right:16px;min-width:100px;z-index:260;background:#000c;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid rgba(255,255,255,.08);border-radius:10px;opacity:0;transform:translateY(-8px) scale(.95);pointer-events:none;transition:opacity .15s ease,transform .15s ease}.settings-modal.visible{opacity:1;transform:translateY(0) scale(1);pointer-events:auto}.modal-items{padding:4px}.modal-item{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:6px;cursor:pointer;transition:background .1s}.modal-item:active{background:#ffffff1a}.modal-item svg{width:14px;height:14px;fill:#ffffff80;flex-shrink:0}.modal-item span{color:#fffc;font-family:system-ui,-apple-system,sans-serif;font-size:11px;font-weight:500;letter-spacing:.02em}.modal-item-toggle{justify-content:flex-start}.toggle-indicator{margin-left:auto;color:#fff6;font-size:9px;text-transform:uppercase}.modal-view{padding:12px;text-align:center;position:relative}.view-title{color:#ffffffe6;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:600;letter-spacing:.1em}.view-sub{color:#fff6;font-size:9px;margin-top:2px}.view-text{color:#ffffff80;font-size:10px;margin:2px 0}.view-back{position:absolute;top:8px;left:8px;color:#fff6;font-size:12px;cursor:pointer;padding:4px}.view-back:active{color:#fffc}.entity-switcher{width:48px;height:48px;border-radius:14px}.entity-switcher svg{width:24px;height:24px}.entity-switcher.has-new-entity{animation:entity-glow 2s ease-in-out infinite}@keyframes entity-glow{0%,to{box-shadow:0 0 #8b5cf600}50%{box-shadow:0 0 20px 4px #8b5cf680}}.entity-wrapper{position:relative;width:64px;height:64px}.entity-wrapper .glass-button{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.emotion-ring{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;pointer-events:none;transition:opacity .3s ease;background:conic-gradient(from 0deg,var(--ring-color),transparent 30%,var(--ring-color) 60%,transparent 90%);mask:radial-gradient(circle,transparent 22px,black 23px,black 31px,transparent 32px);-webkit-mask:radial-gradient(circle,transparent 22px,black 23px,black 31px,transparent 32px)}@supports not (background: conic-gradient(red,blue)){.emotion-ring{background:transparent;border:3px solid var(--ring-color);mask:none;-webkit-mask:none}}.emotion-ring.emotion-peace{--ring-color: #00d4ff;animation:ring-rotate 3s linear infinite}.emotion-ring.emotion-tension{--ring-color: #ff6b35;animation:ring-pulse .8s ease-in-out infinite}.emotion-ring.emotion-trauma{--ring-color: #ff2d55;animation:ring-shake .3s ease-in-out infinite,ring-flicker .15s steps(2) infinite}.emotion-ring.emotion-healing{--ring-color: #34c759;animation:ring-heal 2s ease-in-out infinite;box-shadow:0 0 12px var(--ring-color)}@keyframes ring-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes ring-pulse{0%,to{opacity:.6;transform:scale(1)}50%{opacity:1;transform:scale(1.05)}}@keyframes ring-shake{0%,to{transform:translate(0)}25%{transform:translate(-2px)}75%{transform:translate(2px)}}@keyframes ring-flicker{0%{opacity:1}50%{opacity:.4}}@keyframes ring-heal{0%,to{opacity:.7;transform:scale(1);box-shadow:0 0 8px var(--ring-color)}50%{opacity:1;transform:scale(1.03);box-shadow:0 0 16px var(--ring-color)}}@media (prefers-reduced-motion: reduce){.glass-button,.ui-layer,.settings-modal{transition:none}.entity-switcher.has-new-entity{animation:none;box-shadow:0 0 0 2px #8b5cf680}.emotion-ring{animation:ring-pulse-simple 2s ease-in-out infinite!important}@keyframes ring-pulse-simple{0%,to{opacity:.5}50%{opacity:1}}}
