:root {
  --ink: #1d2f40;
  --ink-soft: #5a6e80;
  --bg: #e4eef4;
  --paper: #ffffff;
  --line: #cfdde6;
  --forest: #1f6f9a;
  --forest-dark: #134d6e;
  --wood: #c98b4f;
  --ember: #ef7a4a;
  --gold: #f2b33d;
  --font: "Zen Maru Gothic", system-ui, 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; }
.nw { white-space: nowrap; }

.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(--forest-dark); text-decoration: none; }

main { max-width: 560px; margin: 0 auto; padding: 0 12px 24px; }
.play { position: relative; }

/* キャンプ場の絵 */
.scene-wrap { position: relative; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 26px rgba(19, 50, 77, 0.2); }
.scene { display: block; width: 100%; height: auto; aspect-ratio: 360 / 220; user-select: none; -webkit-user-select: none; }
.scene-top { position: absolute; left: 10px; right: 10px; top: 8px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.sky-note { white-space: nowrap; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.82); font-size: 12px; font-weight: 900; color: var(--ink); }
.stars { display: flex; gap: 1px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.82); }
.stars span { width: 16px; height: 16px; color: #c8d2da; display: block; }
.stars span.on { color: var(--gold); }
.stars svg { display: block; width: 100%; height: 100%; }

/* 数字 */
.status { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-top: 10px; }
.money-box, .guest-box { background: var(--paper); border-radius: 14px; padding: 8px 12px; }
.lbl { font-size: 11px; font-weight: 900; color: var(--ink-soft); }
.money { display: flex; align-items: baseline; gap: 3px; font-weight: 900; line-height: 1.2; }
.money b { font-size: 28px; font-variant-numeric: tabular-nums; }
.per { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.per b { color: var(--forest); }
.guests { display: flex; align-items: baseline; gap: 3px; font-weight: 900; line-height: 1.2; }
.guests b { font-size: 28px; }
.guests span { font-size: 16px; color: var(--ink-soft); }
.guests small { font-size: 12px; margin-left: 2px; }
.goal { margin-top: 8px; background: var(--paper); border-radius: 14px; padding: 8px 12px 10px; }
.goal-text { margin: 0 0 6px; font-size: 13px; font-weight: 900; }
.goal-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.goal-track span { display: block; height: 100%; background: var(--gold); border-radius: 999px; transition: width 0.4s; }
.hint { margin: 8px 2px 0; font-size: 12px; color: var(--ink-soft); }
/* 今日の依頼 */
.req { margin-top: 8px; background: #fff7e6; border: 2px solid #f2c97a; border-radius: 14px; padding: 8px 12px 9px; }
.req.done { background: #e6f4ee; border-color: #8cc7a8; }
.req-h { font-size: 11px; font-weight: 900; color: #a8691c; }
.req.done .req-h { color: var(--forest); }
.req-text { margin: 2px 0 0; font-size: 13px; font-weight: 900; line-height: 1.55; }
.req-state { margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.req.done .req-state { color: var(--forest); font-weight: 900; }
/* お客さん図鑑 */
.book-wrap { margin-top: 14px; background: var(--paper); border-radius: 14px; padding: 0 12px; }
.book-wrap summary { display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; list-style: none; }
.book-wrap summary::-webkit-details-marker { display: none; }
.book-wrap summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: rotate(45deg); transition: transform 0.2s; }
.book-wrap[open] summary::after { transform: rotate(225deg); }
.book-h { font-size: 16px; font-weight: 900; }
.book-count { font-size: 13px; font-weight: 900; color: var(--forest); }
.book-bonus { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #e8f2f8; color: var(--forest); }
.book-bonus:empty { display: none; }
.book-note { margin: 0 0 10px; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.book { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.book li { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 4px; border-radius: 12px; background: #f2f7fa; }
.book svg { width: 48px; height: 48px; }
.book b { margin-top: 4px; font-size: 12px; line-height: 1.4; }
.book small { font-size: 10px; color: var(--ink-soft); line-height: 1.45; text-wrap: balance; }
.book li.unknown b { color: #8a9aa8; }

/* 施設の一覧 */
.list-h { margin: 18px 2px 8px; font-size: 17px; font-weight: 900; }
.facilities { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fac { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; background: var(--paper); border-radius: 14px; padding: 10px 10px 10px 12px; }
.fac-icon { width: 44px; height: 44px; border-radius: 12px; background: #e8f2f8; display: grid; place-items: center; }
.fac-icon svg { width: 32px; height: 32px; }
.fac-main { min-width: 0; }
.fac-name { font-size: 15px; font-weight: 900; line-height: 1.4; }
.fac-lv { font-size: 12px; color: var(--forest); }
.fac-desc { margin: 0; font-size: 12px; color: var(--ink-soft); line-height: 1.5; text-wrap: pretty; }
.fac-eff { margin: 2px 0 0; font-size: 11px; font-weight: 700; color: var(--forest); line-height: 1.5; text-wrap: pretty; }
.fac-buy { min-width: 86px; padding: 8px 8px; border: 0; border-radius: 12px; background: var(--forest); color: #fff; font: 900 14px/1.25 var(--font); cursor: pointer; box-shadow: 0 3px 0 var(--forest-dark); text-align: center; }
.fac-buy small { display: block; font-size: 11px; font-weight: 700; opacity: 0.85; }
.fac-buy:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--forest-dark); }
.fac-buy:disabled { background: #dde6ec; color: #76889a; box-shadow: none; cursor: default; }
.fac.locked .fac-icon { filter: grayscale(1); opacity: 0.5; }
.fac.locked .fac-name, .fac.locked .fac-desc { opacity: 0.6; }
.fac.maxed .fac-buy:disabled { background: var(--gold); color: #4a3200; }
.fac-name { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.fac-lv { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 4px; font-size: 12px; }
.fac-lv:empty { display: none; }
.fac-lv .tag { font-size: 10px; padding: 0 6px; border-radius: 999px; background: #e8f2f8; color: var(--forest); line-height: 1.6; }
.fac-lv .tag.t2 { background: #fff1d6; color: #8a5a00; }
.fac-eff .ms { color: #a8691c; }
/* 最大になった施設は一覧の最後で小さくたたむ */
.fac.maxed { grid-template-columns: 32px 1fr auto; padding-top: 6px; padding-bottom: 6px; }
.fac.maxed .fac-icon { width: 32px; height: 32px; border-radius: 9px; }
.fac.maxed .fac-icon svg { width: 24px; height: 24px; }
.fac.maxed .fac-name { font-size: 14px; }
.fac.maxed .fac-desc, .fac.maxed .fac-eff { display: none; }
.fac.maxed .fac-buy { min-width: 56px; padding: 4px 10px; font-size: 12px; }
.max-note { margin: 6px 2px 0; font-size: 11px; color: var(--ink-soft); }
.fac-buy.on { background: var(--gold); color: #4a3200; box-shadow: 0 3px 0 #b5851f; }
.deco.owned .fac-buy:disabled { background: #e8f2f8; color: var(--forest); }
.decos { margin-bottom: 12px; }
.decos .fac { background: #f2f7fa; }
/* 今の売上に効いているもの */
.mods { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 8px 0 0; }
.mods:empty { display: none; }
.mod { font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--ink-soft); line-height: 1.6; }
.mod.hot { background: #fff1e0; color: #a8691c; }
.mod.night { background: #22335e; color: #ffe7a3; }
.mod.boost { background: #e6f4ee; color: var(--forest); }
/* 仕入れ */
.boost { display: flex; align-items: center; gap: 10px; margin-top: 8px; background: var(--paper); border-radius: 14px; padding: 8px 10px 8px 12px; }
.boost-main { flex: 1; min-width: 0; line-height: 1.4; }
.boost-main b { display: block; font-size: 14px; font-weight: 900; }
.boost-main small { display: block; font-size: 11px; color: var(--ink-soft); }
/* 次の土地・アルバム */
.land { margin-top: 14px; background: #fff7e6; border: 2px solid #f2c97a; border-radius: 14px; padding: 12px 14px; }
.land-h { margin: 0 0 4px; font-size: 16px; font-weight: 900; }
.land-text { margin: 0; font-size: 13px; line-height: 1.7; }
.album { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.album li { background: #f2f7fa; border-radius: 10px; padding: 6px 10px; line-height: 1.5; }
.album b { display: block; font-size: 13px; }
.album small { font-size: 11px; color: var(--ink-soft); }

.records { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; text-align: center; }
.records > div { background: var(--paper); border-radius: 12px; padding: 6px 4px; }
.records .lbl { display: block; }
.records b { font-size: 14px; }
.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(12, 28, 44, 0.6); }
.dlg-in { width: 100%; max-width: 380px; background: var(--paper); border-radius: 18px; padding: 22px 18px 18px; text-align: center; }
.dlg h2 { margin: 0 0 10px; font-size: 20px; font-weight: 900; }
.dlg p { margin: 0 0 10px; font-size: 14px; text-align: left; }
.dlg .away-line { text-align: center; color: var(--ink-soft); margin: 0; }
.dlg .away-big { text-align: center; font-size: 15px; font-weight: 700; }
.dlg .away-big b { font-size: 26px; color: var(--forest); }
.dlg .away-note { text-align: center; font-size: 12px; color: var(--ink-soft); }
.dlg-in { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.dlg .away-new-h { text-align: center; font-size: 13px; font-weight: 900; color: #a8691c; margin: 0 0 6px; }
/* 留守のあいだの、はじめてのお客さん（札を1組ずつめくる） */
.cards { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; perspective: 600px; }
.card { position: relative; width: 84px; height: 100px; transform-style: preserve-3d; animation: flip 0.6s ease both; }
.card-back, .card-face { position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.card-back { background: var(--forest); color: #fff; font-size: 28px; font-weight: 900; }
.card-face { background: #f2f7fa; transform: rotateY(180deg); padding: 4px; text-align: center; }
.card-face svg { width: 44px; height: 44px; }
.card-face b { font-size: 10.5px; line-height: 1.35; margin-top: 2px; }
@keyframes flip { from { transform: rotateY(0deg); } to { transform: rotateY(180deg); } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; transform: rotateY(180deg); } }
.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; }
.btn.primary { background: var(--ember); color: #fff; box-shadow: 0 4px 0 #b44a24; }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--ink-soft); }
.btn.small { display: inline-block; width: auto; padding: 8px 16px; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 16px; background: rgba(19, 60, 88, 0.95); color: #fff; font-weight: 900; font-size: 14px; text-align: center; pointer-events: none; }

/* 下の解説（ポータルと同じ決まり: 行間 1.85・段落の間は1行分） */
.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(--forest); 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(--forest); }
.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; }
.guide a { color: var(--forest-dark); }
.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); }

/* ===== わたしの水族館だけのもの ===== */
.scene { background: #2b6f96; }
.scene .cr { pointer-events: none; }
/* 泳ぐ: 外の g が場所、真ん中の g が左右の行き来と向き、内の g が上下のゆれ */
.scene .swim { animation: swim var(--dur, 14s) linear infinite; animation-delay: var(--dl, 0s); }
@keyframes swim { 0% { transform: translateX(0) scaleX(1); } 48% { transform: translateX(var(--dx, 120px)) scaleX(1); } 50% { transform: translateX(var(--dx, 120px)) scaleX(-1); } 98% { transform: translateX(0) scaleX(-1); } 100% { transform: translateX(0) scaleX(1); } }
.scene .bob { animation: bob 3s ease-in-out infinite; animation-delay: var(--dl, 0s); }
@keyframes bob { 50% { transform: translateY(-4px); } }
.scene .float { animation: floaty var(--dur, 7s) ease-in-out infinite; animation-delay: var(--dl, 0s); }
@keyframes floaty { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(8px, -26px); } }
.scene .crawl { animation: crawl var(--dur, 24s) ease-in-out infinite; animation-delay: var(--dl, 0s); }
@keyframes crawl { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(var(--dx, 40px)); } }
.scene .sway { animation: sway 2.6s ease-in-out infinite alternate; transform-origin: 0 14px; }
@keyframes sway { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
.scene .wiggle { animation: wiggle 1.4s ease-in-out infinite alternate; }
@keyframes wiggle { to { transform: skewX(8deg); } }
.scene .flap { animation: flap 0.9s ease-in-out infinite alternate; }
@keyframes flap { to { transform: scaleY(0.75); } }
.scene .glow { animation: glow 1.6s ease-in-out infinite alternate; }
@keyframes glow { to { opacity: 0.35; } }
.scene .shine { animation: shine 1.2s linear infinite; }
@keyframes shine { 50% { opacity: 0.2; } }
.scene .kelp path { animation: sway 4s ease-in-out infinite alternate; transform-origin: 0 200px; }
.scene .air { fill: rgba(255, 255, 255, 0.5); animation: air var(--dur, 6s) linear infinite; animation-delay: var(--dl, 0s); }
@keyframes air { from { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } to { transform: translateY(-210px); opacity: 0; } }
.scene .coin { cursor: pointer; }
.scene .coin-in { animation: coin 10s linear forwards; }
@keyframes coin { from { transform: translateY(0); } to { transform: translateY(-140px); } }
.scene .coin.guide .coin-in { animation: none; }
.scene .gain { font: 900 12px var(--font); fill: #fff; stroke: var(--forest-dark); stroke-width: 3px; paint-order: stroke; text-anchor: middle; animation: rise 0.9s ease-out forwards; }
@keyframes rise { to { transform: translateY(-14px); opacity: 0; } }
.scene .ring { animation: ring 1.2s ease-out infinite; }
@keyframes ring { from { transform: scale(0.8); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.scene .guide-t { font: 900 11px var(--font); fill: #fff; stroke: var(--forest-dark); stroke-width: 3px; paint-order: stroke; text-anchor: middle; }
.scene .empty-t { font: 900 13px var(--font); fill: #fff; text-anchor: middle; }
.scene .glass { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 6; }
@media (prefers-reduced-motion: reduce) { .scene * { animation: none !important; } }
.sky-note { max-width: 66%; overflow: hidden; text-overflow: ellipsis; }

/* 水槽の切りかえ */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; padding: 2px 2px 6px; scrollbar-width: thin; }
.tab { flex: none; display: flex; align-items: center; gap: 5px; padding: 6px 12px; border: 2px solid transparent; border-radius: 999px; background: var(--paper); color: var(--ink); font: 900 13px/1.3 var(--font); cursor: pointer; }
.tab i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.tab.on { border-color: var(--forest); background: #e8f2f8; }

/* 採集の船 */
.list-h small { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-left: 6px; }
.boats { display: grid; gap: 8px; }
.boat { background: var(--paper); border-radius: 14px; padding: 10px 12px; }
.boat.ready { box-shadow: inset 0 0 0 2px var(--gold); }
.boat-h { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 900; }
.boat-h svg { width: 30px; height: 22px; flex: none; }
.boat-h .st { margin-left: auto; font-size: 12px; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.boat-bar { height: 6px; margin: 6px 0 0; background: var(--line); border-radius: 999px; overflow: hidden; }
.boat-bar span { display: block; height: 100%; background: var(--forest); border-radius: 999px; }
.areas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.area { padding: 7px 8px; border: 0; border-radius: 12px; background: #e8f2f8; color: var(--ink); font: 900 13px/1.35 var(--font); text-align: left; cursor: pointer; box-shadow: 0 2px 0 #c4d6e2; }
.area small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.area small .new { color: #c4562a; }
.area:active { transform: translateY(1px); box-shadow: none; }
.areas-note { grid-column: 1 / -1; margin: 0; font-size: 11px; color: var(--ink-soft); }
.boat .btn { margin-top: 8px; padding: 10px; font-size: 15px; }

/* 展示 */
.shows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cr-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 8px; align-items: center; background: var(--paper); border-radius: 14px; padding: 6px 10px 6px 8px; }
.cr-row svg { width: 46px; height: 46px; display: block; }
.cr-row b { font-size: 14px; display: block; line-height: 1.35; }
.cr-row small { display: block; font-size: 11px; color: var(--ink-soft); line-height: 1.45; }
.cr-row .pop { color: var(--forest); font-weight: 900; }
.cr-row.on { box-shadow: inset 0 0 0 2px var(--forest); }
.cr-row .fac-buy { min-width: 64px; font-size: 13px; padding: 7px 8px; }
.cr-row .fac-buy.out { background: #fff; color: var(--forest); box-shadow: inset 0 0 0 2px var(--forest); }
.combo-now { margin: 0 2px 8px; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.combo-now:empty { display: none; }
.combo-now span { font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 999px; background: #fff1d6; color: #8a5a00; }
.show-empty { margin: 0; padding: 12px; background: var(--paper); border-radius: 14px; font-size: 13px; color: var(--ink-soft); }
.rare { display: inline-block; font-size: 10px; font-weight: 900; padding: 0 6px; border-radius: 999px; background: #e8f2f8; color: var(--forest); margin-left: 4px; vertical-align: 1px; white-space: nowrap; }
.rare.r3 { background: #fff1d6; color: #8a5a00; }
.rare.r4 { background: #fde2ea; color: #a8325a; }

/* 図鑑 */
.book-tank { margin: 4px 0 6px; font-size: 13px; font-weight: 900; color: var(--forest-dark); }
.book { grid-template-columns: repeat(4, 1fr); }
.book svg { width: 52px; height: 52px; }
@media (max-width: 400px) { .book { grid-template-columns: repeat(3, 1fr); } }
.combos { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.combos li { background: #f2f7fa; border-radius: 10px; padding: 6px 10px; line-height: 1.5; }
.combos b { font-size: 13px; }
.combos small { display: block; font-size: 11px; color: var(--ink-soft); }
.combos li.found b { color: #8a5a00; }
.card-face .tag-new { font-size: 10px; font-weight: 900; color: #c4562a; }
.card-face svg { width: 52px; height: 52px; }
.ready-bar { display: flex; align-items: center; gap: 10px; margin-top: 2px; padding: 8px 10px 8px 14px; border-radius: 14px; background: #fff7e6; border: 2px solid #f2c97a; font-size: 14px; font-weight: 900; }
.ready-bar span { flex: 1; min-width: 0; line-height: 1.45; }
.ready-bar.idle { background: var(--paper); border-color: var(--line); font-weight: 700; }
