:root {
  --ink: #23362b;
  --ink-soft: #5f7166;
  --bg: #e7eee6;
  --paper: #ffffff;
  --line: #d3ddd2;
  --forest: #2f5d46;
  --forest-dark: #1f4232;
  --wood: #c98b4f;
  --ember: #e2683c;
  --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(35, 54, 43, 0.18); }
.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 { 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: #c9d1ca; display: block; }
.stars span.on { color: var(--gold); }
.stars svg { display: block; width: 100%; height: 100%; }

/* 時間帯 */
.scene .sky-a { stop-color: #8fd0f2; } .scene .sky-b { stop-color: #d9f0fb; }
.scene[data-time="dawn"] .sky-a { stop-color: #f7b7a3; } .scene[data-time="dawn"] .sky-b { stop-color: #fde3c4; }
.scene[data-time="evening"] .sky-a { stop-color: #e9775a; } .scene[data-time="evening"] .sky-b { stop-color: #f8c271; }
.scene[data-time="night"] .sky-a { stop-color: #0f1838; } .scene[data-time="night"] .sky-b { stop-color: #2a3766; }
.scene[data-weather="rain"] .sky-a, .scene[data-weather="cloud"] .sky-a { stop-color: #9aa8b3; }
.scene[data-weather="rain"] .sky-b, .scene[data-weather="cloud"] .sky-b { stop-color: #cfd6db; }
.scene[data-weather="rain"][data-time="night"] .sky-a { stop-color: #141a2c; } .scene[data-weather="rain"][data-time="night"] .sky-b { stop-color: #2b3242; }
.scene .stars, .scene .moon { display: none; }
.scene[data-time="night"] .stars, .scene[data-time="night"] .moon { display: inline; }
.scene[data-time="night"] .sun, .scene[data-weather="rain"] .sun, .scene[data-weather="cloud"] .sun { display: none; }
.scene[data-time="night"][data-weather="rain"] .stars, .scene[data-time="night"][data-weather="rain"] .moon { display: none; }
.scene .moon-cut { fill: #0f1838; }
.scene .mt-far { fill: #9db8a6; } .scene .mt-near { fill: #7fa088; }
.scene .ground { fill: #9cc77f; } .scene .path { fill: none; stroke: #d9c79c; stroke-width: 9; stroke-linecap: round; }
.scene .lake { fill: #5fb0cf; } .scene .lake-hi { fill: rgba(255, 255, 255, 0.35); }
.scene .leaf { fill: #3f7d4f; }
.scene[data-time="night"] .mt-far { fill: #2d3a55; } .scene[data-time="night"] .mt-near { fill: #26314a; }
.scene[data-time="night"] .ground { fill: #34503e; } .scene[data-time="night"] .lake { fill: #23466a; } .scene[data-time="night"] .path { stroke: #5d5a4a; }
.scene[data-time="night"] .leaf { fill: #22412f; }
.scene .lamp, .scene .win { fill: #6d4b2f; }
.scene[data-time="night"] .lamp, .scene[data-time="night"] .win, .scene[data-time="evening"] .win { fill: #ffe7a3; }
.scene .tower-scope { fill: #3a4a6b; }
.scene .fire-glow { opacity: 0.25; }
.scene[data-time="night"] .fire-glow, .scene[data-time="evening"] .fire-glow { opacity: 1; }
/* 季節 */
.scene[data-season="spring"] .leaf { fill: #f1a9c0; }
.scene[data-season="autumn"] .leaf { fill: #d9792f; }
.scene[data-season="winter"] .ground { fill: #eef2f3; } .scene[data-season="winter"] .leaf { fill: #5d8a72; } .scene[data-season="winter"] .mt-near { fill: #dfe7ea; }
.scene[data-season="winter"][data-time="night"] .ground { fill: #5a6a7d; }
/* 雨 */
.scene .rain { display: none; stroke: rgba(255, 255, 255, 0.7); stroke-width: 1.2; }
.scene[data-weather="rain"] .rain { display: inline; animation: rain 0.7s linear infinite; }
@keyframes rain { from { transform: translate(0, -20px); } to { transform: translate(-6px, 10px); } }
/* 動き */
.scene .flame { transform-origin: 0 2px; animation: flick 0.6s ease-in-out infinite alternate; }
.scene .f2 { animation-duration: 0.45s; }
@keyframes flick { from { transform: scale(1, 1); } to { transform: scale(0.88, 1.12); } }
.scene .person { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-1.5px); } }

.scene .steam { animation: steam 2.4s ease-in-out infinite; }
@keyframes steam { 50% { opacity: 0.3; transform: translateY(-2px); } }
.scene .bubble { cursor: pointer; animation: pop 0.3s ease-out; }
@keyframes pop { from { opacity: 0; } }
.scene .gain { font: 900 11px 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; } }
@media (prefers-reduced-motion: reduce) { .scene * { animation: none !important; } }

/* 数字 */
.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: #eef7ea; border-color: #9cc77f; }
.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: #eef4ec; 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: #f6f9f5; }
.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: #8a978d; }

/* 施設の一覧 */
.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: #eef4ec; 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: #dfe6de; color: #7b8a80; 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; }

.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(20, 34, 26, 0.55); }
.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 .away-new { text-align: center; font-size: 13px; font-weight: 900; color: #a8691c; }
.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(31, 66, 50, 0.94); 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); }
