@font-face {
  font-family: "Xiaosu Title";
  src: url("/static/fonts/xiaosu-title.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #30483c;
  background: #f7f8f2;
  color-scheme: light;
  --avatar-size: clamp(184px, 52vw, 224px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(32px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 44%, #edf1e580 0, #f7f8f200 65%);
}
main { text-align: center; width: 100%; max-width: 480px; margin-inline: auto; flex-shrink: 0; transform: translateY(-28px); }
@supports (transform: translateY(clamp(-32px, -4vh, -18px))) {
  main { transform: translateY(clamp(-32px, -4vh, -18px)); }
}
.avatar-stage { position: relative; margin-top: clamp(44px, 7vh, 64px); }
.brand { display: flex; flex-direction: column; align-items: center; margin: 0; font-weight: 400; line-height: 1; }
.brand-title { font-family: "Xiaosu Title", "Microsoft YaHei", sans-serif; font-size: clamp(46px, 12vw, 54px); font-weight: 400; letter-spacing: .12em; padding-left: .12em; color: #365741; }
.brand-subtitle { margin-top: 14px; font-size: 12px; font-weight: 500; letter-spacing: .24em; padding-left: .24em; color: #819376; }
button {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled { opacity: .42; cursor: default; }
button:focus-visible { outline: 2px solid #93a985; outline-offset: 5px; }
button:focus:not(:focus-visible) { outline: none; }
.orb {
  -webkit-user-select: none;
  user-select: none;
  display: block;
  padding: 0;
  position: relative;
  margin: 0 auto;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  background: linear-gradient(145deg, #e2ebd6, #dce7ce);
  box-shadow: 0 0 0 12px #eaf0e2, 0 16px 38px -24px #526d4433;
}
.portrait { position: absolute; inset: 0; overflow: hidden; border-radius: 50%; isolation: isolate; transform-origin: 50% 50%; animation: portrait-spin 24s linear infinite; animation-play-state: paused; }
.portrait img { position: absolute; display: block; width: 110%; height: auto; max-width: none; left: 0; top: 8%; pointer-events: none; user-select: none; }
.portrait img[data-custom="true"] { width: 100%; height: 100%; left: 0; top: 0; object-fit: cover; }
.orb::after { content: ""; position: absolute; inset: -12px; border: 1px solid #a2b59a; border-radius: 50%; opacity: 0; pointer-events: none; transition: opacity .3s; }
.orb[data-active="true"] .portrait { animation-play-state: running; }
.orb[data-active="true"]::after { opacity: .65; }
body[data-state="Speaking"] .orb::after { animation: portrait-ring 2.4s ease-in-out infinite; }
body[data-state="Connecting"] .orb::after { animation: portrait-ring 1.4s ease-in-out infinite; }
.orb:focus-visible { outline-offset: 18px; }
.orb-action { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 16%; height: 16%; min-width: 28px; min-height: 28px; max-width: 36px; max-height: 36px; aspect-ratio: 1; background: none; border: 0; display: block; pointer-events: none; }
.orb-action svg { position: absolute; left: 0; top: 0; display: block; width: 100%; height: 100%; fill: white; stroke: none; opacity: .48; transition: opacity .2s; }
.orb-action .control-stop { display: none; }
.orb[data-active="true"] .control-play { display: none; }
.orb[data-active="true"] .control-stop { display: block; }
.orb:focus-visible .orb-action svg { opacity: .85; }
#unlock { text-align: left; background: #ffffff70; border: 1px solid #dbe3d3; border-radius: 18px; padding: 18px; margin: 32px auto 0; width: 100%; max-width: 340px; }
#unlock label { display: block; font-size: 12px; color: #758173; margin-bottom: 12px; }
.unlock-row { display: flex; gap: 8px; }
.unlock-row input { width: 100%; min-width: 0; font: inherit; font-size: 16px; padding: 12px; border: 1px solid #cdd8c5; border-radius: 10px; background: #fff; }
.unlock-row input:focus-visible { outline: 2px solid #93a985; outline-offset: 2px; }
.unlock-row button { padding: 12px 18px; min-height: 44px; border-radius: 10px; flex-shrink: 0; background: #405b49; color: white; font-size: 13px; }
#message { color: #ad4933; font-size: 13px; line-height: 1.6; margin: 24px auto 0; max-width: 340px; }
#message:empty { display: none; }
@keyframes portrait-spin { to { transform: rotate(360deg); } }
@keyframes portrait-ring { 0%, 100% { opacity: .25; transform: scale(1); } 50% { opacity: .65; transform: scale(1.025); } }
@media (hover: hover) {
  .orb:not(:disabled):hover .orb-action svg { opacity: .75; }
}
@media (min-width: 768px) {
  :root { --avatar-size: clamp(208px, 24vh, 256px); }
  .brand-title { font-size: 58px; }
  .brand-subtitle { font-size: 13px; }
}
@media (max-height: 620px) {
  :root { --avatar-size: 156px; }
  body { padding-block: max(28px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-bottom)); }
  .brand-title { font-size: 42px; }
  .brand-subtitle { margin-top: 10px; }
  main { transform: translateY(-16px); }
  .avatar-stage { margin-top: 36px; }
}
@media (max-height: 430px) {
  :root { --avatar-size: 112px; }
  main { transform: translateY(-10px); }
  .avatar-stage { margin-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .portrait, .orb::after { animation: none !important; }
}

.photo-status { position:relative; width:100%; max-width:340px; min-height:40px; margin:32px auto 0; color:#758173; font-size:12px; line-height:1.6; pointer-events:none; }
.photo-status:empty { visibility: hidden; }
.android-client .photo-status { position:absolute; top:calc(100% + 30px); left:50%; transform:translateX(-50%); min-height:0; margin:0; }
.voice-picker { position:fixed; z-index:10; top:max(2px,env(safe-area-inset-top)); left:max(8px,env(safe-area-inset-left)); width:72px; height:48px; margin:0; }
.voice-picker[hidden] { display:none; }
.voice-menu-toggle { display:grid; place-items:center; width:72px; height:48px; padding:0; border-radius:10px; background:transparent; color:#7b8f75; }
.voice-menu-toggle:focus-visible { outline:2px solid #93a985; outline-offset:-3px; }
.voice-dots { display:flex; align-items:center; gap:2.6px; }
.voice-dots i { display:block; width:3.2px; height:3.2px; border-radius:50%; background:currentColor; }
.voice-menu { position:absolute; top:48px; left:0; width:168px; padding:5px 4px; border:1px solid #e1e9dc; border-radius:12px; background:#f6f8f1; box-shadow:0 9px 24px #355b461b; text-align:left; }
.voice-menu-option { display:flex; align-items:center; justify-content:space-between; width:100%; min-height:48px; padding:0 10px; border-radius:8px; background:transparent; color:#355b46; text-align:left; font-size:14px; }
.voice-menu-option:hover,.voice-menu-option:focus-visible { background:#e9f0e4; }
.voice-menu-option:focus-visible { outline:2px solid #93a985; outline-offset:-2px; }
.voice-menu-check { width:18px; color:#5d7c56; font-size:13px; text-align:right; }
#camera-dialog { width:min(480px,calc(100% - 32px)); max-height:calc(100vh - 32px); max-height:calc(100svh - 32px); padding:18px; border:1px solid #e1e8d9; border-radius:24px; background:#f7f8f2; color:#30483c; }
#camera-dialog::backdrop { background:#20362966; backdrop-filter:blur(8px); }
.camera-heading { display:flex; align-items:center; justify-content:space-between; font-size:14px; }
#close-camera { width:44px; height:44px; background:none; color:#758173; font-size:24px; }
#camera-video { display:block; width:100%; max-height:55vh; max-height:55svh; aspect-ratio:4/3; object-fit:contain; background:#eaf0e2; border-radius:14px; }
#camera-message { font-size:12px; color:#758173; }
#camera-message:empty { display:none; }
