:root {
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  color: #65503b;
  background: #fffbef;
  font-synthesis: none;
  color-scheme: light;
  --accent: #ffbc31;
  --accent-light: #fff2c0;
  --level: 0;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #e7a222; outline-offset: 5px; }
a { color: inherit; text-decoration: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.experience {
  min-height: 700px; height: 100svh; overflow: hidden; position: relative; isolation: isolate;
  background: radial-gradient(ellipse at 48% 38%, #fff4c9 0%, #fff9e8 39%, transparent 65%),
    radial-gradient(ellipse at 3% 80%, #e5f4e4 0%, transparent 35%),
    radial-gradient(ellipse at 98% 80%, #ffe9df 0%, transparent 33%), #fffcf3;
  transition: background .5s;
}
.experience[data-theme=tangerine] { background: radial-gradient(ellipse at 50% 40%,#ffe3bc,transparent 66%), #fffbf2; }
.experience[data-theme=peach] { background: radial-gradient(ellipse at 50% 40%,#ffe1e8,transparent 65%),radial-gradient(ellipse at 0% 90%,#f1e7ff,transparent 35%), #fff9f5; }
.experience[data-theme=meadow] { background: radial-gradient(ellipse at 50% 40%,#e6f5c4,transparent 65%),radial-gradient(ellipse at 100% 90%,#dcf2ee,transparent 35%), #fcfdf0; }
header { position: absolute; top: 0; left: 0; width: 100%; padding: 30px 40px; display: flex; align-items: center; justify-content: space-between; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 650; letter-spacing: 2px; color: #6d593c; }
.brand img { width: 30px; height: 30px; }
.header-tools { display: flex; align-items: center; gap: 20px; }
.library-link { font-size: 12px; padding: 8px 15px; border: 1px solid #e9d9bd; border-radius: 30px; color: #96764e; background: #fffdf8aa; }
.library-link:hover { background: #ffefc2; }
.connection { font-size: 10px; letter-spacing: 1px; color: #ad9d84; display: flex; align-items: center; gap: 6px; }
.connection i { width: 5px; height: 5px; border-radius: 50%; background: #9cbe79; }
.icon-button { border: 0; background: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; position: relative; }
.quiet { color: #baa88e; }
.quiet svg { width: 17px; height: 17px; }
.quiet:hover { background: #f2e8d6; }
.stage { position: absolute; left: 0; top: 10%; width: 100%; height: 61%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ambient { position: absolute; width: 440px; height: 440px; border: 1px solid #f0d99b60; border-radius: 50%; top: 46%; left: 50%; transform: translate(-50%,-50%); z-index: -1; }
.ambient::after { content: ''; position: absolute; inset: -30px; border: 1px dashed #eddaac55; border-radius: 50%; }
.character { width: 360px; height: 375px; position: relative; margin-top: -20px; }
.buddy-body { width: 100%; height: 100%; position: relative; z-index: 2; animation: idle-bounce 4.5s ease-in-out infinite; transform-origin: 50% 88%; }
.character-art { display: block; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 85%; transform: scale(calc(1 + var(--level)*.035),calc(1 - var(--level)*.015)); transition: transform 90ms linear; filter: drop-shadow(0 12px 9px #c5a54813); }
.character-platform { position: absolute; bottom: 0; left: 45px; width: 270px; height: 45px; border-radius: 50%; background: radial-gradient(ellipse,#efd69b3d,transparent 70%); }
.character-shadow { position: absolute; bottom: 4px; left: 100px; width: 160px; height: 15px; border-radius: 50%; background: #c7a85f22; filter: blur(7px); animation: shadow-breathe 4.5s ease-in-out infinite; }
.partner-caption { display: flex; flex-direction: column; gap: 10px; text-align: center; margin-top: 5px; }
.partner-name { font-size: 23px; font-weight: 600; letter-spacing: 3px; color: #7b5c37; }
.state-label { font-size: 11px; letter-spacing: 1px; color: #b29a77; min-height: 17px; }
.character-picker { display: flex; gap: 12px; margin-top: 21px; }
.character-choice { width: 46px; height: 46px; padding: 4px; border: 2px solid transparent; border-radius: 50%; background: #fffdf8; transition: transform .2s,border-color .2s; box-shadow: 0 3px 10px #b4a0790b; }
.character-choice img { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; }
.character-choice[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 4px #fff9e8; transform: translateY(-3px); }
.character-choice:hover { transform: translateY(-3px); }
.sun-doodle { position: absolute; left: calc(50% - 282px); top: 16%; color: #f5bf3f; font-size: 62px; transform: rotate(-15deg); opacity: .8; }
.cloud { position: absolute; width: 65px; height: 19px; border-radius: 40px; background: #ffffffc9; }
.cloud::before,.cloud::after { content: ''; position: absolute; background: inherit; border-radius: 50%; }
.cloud::before { width: 32px; height: 32px; bottom: 2px; left: 10px; }
.cloud::after { width: 23px; height: 23px; bottom: 2px; right: 7px; }
.cloud-one { right: calc(50% - 286px); top: 24%; }
.cloud-two { left: calc(50% - 310px); top: 65%; transform: scale(.7); }
.color-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; }
.dot-coral { background: #f6b08f; right: calc(50% - 220px); top: 66%; }
.dot-blue { background: #a9d7de; left: calc(50% - 198px); top: 46%; width: 7px; height: 7px; }
.conversation { position: absolute; bottom: 165px; left: 7%; right: 7%; display: flex; justify-content: space-between; gap: 70px; pointer-events: none; }
.subtitle { width: 40%; max-width: 430px; }
.subtitle span { font-size: 10px; color: #bd9465; letter-spacing: 1px; }
.subtitle p { font-size: 14px; line-height: 1.9; color: #7d6c54; margin: 9px 0 0; max-height: 110px; overflow: auto; pointer-events: auto; scrollbar-width: thin; scrollbar-color: #dccba5 transparent; overflow-wrap: anywhere; }
.user-subtitle { text-align: right; }
.user-subtitle span { color: #9ba582; }
.user-subtitle p { color: #8b987d; }
.controls { position: absolute; left: 50%; bottom: 54px; transform: translateX(-50%); z-index: 3; }
.control-dock { display: flex; align-items: center; gap: 24px; }
.secondary { color: #b59a76; background: #fffcf5; border: 1px solid #efe1c9; width: 44px; height: 44px; }
.secondary svg { width: 19px; height: 19px; }
.secondary:hover { background: #fff0c7; }
.talk-button { display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid #e7aa2522; border-radius: 50px; background: var(--accent); color: #704d22; min-width: 175px; height: 57px; padding: 0 27px; font-size: 14px; font-weight: 600; letter-spacing: 2px; box-shadow: 0 8px 22px #edb22b26,inset 0 2px 0 #ffffff35; transition: transform .2s; }
.talk-button:hover { transform: translateY(-2px); }
.talk-button svg { width: 20px; height: 20px; }
.voice-bars { display: none; align-items: center; gap: 3px; height: 22px; }
.voice-bars i { width: 3px; height: 7px; border-radius: 2px; background: currentColor; animation: bar .7s ease-in-out infinite alternate; }
.voice-bars i:nth-child(2) { animation-delay: -.3s; }.voice-bars i:nth-child(3) { animation-delay: -.5s; }.voice-bars i:nth-child(4) { animation-delay: -.15s; }
.interrupt { display: block; margin: 15px auto -27px; border: 0; background: none; font-size: 10px; color: #aa8c66; }
.mute-line { display: none; position: absolute; width: 22px; height: 1px; background: #b59a76; transform: rotate(-45deg); box-shadow: 0 2px 0 #fffcf5; }
#soundButton[aria-pressed=false] .mute-line { display: block; }
.text-entry { position: absolute; z-index: 7; left: 50%; bottom: 52px; transform: translateX(-50%); width: min(540px,90%); display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 22px; border: 1px solid #ead5a8; background: #fffdf7fa; border-radius: 50px; box-shadow: 0 10px 35px #b9944820; }
.text-entry input { min-width: 0; flex: 1; color: #786044; background: transparent; border: 0; outline: none; font-size: 13px; height: 32px; }
.text-entry input::placeholder { color: #bea88a; }
.text-entry .icon-button { width: 30px; height: 30px; color: #b29a77; }
.text-entry .icon-button svg { width: 16px; height: 16px; }
.send { width: 35px; height: 35px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: #725128; }
.send svg { width: 18px; height: 18px; }
.toast { position: absolute; left: 50%; bottom: 136px; transform: translateX(-50%); padding: 12px 20px; max-width: min(500px,90vw); border: 1px solid #edd8aa; border-radius: 18px; background: #fff9eaf5; color: #997a4f; font-size: 12px; line-height: 1.8; z-index: 10; text-align: center; box-shadow: 0 5px 20px #ab8d4010; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
button:disabled { opacity: .45; cursor: wait; }
.experience[data-state=listening] .talk-button>svg { display: none; }
.experience[data-state=listening] .voice-bars { display: flex; }
.experience[data-state=listening] .buddy-body { animation: listening-tilt 2.2s ease-in-out infinite; }
.experience[data-state=thinking] .buddy-body { animation: thinking-tilt 3s ease-in-out infinite; }
.experience[data-state=speaking] .buddy-body { animation: talking-bounce .85s ease-in-out infinite; }
.experience[data-state=error] .state-label { color: #c67c58; }
@keyframes idle-bounce { 50% { transform: translateY(-9px) rotate(1.5deg); } }
@keyframes shadow-breathe { 50% { transform: scale(.88); opacity: .65; } }
@keyframes listening-tilt { 50% { transform: rotate(-5deg) translateY(-5px); } }
@keyframes thinking-tilt { 50% { transform: rotate(5deg) translateY(-5px); } }
@keyframes talking-bounce { 50% { transform: translateY(-6px) rotate(-2deg); } }
@keyframes bar { to { height: 20px; } }
@media(min-height:950px) { .stage { top:14%; height:57%; }.character { width:390px; height:405px; }.character-platform { left:60px; }.character-shadow { left:115px; }.conversation { bottom:190px; }.controls { bottom:65px; }.text-entry { bottom:63px; } }
@media(max-width:700px) { .experience { min-height:650px; }header { padding:23px 22px; }.brand { font-size:19px; gap:7px; }.brand img { width:26px; height:26px; }.header-tools { gap:10px; }.library-link { font-size:10px; padding:7px 11px; }.connection { font-size:9px; }.quiet { width:28px; height:28px; }.stage { top:10%; height:57%; }.character { width:280px; height:292px; margin-top:-13px; }.character-platform { width:210px; left:35px; bottom:2px; }.character-shadow { width:120px; left:80px; bottom:6px; }.ambient { width:290px; height:290px; top:42%; }.ambient::after { inset:-20px; }.partner-name { font-size:21px; }.partner-caption { gap:8px; }.state-label { font-size:10px; }.character-picker { gap:10px; margin-top:16px; }.character-choice { width:42px; height:42px; }.sun-doodle { left:15px; font-size:39px; top:12%; }.cloud-one { right:17px; transform:scale(.65); top:18%; }.cloud-two { left:0; top:57%; transform:scale(.5); }.dot-coral { right:22px; top:61%; width:7px; height:7px; }.dot-blue { left:32px; top:37%; width:5px; height:5px; }.conversation { bottom:155px; left:23px; right:23px; gap:25px; }.subtitle { width:48%; }.subtitle p { font-size:12px; max-height:86px; }.subtitle span { font-size:9px; }.controls { bottom:max(47px,env(safe-area-inset-bottom)); }.control-dock { gap:19px; }.talk-button { min-width:163px; height:55px; }.secondary { width:39px; height:39px; }.text-entry { bottom:max(46px,env(safe-area-inset-bottom)); }.toast { bottom:123px; } }
@media(max-height:740px) and (min-width:701px) { .experience { min-height:570px; }.stage { top:7%; height:61%; }.character { width:270px; height:280px; }.character-platform { width:200px; left:35px; }.character-shadow { width:120px; left:75px; }.ambient { width:320px; height:320px; }.partner-name { font-size:19px; }.partner-caption { gap:6px; }.character-picker { margin-top:12px; }.character-choice { width:36px; height:36px; }.conversation { bottom:120px; }.subtitle p { max-height:68px; font-size:12px; }.controls { bottom:30px; }.text-entry { bottom:29px; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; }.character-art { transform:none!important; } }

/* True 3D duck: the image and its whole-image animation are hidden when loaded. */
.duck-viewer { position:absolute; inset:-15px -22px -5px; z-index:3; }
.duck-viewer canvas { width:100%; height:100%; display:block; }
.character.has-model .character-shadow { opacity:.25; animation:none; }
.motion-preview { border:1px solid #e8c88b; border-radius:30px; background:#fff9e8; color:#ac8350; font-size:10px; padding:6px 14px; margin-top:11px; }
.motion-preview:hover { background:#ffefbe; }
@media(max-width:700px) { .motion-preview { padding:5px 12px; margin-top:9px; } }
