/* 里山絵図 */
:root {
  --accent: #2f7a4a; --accent-ink: #ffffff; --accent-soft: #e1efe3;
  --bg: #f3eddf; --surface: #fffdf7; --surface-2: #ece4d2; --line: #ddd2bb; --text: #2a2620; --text-sub: #6c6355;
  --gold: #d99a1e; --se-hud: rgba(255, 252, 244, .92); --se-tray: #fbf6ea;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #7fd39a; --accent-ink: #10221a; --accent-soft: #1d3428;
    --bg: #12161d; --surface: #1b212b; --surface-2: #252c38; --line: #313a48; --text: #eee9de; --text-sub: #a9a294;
    --gold: #f2c14e; --se-hud: rgba(24, 29, 38, .92); --se-tray: #181d26;
  }
}
:root[data-theme="dark"] {
  --accent: #7fd39a; --accent-ink: #10221a; --accent-soft: #1d3428;
  --bg: #12161d; --surface: #1b212b; --surface-2: #252c38; --line: #313a48; --text: #eee9de; --text-sub: #a9a294;
  --gold: #f2c14e; --se-hud: rgba(24, 29, 38, .92); --se-tray: #181d26;
}

/* タイトル */
.se-hero { display: block; width: 100%; height: auto; aspect-ratio: 720 / 330; border-radius: 18px; background: #efe7d6; box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .se-hero { background: #e6dcc6; } }
.se-name { font-family: var(--font-serif); letter-spacing: .06em; }
.se-name small { display: inline-block; margin-left: 10px; font-size: 15px; font-weight: 700; color: var(--text-sub); letter-spacing: .1em; font-family: var(--font); }
.se-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.se-quick small { color: var(--text-sub); font-weight: 600; }
.se-story { font-family: var(--font-serif); font-size: 15px; color: var(--text-sub); }
.se-story p { margin: 0 0 .3em; }
.se-daily .mn-daily-num { color: var(--gold); }

/* プレイ画面 */
body.se-play .mn-app { max-width: none; padding: 0; }
body.se-play { overscroll-behavior: none; }
.se-game { display: flex; flex-direction: column; height: calc(100dvh - 57px); max-width: 1100px; margin: 0 auto; position: relative; user-select: none; -webkit-user-select: none; }
.se-hud { display: flex; align-items: center; gap: 12px; padding: 6px 12px; background: var(--se-hud); border-bottom: 1px solid var(--line); flex: none; }
.se-hud-b { display: flex; flex-direction: column; line-height: 1.1; }
.se-hud-b small { font-size: 11px; color: var(--text-sub); font-weight: 700; }
.se-score, .se-deck { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; display: inline-block; }
.se-deck.low { color: #d0503c; }
.se-season { font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.se-season.s0 { background: #f7dfe5; color: #8a3b52; } .se-season.s1 { background: #d9f0d4; color: #2d6a33; }
.se-season.s2 { background: #f6e1c4; color: #8a4a1c; } .se-season.s3 { background: #e3ebf2; color: #3b5670; }
.se-ibtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 900; font-size: 18px; cursor: pointer; }
.se-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; background: #efe7d6; }
.se-cv { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.se-cv:active { cursor: grabbing; }
.se-quests { position: absolute; left: 8px; top: 8px; display: flex; flex-wrap: wrap; gap: 4px; max-width: 70%; pointer-events: none; }
.se-qchip { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(255, 250, 235, .94); color: #4a3420; border: 1px solid rgba(140, 90, 40, .5); }
.se-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.se-zbtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); background: rgba(255, 252, 244, .92); color: #3a3026; font-size: 20px; font-weight: 900; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.se-tip { position: absolute; left: 8px; right: 60px; bottom: 12px; margin: 0 auto; max-width: 440px; transform: translateY(20px); padding: 10px 14px; border-radius: 14px; background: rgba(42, 38, 32, .9); color: #fff8e8; font-size: 14px; font-weight: 700; line-height: 1.5; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; text-align: center; }
.se-tip.on { opacity: 1; transform: none; }
.se-banner { position: absolute; left: 0; right: 0; top: 32%; text-align: center; pointer-events: none; opacity: 0; transition: opacity .6s; }
.se-banner.on { opacity: 1; }
.se-banner b { display: block; font-family: var(--font-serif); font-size: 44px; color: #fffaf0; text-shadow: 0 2px 12px rgba(0, 0, 0, .55); letter-spacing: .2em; }
.se-banner span { display: inline-block; margin-top: 6px; padding: 6px 14px; border-radius: 999px; background: rgba(42, 38, 32, .75); color: #fff8e8; font-size: 14px; font-weight: 700; }

.se-tray { flex: none; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "hand info" "ctrl ctrl"; gap: 6px 12px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--se-tray); border-top: 1px solid var(--line); }
.se-handbox { grid-area: hand; display: flex; align-items: flex-end; gap: 6px; }
.se-handbtn { position: relative; padding: 0; border: 0; background: transparent; cursor: pointer; width: 92px; height: 92px; }
.se-hand-cv { width: 92px; height: 92px; display: block; }
.se-qbadge { position: absolute; right: -4px; top: -2px; font-size: 13px; font-weight: 900; padding: 2px 8px; border-radius: 999px; background: #fff3cf; color: #6a4410; border: 1.5px solid #d99a1e; }
.se-nextbox { display: flex; flex-direction: column; align-items: center; opacity: .85; }
.se-next-cv { width: 46px; height: 46px; }
.se-next-lbl { font-size: 11px; font-weight: 800; color: var(--text-sub); white-space: nowrap; }
.se-info { grid-area: info; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.se-info-main { font-size: 16px; font-weight: 800; line-height: 1.35; }
.se-info-main .pts { font-size: 24px; color: var(--accent); margin-left: 2px; }
.se-info-main .ng { color: #d0503c; font-size: 15px; }
.se-info-main .tag { display: inline-block; margin-left: 6px; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: 3px; }
.se-info-main .tag.gold { background: #fff0c7; color: #8a5a00; }
.se-info-sub { font-size: 13px; color: var(--text-sub); display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; line-height: 1.4; min-height: 18px; }
.se-qp { font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.se-qp.ok { background: #fff0c7; color: #7a4f00; }
.se-qp.ng { background: var(--bad-soft); color: var(--bad); }
.se-ctrl { grid-area: ctrl; display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; }
.se-rot { font-size: 26px; min-height: 52px; padding: 0; }
.se-place { min-height: 52px; font-size: 18px; letter-spacing: .2em; }
@media (min-width: 760px) {
  .se-tray { grid-template-columns: auto 1fr 340px; grid-template-areas: "hand info ctrl"; align-items: center; }
  .se-hud { padding: 8px 18px; }
}
.se-bump { animation: se-bump .45s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes se-bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: var(--gold); } 100% { transform: scale(1); } }

/* 手紙・住人 */
.se-letter, .se-folk-scene { font-family: var(--font-serif); }
.se-letter { background: #fbf5e6; color: #3a3226; border-radius: 12px; padding: 18px 16px; border: 1px solid #e3d6b8; box-shadow: inset 0 0 30px rgba(170, 140, 90, .18); }
.se-letter h3 { font-size: 18px; margin-bottom: 10px; }
.se-letter-k { font-size: 12px; letter-spacing: .2em; color: #8a6a3a; margin: 0 0 4px; font-family: var(--font); font-weight: 700; }
.se-letter-b p { margin: 0; line-height: 2; }
.se-new { font-weight: 800; color: var(--accent); margin: 0 0 8px; }
.se-folk-scene { text-align: center; }
.se-folk-scene .se-letter-b { text-align: left; margin: 10px auto; max-width: 400px; }
.se-folk-ic { font-size: 64px; line-height: 1.2; }
.se-folk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.se-folk { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; min-height: 96px; }
.se-folk-i { font-size: 30px; line-height: 1.2; }
.se-folk b { font-size: 13px; line-height: 1.3; text-align: center; }
.se-folk small { font-size: 10.5px; color: var(--text-sub); line-height: 1.35; text-align: center; }
.se-folk.locked .se-folk-i { opacity: .4; }
.se-list { display: grid; gap: 6px; }
.se-li { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; min-height: 52px; }
.se-li span { grid-row: 1 / 3; font-size: 20px; }
.se-li small { color: var(--text-sub); font-size: 12px; }
.se-li.locked { opacity: .7; cursor: default; }
.se-help p { margin: 0 0 6px; font-size: 15px; }

/* 結果 */
.se-result-line { font-family: var(--font-serif); font-size: clamp(21px, 5.6vw, 28px); line-height: 1.5; }
.se-result-score { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.se-result-score > span:nth-child(2) { font-size: 22px; font-weight: 800; }
.se-result-board { display: block; width: 100%; height: auto; border-radius: 16px; background: #efe7d6; box-shadow: var(--shadow); }
.se-ending { font-family: var(--font-serif); color: var(--text-sub); }
.se-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.se-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; }
.se-stat small { display: block; font-size: 11px; color: var(--text-sub); line-height: 1.3; }
.se-stat b { font-size: 16px; }
.se-near { background: #fff4d6; color: #5c4210; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.se-near b { font-size: 17px; color: #b06d00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .se-near { background: #3a3019; color: #f3e2b5; } :root:not([data-theme="light"]) .se-near b { color: #f2c14e; } }
.se-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 400px) { .se-stats { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .se-tip, .se-banner { transition: none; } }

/* 生成画像（assets/manifest.js にあるときだけ使う） */
img.se-hero, video.se-hero { aspect-ratio: 16 / 9; object-fit: cover; }
.se-ic { width: 1.25em; height: 1.25em; vertical-align: -.25em; object-fit: contain; }
.se-li span .se-ic { width: 26px; height: 26px; }
.se-folk-img { display: block; width: 100%; max-width: 360px; margin: 6px auto 4px; border-radius: 12px; aspect-ratio: 6 / 5; object-fit: cover; box-shadow: var(--shadow); }
.se-folk-th { width: 52px; height: 44px; object-fit: cover; border-radius: 8px; display: block; }
.se-intro-img { display: block; width: 100%; border-radius: 10px; margin-bottom: 8px; aspect-ratio: 16 / 9; object-fit: cover; }
.se-banner-img { display: block; width: min(80%, 420px); margin: 0 auto 8px; border-radius: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); aspect-ratio: 16 / 9; object-fit: cover; }
.se-ending-img { display: block; width: 100%; border-radius: 14px; aspect-ratio: 16 / 9; object-fit: cover; box-shadow: var(--shadow); }
.se-letter.has-art { background-color: #fbf5e6; background-size: cover; background-position: center; border: 0; padding: 26px 22px; box-shadow: 0 4px 16px rgba(0, 0, 0, .15); }
.se-letter.has-art .se-letter-b p, .se-letter.has-art h3 { text-shadow: 0 0 6px rgba(251, 245, 230, .9); }
.se-banner { top: 18%; }
