:root {
  color-scheme: light;
  font-family: "Noto Sans JP", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 16px;
  color: #282319;
  background: #f6f1e7;
  --ink: #282319;
  --muted: #5f5546;
  --line: #d9ccba;
  --surface: #fffaf0;
  --paper: #fffcf5;
  --accent: #f3ba49;
  --outline: #81521d;
  --show-color: #b45b16;
  --charge-light: 0;
  --stage-size: min(710px, max(265px,calc(100svh - 218px)), calc(100vw - 44px));
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(ellipse at 15% 0%, #fffaf0, transparent 62%), #f3eee3;
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
.game {
  min-height: 100svh;
  height: max(540px,100svh);
  max-width: 1270px;
  margin: auto;
  padding: 17px 25px 18px;
  display: grid;
  grid-template-rows: 66px minmax(0,1fr) auto;
}
.header { display:flex; align-items:center; gap:12px; padding-bottom:14px; }
h1 { margin:0 auto 0 0; font-size:clamp(23px,3.35vw,40px); font-weight:900; line-height:1.16; letter-spacing:-.06em; white-space:nowrap; }
h1 span { color:#8c4519; }
.header-stats,.header-menu { display:flex; gap:8px; align-items:center; }
.header-menu { padding-left:12px; border-left:1px solid var(--line); }
.wallet,.counter { display:flex; align-items:baseline; gap:6px; white-space:nowrap; }
.wallet { align-items:center; justify-content:center; min-height:40px; min-width:61px; padding:4px 11px; border:1px solid #d9bd80; border-radius:10px; background:#fff2cb; color:#594015; }
.counter { padding:4px 9px; }
.counter strong { font-size:24px; line-height:1; font-weight:900; }
.counter-label,.counter-unit { font-size:13px; font-weight:700; color:var(--muted); }
.counter-unit { margin-left:3px; }
.coin-mark { width:13px; height:13px; border:2px solid #b47c2b; border-radius:50%; background:#ffd671; box-shadow:inset 0 0 0 1px #fff0b0; }
button, select {
  min-height:43px; padding:8px 14px; border:1px solid var(--line); border-radius:10px; color:var(--ink);
  font:inherit; font-size:14px; font-weight:700; background:var(--paper); cursor:pointer;
}
button:hover, button[aria-pressed="true"] { background:#f3e7d1; border-color:#bfa26f; }
button:focus-visible, select:focus-visible, input:focus-visible { outline:2px solid var(--outline); outline-offset:3px; }
button:disabled { color:#63594a; background:#f0ece3; cursor:default; }
#open-market,#sell-all:not(:disabled),button.start { background:var(--accent); border-color:#a67124; color:#302212; }
#open-market:hover,#sell-all:not(:disabled):hover,button.start:hover { background:#ffcf67; }
button.start { min-height:44px; padding-inline:28px; font-weight:900; }
.header-menu button { white-space:nowrap; }

.play-area {
  --stage-light:#fbf0d3; --stage-mid:#e7c999; --stage-edge:#b48c62; --horizon:#7d583254;
  --stage-ink:#301e16; --stage-shadow:#80522352; --stage-badge:#fff4d6;
  --platform:#fff5d17f; --platform-edge:#85562a75;
  position:relative; display:grid; place-items:center; min-height:0; overflow:hidden; isolation:isolate;
  border-radius:22px; border:1px solid var(--stage-edge);
  background:linear-gradient(0deg,var(--horizon),transparent 25%),
    radial-gradient(ellipse at 49% 47%,var(--stage-light),transparent 70%),linear-gradient(120deg,var(--stage-edge),var(--stage-mid) 65%,var(--stage-edge));
  box-shadow:0 10px 23px #53391712, inset 0 1px 0 #ffffff80;
}
.play-area[data-biome="grove"] { --stage-light:#dfedaa; --stage-mid:#9cb56e; --stage-edge:#627a4f; --horizon:#283b3355; --stage-badge:#ecf0d8; --platform:#edf6bb67; --platform-edge:#36472c92; }
.play-area[data-biome="bloom"] { --stage-light:#ffe2cb; --stage-mid:#e4a99c; --stage-edge:#aa695e; --horizon:#783f5266; --stage-badge:#fff0e6; --platform:#fff5e37a; --platform-edge:#89545398; }
.play-area[data-biome="jade"] { --stage-light:#8bbc9f; --stage-mid:#3a6b5b; --stage-edge:#173d36; --horizon:#9cdfba57; --stage-badge:#e7f8ec; --stage-ink:#194031; --platform:#b5e7b66b; --platform-edge:#94dbb396; }
.play-area[data-biome="moon"] { --stage-light:#735b9b; --stage-mid:#383553; --stage-edge:#1d1b39; --horizon:#a99ee26b; --stage-badge:#f4edff; --stage-ink:#362640; --platform:#dcc4ff70; --platform-edge:#f2d9ff88; }
.play-area[data-biome="frost"] {
  --stage-light:#739eb6; --stage-mid:#273c56; --stage-edge:#111e35; --horizon:#73b9e26d;
  --stage-badge:#e3f4fb; --stage-ink:#102b42; --stage-shadow:#0f3859af; --platform:#a4d8f272; --platform-edge:#afedffaa;
}
.play-area[data-biome="volcano"] {
  --stage-light:#b04022; --stage-mid:#512321; --stage-edge:#211415; --horizon:#e646144f;
  --stage-badge:#fff0df; --stage-ink:#442013; --stage-shadow:#210c07c4; --platform:#591d16a6; --platform-edge:#f16a3db3;
}
.play-area[data-biome="pearl"] { --stage-light:#f5e7ff; --stage-mid:#c9bbdf; --stage-edge:#8e81ae; --horizon:#534b7566; --stage-badge:#f9f2ff; --platform:#eee4ffa3; --platform-edge:#55466988; }
.play-area[data-biome="thunder"] { --stage-light:#687c95; --stage-mid:#243755; --stage-edge:#182039; --horizon:#a4a75071; --stage-badge:#fcf3d1; --stage-ink:#24323c; --platform:#b9c7ec6b; --platform-edge:#ebecb3a6; }
.play-area[data-biome="ocean"] { --stage-light:#397fa6; --stage-mid:#1c4267; --stage-edge:#0d203b; --horizon:#6aced268; --stage-badge:#e5f7fb; --stage-ink:#163044; --platform:#66c8ea6b; --platform-edge:#9ce8e9a6; }
.play-area[data-biome="prism"] { --stage-light:#b88ac0; --stage-mid:#594c8a; --stage-edge:#302648; --horizon:#7796cc7b; --stage-badge:#f5eaff; --stage-ink:#3a2448; --platform:#bda4ef6b; --platform-edge:#f7ceff9c; }
.play-area[data-biome="sun"] { --stage-light:#ffc263; --stage-mid:#b45319; --stage-edge:#5e2917; --horizon:#ff723755; --stage-badge:#fff3d1; --stage-ink:#4a250b; --platform:#ffbc766b; --platform-edge:#ffbc76a6; }
.play-area[data-world="hive"] { --stage-light:#fff1a5; --stage-mid:#c99140; --stage-edge:#886243; --stage-badge:#fff3d2; }
.play-area[data-world="candy"] { --stage-light:#ffe5f1; --stage-mid:#e59bcc; --stage-edge:#ad82ba; --stage-badge:#fff0ff; }
.play-area[data-world="cavern"] { --stage-light:#7964a1; --stage-mid:#332440; --stage-edge:#1b1324; }
.play-area[data-world="reef"] { --stage-light:#81b5ac; --stage-mid:#343d5c; --stage-edge:#302349; --stage-badge:#fff1e9; }
.play-area[data-world="wind"] { --stage-light:#defee9; --stage-mid:#71c7a8; --stage-edge:#3b7b66; }
.play-area[data-world="fungus"] { --stage-light:#d2a366; --stage-mid:#584635; --stage-edge:#312722; --stage-badge:#fff0d8; }
.play-area[data-world="machine"] { --stage-light:#dfaf74; --stage-mid:#77644d; --stage-edge:#4b362c; }
.play-area[data-world="aurora"] { --stage-light:#536fa2; --stage-mid:#273757; --stage-edge:#151a36; }
.play-area[data-world="spirit"] { --stage-light:#a4b8c8; --stage-mid:#5a6a81; --stage-edge:#26354b; }
.play-area[data-world="neon"] { --stage-light:#8f4eac; --stage-mid:#382456; --stage-edge:#181533; }
.play-area[data-world="meteor"],.play-area[data-world="galaxy"] { --stage-light:#523e81; --stage-mid:#242750; --stage-edge:#101a31; }
.play-area[data-world="eclipse"] { --stage-light:#816a88; --stage-mid:#392e4c; --stage-edge:#1c172a; --stage-badge:#fff0d7; }
.play-area::after {
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; z-index:0;
  box-shadow:inset 0 0 24px var(--show-color),inset 0 0 0 2px var(--show-color);
  opacity:calc(var(--charge-light)*.40);
}
#atmosphere,#fruit-pile { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:0; }
.fruit-trays { position:absolute; inset:0; pointer-events:none; }
.fruit-trays i {
  position:absolute; bottom:2.8%; width:27%; height:5.5%; border-radius:50%; border:1px solid var(--platform-edge);
  background:radial-gradient(ellipse at center,var(--platform),transparent 80%);
  box-shadow:0 5px 10px var(--stage-shadow),inset 0 -4px 6px var(--stage-shadow);
}
.fruit-trays i:first-child { left:2.5%; }
.fruit-trays i:last-child { right:2.5%; }
.scene { width:var(--stage-size); height:var(--stage-size); position:relative; z-index:1; }
#banana-3d,.scene #banana { position:absolute; inset:0; width:100%; height:100%; }
.scene.has-3d #banana > :not(defs):not(#target) { display:none; }
#banana { overflow:visible; touch-action:none; user-select:none; -webkit-user-select:none; }
#banana.is-ready #hit { cursor:grab; }
#banana.is-dragging { cursor:grabbing; }
#target-halo { fill:#fffcde; fill-opacity:.9; stroke:#412411; stroke-width:2.7; }
#target-mark { stroke:#412411; stroke-width:2.4; }
#banana.is-intro #target { opacity:.80; }

.variety-now,.route,.stock-tag { color:var(--stage-ink); z-index:2; position:absolute; }
.variety-now {
  top:17px; left:17px; max-width:36%; display:grid; gap:4px; padding:12px 15px; border-radius:12px;
  border:1px solid color-mix(in srgb,var(--stage-ink) 23%,transparent); background:var(--stage-badge); pointer-events:none;
  box-shadow:0 4px 13px var(--stage-shadow);
}
.variety-now h2 { font-size:clamp(17px,2.4vw,30px); line-height:1.15; letter-spacing:-.04em; margin:0; }
.variety-now span { font-size:13px; font-weight:650; line-height:1.55; }
.stock-tag {
  left:16px; bottom:9px; display:flex; align-items:baseline; gap:5px; padding:5px 9px; border-radius:8px;
  background:var(--stage-badge); color:var(--stage-ink); font-size:12px; pointer-events:none; box-shadow:0 2px 8px var(--stage-shadow);
}
.stock-tag strong { font-size:17px; line-height:1; }
#yield-tag { border-left:1px solid currentColor; padding-left:7px; font-weight:750; }
.route {
  top:17px; right:17px; width:min(237px,30%); padding:11px 13px; border-radius:12px; background:var(--stage-badge);
  border:1px solid color-mix(in srgb,var(--stage-ink) 23%,transparent); box-shadow:0 4px 13px var(--stage-shadow);
}
.route-top { display:flex; flex-wrap:wrap; justify-content:space-between; gap:3px 7px; font-size:12px; font-weight:700; }
#chapter-name { display:block; margin:3px 0 6px; font-size:16px; }
#chapter-path { display:grid; grid-template-columns:repeat(6,1fr); gap:4px; list-style:none; padding:0; margin:0 0 9px; }
#chapter-path li { height:4px; border-radius:99px; background:color-mix(in srgb,var(--stage-ink) 19%,transparent); }
#chapter-path [data-state="passed"] { background:#aa7d4e; }
#chapter-path [aria-current="step"] { background:#81361b; }
.route-next { display:grid; gap:3px; border-top:1px solid color-mix(in srgb,var(--stage-ink) 22%,transparent); padding-top:8px; }
#goal-kind,#goal-after { font-size:12px; }
#goal-distance { font-size:13px; font-weight:700; }
#goal-name { font-size:16px; line-height:1.25; }
#goal-after { padding-top:2px; }
.unlock-news { margin:7px 0 1px; font-size:12px; font-weight:850; }
.is-focused .route,.is-focused #up-next { display:none; }

.footer { margin:0 auto; padding-top:10px; width:min(665px,100%); text-align:center; }
.instruction { margin:0 0 6px; font-size:clamp(17px,2vw,22px); line-height:1.3; font-weight:800; }
.meter { margin:0 auto; max-width:490px; gap:10px; display:flex; align-items:center; color:var(--muted); font-size:14px; font-weight:750; }
#peel-step,#peel-percent { flex:none; white-space:nowrap; text-align:center; min-width:3.3em; }
#peel-meter { flex:1; height:10px; display:grid; gap:4px; grid-template-columns:repeat(3,minmax(0,1fr)); }
#peel-meter span { border-radius:99px; background:#dfd3bf; position:relative; overflow:hidden; }
#peel-meter span::before {
  content:""; position:absolute; inset:0; transform:scaleX(var(--fill,0)); transform-origin:left;
  background:linear-gradient(90deg,#883910,color-mix(in srgb,var(--show-color) 72%,#edb842));
}
.controls { min-height:36px; display:flex; justify-content:center; align-items:center; gap:12px; margin-top:4px; }
#up-next,.audio-notice { color:var(--muted); font-size:13px; }
.audio-notice { margin:6px 0 0; }

dialog {
  padding:0; width:min(902px,calc(100vw - 32px)); max-height:calc(100svh - 34px); overflow:hidden;
  border:1px solid #c8b594; border-radius:19px; box-shadow:0 21px 85px #25140858; background:var(--paper); color:var(--ink);
}
dialog[open] { display:flex; flex-direction:column; }
dialog::backdrop { background:#241a145e; }
.catalog-header { display:flex; flex:none; justify-content:space-between; align-items:center; gap:13px; padding:16px 21px; border-bottom:1px solid var(--line); background:#fbf2df; }
.catalog-header h2 { font-size:clamp(23px,3vw,32px); margin:0; line-height:1.2; letter-spacing:-.035em; }
.catalog-header p { margin:5px 0 0; }
.catalog-header p,.catalog-note { font-size:13px; color:var(--muted); }
.dialog-body { overflow:auto; min-height:0; padding:15px 20px 18px; scrollbar-width:thin; scrollbar-color:#a28c70 transparent; }
.catalog-switch { padding:9px 20px; display:flex; gap:7px; border-bottom:1px solid var(--line); }
.catalog-switch button { border-radius:999px; min-height:38px; padding:6px 16px; }
.catalog-switch button[aria-pressed="true"] { border-color:#784b26; color:#fff7de; background:#673b20; }
.catalog-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(188px,1fr)); gap:10px; }
.catalog-card {
  display:grid; text-align:left; justify-items:start; align-content:start; gap:5px; min-height:92px; padding:10px 11px;
  border:1px solid var(--line); border-left:4px solid color-mix(in srgb,var(--card-color) 72%,#674537); background:#fffaf0;
  font-size:16px;
}
.catalog-card span { color:var(--muted); font-size:13px; font-weight:600; line-height:1.45; align-self:start; }
.catalog-card span:last-child { color:#69401b; font-size:12px; font-weight:800; margin-top:2px; }
.catalog-card:disabled { background:#f1ede4; }
.catalog-card[aria-pressed="true"] { background:#fff0c6; border-color:#a26b21; }
.catalog-card .catalog-thumb {
  width:100%; height:79px; padding:2px; display:grid; place-items:center; border-radius:7px; overflow:hidden;
  background:radial-gradient(ellipse at center,#fff6e1,color-mix(in srgb,var(--card-color) 39%,#fcf0d9));
}
.catalog-thumb img { width:min(100%,128px); height:75px; display:block; object-fit:contain; }
.catalog-card[disabled] img { filter:saturate(.6); }
.market-ledger { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.market-ledger > div,.market-upgrade { min-width:0; padding:9px 11px; border:1px solid var(--line); border-radius:11px; background:#faf0db; }
.market-ledger span { color:var(--muted); font-size:13px; }
.market-ledger strong { display:block; font-size:22px; overflow-wrap:anywhere; }
.market-ledger strong span { color:inherit; font-size:inherit; }
.market-sale { margin-top:11px; padding-bottom:4px; border-bottom:1px solid var(--line); }
.market-sale-buttons { display:flex; flex-wrap:wrap; gap:8px; }
.market-message { margin:7px 0; font-size:14px; color:#694019; font-weight:800; }
.market-message:empty { margin:0; }
.stock-prices { display:flex; flex-wrap:wrap; gap:6px 12px; padding:0; list-style:none; font-size:13px; color:var(--muted); }
dialog h3 { margin:13px 0 7px; font-size:16px; color:#744428; }
.market-upgrades { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.market-upgrade { display:grid; align-content:start; gap:5px; }
.market-upgrade p { margin:0; color:var(--muted); font-size:13px; }
.market-upgrade small { font-weight:750; color:#73411d; }
.market-upgrade button { width:100%; }
#settings { width:min(560px,calc(100vw - 32px)); }
.settings-group+section { margin-top:12px; }
.settings-group h3 { margin:1px 0 6px; }
.settings-row {
  display:flex; align-items:center; justify-content:space-between; gap:8px 14px; flex-wrap:wrap; min-height:60px;
  padding:8px 0; border-top:1px solid var(--line);
}
.settings-row > div { display:grid; gap:2px; }
.settings-row > div > label { font-weight:800; }
.settings-row > div span { color:var(--muted); font-size:13px; }
.settings-row button,.settings-row select { min-width:88px; }
#reset-progress { width:min(440px,calc(100vw - 32px)); }
.reset-content { padding:22px; }
.reset-content h2 { margin:0; font-size:clamp(19px,4.7vw,25px); }
.reset-content p { line-height:1.6; margin:12px 0 19px; }
.reset-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:9px; }
.reset-outline { color:#842d26; border-color:#c48272; }
.reset-confirm { background:#8a3128; color:#fff9f3; border-color:#742820; }
.reset-confirm:hover { background:#742820; color:#fff9f3; }
#reset-error { color:#842d26; font-weight:700; }
.volume-control { display:flex; align-items:center; gap:9px; font-size:14px; font-weight:750; }
input[type="range"] { accent-color:#9f4e20; width:115px; height:30px; cursor:pointer; }
output { min-width:38px; }

.effects-canvas { position:fixed; inset:0; width:100%; height:100%; z-index:5; pointer-events:none; }
.reward-badge { position:fixed; z-index:6; width:max-content; pointer-events:none; opacity:0; text-align:center; will-change:transform,opacity; }
.reward-badge strong {
  display:block; color:#fff7e8; font-size:clamp(25px,4.2vw,50px); line-height:1.05; font-weight:950; letter-spacing:-.075em;
  -webkit-text-stroke:1px #312127; paint-order:stroke fill; text-shadow:0 3px 0 #291e21,0 0 20px var(--burst-color);
}
.reward-badge.is-big strong {
  font-size:clamp(28px,min(7.8vw,12vh),107px); line-height:1.09; color:#fff6db;
  -webkit-text-stroke:clamp(2px,.85vw,9px) #241923; paint-order:stroke fill;
  text-shadow:0 0 26px var(--burst-color),0 6px 0 #321b25,0 10px 0 #1b141c;
}
.reward-badge.is-big[data-biome="volcano"] strong { color:#ffe19b; }
.reward-badge.is-big[data-biome="frost"] strong { color:#e8ffff; }
.reward-badge.is-big[data-biome="jade"] strong,.reward-badge.is-big[data-biome="ocean"] strong { color:#d6fff2; }
.reward-badge.is-big[data-biome="moon"] strong,.reward-badge.is-big[data-biome="prism"] strong { color:#f3e5ff; }
.reward-badge.is-big[data-biome="sun"] strong,.reward-badge.is-big[data-biome="thunder"] strong { color:#fff3aa; }
.reward-badge span {
  display:block; width:max-content; max-width:min(76vw,700px); margin:6px auto 0; padding:4px 10px 5px;
  border:1px solid var(--burst-color); border-radius:7px; color:#fff9ec; background:#261c23;
  font-size:clamp(12px,2vw,20px); font-weight:850; text-wrap:balance;
}
.reward-badge span:empty { display:none; }
.reward-badge.is-calm strong { font-size:clamp(24px,5.5vw,52px); color:#fff7e1; text-shadow:0 2px 5px #181215; }

@media (max-width:680px) {
  :root { --stage-size:min(max(224px,calc(100svh - 280px)),calc(100vw - 32px)); }
  .game { height:auto; min-height:100svh; padding:9px 10px 13px; grid-template-rows:auto minmax(340px,1fr) auto; }
  .header { flex-wrap:wrap; gap:6px; padding-bottom:8px; }
  .header-menu { margin-left:auto; padding-left:0; border:0; }
  .header-menu button { padding-inline:9px; min-height:38px; }
  .full-label { display:none; }
  .wallet { padding-inline:7px; min-width:0; min-height:34px; }
  .counter { padding-inline:3px; }
  .play-area { border-radius:15px; }
  .route,.variety-now { top:8px; max-width:45%; padding:7px 8px; }
  .variety-now { left:8px; }
  .variety-now span { font-size:11px; }
  .route { right:8px; width:min(145px,43%); }
  .route-top,#goal-kind,#goal-distance { font-size:11px; }
  #chapter-name,#goal-after { display:none; }
  #chapter-path { margin:4px 0; }
  .route-next { padding-top:4px; }
  #goal-name { font-size:13px; }
  .stock-tag { left:7px; bottom:6px; }
  .catalog-header,.dialog-body,.catalog-switch { padding-inline:12px; }
  .catalog-grid { grid-template-columns:repeat(auto-fit,minmax(min(139px,100%),1fr)); gap:7px; }
  .market-upgrades { grid-template-columns:1fr; }
}

.market-upgrade, .market-ledger, .market-sale, .stock-tag, #wallet-coins { overflow-wrap:anywhere; }
