:root{--bg:#fbf5ea;--ink:#2b2622;--mute:#6a5f55;--card:#fff;--line:#e8dccb;--accent:#2f7d5b;--warn:#b64a24;--soil:#8a5a3b;--pot:#d98b5f;--sky:#dcebf5;--sky1:#cfe6f3;--sky2:#fde8cf;--hill:#bfd9b4;--hill2:#a9cba0;--grass:#7fbf7a;--soil2:#a9724c;--peb:#c9a07a;--cl:#ffffff;--leaf:#4fa36f;--sun:#f4b73e}
html[data-theme=dark]{--bg:#1c1a18;--ink:#f3ece2;--mute:#b7aa9b;--card:#2a2623;--line:#43392f;--accent:#6fcf9c;--warn:#f08a62;--soil:#a8744f;--pot:#c97a4f;--sky:#26333d;--sky1:#1f2c3a;--sky2:#4a3a38;--hill:#2f4a3b;--hill2:#27402f;--grass:#4f9a62;--soil2:#6e4a33;--peb:#8a6a50;--cl:#5b6772;--leaf:#6fcf9c;--sun:#f4c35a}
*{box-sizing:border-box;margin:0}
html,body{height:100%}
body{background:var(--bg);color:var(--ink);font:16px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;max-width:720px;margin:0 auto;padding:env(safe-area-inset-top) 16px env(safe-area-inset-bottom);height:100dvh;overflow:hidden}
#top{display:flex;align-items:center;gap:8px;min-height:56px}h1{flex:1}
h1{font-size:20px}
.pill{min-width:44px;min-height:44px;border-radius:22px;border:1px solid var(--line);background:var(--card);color:var(--ink);font-size:20px;cursor:pointer}
#stage-wrap{min-height:0;display:flex;flex-direction:column;background:var(--sky);border-radius:20px;overflow:hidden}
#stage{width:100%;flex:1 1 auto;min-height:0;display:block}
#labels{display:flex;width:100%;justify-content:space-around;font-size:14px;font-weight:600;color:var(--mute);padding:6px 0;background:var(--card);border-top:1px solid var(--line)}
#card{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:14px 16px;margin-top:12px;min-height:108px}
#card p{font-size:17px}
#line1{font-weight:650}
#line2{color:var(--mute);margin-top:4px}
#tester{margin-top:10px}
#verdict{font-size:15px;font-weight:700;min-height:22px}
#verdict.ok{color:var(--accent)}#verdict.no{color:var(--warn)}
#switches{display:flex;gap:6px;margin-top:8px}
.sw{flex:1;min-height:44px;border-radius:14px;border:2px solid var(--line);background:var(--bg);color:var(--ink);font-size:15px;font-weight:600;cursor:pointer}
.sw[aria-pressed=true]{border-color:var(--warn);background:var(--warn);color:#fff}
.sw.fairon[aria-pressed=true]{border-color:var(--accent);background:var(--accent);color:#fff}
#dock{display:grid;grid-template-columns:44px minmax(0,1fr) 104px;align-items:center;gap:12px;padding:12px 0}
#btnNext{min-height:48px;border-radius:24px;border:0;background:var(--accent);color:#fff;font-size:17px;font-weight:700;cursor:pointer}
html[data-theme=dark] #btnNext{color:#12261c}
#btnBack[hidden]{visibility:hidden;display:block}
#dots{display:flex;gap:6px;justify-content:center}
#dots i{width:8px;height:8px;border-radius:4px;background:var(--line)}
#dots i.on{background:var(--accent);width:18px}
button:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
button:active{filter:brightness(.95)}
svg .grow{transition:transform .9s ease}
svg .fade{transition:opacity .5s ease}
@media (prefers-reduced-motion:reduce){svg .grow,svg .fade{transition:none}}
@media (orientation:landscape) and (max-height:480px){
  body{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;column-gap:16px;padding-bottom:max(10px,env(safe-area-inset-bottom))}
  #top{grid-column:1/3}#stage-wrap{grid-row:2/4;grid-column:1}#card{grid-column:2;grid-row:2;margin-top:0;overflow:auto;min-height:0;align-self:center}#card.t{padding:10px 14px}#card p{font-size:15px;line-height:1.3}#verdict{font-size:14px;min-height:0}#tester{margin-top:6px}#switches{margin-top:6px}#dock{grid-column:2;grid-row:3}
}

.drift{animation:drift 14s ease-in-out infinite alternate}.bob{animation:bob 3.2s ease-in-out infinite alternate}
@keyframes drift{to{transform:translateX(14px)}}@keyframes bob{to{transform:translateY(-6px)}}
@media (prefers-reduced-motion:reduce){.drift,.bob{animation:none}}
html[data-theme=dark] .sw[aria-pressed=true],html[data-theme=dark] .sw.fairon[aria-pressed=true]{color:#1c1a18}
svg.noanim .grow,svg.noanim .fade{transition:none}

.sw.col{min-width:44px;padding:0;border-width:3px;border-color:var(--c);background:var(--bg)}.sw.col[aria-pressed=true]{background:var(--c);border-color:var(--c)}.sw.col[aria-pressed=false]{background:var(--bg);color:transparent}
.sw.col:focus-visible{outline:3px solid var(--accent)}
svg .ray{transition:opacity .6s ease,transform .6s ease}
@media (prefers-reduced-motion:reduce){svg .ray{transition:none}}
svg.noanim .ray{transition:none}
#switches .col{flex:0 0 44px}#switches:has(.col){justify-content:space-between}
@media (max-width:340px){body{padding-left:8px;padding-right:8px}#card{padding:10px}h1{font-size:15px}}
#switches:has(.col){gap:2px}
.sw.col{box-shadow:0 0 0 1px var(--mute)}
.sw.pk{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;min-height:68px;padding:2px 4px;font-size:15px}
.sw.pk svg{width:56px;height:36px;display:block}
.sw.pk.bad{border-color:var(--warn)}
.sw.pk.rev{border-color:var(--ink);border-width:2px}
.sw.pk.good{border-color:var(--accent);background:var(--accent);color:#fff}
html[data-theme=dark] .sw.pk.good{color:#1c1a18}
.sw.act{flex:1;min-height:48px}
#switches:has(.pk){gap:8px}
@media (orientation:landscape) and (max-height:480px){.sw.pk{min-height:50px;flex-direction:row;gap:4px;padding:2px 6px}.sw.pk svg{width:34px;height:28px}#switches:has(.pk){gap:6px}#card{padding:8px 12px}#line2{margin-top:2px}}
@media (orientation:landscape) and (max-height:480px){.sw.pk{flex-direction:column;gap:0;min-height:48px;padding:0 2px;font-size:14px}.sw.pk svg{width:40px;height:22px}}

@media (orientation:landscape) and (max-height:480px){#card.t{padding:12px 14px}#card p{font-size:clamp(15px,4.8vh,21px)}#verdict{font-size:clamp(14px,4.2vh,19px)}.sw.pk{min-height:clamp(48px,15vh,76px)}.sw.pk svg{height:clamp(22px,7vh,40px)}#switches{margin-top:clamp(6px,2.4vh,14px)}}
@media (orientation:landscape) and (max-height:480px){#card.t{padding:clamp(12px,3.4vh,18px) 14px}#card:not(.t){padding:clamp(14px,4vh,22px) 16px}#card:not(.t) p{font-size:clamp(17px,6vh,26px);line-height:1.3}}
@media (orientation:landscape) and (max-height:480px){#card.tight{padding:5px 12px}#card.tight p{font-size:14px;line-height:1.25}#card.tight #verdict{font-size:14px;line-height:1.25;margin-top:4px}#card.tight #switches{margin-top:4px}}
@media (orientation:landscape) and (max-height:310px){#card.t{padding:6px 10px}#card.t p{font-size:14px;line-height:1.2}#card.t #line1{margin:0}#card.t .sw{min-height:44px}#card.t #switches,#card.t #verdict{margin-top:3px}}
@media (orientation:landscape) and (max-height:340px){#card.tw{padding:6px 12px}#card.tw p{line-height:1.2}#card.tw #switches{margin-top:4px}}
