:root {
  color-scheme: light;
  font-family: system-ui,"Microsoft YaHei",sans-serif;
  color: #202a26;
  background: #fff5e5;
  --paper: #fff5e5;
  --ink: #202a26;
  --line: #d6d9ce;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button[hidden] { display: none; }
button:focus-visible { outline: 2px solid #496d60; outline-offset: 3px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 74px; padding: 12px clamp(16px,4vw,66px);
}
.brand { display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.brand img { border-radius: 12px; display: block; width: 40px; height: 40px; }
.brand span { font-family: Georgia,serif; font-size: 23px; font-weight: 700; letter-spacing: -.045em; }
.tools { display: flex; align-items: center; gap: 7px; }
.sound {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #fbfaf3; border: 1px solid var(--line); border-radius: 999px;
  min-height: 44px; padding: 8px 14px; font-size: 14px; font-weight: 650;
}
.sound:hover { background: #e7ede1; }
.sound[aria-pressed=true] { background: #dce7da; border-color: #9cb6a7; }
.choose { background: #e7ede1; }
.moon { width: 14px; height: 14px; border-radius: 50%; box-shadow: -4px 2px 0 currentColor; margin: -2px -2px 0 4px; }
.screen-icon { width: 13px; height: 13px; border: 2px solid currentColor; border-radius: 3px; }
.speaker { position: relative; width: 17px; height: 16px; }
.speaker::before { content: ""; position: absolute; inset: 1px 4px 1px 0; background: currentColor; clip-path: polygon(0 33%,38% 33%,85% 0,85% 100%,38% 67%,0 67%); }
.speaker::after { content: ""; position: absolute; right: 2px; top: 1px; width: 2px; height: 15px; background: currentColor; transform: rotate(-40deg); }
.sound[aria-pressed=true] .speaker::after { right: 0; top: 3px; width: 7px; height: 10px; background: transparent; border-right: 2px solid currentColor; border-radius: 50%; transform: none; }
.stage {
  position: relative; isolation: isolate; overflow: hidden;
  margin: 0 clamp(13px,3vw,48px); height: max(440px,calc(100svh - 182px)); border-radius: 25px;
  color: #542522;
  background: radial-gradient(ellipse at 67% 22%,#ffe3a1 2%,#ffba80 56%,#fb937c 100%);
}
.stage::before {
  content: ""; position: absolute; inset: 29% 5% 22% 4%; border-radius: 12% / 27%;
  background: radial-gradient(ellipse at 37% 8%,#fff8cc 10%,#ffe096 63%,#f0ab6c);
  border: 1px solid #ffeac0; pointer-events: none;
  box-shadow: inset 0 4px 16px #fff4c9, inset 0 -9px 24px #c77b4455, 0 10px 0 #e68b63, 0 21px 32px #94482b3d;
}
.world { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
.world canvas.fur { display: block; width: 100%; height: 100%; filter: drop-shadow(4px 11px 10px #6a3b4877) drop-shadow(1px 3px 2px #5f303450); }
.world canvas.stroke-hand { position: absolute; top: 0; left: 0; opacity: 0; height: auto; filter: drop-shadow(2px 5px 5px #643f5055); }
.pet-target { position: absolute; z-index: 2; cursor: grab; touch-action: none; }
.pet-target[hidden] { display: none; }
.can-pet .pet-target { cursor: none; }
.pet-target:focus-visible { outline: 2px dashed #ffedd2; outline-offset: 4px; border-radius: 20px; }
.intro { position: absolute; z-index: 3; top: clamp(20px,3.3vw,49px); left: clamp(20px,4vw,62px); pointer-events: none; }
h1 { margin: 0; font-size: clamp(32px,5vw,62px); font-weight: 850; letter-spacing: -.055em; line-height: 1.1; }
#reaction { margin: 9px 0 0; color: #653a32; font-size: 14px; font-weight: 650; }
.actions {
  position: absolute; z-index: 3; inset: auto clamp(20px,4vw,62px) clamp(16px,3vw,40px);
  display: flex; justify-content: space-between; align-items: end; gap: 16px; pointer-events: none;
}
.actions p { order: -1; margin: 0; font-size: 14px; color: #653a32; line-height: 1.55; }
.pet-button {
  min-height: 49px; flex: none; border: 1px solid #963f2c; border-radius: 999px;
  background: #aa3b2c; color: #fff7e2; padding: 10px 23px;
  font-size: 16px; font-weight: 800; box-shadow: 0 5px 19px #10202140; pointer-events: auto;
}
.pet-button:hover { background: #8e3026; }
.pet-button:active { transform: translateY(1px); }
.touch-hint { display: none; }
@media(pointer:coarse) { .touch-hint { display: inline; } .mouse-hint { display: none; } }
.cat-tray {
  display: flex; align-items: center; gap: 21px; min-height: 104px;
  padding: 14px clamp(16px,4vw,66px);
}
.cat-caption { min-width: 102px; }
.cat-caption h2 { margin: 0; font-size: 14px; font-weight: 800; }
.cat-caption p { margin: 4px 0 0; font-size: 13px; color: #51655b; }
.coats { display: grid; grid-template-columns: repeat(13,minmax(38px,48px)); gap: clamp(3px,.55vw,8px); }
.coat { display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 0; background: #faf9f1; border: 1px solid var(--line); border-radius: 50%; }
.coat:hover { background: #e1eade; }
.coat[aria-pressed=true] { border: 2px solid #2c5b49; background: #dfece0; }
.coat span { width: 77%; aspect-ratio: 1; border: 1px solid #39413850; border-radius: 50%; background: var(--swatch); background-size: auto 114%,cover; background-position: left center,center; background-repeat: no-repeat; }
.pose-switch {
  display: flex; flex: none; gap: 4px; margin-left: auto; padding: 3px;
  border: 1px solid #eacdb4; border-radius: 999px; background: #fff9ed;
}
.pose-switch button {
  min-height: 36px; padding: 5px 12px; border: 0; border-radius: 999px; background: transparent;
  white-space: nowrap; color: #704038; font-size: 14px; font-weight: 700;
}
.pose-switch button:hover { background: #ffe6ca; }
.pose-switch button[aria-pressed=true] { background: #a83f32; color: #fffaf0; }
.night { background: #1f282c; color: #f4eee5; --line: #4a5d61; }
.night .sound,.night .coat { background: #28383b; color: #f4eee5; }
.night .sound[aria-pressed=true],.night .coat[aria-pressed=true] { background: #385459; border-color: #a6c8c1; }
.night .cat-caption p { color: #bfd3cf; }
.night .pose-switch { background: #29383b; border-color: #587074; }
.night .pose-switch button { color: #fff0df; }
.night .pose-switch button:hover { background: #394e51; }
.night .pose-switch button[aria-pressed=true] { background: #624974; }
.night .stage { color: #fff3df; background: radial-gradient(ellipse at 63% 28%,#8062a0,#3f3c6c 70%); }
.night .stage::before { background: radial-gradient(ellipse at 45% 10%,#93779d,#65527b 73%,#584d76); box-shadow: inset 0 4px 16px #cfacc466,0 10px 0 #493b5b,0 20px 26px #23183150; border-color: #9b84aa; }
.night #reaction,.night .actions p { color: #fff0dc; }
.night .world canvas.stroke-hand { filter: brightness(.68) drop-shadow(2px 6px 4px #081519); }
.fallback { position: absolute; inset: 50% 14% auto; text-align: center; font-weight: 700; }
dialog { width: min(420px,calc(100% - 32px)); border: 1px solid var(--line); border-radius: 21px; background: #f8f7ee; color: var(--ink); padding: 22px; box-shadow: 0 18px 60px #0e241b55; }
dialog::backdrop { background: #1426206a; backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin: 0; font-size: 23px; }
.shape-settings { display: grid; gap: 8px; margin: 18px 0 6px; font-size: 15px; font-weight: 700; }
.shape-settings label { display: flex; justify-content: space-between; }
.shape-settings input { width: 100%; margin: 0 0 10px; accent-color: #31674e; }
@media(max-width:1050px) {
  .coats { grid-template-columns: repeat(7,minmax(38px,46px)); gap: 6px; }
  .stage { height: max(417px,calc(100svh - 211px)); }
}
@media(max-width:600px) {
  .topbar { min-height: 62px; padding: 9px 12px; gap: 6px; }
  .brand { gap: 6px; }
  .brand img { width: 31px; height: 31px; border-radius: 9px; }
  .brand span { font-size: 18px; }
  .tools { gap: 4px; }
  .tools .sound { min-width: 42px; padding: 6px; min-height: 42px; font-size: 13px; }
  .tool-label { display: none; }
  .stage { margin: 0 8px; height: max(380px,calc(100svh - 216px)); border-radius: 17px; }
  .stage::before { inset: 35% 4% 31% 4%; }
  .cat-tray { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 9px 12px 13px; }
  .cat-caption { grid-area: 1 / 1; }
  .cat-caption p { margin: 2px 0 0; }
  .pose-switch { grid-area: 1 / 2; }
  .coats { grid-area: 2 / 1 / 3 / 3; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
  .coat { width: 100%; max-width: 46px; justify-self: center; }
  .actions { inset-inline: 15px; gap: 10px; }
  .actions p { font-size: 12px; }
  .pet-button { min-height: 44px; padding: 8px 14px; font-size: 14px; }
}
