:root{--navy:#14213d;--ink:#1b2a4a;--sub:#42536e;--accent:#e07f00;--gold:#b57900;--blue:#2e7ddc;--paper:#f5f7fa;--line:#c9d4e3}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:"Hiragino Maru Gothic ProN","Hiragino Sans","Noto Sans JP",sans-serif;color:var(--ink);background:var(--paper);background-image:linear-gradient(#e6ecf4 1px,transparent 1px),linear-gradient(90deg,#e6ecf4 1px,transparent 1px);background-size:40px 40px;line-height:1.55}
main{max-width:1020px;margin:0 auto;padding:16px 14px 40px}
.badge{display:inline-block;background:var(--navy);color:#fff;font-weight:700;padding:6px 14px;border-radius:10px;font-size:14px}
h1{font-size:clamp(24px,5.4vw,38px);margin:12px 0 4px;color:var(--navy);line-height:1.25;min-height:2.5em}
.sub{font-size:clamp(17px,3.6vw,22px);font-weight:700;color:var(--accent);margin:0 0 8px;min-height:1.55em}
.lead{color:var(--ink);max-width:720px;margin:0 0 14px;min-height:4.6em}
.panel{background:rgba(255,255,255,.96);border:1.5px solid var(--line);border-radius:16px;padding:14px;margin:12px 0}
.spinrow{display:flex;flex-wrap:wrap;gap:12px;align-items:center;min-height:58px}
#flipBtn{font:inherit;font-weight:800;font-size:19px;min-height:58px;padding:12px 26px;border-radius:999px;border:3px solid var(--navy);background:#fff;color:var(--navy);cursor:pointer}
#flipBtn.on{background:var(--accent);color:#fff;border-color:var(--navy)}
#spinState{font-weight:700;font-size:17px}
#nextGoal{color:var(--gold);font-weight:700}
.tabs{display:flex;gap:8px;overflow-x:auto;padding:4px 0;-webkit-overflow-scrolling:touch;min-height:58px}
.tabbtn{font:inherit;font-weight:700;min-height:50px;padding:10px 20px;border-radius:12px;border:2px solid var(--navy);background:#fff;color:var(--navy);cursor:pointer;white-space:nowrap}
.tabbtn[aria-selected="true"]{background:var(--navy);color:#fff}
canvas{width:100%;height:auto;display:block;border-radius:10px}
.note{color:var(--sub);font-size:14px;margin:6px 0}
.meters{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px;margin-top:10px}
.meter{background:#fff;border:1.5px solid var(--line);border-radius:12px;padding:8px 12px}
.meter .lb{font-size:13px;color:var(--sub);font-weight:700}
.meter .vl{font-size:24px;font-weight:800;color:var(--navy)}
.controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;margin-top:10px}
.controls label{font-weight:700;font-size:14px;color:var(--sub);display:block;margin-bottom:4px}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px}
.chip{font:inherit;font-weight:700;min-height:48px;padding:8px 16px;border-radius:999px;border:2px solid var(--line);background:#fff;cursor:pointer;white-space:nowrap}
.chip.sel{border-color:var(--navy);background:var(--navy);color:#fff}
input[type=range]{width:100%;min-height:44px}
select,input[type=date]{font:inherit;min-height:48px;padding:8px;border:2px solid var(--line);border-radius:10px;background:#fff;width:100%}
button.act{font:inherit;font-weight:800;min-height:52px;padding:10px 22px;border-radius:12px;border:2.5px solid var(--navy);background:#fff;color:var(--navy);cursor:pointer}
button.act.primary{background:var(--accent);color:#fff}
.seg{display:flex;gap:8px;flex-wrap:wrap}
.seg button{font:inherit;font-weight:700;min-height:48px;padding:8px 18px;border-radius:10px;border:2px solid var(--navy);background:#fff;cursor:pointer}
.barWrap{background:#e3e8f0;border-radius:8px;height:24px;overflow:hidden}
#desertBar{background:#e0a83e;height:100%;width:92%;transition:width .6s ease}
.bigNum{font-size:32px;font-weight:800;color:var(--gold)}
figure{margin:10px 0}figure img{width:100%;height:auto;border:1px solid var(--line);border-radius:8px;background:#fff}
figcaption{font-size:13px;color:var(--sub)}
.challenge{border-top:1.5px solid var(--line);padding:10px 0}
.challenge:first-of-type{border-top:0}
.cq{font-weight:700;margin:4px 0 8px}
.copts{display:flex;gap:8px;flex-wrap:wrap}
.copts button{font:inherit;font-weight:700;min-height:50px;padding:10px 20px;border-radius:10px;border:2px solid var(--navy);background:#fff;cursor:pointer}
.cans{background:#fdf3d8;border-radius:10px;padding:10px 12px;font-weight:700}
.actions{display:flex;gap:10px;flex-wrap:wrap}
footer{color:var(--sub);font-size:13px;margin-top:22px}
:focus-visible{outline:3px solid var(--blue);outline-offset:2px}
@media (prefers-reduced-motion:reduce){#desertBar{transition:none}}
