* {box-sizing:border-box}
[hidden] {display:none!important}
:root {
  --ink:#343e32; --subtle:#655f55; --paper:#fffdf7; --hair:#e7dfd0;
  --accent:#97613e; --mint:#eaf0e5; --green:#375741;
  --gutter:24px; --top:0px;
  font:16px/1.55 "PingFang SC","Microsoft YaHei","DengXian",sans-serif;
  color:var(--ink); background:#f6f3e9;
}
body {margin:0;min-height:100vh;background:radial-gradient(ellipse at 10% 12%,#f5e9cd 0,transparent 47%),radial-gradient(ellipse at 98% 90%,#e5ecdd 0,transparent 55%),#f8f6ed}
main {max-width:1064px;margin:auto;padding:0 36px 48px;padding-top:var(--top);padding-bottom:calc(48px + env(safe-area-inset-bottom))}
header,.brand,.quiet,.caption,.line,.cue,.mode,.primary,.secondary {display:flex;align-items:center}
header {justify-content:space-between;min-height:88px;margin-bottom:32px;border-bottom:1px solid #d8d9ca}
.brand {font-weight:700;letter-spacing:.035em;font-size:16px}.brandMark {width:40px;height:40px;border-radius:14px;background:#f4e5cb;margin-right:11px;display:grid;place-items:center}.brand img {width:30px;height:32px;object-fit:contain}
button,input {font:inherit}button {min-height:44px;border:0;color:inherit;cursor:pointer;touch-action:manipulation}button:disabled {opacity:.55;cursor:wait}
button:focus,input:focus+.switch {outline:3px solid #5c806a;outline-offset:3px}button:focus:not(:focus-visible),input:focus:not(:focus-visible)+.switch {outline:none}
.quiet {justify-content:center;background:transparent;border-radius:22px;padding:0 14px;font-size:14px;font-weight:600}.quiet:hover {background:#eaece2}
#rulesButton {border:1px solid #dcdcca;background:#fffdf4}.helpIcon {border:1.6px solid currentColor;border-radius:50%;width:16px;height:16px;font:700 12px/14px sans-serif;text-align:center;margin-right:7px}
.spread {display:grid;grid-template-columns:1fr .93fr;grid-template-rows:auto auto;grid-column-gap:7%;align-content:center;background:var(--paper);padding:40px;border-radius:32px;border:1px solid #e4ddca;box-shadow:0 18px 60px #64523310}
.intro {grid-column:2;align-self:end}.intro h1 {font-size:60px;line-height:1.12;letter-spacing:.045em;margin:0;font-weight:900;color:#304d39}.lead {margin:12px 0 26px;font-size:16px;color:var(--subtle)}
.postcard {position:relative;grid-column:1;grid-row:1 / span 2;margin:0;align-self:stretch;min-height:432px;overflow:hidden;border-radius:130px 130px 22px 22px;background:#efdfbd;border:5px solid #f4e7ce;box-shadow:0 0 0 1px #d6cab3}
.picture {position:absolute;inset:0;top:0;left:0;right:0;bottom:0;overflow:hidden}
.picture #scene,.resultArt>img:first-child {width:100%;height:100%;object-fit:cover;object-position:50% 62%;display:block}
.heroCat {position:absolute;height:42%;width:62%;object-fit:contain;left:19%;bottom:8%;filter:drop-shadow(0 5px 3px #70432845)}
.caption {position:absolute;bottom:12px;left:12px;right:12px;justify-content:space-between;pointer-events:none}
#sceneLabel {background:#fff9e9;color:#5c4836;border-radius:22px;padding:5px 13px;font-weight:700;font-size:13px;box-shadow:0 2px 5px #4c352521}
#swatches {display:flex;background:#fffcf1;border-radius:20px;padding:5px}#swatches i {width:12px;height:12px;border-radius:50%;margin:0 1px}
.controls {grid-column:2;align-self:start;min-width:0}
fieldset {margin:0;padding:0;border:0;min-width:0}legend {font-weight:700;font-size:15px;margin-bottom:12px;padding:0}
.themes {display:grid;grid-template-columns:repeat(3,1fr);grid-column-gap:8px}
.themes button {position:relative;border-radius:14px;padding:8px 7px 6px;background:#faf7ef;border:1px solid #e4ddcf;line-height:1.4;font-weight:700;font-size:14px;min-width:0}
.themes button:hover {background:#f3efdf}.themes button[aria-pressed=true] {background:#eef3e9;border-color:#628269;box-shadow:inset 0 0 0 1px #628269}
.themes button[aria-pressed=true]:after {content:"✓";position:absolute;right:4px;top:4px;background:#45694c;color:white;font:bold 10px/15px Arial;text-align:center;width:15px;border-radius:50%}
.themes b {display:flex;align-items:center;justify-content:center;height:28px;margin:0 0 4px}
.themes b i {display:block;width:15px;height:22px;margin-left:-6px;border:1.5px solid #fff9eb;border-radius:4px;transform-origin:center 90%;box-shadow:0 1px 2px #45352629}.themes b i:first-child {margin:0;transform:rotate(-19deg)}.themes b i:last-child {transform:rotate(19deg)}
.mode {position:relative;min-height:60px;cursor:pointer;margin:8px 0 10px;border-bottom:1px solid var(--hair);font-size:14px}
.mode span {margin-left:8px;color:var(--subtle);font-size:12px}.mode input {position:absolute;right:0;opacity:0;width:44px;height:44px;margin:0}
.switch {margin-left:auto;width:38px;height:22px;background:#d3d3c8;border:1px solid #bcbfb2;border-radius:20px;pointer-events:none}.switch:before {content:"";display:block;width:16px;height:16px;margin:2px;background:#fffdf7;border-radius:50%;box-shadow:0 1px 3px #3c4c3933}.mode input:checked+.switch {background:#547458}.mode input:checked+.switch:before {transform:translateX(16px)}
.primary,.secondary {justify-content:center;width:100%;border-radius:15px;font-weight:700;min-height:52px;letter-spacing:.035em}
.primary {background:var(--green);color:#fffef3;box-shadow:0 3px 0 #203c2b}.primary:hover {background:#2f4c39}.playIcon {width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:10px solid #ffefd0;margin-right:10px}.secondary {margin-top:12px;background:var(--mint);color:#324f3b}
.record {text-align:center;font-size:13px;color:var(--subtle);margin:14px 0 0}
.panel {max-width:480px;margin:auto;padding:var(--gutter);background:var(--paper);border:1px solid var(--hair);border-radius:24px;box-shadow:0 12px 36px #6656360c}
.panel h2 {margin:0;font-size:25px;line-height:1.4;letter-spacing:.025em}.center {text-align:center}.center>.quiet {margin:8px auto 0}
.line {justify-content:space-between}.line .quiet {background:var(--mint);color:var(--green)}
.stats {display:grid;grid-template-columns:1.18fr 1fr 1fr;text-align:left;background:#eff2e9;border-radius:16px 16px 0 0;padding:14px 0 12px;margin-top:16px}
.stats div {padding:0 16px;color:#506151;font-size:13px}.stats div+div {border-left:1px solid #d3dbcd}.stats b {display:block;color:#314d39;font:700 30px/1.25 Arial,sans-serif;font-variant-numeric:tabular-nums}
.track {height:5px;background:#d7dfd3;border-radius:0 0 5px 5px;overflow:hidden}.track i {display:block;height:100%;background:#678769}
.cue {min-height:80px}.cue img {width:44px;height:46px;object-fit:contain;margin-right:12px}.cue strong {font-size:17px}.cue small {display:block;color:var(--subtle);font-size:13px}
#board {display:grid;grid-gap:7px;background:#f4f4f4;padding:12px;border:1px solid #dedede;border-radius:18px}
#board button {height:0;min-height:0;padding:0 0 100%;border-radius:9px;-webkit-tap-highlight-color:transparent}
#rules p {margin:18px 0;color:var(--subtle)}.restCat {width:110px;height:115px;object-fit:contain;margin:12px auto}
.resultArt {position:relative;height:156px;overflow:hidden;border-radius:18px 18px 60px 18px;background:#f1e4cc}.resultArt img+img {position:absolute;bottom:4%;height:78%;left:20%;width:60%;object-fit:contain}
#resultTheme {color:var(--accent);font-size:14px;font-weight:700;margin:18px 0 4px}.points {display:block;color:var(--green);font-size:56px;line-height:1.28;font-weight:800;font-variant-numeric:tabular-nums}#detail {margin:8px auto;padding:12px 4px;border-top:1px solid var(--hair);border-bottom:1px solid var(--hair)}#saved {margin:10px 0 20px}
#posterView img,#posterView canvas {display:block;width:100%;max-width:324px;margin:16px auto;border-radius:12px;box-shadow:0 5px 18px #66553221}#message {font-size:14px;color:var(--subtle)}
@media(max-width:720px) {
  :root {--gutter:16px}
  main {max-width:480px;padding:0 20px 28px;padding-top:var(--top);padding-bottom:calc(28px + env(safe-area-inset-bottom))}
  header {min-height:72px;margin-bottom:20px}.brandMark {width:34px;height:34px;margin-right:8px}.brand img {width:26px;height:28px}.brand {font-size:14px}
  #rulesButton {background:transparent;border:0;padding:0 2px 0 12px;font-size:13px}
  .spread {display:block;border:0;border-radius:0;box-shadow:none;background:none;padding:0}
  .intro h1 {font-size:42px}.lead {font-size:14px;margin:7px 0 16px}
  .postcard {min-height:0;height:190px;height:23vh;max-height:220px;border-radius:68px 20px 20px 20px;border-width:3px}
  .picture #scene {object-position:50% 64%}.heroCat {height:68%;bottom:4%;left:25%;width:50%}
  .caption {left:8px;right:8px;bottom:8px}#sceneLabel {font-size:12px;padding:4px 10px}
  .controls {margin-top:16px;background:var(--paper);border:1px solid var(--hair);border-radius:20px;padding:18px}
  .mode {min-height:49px;margin:4px 0 12px}.primary,.secondary {min-height:48px}
  .record {margin-top:11px}.panel {padding:16px}.stats div {padding:0 12px}
}
@media(max-height:670px) and (max-width:720px) {
  header {min-height:52px;margin-bottom:10px}.intro h1 {font-size:32px}.lead {margin:3px 0 10px}
  .postcard {height:18vh;border-radius:32px 16px 16px 16px}.controls {margin-top:10px;padding:12px 14px}
  .themes b {height:20px}.themes b i {height:17px}legend {margin-bottom:7px}.mode {min-height:44px;margin:0 0 8px}
}
@media(max-width:350px) {
  main {padding-left:12px;padding-right:12px}.panel {padding:12px}#board {padding:8px;grid-gap:5px}.stats b {font-size:25px}.panel h2 {font-size:21px}
}
@supports(padding-top: max(0px,1px)) {main {padding-top:max(var(--top),env(safe-area-inset-top))}}
@media(prefers-reduced-motion:no-preference) {
  .primary:active {transform:translateY(2px)}.cue img.pop {animation:pop .18s ease-out}
  @keyframes pop {50% {transform:translateY(-3px)}}
}


/* Each object has an equal, square touch area. The paint fills the object itself. */
#board {background:#f8f7f4;grid-gap:6px;isolation:isolate}
#board button {position:relative;background:transparent;overflow:visible}
#board button svg {position:absolute;top:3%;left:3%;width:94%;height:94%;pointer-events:none}
#board button:disabled {opacity:.19;cursor:default}
#board[data-theme=milk_tea] button:after {content:"";position:absolute;bottom:0;left:-3px;right:-3px;height:2px;background:#dfd7cb}
#board[data-theme=nail] {border-radius:28px;background:#f8f7f6;box-shadow:inset 0 0 0 4px #eae6e1}
#board[data-theme=nail] button svg {width:90%;height:90%;left:5%;top:5%}
#board[data-theme=outfit] button:before {content:"";position:absolute;height:2px;top:3%;left:-3px;right:-3px;background:#d8d5cb}
#board[data-theme=outfit] button svg {top:5%}
.cue #playScene {width:68px;height:42px;object-fit:cover;margin:0 0 0 auto;border-radius:20px 8px 8px 8px}
.toolRack,.homeFoot {display:flex;align-items:center;justify-content:space-between}
.toolRack {justify-content:flex-end;padding-top:6px}.toolRack button,.homeFoot button {color:var(--green);font-size:13px}.homeFoot .record {margin:0}
.merch {display:grid;grid-template-columns:80px 1fr;grid-column-gap:15px;align-items:center;border-top:1px solid var(--hair);padding:18px 0}
.merch img,.ticketArt {width:80px;height:92px;border-radius:30px 12px 12px 12px;object-fit:cover}
.ticketArt {display:grid;place-items:center;background:#e4eddd;color:var(--green);font:italic 44px Georgia,serif}
.merch h3,.merch p {margin:0}.merch p,#shopStatus {font-size:13px;color:var(--subtle)}
.merch button {font-size:13px;margin-top:7px;min-height:44px}.merch button:disabled {cursor:default}
#balance {color:var(--green);background:var(--mint);border-radius:14px;padding:5px 12px}#closeShop {margin:6px auto 0}
@media(max-width:350px){#board{grid-gap:5px}.cue #playScene{width:45px;height:35px}}

.themes.hasGarden {grid-template-columns:repeat(4,minmax(0,1fr))}
