:root {
  --ink: #233a3e;
  --ink-soft: #5f7579;
  --bg: #e6efee;
  --paper: #ffffff;
  --line: #cfdedc;
  --sea: #3f8a9a;
  --sea-dark: #2a6676;
  --sand: #efdcae;
  --grass: #a3cc7f;
  --forest: #6fa45f;
  --cliff: #c3bcae;
  --marsh: #8cbfa8;
  --accent: #e2683c;
  --font: "Zen Kaku Gothic New", system-ui, sans-serif;
  --hand: "Klee One", "Zen Kaku Gothic New", 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: 520px; 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); }
.g-head [data-mg-account] a { color: var(--sea-dark); text-decoration: none; }
main { max-width: 520px; margin: 0 auto; padding: 0 12px 24px; }

/* 上の数字 */
.top { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.top > div { background: var(--paper); border-radius: 14px; padding: 8px 12px; }
.lbl { display: block; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.top b { font-size: 22px; font-weight: 900; line-height: 1.25; font-variant-numeric: tabular-nums; }
.top small { display: block; font-size: 11px; color: var(--ink-soft); line-height: 1.4; }
.feat { margin: 8px 0 0; padding: 7px 12px; border-radius: 12px; background: #fff6e4; border: 1px solid #f0d49a; font-size: 12px; line-height: 1.5; }
.feat:empty { display: none; }
.feat b { color: var(--accent); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 10px 0 8px; }
.tabs button { padding: 10px 2px; border: 0; border-radius: 12px; background: var(--paper); color: var(--ink-soft); font: 900 14px/1.2 var(--font); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--sea); color: #fff; }

/* 島 */
.island { position: relative; width: 100%; aspect-ratio: 10 / 14; border-radius: 16px; overflow: hidden; background: var(--sea); cursor: pointer; user-select: none; -webkit-user-select: none; box-shadow: 0 8px 22px rgba(35, 58, 62, 0.18); }
.map { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(14, 1fr); }
.tile { position: relative; display: grid; place-items: center; }
.tile svg { width: 100%; height: 100%; }
.tile.sea { background: var(--sea); background-image: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.12) 0 10%, transparent 11%); }
.tile.beach { background: var(--sand); }
.tile.meadow { background: var(--grass); }
.tile.forest { background: var(--forest); }
.tile.cliff { background: var(--cliff); }
.tile.marsh { background: var(--marsh); }
.tile .leaf { fill: #3f7d4f; }
.tile.locked { filter: grayscale(0.7) brightness(0.8); }
.tile.locked::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.12) 0 4px, transparent 4px 9px); }
.island[data-season="spring"] .tile .leaf { fill: #f1a9c0; }
.island[data-season="autumn"] .tile .leaf { fill: #d9792f; }
.island[data-season="winter"] .tile.meadow { background: #e6ece8; }
.island[data-season="winter"] .tile .leaf { fill: #4f7a62; }
.island::after { content: ""; position: absolute; inset: 0; pointer-events: none; transition: background 0.6s; }
.island[data-time="dawn"]::after { background: rgba(255, 170, 120, 0.18); }
.island[data-time="night"]::after { background: rgba(12, 20, 60, 0.45); }
.layer { position: absolute; inset: 0; pointer-events: none; }
.sp { position: absolute; left: 0; top: 0; width: 10%; height: calc(100% / 14); display: grid; place-items: center; }
.sp svg { width: 92%; height: 92%; }
.sp.me { z-index: 3; transition: transform 0.1s linear; }
.sp.me svg { width: 108%; height: 108%; }
.sp.spot { z-index: 2; }
.sp.spot svg { animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(1.12); filter: drop-shadow(0 0 3px #fff6c0); } }
.rainfx { display: none; position: absolute; inset: 0; pointer-events: none; background-image: repeating-linear-gradient(105deg, rgba(255, 255, 255, 0.35) 0 1px, transparent 1px 14px); animation: rain 0.6s linear infinite; z-index: 4; }
.island.rain .rainfx { display: block; }
@keyframes rain { to { background-position: -14px 40px; } }
@media (prefers-reduced-motion: reduce) { .sp.spot svg, .rainfx { animation: none; } .sp.me { transition: none; } }
.here { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 6px 10px; background: var(--paper); border-radius: 12px; font-size: 13px; min-height: 48px; }
.here > span:first-child { flex: 1; }
.spots-n { font-size: 12px; color: var(--ink-soft); }
.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(--sea); border-radius: 999px; }
.hint { margin: 8px 2px 0; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }

/* 博物館 */
.m-head { margin: 4px 2px 8px; font-size: 13px; color: var(--ink-soft); }
.m-head b { color: var(--sea-dark); }
.hall { background: var(--paper); border-radius: 16px; padding: 10px 10px 12px; margin-bottom: 10px; }
.hall h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; font: 600 18px/1.4 var(--hand); }
.hall h3 span { font: 900 12px var(--font); color: var(--sea-dark); }
.exhibits { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.exhibits li { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 4px; border-radius: 12px; background: #f3f8f7; }
.exhibits svg { width: 46px; height: 46px; }
.exhibits b { margin-top: 2px; font-size: 12px; line-height: 1.4; }
.exhibits small { font-size: 10px; color: var(--ink-soft); line-height: 1.4; text-wrap: balance; }
.exhibits li.no b { color: #94a5a8; }
.tools { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tools li { display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 14px; padding: 8px 10px; }
.t-ic svg { width: 36px; height: 36px; display: block; }
.tools li > div { flex: 1; min-width: 0; }
.tools b { font-size: 14px; }
.tools .lv { margin-left: 6px; font-size: 12px; font-weight: 900; color: var(--sea-dark); }
.tools p { margin: 0; font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.panel { margin-top: 12px; display: grid; gap: 10px; }
.panel .mg-box { background: var(--paper); border-color: transparent; }

/* ボタン */
.btn { display: block; width: 100%; margin: 8px 0 0; padding: 13px 10px; border: 0; border-radius: 14px; font: 900 16px/1.2 var(--font); cursor: pointer; background: var(--bg); color: var(--ink); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 #b44a24; }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #b44a24; }
.btn.small { width: auto; flex: none; margin: 0; padding: 8px 14px; font-size: 13px; border-radius: 10px; background: var(--sea); color: #fff; }
.btn.small:disabled { background: #d9e3e2; color: #8a9a9c; cursor: default; }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--ink-soft); font-size: 14px; }

/* 小窓 */
.dlg { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(20, 36, 40, 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: 600 22px/1.35 var(--hand); }
.dlg p { margin: 0 0 10px; font-size: 14px; text-align: left; }
.find .f-kind { text-align: center; margin: 0; font-size: 12px; font-weight: 900; color: var(--sea-dark); letter-spacing: 0.1em; }
.f-art svg { width: 120px; height: 120px; }
.find .f-rare { text-align: center; color: var(--accent); font-weight: 900; font-size: 13px; }
.find .f-note { text-align: center; font-size: 13px; color: var(--ink-soft); }
.finder { position: relative; height: 110px; margin: 6px 0 8px; border-radius: 12px; background: linear-gradient(#cfe8f2, #e8f4ea); overflow: hidden; border: 3px solid #2a3a40; }
.finder::before, .finder::after { content: ""; position: absolute; top: 8px; bottom: 8px; width: 12px; border: 2px solid rgba(42, 58, 64, 0.5); }
.finder::before { left: 8px; border-right: 0; } .finder::after { right: 8px; border-left: 0; }
.zone { position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); background: rgba(226, 104, 60, 0.16); border-left: 2px dashed var(--accent); border-right: 2px dashed var(--accent); }
.ph-bird { position: absolute; top: 50%; left: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); }
.ph-bird svg { width: 100%; height: 100%; }
.ph-msg { text-align: center !important; font-size: 13px !important; color: var(--ink-soft); }
.rk-art svg { width: 110px; height: 110px; }
.rk-art.hit svg { animation: knock 0.18s; }
@keyframes knock { 50% { transform: translate(3px, 2px) rotate(-4deg); } }
.aw { text-align: center !important; }
.aw b { font-size: 26px; color: var(--sea-dark); }
.aw-spots { text-align: center !important; font-size: 13px !important; font-weight: 900; color: var(--accent); }
.aw-spots: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(42, 102, 118, 0.96); 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(--sea); 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(--sea); }
.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; }
.g-foot { max-width: 520px; margin: 0 auto; padding: 14px 16px 28px; font-size: 12px; text-align: center; }
.g-foot a { color: var(--ink-soft); }
