:root {
  --ink: #26302a;
  --ink-soft: #66726a;
  --bg: #e9eee4;
  --paper: #ffffff;
  --line: #d4ddd0;
  --land: #b8d89a;
  --land-2: #aed08e;
  --water: #5fb0cf;
  --hill: #a89878;
  --green: #4a7a52;
  --green-dark: #345a3a;
  --accent: #e2683c;
  --font: "Zen Kaku Gothic New", system-ui, sans-serif;
  --hand: "Yusei Magic", "Zen Kaku Gothic New", sans-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; }
[hidden] { display: none !important; }
.g-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; max-width: 540px; 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; font-family: var(--hand); font-weight: 400; font-size: 16px; }
.g-head [data-mg-account] a { color: var(--green-dark); text-decoration: none; }
main { max-width: 540px; margin: 0 auto; padding: 0 12px 24px; }

.top { display: grid; grid-template-columns: 1fr 1.1fr 1.1fr; gap: 6px; }
.top > div { background: var(--paper); border-radius: 12px; padding: 6px 10px; }
.lbl { display: block; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.top b { font-size: 20px; font-weight: 900; line-height: 1.3; font-variant-numeric: tabular-nums; }
.t-name b { font: 400 20px/1.3 var(--hand); color: var(--green-dark); }
.top small { display: block; font-size: 10px; color: var(--ink-soft); line-height: 1.45; }
.req { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 12px; border-radius: 12px; background: #fff5e2; border: 2px solid #f0c878; font-size: 12px; line-height: 1.5; }
.req.done { background: #eef6ec; border-color: #9cc77f; }
.r-tag { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--green); color: #fff; font-weight: 900; font-size: 11px; }

.mapbox { position: relative; margin-top: 8px; padding: 6px; border-radius: 14px; background: #8fb072; box-shadow: 0 8px 20px rgba(38, 48, 42, 0.15); }
.map { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.tile { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 4px; background: var(--land); cursor: pointer; display: grid; place-items: center; }
.tile:nth-child(odd) { background: var(--land-2); }
.tile.water { background: var(--water); background-image: radial-gradient(circle at 30% 35%, rgba(255, 255, 255, 0.35) 0 12%, transparent 13%); cursor: default; }
.tile.hill { background: #c9c09a; cursor: default; }
.tile svg { width: 92%; height: 92%; display: block; }
.tile.sel { outline: 3px solid var(--accent); outline-offset: -1px; z-index: 1; }
.tile.heat::after { content: ""; position: absolute; inset: 0; border-radius: 4px; background: var(--heat); opacity: 0.55; }
.pips { position: absolute; right: 2px; bottom: 2px; display: flex; gap: 1px; }
.pips i { width: 4px; height: 4px; border-radius: 50%; background: #f2c14e; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3); }
.tile .smoke { animation: smoke 2s ease-in-out infinite; }
@keyframes smoke { 50% { transform: translateY(-2px); opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .tile .smoke { animation: none; } }
.heat-btn { display: block; margin: 6px auto 0; padding: 4px 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.85); font: 900 12px var(--font); color: var(--green-dark); cursor: pointer; }
.heat-btn[aria-pressed="true"] { background: var(--green-dark); color: #fff; }

.panel-op { margin-top: 8px; background: var(--paper); border-radius: 14px; padding: 10px; }
.p-hint { margin: 0; font-size: 13px; color: var(--ink-soft); text-align: center; }
.p-h { margin: 0 0 6px; font-size: 14px; font-weight: 900; }
.p-h .lv { margin-left: 8px; font-size: 12px; color: var(--accent); }
.p-info { margin: 0; font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.blist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bbtn { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-family: var(--font); color: var(--ink); text-align: left; cursor: pointer; }
.bbtn:disabled { opacity: 0.45; cursor: default; }
.bi svg { width: 36px; height: 36px; display: block; }
.bi.big svg { width: 56px; height: 56px; }
.bt b { font-size: 14px; }
.bt small { display: block; font-size: 11px; color: var(--ink-soft); line-height: 1.45; }
.bc { font-size: 13px; font-weight: 900; color: var(--green-dark); white-space: nowrap; }
.cur { display: flex; align-items: center; gap: 10px; }
.acts { display: grid; gap: 4px; margin-top: 8px; }
.goal { margin-top: 8px; background: var(--paper); border-radius: 12px; padding: 8px 12px 10px; }
.goal-text { margin: 0 0 4px; font-size: 12px; font-weight: 900; }
.goal-track { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.goal-track span { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.book-wrap { margin-top: 8px; background: var(--paper); border-radius: 12px; padding: 0 12px; }
.book-wrap summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; font-weight: 900; cursor: pointer; list-style: none; }
.book-wrap summary::-webkit-details-marker { display: none; }
.book-wrap summary b { color: var(--accent); font-size: 13px; }
.hint { margin: 0 0 8px; font-size: 12px; color: var(--ink-soft); }
.book { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.book li { padding: 6px 10px; border-radius: 10px; background: var(--bg); }
.book li.got { background: #fff5e2; border: 1px solid #f0c878; }
.book b { font-size: 13px; } .book small { display: block; font-size: 11px; color: var(--ink-soft); line-height: 1.4; }
.mg { margin-top: 12px; display: grid; gap: 10px; }
.mg .mg-box { background: var(--paper); border-color: transparent; }

.btn { display: block; width: 100%; margin: 8px 0 0; padding: 12px 10px; border: 0; border-radius: 12px; font: 900 15px/1.2 var(--font); cursor: pointer; background: var(--green); color: #fff; }
.btn:disabled { background: #dfe6dc; color: #8a968e; cursor: default; font-size: 13px; }
.btn.primary { background: var(--accent); box-shadow: 0 4px 0 #b44a24; }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--ink-soft); font-size: 13px; }
.dlg { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(30, 40, 32, 0.55); }
.dlg-in { width: 100%; max-width: 380px; background: var(--paper); border-radius: 18px; padding: 20px 18px 16px; text-align: center; }
.dlg h2 { margin: 0 0 10px; font: 400 26px/1.3 var(--hand); color: var(--green-dark); }
.dlg p { margin: 0 0 10px; font-size: 14px; text-align: left; }
.dlg .aw { text-align: center; } .dlg .aw b { font-size: 24px; color: var(--green-dark); }
.aw-pop { text-align: center !important; font-weight: 900; color: var(--accent); }
.aw-pop:empty { display: none; }
.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(52, 90, 58, 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(--green); 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(--green); }
.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; }
.reset-row .btn { display: inline-block; width: auto; padding: 8px 16px; font-size: 13px; background: transparent; border: 2px solid var(--line); color: var(--ink-soft); }
.g-foot { max-width: 540px; margin: 0 auto; padding: 14px 16px 28px; font-size: 12px; text-align: center; }
.g-foot a { color: var(--ink-soft); }
