:root {
  color-scheme: light;
  --ink: #243a2c;
  --muted: #526758;
  --green: #325c43;
  --lime: #e7eea2;
  --paper: #f8f3e7;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
.asset-credit { max-width: 1280px; margin: 0 auto 20px; padding: 0 20px; color: var(--muted); text-align: right; font-size: 11px; line-height: 1.5; }
.asset-credit a { color: inherit; }
button, a { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid #325c43; outline-offset: 4px; }
button:disabled { opacity: .55; cursor: default; }
[hidden] { display: none !important; }
.shell { max-width: 1392px; margin: 0 auto; padding: 0 56px 40px; }
.top { min-height: 88px; border-bottom: 1px solid #dddcc9; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; font-weight: 800; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; background: var(--lime); border-radius: 50%; width: 39px; height: 39px; font: 24px Georgia, serif; }
.reset, .view { border: 1px solid #d6dbcb; border-radius: 99px; background: transparent; color: var(--green); padding: 10px 14px; }
.reset:hover, .view:hover { background: #e6eddb; }
.layout { display: grid; grid-template-columns: minmax(250px, .67fr) minmax(0, 1.63fr); gap: clamp(26px, 5vw, 78px); align-items: center; padding-top: clamp(26px, 6vh, 66px); }
.breed { display: flex; align-items: center; gap: 8px; width: fit-content; margin: 0 0 19px; color: #31513a; font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.breed [aria-hidden], .scene-label [aria-hidden] { height: 8px; width: 8px; border-radius: 50%; background: #6f9662; }
h1 { margin: 0; font-size: clamp(53px, 6vw, 94px); line-height: 1.06; letter-spacing: -.025em; }
h1 .period { color: #78935d; }
.description { margin: 22px 0 31px; color: var(--muted); font-size: 15px; line-height: 1.85; }
.status { border-top: 1px solid #dddcc9; padding-top: 19px; max-width: 310px; }
.status-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; }
.status-line output { font-size: 19px; font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 8px; display: block; margin-top: 9px; appearance: none; border: 0; border-radius: 99px; overflow: hidden; background: #dce3ce; color: #648353; }
progress::-webkit-progress-bar { background: #dce3ce; }
progress::-webkit-progress-value { background: #648353; border-radius: 99px; }
progress::-moz-progress-bar { background: #648353; }
#hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; min-height: 2.7em; line-height: 1.5; }
.play { min-width: 0; border: 1px solid #d6dfcc; border-radius: 27px; overflow: hidden; background: #fbfbf2; box-shadow: 0 18px 48px #283f1d0c; }
.stage { position: relative; height: clamp(390px, 58vh, 620px); isolation: isolate; overflow: hidden; touch-action: none; background: radial-gradient(ellipse at 47% 36%, #f5f9db 0%, #e6eecb 41%, #c9dcb5 100%); }
.stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.stage .spray { z-index: 1; pointer-events: none; }
.stage .world { touch-action: none; cursor: crosshair; }
.stage.turning .world { cursor: grab; }
.stage.turning .world:active { cursor: grabbing; }
.scene-label { position: absolute; z-index: 2; top: 18px; left: 18px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 99px; background: #f9fae8df; color: #304c35; font-size: 13px; font-weight: 700; pointer-events: none; }
.loading { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none; padding: 20px; color: var(--muted); text-align: center; }
.toolbar { min-height: 68px; padding: 11px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modes { display: flex; flex-shrink: 0; gap: 3px; padding: 4px; background: #e7ecdb; border-radius: 99px; }
.modes button { border: 0; border-radius: 99px; background: none; color: var(--green); font-size: 13px; padding: 8px 16px; white-space: nowrap; font-weight: 700; }
.modes button[aria-pressed="true"] { color: white; background: var(--green); }
.toolbar p { margin: 0; font-size: 12px; color: var(--muted); }
.view { flex-shrink: 0; width: 37px; height: 37px; padding: 0; font-size: 21px; line-height: 1; }
.touch-help { display: none; }
.finish { z-index: 4; position: absolute; inset: auto 0 16px; width: min(352px, calc(100% - 26px)); margin: auto; padding: 13px 16px; text-align: center; border: 1px solid #dce7ca; border-radius: 19px; background: #fffff2f2; box-shadow: 0 9px 34px #1b392228; }
.finish h2, .finish p { margin: 0 0 6px; }
.finish h2:focus { outline: none; }
.finish p { color: var(--muted); font-size: 13px; }
.finish .next-hint { margin-top: 9px; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.result-actions button, #ad-preview button { border-radius: 99px; border: 1px solid var(--green); color: white; background: var(--green); padding: 8px 13px; }
.result-actions .secondary { color: var(--green); background: transparent; border-color: #bac9b5; }
#ad-preview { width: min(330px, calc(100% - 36px)); border: 1px solid #d6dfcc; border-radius: 19px; background: #fffff2; color: var(--ink); text-align: center; padding: 22px; }
#ad-preview::backdrop { background: #243a2c74; }
#ad-preview h2 { margin: 0; }
#share-card { width: min(625px, calc(100% - 24px)); border: 1px solid #d6dfcc; border-radius: 19px; background: #f8f3e7; color: var(--ink); padding: 16px; }
#share-card::backdrop { background: #243a2c8a; }
#share-card h2 { margin: 0 0 12px; }
#share-card canvas { display: block; width: 100%; height: auto; border-radius: 12px; }
#share-card .close-card { float: right; background: transparent; border: 0; font-size: 24px; color: inherit; }
#share-status { min-height: 1.3em; margin: 9px 0 0; font-size: 13px; overflow-wrap: anywhere; }
@media (pointer: coarse) {
  .desktop-help { display: none; }
  .touch-help { display: block; }
}
@media (max-width: 800px) {
  .shell { padding: 0 20px 24px; }
  .top { min-height: 65px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 17px; padding-top: 18px; }
  .intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(95px, .47fr); column-gap: 16px; align-items: end; }
  .breed { grid-column: 1 / -1; margin: 0 0 7px; }
  h1 { font-size: clamp(26px, 7vw, 61px); letter-spacing: -.025em; }
  h1 br, .description br { display: none; }
  .description { grid-column: 1 / -1; grid-row: 3; margin: 7px 0 0; font-size: 13px; }
  .status { grid-column: 2; grid-row: 2; padding: 0; border: 0; width: 100%; justify-self: end; }
  #hint { display: none; }
  .stage { height: clamp(320px, 51vh, 540px); }
  .finish { inset-block-end: 8px; padding-block: 9px; }
  .toolbar { padding: 8px 10px; min-height: 58px; gap: 7px; }
  .modes button { padding-inline: 10px; }
}
@media (max-width: 395px) {
  .shell { padding-inline: 13px; }
  .toolbar p { font-size: 11px; }
  .view { width: 33px; height: 33px; }
}

/* Stage fills the viewport; only the compact controls sit above the canvas. */
.shell { position: relative; width: 100%; height: 100dvh; max-width: none; margin: 0; padding: 0; overflow: hidden; }
.layout, .play, .stage { position: absolute; inset: 0; width: 100%; height: 100%; }
.layout { display: block; padding: 0; }
.play { border: 0; border-radius: 0; box-shadow: none; }
.stage { background: radial-gradient(ellipse at 50% 39%, #e9f2e3 0%, #d3e6dd 48%, #accdca 100%); }
.top { position: absolute; z-index: 3; inset: 14px 18px auto; min-height: 0; border: 0; pointer-events: none; }
.top a, .top button { pointer-events: auto; }
.top-actions { display: flex; gap: 7px; align-items: center; }
#language { pointer-events: auto; font: inherit; font-size: 13px; color: var(--green); background: #f5faf2eb; border: 1px solid #c6d9ce; border-radius: 99px; padding: 8px; }
.toolbar p { min-width: 0; line-height: 1.3; }
.brand, .reset, .intro, .toolbar { background: #f5faf2eb; box-shadow: 0 4px 18px #23413713; }
.brand { border-radius: 99px; padding: 4px 13px 4px 4px; gap: 7px; font-size: 14px; }
.brand-mark { width: 31px; height: 31px; font-size: 19px; }
.reset { padding: 9px 12px; font-size: 13px; }
.intro { display: block; position: absolute; z-index: 3; top: 63px; left: 18px; width: min(221px, calc(100% - 36px)); padding: 10px 12px; border: 1px solid #c6d9ce; border-radius: 13px; pointer-events: none; }
.breed { margin: 0 0 6px; font-size: 11px; }
.status { padding: 0; border: 0; max-width: none; }
.status-line output { font-size: 15px; }
progress { margin-top: 4px; height: 5px; }
#hint { display: block; min-height: auto; margin: 6px 0 0; font-size: 11px; }
.scene-label { top: 66px; left: auto; right: 18px; }
.toolbar { position: absolute; z-index: 3; left: 50%; bottom: max(32px, env(safe-area-inset-bottom)); transform: translateX(-50%); min-height: 0; width: max-content; max-width: calc(100% - 20px); padding: 7px 9px; border: 1px solid #c6d9ce; border-radius: 99px; gap: 12px; }
.finish { inset-block-end: 99px; }
.asset-credit { position: absolute; z-index: 4; bottom: 4px; left: 0; right: 0; margin: 0 auto; padding: 0 10px; text-align: center; font-size: 10px; }
.stage:focus { outline: none; }
@media (max-width: 520px) {
  .top { inset-inline: 10px; }
  .intro { left: 10px; width: min(195px, calc(100% - 100px)); }
  .scene-label { right: 10px; }
  .toolbar { gap: 7px; }
  .toolbar p { font-size: 10px; }
}
@media (max-height: 460px) {
  .intro { width: 155px; }
  #hint { display: none; }
  .finish { inset-block-end: 75px; }
  .toolbar { bottom: 19px; }
}

