:root {
  color-scheme: light;
  --ink: #242e1c;
  --deep: #253928;
  --mute: #53604d;
  --paper: #fbf9ee;
  --cream: #fffdf1;
  --milk: #f8d54e;
  --shell: #f9ce3d;
  --line: #39402a;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  font: 16px/1.55 "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box }
[hidden] { display:none !important }
body { margin:0; min-height:100vh; min-height:100svh; background-color:var(--paper); background-image:radial-gradient(#b4aa862e .9px,transparent 1px); background-size:10px 10px; }
h1,h2,h3,p,fieldset { margin:0 }
fieldset { border:0; padding:0; min-inline-size:0 }
button,input,textarea { font:inherit }
button, a { -webkit-tap-highlight-color:transparent; touch-action:manipulation }
button { color:var(--ink); cursor:pointer; border:2px solid var(--line); border-radius:12px; background:var(--cream); padding:.72rem 1.1rem; font-weight:720; min-height:46px; }
button:not(:disabled):active, .key:active { transform:translateY(2px) }
button:disabled { opacity:.6; cursor:wait }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, textarea:focus-visible { outline:3px solid #0e73a0; outline-offset:4px }
[tabindex="-1"]:focus:not(:focus-visible) { outline:0 }
a { color:var(--deep) }
.mast { max-width:1150px; margin:0 auto; padding:24px clamp(20px,4.4vw,64px) 18px; display:flex; align-items:center; justify-content:space-between; }
.wordmark { display:flex; align-items:center; gap:13px }
.wordmark b { font:900 1.12rem/1 "Archivo Black", "Arial Black", var(--mono); letter-spacing:.065em; transform:scaleX(1.05); transform-origin:left }
.pixel-frog { position:relative; width:33px; height:22px; display:block; background:var(--milk); border:3px solid var(--ink); border-radius:7px 7px 9px 9px; margin-top:5px }
.pixel-frog::before,.pixel-frog::after { content:""; position:absolute; top:-8px; width:10px; height:10px; border:2px solid var(--ink); border-radius:4px 4px 3px 3px; background:radial-gradient(circle at 55% 54%,var(--ink) 24%,#a2bc67 30%,#a2bc67 66%,var(--milk) 69%); }
.pixel-frog::before { left:1px }.pixel-frog::after { right:1px }
.beta-status { display:flex; align-items:center; gap:8px; font:650 .82rem/1.4 var(--mono),sans-serif; color:var(--mute) }
.beta-status i,.console-top i { width:8px; height:8px; background:#719445; border:1.5px solid #385331; border-radius:50%; }
main { width:100%; padding:0 clamp(18px,4vw,56px) max(38px,env(safe-area-inset-bottom)); }
.home { max-width:1030px; margin:clamp(40px,10vh,110px) auto; display:grid; grid-template-columns:.87fr 1.13fr; grid-template-rows:auto auto; column-gap:clamp(20px,4vw,70px); align-items:center; }
.intro-heading { grid-column:1; grid-row:1; align-self:end; }
.facts { font:650 .91rem/1.3 var(--mono),sans-serif; color:#4e5940; display:flex; gap:12px; align-items:center; margin:0 0 20px; }
.facts i { background:#7c8266; width:3px; height:3px; transform:rotate(45deg) }
.intro-heading h1 { font-size:clamp(52px,5.65vw,84px); line-height:1.1; font-weight:950; letter-spacing:-.055em; color:var(--deep); }
.intro-heading h1 span { display:block; margin-top:3px; }
.intro-actions { grid-column:1; grid-row:2; align-self:start; margin-top:23px }
.intro-copy { font-size:1.04rem; color:var(--mute); margin-bottom:22px; }
.start-key,.key { background:var(--deep); color:#fff9d6; border-color:var(--deep); box-shadow:0 3px 0 #18251a; }
.start-key { display:inline-flex; gap:17px; align-items:center; justify-content:center; font-size:1.09rem; border-radius:12px; min-width:189px; min-height:54px; letter-spacing:.05em; }
.start-key i { width:0; height:0; border-top:6px solid transparent; border-bottom:6px solid transparent; border-left:9px solid var(--milk); }
.start-key:not(:disabled):hover,.key:hover { background:#344d38; }
.start-key:not(:disabled):active,.key:active { box-shadow:0 1px 0 #18251a }
.info { margin-top:22px; max-width:390px; color:var(--mute); font-size:.89rem; }
.info summary { cursor:pointer; width:fit-content; min-height:36px; line-height:32px; }
.info[open] summary { margin-bottom:4px }
.info p,.info label { margin:8px 0; }
.info label { display:block;font-weight:700; }
.info input { max-width:100%; }
.device-scene { position:relative; isolation:isolate; grid-column:2; grid-row:1/3; width:100%; max-width:548px; justify-self:center; padding:22px 16px; }
.device-scene::before { content:"";position:absolute; z-index:-1; inset:-4% -2%;border-radius:48% 46% 49% 42%; transform:rotate(-9deg); background:repeating-linear-gradient(135deg,transparent,transparent 6px,#d8daa6 6px,#d8daa6 7px); opacity:.64; }
.console { position:relative; border:3px solid #413e23; border-radius:29px 31px 49px 33px; padding:13px 21px 17px; background:linear-gradient(155deg,#ffdc62 0%,#f9cd3c 72%); box-shadow:inset 0 4px 0 #ffe99c, inset -4px -6px 0 #dfad32, 0 5px 0 #615631, 6px 15px 0 #343c2726; transform:rotate(-3.5deg); }
.console-top { display:flex; justify-content:space-between; align-items:center; height:15px; padding:0 4px 7px; }
.console-top i { width:6px;height:6px }
.console-top span,.shell-bottom { background:repeating-linear-gradient(to right,var(--line) 0 3px,transparent 3px 7px); }
.console-top span { width:25px;height:3px;opacity:.6; }
.bezel { border-radius:16px 16px 24px 16px; background:#36483d; border:2px solid var(--line); padding:13px; box-shadow:inset 0 3px 0 #526557,0 2px 0 #fff0ac; }
.lcd { border:2px solid #202c24; border-radius:5px; overflow:hidden; background:#efdfb0; }
.lcd img { display:block; object-fit:cover; width:100%; height:auto; aspect-ratio:1.77; }
.controls { display:flex; align-items:center; justify-content:space-between; height:75px; padding:3px 4px 0; }
.dpad { width:42px; aspect-ratio:1; position:relative; filter:drop-shadow(0 3px 0 #192719); }
.dpad::before,.dpad::after { content:""; position:absolute; top:0;left:33%;width:35%;height:100%; background:#405243; border-radius:3px; }
.dpad::after { left:0;top:33%;width:100%;height:35%; }
.vents { align-self:flex-end;display:flex;gap:3px; margin-bottom:10px; }
.vents i { display:block;width:3px;height:12px;border-radius:2px;background:#927a37;transform:rotate(25deg); }
.pads { width:84px; display:flex; justify-content:space-around; transform:rotate(-15deg); }
.pads i { border-radius:50%; height:29px; width:29px; border:2px solid #413f26; box-shadow:0 3px 0 #5b552e, inset 0 2px 0 #f6eeae; background:#eef1bc; }
.pads i+i { background:#78916a; box-shadow:0 3px 0 #5b552e,inset 0 2px 0 #a6bd86; }
.spark { width:24px; aspect-ratio:1; position:absolute; z-index:1; background:#6a814d;clip-path:polygon(40% 0,60% 0,65% 34%,100% 42%,100% 58%,65% 64%,58% 100%,43% 100%,35% 65%,0 57%,0 43%,36% 35%); }
.spark-one { right:5%;top:-6%; }.spark-two { left:-2%;bottom:10%;width:13px; }.spark-three { right:-2%;top:4%;width:11px;background:#e4b53a; }
.status { color:var(--mute); font-size:.94rem; }.status:not(:empty) { margin:10px 0; }
@media (max-width:700px) {
  .mast { padding:18px 21px 13px; }
  main { padding-inline:18px; }
  .home { margin:24px auto 20px; max-width:470px; grid-template-columns:1fr; row-gap:16px; }
  .intro-heading,.intro-actions,.device-scene { grid-column:1; grid-row:auto; }
  .intro-heading,.intro-actions { text-align:center; }
  .facts { justify-content:center; margin-bottom:10px; font-size:.84rem; }
  .intro-heading h1 { font-size:clamp(37px,9.4vw,55px); letter-spacing:-.055em; }
  .intro-heading h1 span { display:inline; }
  .device-scene { max-width:365px; width:90%; padding:12px 10px; }
  .console { border-radius:21px 22px 37px 26px;padding:8px 13px 8px; }
  .bezel { padding:8px;border-radius:10px 11px 17px 11px; }
  .controls { height:48px; }.dpad { width:30px; }.pads {width:62px}.pads i {width:21px;height:21px}
  .intro-actions { margin:0; }.intro-copy { font-size:.97rem; margin:2px 0 16px; }
  .start-key { min-width:188px;min-height:50px; }
  .info { margin:15px auto 0; text-align:start; }.info summary { margin-inline:auto; }
  .spark-one { top:0;right:2%;width:17px; }
}
.quiz { width:min(100%,650px); margin:16px auto 0; }
.quiz-top { position:sticky; z-index:4; top:0; display:grid;grid-template-columns:auto 1fr auto; gap:14px; align-items:center; padding:9px 1px 14px; background:var(--paper); color:var(--deep); font-size:.87rem; font-weight:720; }
#count { font:700 .96rem/1.3 var(--mono); letter-spacing:.04em; white-space:nowrap; }
.meter { border:2px solid var(--line); border-radius:4px; overflow:hidden; height:12px; background:#ebe9d8; }
#progress { display:block; width:100%; height:100%; border:0; padding:0; background:#ebe9d8; appearance:none; color:#628051; }
#progress::-webkit-progress-bar { background:#ebe9d8; }
#progress::-webkit-progress-value { background:repeating-linear-gradient(90deg,#627d52 0 9px,#85a065 9px 11px); }
#progress::-moz-progress-bar { background:#627d52; }
.quiz-panel { background:linear-gradient(135deg,#ffdb5a,#f7cd42); border:2px solid var(--line); border-radius:23px 23px 33px 23px; padding:clamp(12px,3.8vw,25px); box-shadow:inset 0 3px 0 #ffeaa2,inset -2px -4px 0 #e6b534,0 4px 0 #5e5930; }
.display { background:#e8efcf; position:relative; border:5px solid #3e5140; padding:26px clamp(13px,2vw,24px) 18px; border-radius:12px 12px 19px 12px; box-shadow:inset 0 3px 0 #bfcca6,0 2px 0 #ffeb95; }
.screen-trim { display:flex; gap:3px; position:absolute;right:12px;top:9px; }
.screen-trim i {width:3px;height:6px; background:#a0b38a; }
.stem-slot,.text-sizer,#choice-sizer { display:grid; }
.stem-slot > *, .text-sizer > *,#choice-sizer > * { grid-area:1/1; }
.stem-slot { align-items:center; }
#question-title,.text-sizer { font-size:clamp(1.16rem,1.35vw + .65rem,1.52rem); font-weight:780; line-height:1.55; letter-spacing:.004em; overflow-wrap:anywhere; }
#question-title { z-index:1; }
.text-sizer,#choice-sizer { visibility:hidden; pointer-events:none; user-select:none; }
.answer-stage { margin-top:19px; position:relative; }
#choice-sizer { position:absolute; inset:0 0 auto 0; padding:11px 14px 11px 57px; border:2px solid transparent; min-height:51px; }
#choice-sizer,.choice {font-size:1rem;font-weight:620;line-height:1.48;overflow-wrap:anywhere; }
#options { display:grid;grid-template-rows:repeat(4,minmax(var(--choice-h,51px),auto)); gap:9px; }
button.choice { display:grid;grid-template-columns:30px minmax(0,1fr);align-items:center;text-align:left; gap:12px; width:100%; min-height:var(--choice-h,51px); background:#fffbea; border:2px solid var(--line); border-radius:11px; padding:8px 13px; box-shadow:0 3px 0 #88712e; }
button.choice:active { box-shadow:0 1px 0 #88712e; background:#e7edc3; }
@media(hover:hover) {.choice:hover {background:#edf1d4;}}
.letter { border-radius:6px; min-width:27px; height:27px; display:inline-grid;place-items:center; font:700 .93rem var(--mono); color:var(--deep); background:#e7ead2; }
.shell-bottom { height:5px; width:35px; border-radius:2px; margin:16px 0 0 auto; opacity:.55; }
@media(max-width:620px) {
 body[data-screen=question] .mast {padding-top:14px;padding-bottom:10px;}
 .quiz {margin-top:0;}.quiz-top {gap:11px;}.display {padding-top:19px;padding-bottom:13px;}
 .answer-stage {margin-top:15px;}.quiz-panel {padding:13px 12px 11px;border-radius:18px 18px 28px 18px;}
 .shell-bottom {margin-top:12px;}
}
.waiting { margin:clamp(70px,18vh,165px) auto; text-align:center; max-width:535px; padding:25px 20px; }
.spinner { width:52px;height:52px;margin:0 auto 22px;border:6px solid #e7d892;border-top-color:#435b3d;border-right-color:#efb923;border-radius:50%;animation:spin .8s linear infinite; }
.waiting h1 {font-size:1.5rem;}.waiting a {display:inline-block;margin-top:16px;}
@keyframes spin {to{transform:rotate(360deg)}}
#result {max-width:625px;margin:12px auto 0; outline:0;}
.result-group {margin-bottom:22px;}
.frog {outline:0;}
.primary .frog,.lead .frog,.frog.sealed {border:2px solid var(--line);border-radius:21px;overflow:hidden; background:var(--cream);box-shadow:0 4px 0 #d7c989;}
.primary .frog + .frog,.lead .frog + .frog {margin-top:16px;}
.role-art {width:100%;display:block;max-height:min(55svh,470px);object-fit:contain;background:#ece8cb;}
.frog .name {font-size:clamp(1.7rem,4vw,2.5rem);font-weight:850;line-height:1.15;letter-spacing:-.035em;}
.primary .name,.lead .name {margin:20px 22px 0;}
.similarity {color:var(--deep);}
.primary .similarity,.lead .similarity {margin:13px 22px 17px;}
.similarity-label,.similarity-value {font-size:.88rem;font-weight:650;}
.similarity-value {font:700 .95rem var(--mono);}
.similarity-track {margin:5px 0 0;height:10px;background:#e8e5d0;border:1px solid #636c4a;border-radius:4px;overflow:hidden;}
.similarity-fill {display:block;height:100%;background:repeating-linear-gradient(90deg,#f1c843 0 13px,#e1b235 13px 15px);}
.similarity-track.negative .similarity-fill {margin-left:auto;background:#8a9290;}
.result-poem {margin:18px 22px;padding-left:14px;border-left:3px solid #e4bb3b;white-space:pre-line;font:500 1.08rem/1.8 "Noto Serif CJK SC","Songti SC",SimSun,serif;}
.result-analysis,.blurb {margin:15px 22px 22px;color:#41503d;font-size:1rem;line-height:1.8;}
.result-analysis p+p {margin-top:9px;}
.other-title {font-size:1rem;margin:20px 0 9px;}
.secondary .frog:not(.sealed) {margin:6px 0;padding:14px 17px;background:#f0f0da;border:1px solid #c6c9ab;border-radius:11px;}
.secondary .name {font-size:1.15rem;}
.secondary .similarity {margin-top:8px;}
.sealed {padding:clamp(22px,5vw,38px);background:radial-gradient(ellipse at 95% 0,#456245,transparent 65%),#263d32 !important;color:#fff6cf;}
.teaser {font:550 clamp(1.14rem,3vw,1.45rem)/1.7 "Songti SC",SimSun,serif;white-space:pre-line;}
.reveal-button {margin-top:18px;background:var(--milk); box-shadow:0 3px 0 #182b20;}
.sealed .status,.sealed .hint {color:#edecd2;}
.dissolving .teaser,.teaser.dissolving {animation:dissolve .43s ease-in both;}
.revealed {animation:reveal .44s ease-out;}
@keyframes dissolve {to {opacity:0;filter:blur(7px); transform:translateY(-3px);}}
@keyframes reveal {from{opacity:.18;transform:translateY(5px);}to{opacity:1;transform:none;}}
.result-footer {margin:24px 0 0;}
.action-grid {display:flex;flex-wrap:wrap;gap:10px; justify-content:center; margin:14px 0;}
.result-footer .action-grid > button {flex:1 1 145px;}
.tool-panel {padding:14px 0;text-align:center;}
.tool-panel img {width:auto;display:block;max-width:100%;max-height:450px;margin:8px auto;object-fit:contain;}
.tool-panel a {display:inline-flex;text-decoration:none;padding:8px 18px;border-radius:10px;align-items:center;min-height:44px;}
.tool-panel label {display:block;margin-bottom:6px;}
.tool-panel textarea {width:100%;display:block;resize:vertical;padding:10px;border:1px solid #889279;border-radius:8px;margin:0 0 8px;}
.tool-panel p,.export-row p {font-size:.85rem;color:var(--mute);}
.export-row {border-top:1px solid #c3c5ad;text-align:center;padding:19px 0 10px;margin:20px 0 0;}
.export-row p {margin-top:6px;}.export-row button {background:transparent;}
.replay-row {text-align:center;margin-top:8px;}
#restart {min-width:159px;background:var(--milk);box-shadow:0 3px 0 #716839;}
.result-footer .status {text-align:center;}
@media(prefers-reduced-motion:reduce) {*,*::before,*::after {animation-duration:.01ms !important;animation-iteration-count:1 !important;transition:none !important;scroll-behavior:auto !important;}.spinner{border-style:dotted;}}
.similarity-label {display:flex;align-items:baseline;justify-content:space-between;gap:12px;}
.secondary .frog:not(.sealed):has(.role-art) {display:grid;grid-template-columns:66px minmax(0,1fr);grid-template-rows:auto auto;column-gap:14px;align-items:center;}
.secondary .role-art {grid-row:1/3;align-self:center;width:66px;height:66px;border-radius:7px;object-fit:contain;background:#e6e6d1;}
.secondary .name,.secondary .similarity {grid-column:-2/-1;}
.empty-result {padding:26px 20px; border:2px solid var(--line); border-radius:16px; background:var(--cream);}
