:root {
  --ink: #3a2a33;
  --ink-soft: #7a6670;
  --bg: #f4eef0;
  --paper: #ffffff;
  --line: #eadde2;
  --rose: #c4577a;
  --rose-dark: #9a3d5c;
  --leaf: #4f8a5b;
  --soil: #8a6440;
  --gold: #f2b33d;
  --font: "Zen Maru Gothic", system-ui, sans-serif;
  --hand: "Kiwi Maru", "Zen Maru Gothic", serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-weight: 500; line-height: 1.7; line-break: strict; }
body[data-season="spring"] { --accent: #f2a7c0; } body[data-season="summer"] { --accent: #f5c838; } body[data-season="autumn"] { --accent: #e08a3c; } body[data-season="winter"] { --accent: #8fb6d9; }
[hidden] { display: none !important; }

.g-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; max-width: 560px; margin: 0 auto; font-size: 13px; font-weight: 900; }
.g-brand { color: var(--ink-soft); text-decoration: none; }
.g-title { flex: 1; text-align: center; }
.g-head [data-mg-account] a { color: var(--rose-dark); text-decoration: none; }
main { max-width: 560px; margin: 0 auto; padding: 0 12px 24px; }

/* 看板 */
.sign { position: relative; background: var(--paper); border-radius: 18px; padding: 14px 14px 12px; border-top: 6px solid var(--accent, var(--rose)); box-shadow: 0 8px 22px rgba(58, 42, 51, 0.08); }
.sign-name { font: 500 22px/1.3 var(--hand); color: var(--rose-dark); letter-spacing: 0.06em; }
.sign-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 4px; }
.money { flex: none; font-weight: 900; }
.money .lbl { display: block; font-size: 11px; color: var(--ink-soft); }
.money-v { white-space: nowrap; }
.money b { font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.1; margin-right: 2px; }
.season { margin: 0; font-size: 12px; font-weight: 700; color: var(--ink-soft); text-align: right; text-wrap: balance; }
.goal { margin-top: 8px; }
.goal-text { margin: 0 0 4px; font-size: 12px; font-weight: 900; }
.goal-track { height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; }
.goal-track span { display: block; height: 100%; background: var(--rose); border-radius: 999px; transition: width 0.4s; }

/* 注文 */
.order, .walk-item { margin-top: 0; background: #fff8ec; border: 2px solid #f2d6a2; border-radius: 16px; padding: 10px 12px 12px; }
.walk-item { background: var(--paper); border-color: var(--line); margin-top: 8px; }
.walk-item:first-child { margin-top: 0; }
.o-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.o-tag { flex: none; font-size: 11px; font-weight: 900; color: #fff; background: #d08a2c; border-radius: 999px; padding: 1px 8px; }
.walk-tag { background: var(--leaf); }
.o-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.oi { display: flex; align-items: center; gap: 4px; padding: 4px 10px 4px 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.8); border: 1px solid var(--line); font-size: 12px; font-weight: 700; line-height: 1.35; }
.oi svg { width: 30px; height: 36px; flex: none; }
.oi b { margin-left: 4px; }
.oi small { display: block; font-size: 10px; color: var(--ink-soft); font-weight: 500; }
.oi.ok { border-color: #9cc77f; background: #f1f8ec; }
.o-done { margin: 0; font-size: 13px; font-weight: 900; color: var(--leaf); }
.walk-none { margin: 8px 2px 0; font-size: 12px; color: var(--ink-soft); }

/* タブ */
.tabs { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 14px 0 10px; padding: 6px 0; background: var(--bg); }
.tabs button { position: relative; padding: 10px 2px; border: 0; border-radius: 12px; background: var(--paper); color: var(--ink-soft); font: 900 13px/1.2 var(--font); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--rose); color: #fff; }
.badge { position: absolute; top: -4px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #4a3200; font-size: 11px; line-height: 18px; }
.sub-h { margin: 14px 2px 6px; font-size: 16px; font-weight: 900; }
.panel-b > .sub-h:first-child { margin-top: 2px; }
.hint { margin: 6px 2px 8px; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }

/* 花壇 */
.garden { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 480px) { .garden { grid-template-columns: repeat(4, 1fr); } }
.plot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 8px; border: 0; border-radius: 16px; background: linear-gradient(#fff 60%, #f3e7da); font-family: var(--font); color: var(--ink); cursor: pointer; box-shadow: inset 0 -4px 0 #e7d5c1; }
.plot-art svg { display: block; width: 64px; height: 76px; }
.plot-name { font-size: 11px; font-weight: 700; line-height: 1.35; min-height: 2.7em; text-align: center; text-wrap: balance; }
.plot-act { font-size: 12px; font-weight: 900; color: var(--ink-soft); }
.plot-bar { width: 80%; height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; }
.plot-bar span { display: block; height: 100%; background: var(--leaf); border-radius: 999px; }
.plot.empty .plot-act { color: var(--rose-dark); }
@media (max-width: 359px) { .plot-name { font-size: 10px; letter-spacing: -0.02em; } }
.plot.empty .plot-name { color: var(--ink-soft); min-height: 1.35em; }
.plot.ready { background: linear-gradient(#fff6f9 60%, #f6dbe5); box-shadow: inset 0 -4px 0 #ecbfd0, 0 0 0 2px var(--rose); }
.plot.ready .plot-act { color: #fff; background: var(--rose); border-radius: 999px; padding: 0 12px; }
.plot.ready .plot-bar { display: none; }
.plot.ready .plot-art svg { animation: sway 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes sway { 50% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .plot.ready .plot-art svg { animation: none; } }

/* 保管・鉢 */
.stock, .pots, .seeds, .ups, .book, .hints, .pick { list-style: none; margin: 0; padding: 0; }
.stock { display: grid; gap: 6px; }
.stock li { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px; background: var(--paper); border-radius: 14px; padding: 4px 8px; }
.stock li svg { width: 36px; height: 43px; }
.stock li.none { display: block; padding: 12px; font-size: 13px; color: var(--ink-soft); }
.st-name { font-size: 13px; font-weight: 700; line-height: 1.4; }
.st-name b { margin-left: 6px; color: var(--rose-dark); }
.pots { display: grid; gap: 8px; }
.pot { display: flex; align-items: center; gap: 6px; background: var(--paper); border-radius: 14px; padding: 6px 8px; }
.pot svg { width: 34px; height: 41px; }
.pot .x { font-weight: 900; color: var(--ink-soft); }
.pot-t { flex: 1; font-size: 13px; font-weight: 700; }
.pot.empty .pot-t { color: var(--ink-soft); padding-left: 6px; }
.pot.ready { box-shadow: 0 0 0 2px var(--rose); }

/* 種屋 */
.seeds { display: grid; gap: 8px; }
.sp { background: var(--paper); border-radius: 14px; padding: 8px 10px 10px; }
.sp-h { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 15px; }
.tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); }
.tag.good { background: #eef7ea; color: var(--leaf); }
.sp-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.seed-btn { position: relative; display: flex; align-items: center; gap: 2px; padding: 3px 10px 3px 2px; border: 1px solid var(--line); border-radius: 12px; background: #fffaf3; font: 700 12px/1.3 var(--font); color: var(--ink); cursor: pointer; }
.seed-btn svg { width: 30px; height: 36px; }
.seed-btn small { display: block; font-size: 10px; color: var(--ink-soft); }
.seed-btn em { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--leaf); color: #fff; font: 900 11px/18px var(--font); font-style: normal; text-align: center; }
.seed-btn:disabled { opacity: 0.45; cursor: default; }
.ups { display: grid; gap: 6px; }
.ups li { display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 14px; padding: 8px 10px; }
.ups li > div { flex: 1; min-width: 0; }
.ups b { font-size: 14px; }
.ups .lv { margin-left: 6px; font-size: 12px; color: var(--rose-dark); font-weight: 900; }
.ups p { margin: 0; font-size: 12px; color: var(--ink-soft); line-height: 1.5; }

/* 図鑑 */
.book-head { display: flex; align-items: baseline; gap: 8px; }
.book-count { font-weight: 900; color: var(--rose-dark); }
.book-bonus { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #eef7ea; color: var(--leaf); }
.book-bonus:empty { display: none; }
.book { display: grid; gap: 8px; }
.book li { background: var(--paper); border-radius: 14px; padding: 8px 10px; }
.bk-sp { font-size: 14px; }
.bk-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; margin-top: 4px; }
.bk { display: flex; flex-direction: column; align-items: center; }
.bk svg { width: 36px; height: 43px; }
.bk small { font-size: 10px; font-weight: 700; color: var(--ink-soft); line-height: 1.3; white-space: nowrap; }
.hints { display: grid; gap: 4px; }
.hints li { background: var(--paper); border-radius: 10px; padding: 6px 12px; font-size: 13px; font-weight: 700; }
.hints span { margin: 0 2px; }
.hints b { margin-left: 4px; color: var(--rose-dark); }

/* ボタン */
.btn { display: block; width: 100%; margin: 8px 0 0; padding: 12px 10px; border: 0; border-radius: 14px; background: var(--rose); color: #fff; font: 900 15px/1.2 var(--font); cursor: pointer; box-shadow: 0 3px 0 var(--rose-dark); }
.btn:disabled { background: #e3d6db; color: #9b8a92; box-shadow: none; cursor: default; }
.btn.small { width: auto; display: inline-block; padding: 9px 16px; font-size: 13px; margin: 0; }
.btn.tiny { width: auto; flex: none; margin: 0; padding: 6px 10px; font-size: 12px; border-radius: 10px; box-shadow: 0 2px 0 var(--rose-dark); text-align: center; }
.btn.tiny small { display: block; font-size: 10px; font-weight: 700; opacity: 0.9; }
.btn.tiny:disabled { box-shadow: none; }
.btn.primary { background: var(--rose); }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--ink-soft); box-shadow: none; }
#b-harvest { margin-top: 10px; }
.records { margin: 14px 2px 0; font-size: 12px; color: var(--ink-soft); text-align: center; }
.panel { margin-top: 12px; display: grid; gap: 10px; }
.panel .mg-box { background: var(--paper); border-color: transparent; }

/* 小窓 */
.dlg { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(58, 42, 51, 0.5); }
.dlg-in { width: 100%; max-width: 400px; max-height: 86vh; overflow: auto; background: var(--paper); border-radius: 18px; padding: 20px 16px 16px; }
.dlg h2 { margin: 0 0 10px; font-size: 19px; font-weight: 900; text-align: center; }
.dlg p { margin: 0 0 10px; font-size: 14px; }
.sheet-wrap { place-items: end center; padding: 0; }
.sheet { max-width: 560px; border-radius: 20px 20px 0 0; padding: 14px 14px 22px; }
.sheet-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sheet-top h2 { flex: 1; margin: 0; text-align: left; font-size: 16px; }
.x-btn { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.sheet-note { font-size: 12px !important; color: var(--ink-soft); }
.sheet-empty { color: var(--ink-soft); }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pick button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 8px 6px 4px; border: 1px solid var(--line); border-radius: 12px; background: #fffaf3; font: 700 13px/1.35 var(--font); color: var(--ink); text-align: left; cursor: pointer; }
.pick svg { width: 34px; height: 41px; flex: none; }
.pick small { display: block; font-size: 11px; color: var(--ink-soft); font-weight: 500; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; width: max-content; max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 16px; background: rgba(154, 61, 92, 0.95); color: #fff; font-weight: 900; font-size: 14px; text-align: center; pointer-events: none; }

/* 下の解説（ポータルと同じ決まり） */
.guide { margin-top: 28px; background: var(--paper); border-radius: 18px; padding: 22px 20px 12px; font-size: 15px; line-height: 1.85; }
.guide p { margin: 0 0 1em; }
.guide h2 { font-size: 19px; margin: 32px 0 12px; padding-left: 10px; border-left: 5px solid var(--rose); line-height: 1.4; }
.guide h2:first-child { margin-top: 0; }
.guide h3 { font-size: 16px; margin: 22px 0 6px; line-height: 1.5; }
.guide .steps { list-style: none; padding: 0; margin: 0 0 1em; }
.guide .steps li { display: flex; align-items: baseline; gap: 6px; margin: 6px 0; }
.guide .steps .num { flex: none; font-weight: 900; color: var(--rose); }
.guide details { border-top: 1px solid var(--line); padding: 12px 0; }
.guide details p { margin: 8px 0 4px; }
.guide summary { font-weight: 900; cursor: pointer; }
.reset-row { text-align: center; margin-top: 16px !important; }
.g-foot { max-width: 560px; margin: 0 auto; padding: 14px 16px 28px; font-size: 12px; text-align: center; }
.g-foot a { color: var(--ink-soft); }
