/* Кустомания: a garden by day, a garden at night.
   Light = sage meadow, dark = the same meadow after sunset.
   One memorable thing: the living bush scene on the home tab.
   Everything else stays quiet: flat paper cards, one accent per job
   (sun = leaves and main actions, berry = HP and berries, dew = water). */

:root {
  --ground: #dbe5ca;
  --ground-2: #cfdcbb;
  --paper: #f5f8ec;
  --paper-2: #ebf0de;
  --line: #c3d0ad;
  --pine: #1f3b2c;
  --pine-2: #46604f;
  --moss: #4e7a3a;
  --moss-2: #6c9a4f;
  --sun: #f0ac2e;
  --sun-ink: #4a3204;
  --berry: #c23b5e;
  --dew: #3a89ab;
  --bark: #7a5a3a;
  --frost: #cfe3ef;
  --shadow: 0 1px 0 rgba(31, 59, 44, .08), 0 6px 18px -10px rgba(31, 59, 44, .35);
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --hand: "Neucha", "Comic Sans MS", cursive;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #13221a;
    --ground-2: #0f1c15;
    --paper: #1c3025;
    --paper-2: #23392d;
    --line: #2f4a3a;
    --pine: #e5eedb;
    --pine-2: #a9bca6;
    --moss: #8cc265;
    --moss-2: #6fa64d;
    --sun: #f4c055;
    --sun-ink: #3a2700;
    --berry: #ec6f92;
    --dew: #6dc0df;
    --bark: #b48a5e;
    --frost: #3a5566;
    --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 8px 22px -12px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  --ground: #13221a;
  --ground-2: #0f1c15;
  --paper: #1c3025;
  --paper-2: #23392d;
  --line: #2f4a3a;
  --pine: #e5eedb;
  --pine-2: #a9bca6;
  --moss: #8cc265;
  --moss-2: #6fa64d;
  --sun: #f4c055;
  --sun-ink: #3a2700;
  --berry: #ec6f92;
  --dew: #6dc0df;
  --bark: #b48a5e;
  --frost: #3a5566;
  --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 8px 22px -12px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ground);
  color: var(--pine);
  font: 600 15px/1.45 var(--body);
  font-variant-numeric: tabular-nums;
  overscroll-behavior-y: none;
  min-height: 100vh;
}
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; font-family: var(--hand); letter-spacing: .01em; }
h1 { font-size: 34px; line-height: 1.05; }
h2 { font-size: 26px; line-height: 1.1; }
h3 { font-size: 21px; line-height: 1.15; }
p { margin: 0; }
.muted { color: var(--pine-2); font-weight: 600; }
.small { font-size: 13px; }
.hand { font-family: var(--hand); font-weight: 400; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

#app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(96px + var(--safe-b)); }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; gap: 14px;
  background: var(--ground); z-index: 50; text-align: center; transition: opacity .35s;
  font-family: var(--hand); font-size: 22px;
}
.boot.gone { opacity: 0; pointer-events: none; }
.boot-sprout {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 50% 0 50% 0;
  background: var(--moss); transform: rotate(-45deg); animation: sprout 1.2s ease-in-out infinite alternate;
}
@keyframes sprout { to { transform: rotate(-45deg) scale(1.15); background: var(--moss-2); } }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  padding: 10px 0 8px; background: var(--ground);
}
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px;
  background: var(--paper); box-shadow: var(--shadow); font-weight: 800; font-size: 14px; white-space: nowrap;
}
.pill .e { font-size: 15px; }
.level-pill { margin-left: auto; gap: 8px; }
.xp { width: 54px; height: 6px; border-radius: 9px; background: var(--paper-2); overflow: hidden; }
.xp > i { display: block; height: 100%; background: var(--moss); border-radius: 9px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); z-index: 20;
  width: min(528px, calc(100% - 24px));
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 6px;
  background: var(--paper); border-radius: 24px; box-shadow: 0 10px 30px -12px rgba(0,0,0,.45), 0 0 0 1px var(--line);
}
.tab {
  border: 0; background: none; padding: 6px 2px 5px; border-radius: 18px; display: grid; justify-items: center; gap: 1px;
  font-size: 11px; font-weight: 800; color: var(--pine-2); cursor: pointer;
}
.tab .ti { font-size: 22px; line-height: 1.1; filter: saturate(.6); transition: transform .2s; }
.tab.on { background: var(--ground); color: var(--pine); }
.tab.on .ti { filter: none; transform: translateY(-1px) scale(1.08); }
.tab .lock { font-size: 9px; }

/* ---------- generic blocks ---------- */
.stack { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.card {
  background: var(--paper); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; background: var(--paper-2); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 10px 2px 2px; }
.section-title h2 { font-size: 25px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  background: var(--paper-2); font-size: 12px; font-weight: 800; color: var(--pine-2);
}
.chip.good { background: color-mix(in srgb, var(--moss) 18%, transparent); color: var(--moss); }
.chip.bad { background: color-mix(in srgb, var(--berry) 16%, transparent); color: var(--berry); }
.chip.sun { background: color-mix(in srgb, var(--sun) 25%, transparent); color: var(--pine); }
.empty { text-align: center; padding: 22px 10px; color: var(--pine-2); }
.empty .hand { font-size: 22px; color: var(--pine); display: block; margin-bottom: 4px; }

.btn {
  border: 0; cursor: pointer; border-radius: 14px; padding: 11px 14px; font-weight: 800; font-size: 15px;
  background: var(--paper-2); color: var(--pine); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--sun); color: var(--sun-ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--sun) 60%, #000); }
.btn.green { background: var(--moss); color: var(--paper); box-shadow: 0 3px 0 color-mix(in srgb, var(--moss) 60%, #000); }
.btn.danger { background: var(--berry); color: #fff; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn[disabled] { filter: grayscale(.8) opacity(.55); cursor: default; transform: none; }

.bar { height: 10px; border-radius: 99px; background: var(--paper-2); overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--moss); transition: width .6s cubic-bezier(.2,.9,.3,1.2); }
.bar.water > i { background: var(--dew); }
.bar.season { height: 6px; margin: 8px 0 6px; }
.bar.season > i { background: var(--sun); }
.effects { margin: 4px 0 8px; padding-left: 18px; display: grid; gap: 3px; font-size: 14px; }
.effects li::marker { color: var(--moss); }
.bar.hp > i { background: var(--berry); }
.bar.hp.enemy > i { background: var(--bark); }
.bar.thick { height: 14px; }

/* ---------- home: the scene ---------- */
.scene {
  position: relative; border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 36 / 27;
  box-shadow: var(--shadow); background: var(--paper-2);
}
.scene svg { display: block; width: 100%; height: 100%; }
.scene .badge {
  position: absolute; top: 12px; left: 12px; padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.82); color: #1f3b2c; font-weight: 800; font-size: 13px; backdrop-filter: blur(6px);
}
.scene .badge.right { left: auto; right: 12px; }
.bush-sway { transform-origin: 180px 214px; animation: sway 6s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.4deg); } }
.splash .bush-sway { animation: sway 6s ease-in-out infinite, splash .7s ease-out; }
@keyframes splash { 30% { transform: scale(1.04, .96); } 60% { transform: scale(.98, 1.03); } }
.rain-drop { animation: rain 0.8s linear infinite; }
@keyframes rain { from { transform: translate(0, 0); } to { transform: translate(-80px, 300px); } }
.ripple { animation: ripple 1.6s ease-out infinite; }
@keyframes ripple { from { transform: scale(.2); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }
.glint { animation: glint 3s ease-in-out infinite; }
@keyframes glint { 0%, 100% { opacity: .15; } 50% { opacity: .95; } }
.leaf-fall { animation: leaffall 8s linear infinite; }
@keyframes leaffall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translate(24px, 60px) rotate(160deg); }
  100% { transform: translate(-10px, 130px) rotate(340deg); opacity: 0; }
}
.snow { animation: snow 7s linear infinite; }
@keyframes snow { from { transform: translate(0, -20px); } to { transform: translate(18px, 280px); } }
.sun-rays { transform-origin: 300px 52px; animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cloud { animation: drift 30s linear infinite alternate; }
@keyframes drift { to { transform: translateX(40px); } }
.aphid { animation: crawl 2.4s ease-in-out infinite alternate; }
@keyframes crawl { to { transform: translate(4px, -3px); } }
.firefly { animation: fly 5s ease-in-out infinite alternate; }
@keyframes fly { 50% { opacity: .2; } to { transform: translate(14px, -10px); } }

.bush-title { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin: 2px 4px; }
.bush-title h1 { font-size: 38px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--paper); border-radius: var(--r-md); padding: 11px 12px; box-shadow: var(--shadow); display: grid; gap: 7px; }
.stat .k { font-size: 12px; color: var(--pine-2); font-weight: 800; display: flex; justify-content: space-between; }
.stat .v { font-size: 20px; font-weight: 900; line-height: 1; }
.stat.wide { grid-column: span 2; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.act {
  border: 0; cursor: pointer; background: var(--paper); border-radius: 18px; padding: 12px 6px 10px;
  display: grid; justify-items: center; gap: 3px; box-shadow: var(--shadow); position: relative;
}
.act .ai { font-size: 27px; line-height: 1.1; }
.act .al { font-size: 13px; font-weight: 800; }
.act .as { font-size: 11px; color: var(--pine-2); font-weight: 700; }
.act.ready::after {
  content: ""; position: absolute; top: 8px; right: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--sun); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sun) 30%, transparent);
}
.act:active { transform: scale(.96); }
.act[disabled] { opacity: .5; }

.weather-strip { display: flex; gap: 12px; align-items: center; }
.weather-strip .big { font-size: 34px; }

/* ---------- lists ---------- */
.list { display: grid; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-md);
  background: var(--paper); box-shadow: var(--shadow);
}
.item .ie { font-size: 26px; width: 36px; text-align: center; flex: none; }
.item .it { font-weight: 800; }
.item.tap { cursor: pointer; }
.item.dim { opacity: .55; }
.qty { font-weight: 900; font-size: 18px; }

.inv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.inv {
  background: var(--paper); border-radius: 16px; padding: 10px 4px 8px; text-align: center; box-shadow: var(--shadow);
  border: 0; cursor: pointer; position: relative; display: grid; gap: 2px; justify-items: center;
}
.inv .ie { font-size: 28px; }
.inv .n { font-size: 11px; font-weight: 800; color: var(--pine-2); line-height: 1.1; }
.inv .q { position: absolute; top: 6px; right: 8px; font-weight: 900; font-size: 13px; }
.inv.zero { opacity: .35; }

.seg { display: flex; background: var(--paper-2); padding: 4px; border-radius: 14px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 6px; border-radius: 10px; font-weight: 800; font-size: 14px; cursor: pointer; color: var(--pine-2); }
.seg button.on { background: var(--paper); color: var(--pine); box-shadow: var(--shadow); }

.cost { display: flex; flex-wrap: wrap; gap: 6px; }
.cost .c { padding: 3px 8px; border-radius: 9px; background: var(--paper-2); font-size: 12px; font-weight: 800; }
.cost .c.short { background: color-mix(in srgb, var(--berry) 16%, transparent); color: var(--berry); }

/* ---------- forest ---------- */
.trail { position: relative; display: grid; gap: 0; }
.trail::before {
  content: ""; position: absolute; left: 33px; top: 30px; bottom: 30px; width: 4px;
  background: repeating-linear-gradient(var(--line) 0 8px, transparent 8px 16px); border-radius: 4px;
}
.stop { position: relative; display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.stop .dot {
  width: 70px; height: 70px; flex: none; border-radius: 24px; display: grid; place-items: center; font-size: 34px;
  background: var(--paper); box-shadow: var(--shadow); position: relative; z-index: 1;
}
.stop.locked .dot { filter: grayscale(1); opacity: .6; }
.stop .body { flex: 1; min-width: 0; }
.stop .body .t { font-family: var(--hand); font-size: 22px; line-height: 1.1; }
.cooldown { display: flex; align-items: center; gap: 8px; }

/* battle */
.battle { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.grid6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; padding: 10px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--moss) 16%, var(--paper)); touch-action: none; }
.cell { aspect-ratio: 1; border-radius: 10px; background: color-mix(in srgb, var(--moss) 10%, var(--paper)); display: grid; place-items: center; font-size: 25px; transition: background .2s; }
.cell.tree { background: transparent; font-size: 28px; }
.cell.me { background: color-mix(in srgb, var(--sun) 35%, var(--paper)); }
.cell.foe { background: color-mix(in srgb, var(--berry) 22%, var(--paper)); animation: lurk 1.4s ease-in-out infinite alternate; }
@keyframes lurk { to { transform: scale(1.08); } }
.dpad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 54px); gap: 6px; justify-content: center; }
.dpad .btn { padding: 0; font-size: 22px; }
.dpad .up { grid-column: 2; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 2; }
.dpad .right { grid-column: 3; grid-row: 2; }

.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.fighter { background: var(--paper); border-radius: var(--r-lg); padding: 12px; text-align: center; box-shadow: var(--shadow); position: relative; display: grid; gap: 6px; }
.fighter .fe { font-size: 56px; line-height: 1; }
.fighter .fn { font-family: var(--hand); font-size: 19px; line-height: 1.1; }
.vs { font-family: var(--hand); font-size: 24px; color: var(--pine-2); }
.hit { animation: hit .35s; }
@keyframes hit { 20% { transform: translateX(-6px) rotate(-3deg); } 40% { transform: translateX(6px) rotate(2deg); } 60% { transform: translateX(-3px); } }
.float {
  position: absolute; left: 50%; top: 44px; font-weight: 900; font-size: 24px; color: var(--berry);
  pointer-events: none; animation: float 1.1s ease-out forwards; text-shadow: 0 2px 0 var(--paper);
}
.float.heal { color: var(--moss); }
@keyframes float { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -46px); opacity: 0; } }
.log { display: grid; gap: 4px; font-size: 14px; max-height: 210px; overflow: auto; }
.log p { padding: 6px 10px; border-radius: 10px; background: var(--paper-2); }
.log p.new { animation: pop .3s; }
.log p.turn { background: none; text-align: center; font-family: var(--hand); font-size: 17px; color: var(--pine-2); padding: 2px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.notes { display: grid; gap: 4px; font-size: 13px; }
.resists { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }

/* tactical board */
.ap { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.ap i { width: 13px; height: 13px; border-radius: 50%; background: var(--paper-2); box-shadow: inset 0 0 0 2px var(--line); }
.ap i.on { background: var(--sun); box-shadow: none; }
.foes-strip { display: flex; gap: 6px; overflow-x: auto; }
.foe-chip { flex: 1 0 140px; border: 0; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); text-align: left; }
.foe-chip .fe { font-size: 26px; }
.foe-chip.reach { box-shadow: var(--shadow), inset 0 0 0 2px var(--berry); }
.tboard { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 6px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--moss) 28%, var(--paper)); touch-action: manipulation; }
.tcell { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 8px; cursor: pointer; display: grid; place-items: center;
  background: color-mix(in srgb, var(--moss) 14%, var(--paper)); font: inherit; color: inherit; overflow: visible; }
.tcell.exit { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--sun) 16%, var(--paper)) 0 6px, color-mix(in srgb, var(--moss) 14%, var(--paper)) 6px 12px); }
.tcell.t-T { background: color-mix(in srgb, var(--moss) 40%, var(--paper)); cursor: default; }
.tcell.t-B { background: color-mix(in srgb, var(--moss) 30%, var(--paper)); }
.tcell.t-R { background: color-mix(in srgb, var(--bark) 22%, var(--paper)); }
.tcell.t-W { background: color-mix(in srgb, var(--dew) 30%, var(--paper)); }
.tcell .tt { font-size: 26px; line-height: 1; }
.tcell .tm { position: absolute; left: 2px; top: 1px; font-size: 12px; opacity: .85; }
.tcell.move { box-shadow: inset 0 0 0 2px var(--moss); }
.tcell.move::after { content: ""; position: absolute; width: 22%; height: 22%; border-radius: 50%; background: var(--moss); opacity: .55; }
.tcell .cost { position: absolute; right: 3px; bottom: 1px; font-size: 10px; font-weight: 900; color: var(--moss); }
.tcell.me { box-shadow: inset 0 0 0 2px var(--sun); background: color-mix(in srgb, var(--sun) 30%, var(--paper)); }
.tcell.foe { background: color-mix(in srgb, var(--berry) 16%, var(--paper)); }
.tcell.target { box-shadow: inset 0 0 0 3px var(--berry); animation: lurk 1.2s ease-in-out infinite alternate; }
.unit { position: relative; font-size: 24px; line-height: 1; display: grid; justify-items: center; }
.unit.dead { opacity: .4; font-size: 18px; }
.uhp { display: block; width: 26px; height: 4px; border-radius: 3px; background: rgba(0,0,0,.18); margin-top: 2px; overflow: hidden; }
.uhp b { display: block; height: 100%; background: var(--berry); }
.uhp.e b { background: var(--bark); }
.chance { position: absolute; top: -7px; right: -4px; z-index: 2; padding: 1px 4px; border-radius: 7px; font-size: 10px; font-weight: 900;
  background: var(--berry); color: #fff; }
.tboard.bombing .tcell.target { box-shadow: inset 0 0 0 3px var(--sun); }
.legend { font-size: 13px; background: var(--paper-2); border-radius: 14px; padding: 8px 12px; }
.legend summary { cursor: pointer; font-weight: 800; }
.legend p { margin: 6px 0; }
.unit .float { top: -6px; font-size: 18px; }

/* dungeon */
.party { display: grid; gap: 6px; }
.member { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); }
.member.dead { opacity: .45; }
.member.me { box-shadow: var(--shadow), inset 0 0 0 2px var(--sun); }
.foes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.foe {
  border: 0; cursor: pointer; text-align: center; background: var(--paper); border-radius: 18px; padding: 10px; box-shadow: var(--shadow);
  display: grid; gap: 5px; position: relative;
}
.foe .fe { font-size: 44px; line-height: 1; }
.foe.sel { box-shadow: var(--shadow), inset 0 0 0 3px var(--berry); }
.foe.dead { opacity: .35; filter: grayscale(1); }
.foe.boss .fe { font-size: 60px; }
.timer { --p: 100; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 15px;
  background: conic-gradient(var(--sun) calc(var(--p) * 1%), var(--paper-2) 0); position: relative; }
.timer::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--paper); }
.timer span { position: relative; }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 20, 14, .45); z-index: 40; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(560px, 100%); z-index: 41;
  max-height: 88vh; overflow: auto; background: var(--ground); border-radius: 26px 26px 0 0;
  padding: 10px 16px calc(20px + var(--safe-b)); animation: up .28s cubic-bezier(.2,.9,.3,1);
}
@keyframes up { from { transform: translate(-50%, 100%); } }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { margin-bottom: 6px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 800; color: var(--pine-2); }
.input {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--paper);
  color: var(--pine); font: 700 16px var(--body);
}
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .input { text-align: center; }

/* ---------- toast ---------- */
#toast-root { position: fixed; left: 0; right: 0; top: 10px; z-index: 60; display: grid; justify-items: center; gap: 6px; pointer-events: none; padding: 0 16px; }
.toast {
  max-width: 520px; width: 100%; padding: 12px 14px; border-radius: 16px; background: var(--pine); color: var(--paper);
  font-weight: 700; font-size: 14px; white-space: pre-line; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5);
  animation: drop .3s cubic-bezier(.2,.9,.3,1.3); pointer-events: auto;
}
.toast.bad { background: var(--berry); color: #fff; }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }

/* onboarding */
.onboard { display: grid; gap: 14px; padding-top: 10px; }
.variety { border: 0; cursor: pointer; text-align: left; display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.variety .ve { font-size: 34px; }
.variety.on { box-shadow: var(--shadow), inset 0 0 0 3px var(--moss); }

/* ranking */
.rank { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
.rank .pos { font-family: var(--hand); font-size: 22px; text-align: center; }
.rank .who { min-width: 0; }
.rank .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ach { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; }
.ach .ae { font-size: 30px; text-align: center; }
.ach.locked .ae { filter: grayscale(1); opacity: .5; }

.rules p { margin-bottom: 8px; }
.rules h3 { margin: 12px 0 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 360px) {
  .inv-grid { grid-template-columns: repeat(3, 1fr); }
  h1, .bush-title h1 { font-size: 32px; }
}
