:root {
  --bg: #0b1026;
  --bg-2: #111838;
  --panel: #151d44;
  --panel-2: #1b2552;
  --line: #2a3670;
  --text: #eef0ff;
  --muted: #a9b0d6;
  --lantern: #ffd27a;
  --lantern-2: #ffb347;
  --lantern-ink: #2a1c00;
  --warp: #6fe3d0;
  --danger: #ff8f8f;
  --ok: #8fe3a5;
  --radius: 14px;
  --tap: 48px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #1a2358 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--lantern); }
a:hover { color: #ffe3a8; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lantern); outline-offset: 2px; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
.wrap.wide { max-width: 760px; }

/* ヘッダー */
.brand { display: flex; align-items: center; gap: 12px; margin: 8px 0 18px; text-decoration: none; color: var(--text); }
.brand .mark { width: 44px; height: 44px; flex: none; }
.brand h1 { font-size: 26px; margin: 0; letter-spacing: .02em; line-height: 1.1; }
.brand .ja { font-size: 13px; color: var(--muted); letter-spacing: .2em; }
.tagline { color: var(--lantern); margin: -6px 0 18px; font-size: 15px; }
.subhead { display: flex; align-items: center; gap: 10px; margin: 6px 0 16px; }
.subhead h2 { margin: 0; font-size: 20px; }

/* カード */
.card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card h2, .card h3 { margin: 0 0 8px; font-size: 18px; }
.today-date { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, transform .08s; }
.btn:hover { background: #24306a; color: var(--text); }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(180deg, var(--lantern), var(--lantern-2)); color: var(--lantern-ink); border-color: transparent; box-shadow: 0 0 24px rgba(255, 196, 90, .35); font-size: 17px; }
.btn.primary:hover { background: linear-gradient(180deg, #ffe0a0, #ffc063); color: var(--lantern-ink); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stat { background: rgba(0,0,0,.18); border-radius: 10px; padding: 10px 6px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--lantern); color: var(--lantern-ink); font-size: 13px; font-weight: 700; }
.badge.muted { background: var(--line); color: var(--text); }

.links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: 14px; margin-top: 22px; color: var(--muted); }
.links a { color: var(--muted); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); }
.toggle input { width: 22px; height: 22px; accent-color: var(--lantern); }

/* スポンサー枠 */
.sponsor { margin: 16px 0; border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px; text-align: center; }
.sponsor .label { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-bottom: 6px; }
.sponsor img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 8px; }
.sponsor .adv { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* フォーム */
label.field { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 600; font-size: 15px; }
label.field small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #0e1534; color: var(--text); font-size: 16px;
}
textarea { min-height: 140px; resize: vertical; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.msg { padding: 10px 14px; border-radius: 10px; margin: 10px 0; }
.msg.ok { background: rgba(143, 227, 165, .12); border: 1px solid rgba(143, 227, 165, .4); }
.msg.err { background: rgba(255, 143, 143, .12); border: 1px solid rgba(255, 143, 143, .4); }

/* ランキング */
.tabs { display: flex; gap: 6px; background: rgba(0,0,0,.2); padding: 4px; border-radius: 999px; margin-bottom: 12px; }
.tabs button { flex: 1; min-height: 44px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; font-weight: 600; color: var(--muted); }
.tabs button[aria-selected=true] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 10px 6px; border-bottom: 1px solid rgba(42, 54, 112, .6); font-variant-numeric: tabular-nums; }
.rank-list li.me { background: rgba(255, 210, 122, .1); border-radius: 8px; }
.rank-list .n { font-weight: 700; color: var(--lantern); text-align: center; }
.rank-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .rec { text-align: right; font-size: 14px; }
.rank-list .rec small { color: var(--muted); display: block; }
.datebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }

/* プレイ画面 */
body.playing { overflow: hidden; overscroll-behavior: none; }
.play { position: fixed; inset: 0; display: flex; flex-direction: column; background: #070a1b; }
.hud { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; background: rgba(11, 16, 38, .92); border-bottom: 1px solid var(--line); z-index: 2; }
.hud .meters { display: flex; gap: 14px; flex: 1; justify-content: center; font-variant-numeric: tabular-nums; }
.hud .meter { text-align: center; line-height: 1.15; }
.hud .meter .k { font-size: 11px; color: var(--muted); }
.hud .meter .v { font-size: 19px; font-weight: 700; }
.hud .btn { min-height: 44px; padding: 6px 12px; font-size: 14px; }
.stage { position: relative; flex: 1; min-height: 0; touch-action: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tip { position: absolute; z-index: 1; left: 50%; top: 12px; transform: translateX(-50%); width: min(92%, 460px); background: rgba(21, 29, 68, .92); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 15px; text-align: center; pointer-events: none; }
.tip b { color: var(--lantern); }
.toast { position: absolute; z-index: 1; left: 50%; bottom: 16px; transform: translateX(-50%); background: rgba(21, 29, 68, .95); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 14px; pointer-events: none; white-space: nowrap; }

.pad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 56px); gap: 6px; justify-content: center; padding: 10px 0 calc(12px + env(safe-area-inset-bottom)); background: rgba(11, 16, 38, .92); border-top: 1px solid var(--line); user-select: none; -webkit-user-select: none; touch-action: none; }
.pad button { border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); font-size: 24px; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.pad button:active, .pad button.on { background: #2a3775; box-shadow: 0 0 16px rgba(255, 210, 122, .35) inset; }
.pad .u { grid-column: 2; grid-row: 1; } .pad .l { grid-column: 1; grid-row: 2; } .pad .r { grid-column: 3; grid-row: 2; } .pad .d { grid-column: 2; grid-row: 3; }
.pad .c { grid-column: 2; grid-row: 2; display: grid; place-items: center; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
.pad.hidden { display: none; }

.overlay { position: fixed; inset: 0; background: rgba(5, 8, 22, .82); display: grid; place-items: center; z-index: 10; padding: 16px; }
.dialog { width: min(100%, 420px); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.dialog h2 { margin-top: 0; font-size: 20px; }
.dialog .stack { margin-top: 16px; }

/* 結果 */
.result-head { text-align: center; margin: 10px 0 18px; }
.result-head .glow { width: 88px; height: 88px; margin: 0 auto 8px; }
.result-head h2 { margin: 0; font-size: 24px; }

.lantern-glow { filter: drop-shadow(0 0 14px rgba(255, 196, 90, .6)); }
@media (prefers-reduced-motion: no-preference) {
  html:not(.reduce-motion) .lantern-glow { animation: flicker 3.2s ease-in-out infinite; }
}
@keyframes flicker { 0%, 100% { filter: drop-shadow(0 0 12px rgba(255, 196, 90, .55)); } 50% { filter: drop-shadow(0 0 18px rgba(255, 196, 90, .75)); } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.prose h3 { font-size: 17px; margin: 18px 0 6px; }
.prose p, .prose li { color: #d8dcf5; font-size: 15px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 14px; }
.hidden { display: none !important; }
@media (max-width: 380px) {
  .hud .meter .v { font-size: 17px; }
  .pad { grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 50px); }
}

/* ヒント */
.hint-dialog { width: min(100%, 560px); max-height: calc(100vh - 32px); overflow-y: auto; }
.hint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; margin-top: 12px; }
.hint-card { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; min-height: 64px; }
.hint-card:hover:not([disabled]) { border-color: var(--lantern); box-shadow: 0 0 16px rgba(255, 210, 122, .2); }
.hint-card[disabled] { opacity: .45; cursor: not-allowed; }
.hint-icon { font-size: 26px; line-height: 1; width: 32px; text-align: center; flex: none; }
.hint-body { display: grid; gap: 3px; }
.hint-body small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.hint-meta { font-size: 12px; color: var(--muted); }
.hint-meta .badge { font-size: 11px; padding: 0 8px; }
.map-dialog { width: auto; max-width: calc(100vw - 32px); text-align: center; }
.map-canvas { display: block; margin: 8px auto; border-radius: 6px; max-width: 100%; height: auto; }
.map-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 3px; }
.lg.me { background: #ffd27a; border-radius: 50%; } .lg.exit { background: #ff7a5c; } .lg.warp { background: #6fe3d0; border-radius: 50%; } .lg.seen { background: #8f7d5c; }
.target-ind, .flag-ind { position: absolute; z-index: 1; transform: translate(-50%, -50%); font-size: 26px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(11, 16, 38, .8); border: 1px solid rgba(255, 122, 92, .7); box-shadow: 0 0 14px rgba(255, 122, 92, .5); pointer-events: none; }
.target-ind { font-weight: 700; font-size: 22px; }
.boost-badge { position: absolute; z-index: 1; left: 50%; transform: translateX(-50%); bottom: 64px; white-space: nowrap; background: rgba(42, 28, 0, .85); color: var(--lantern); border: 1px solid var(--lantern); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
.lang-pick { display: inline-flex; align-items: center; gap: 6px; }
.lang-select { width: auto; min-height: 40px; padding: 6px 10px; font-size: 15px; }

/* 迷路のカテゴリー */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.cat { display: grid; gap: 2px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.18); color: var(--text); text-decoration: none; min-height: 64px; }
.cat:hover { border-color: var(--lantern); color: var(--text); }
.cat-icon { font-size: 22px; }
.cat small { color: var(--muted); font-size: 12px; }
.maze-list { display: grid; gap: 8px; }
.maze-card { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--text); text-decoration: none; }
.maze-card:hover { border-color: var(--lantern); color: var(--text); }
.maze-rank { font-weight: 700; color: var(--lantern); min-width: 2em; text-align: center; font-variant-numeric: tabular-nums; }
.maze-rank.no { font-size: 12px; }
.maze-main { display: grid; gap: 4px; min-width: 0; }
.maze-main small { font-size: 12px; }
.maze-side { text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; color: var(--muted); }
.stars { color: var(--lantern); letter-spacing: 1px; }
.stars .dim { color: var(--line); }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs .tab { flex: 1; min-height: 44px; border-radius: 999px; display: grid; place-items: center; color: var(--muted); text-decoration: none; font-weight: 600; }
.tabs .tab[aria-selected=true] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 420px) { .maze-card { grid-template-columns: auto 1fr; } .maze-side { grid-column: 2; text-align: left; } }

/* ホームの主人公 */
.hero { position: relative; margin: 0 0 14px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: radial-gradient(420px 220px at 50% 70%, #2a2f5c 0%, #0b1026 70%); }
.hero #hero-stage, .hero #ward-stage { height: 240px; }
.hero.small #ward-stage { height: 220px; }
.showcase-stage { position: relative; width: 100%; height: 100%; cursor: pointer; }
.showcase-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-fallback { display: grid; place-items: center; height: 100%; }
.hero-fallback svg { width: 96px; height: 96px; }
.bubble { position: absolute; z-index: 1; left: 50%; top: 14px; transform: translateX(-50%); max-width: 86%; background: #fff6de; color: #3a2a10; font-weight: 700; padding: 8px 14px; border-radius: 16px; box-shadow: 0 4px 18px rgba(0,0,0,.35); text-align: center; font-size: 15px; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 8px solid transparent; border-top-color: #fff6de; border-bottom: 0; }
html:not(.reduce-motion) .bubble { animation: bubble-in .5s ease-out both; }
@keyframes bubble-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.hero-wardrobe { position: absolute; z-index: 1; right: 10px; bottom: 10px; background: rgba(11,16,38,.75); }
/* 着せ替え */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.skin-card { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.skin-card[aria-selected=true] { border-color: var(--lantern); box-shadow: 0 0 14px rgba(255, 210, 122, .25); }
.skin-card small { color: var(--muted); font-size: 12px; }
.swatch { width: 100%; height: 26px; border-radius: 8px; }
/* オープニング */
.intro { position: fixed; inset: 0; z-index: 50; background: #070a1b; }
.intro-stage { position: absolute; inset: 0; }
.intro-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-caption { position: absolute; left: 50%; bottom: calc(40px + env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; width: min(92%, 520px); text-align: center; font-size: 18px; font-weight: 700; color: #fff3d6; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
.intro-skip { position: absolute; right: 14px; top: calc(14px + env(safe-area-inset-top)); background: rgba(11,16,38,.7); }
.intro-title { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; background: radial-gradient(closest-side, rgba(7,10,27,.72), rgba(7,10,27,.92)); padding: 16px; }
.intro-title h1 { margin: 0; font-size: clamp(34px, 8vw, 56px); color: #ffe7b0; text-shadow: 0 0 24px rgba(255, 196, 90, .6); letter-spacing: .02em; }
.intro-title p { margin: 0 0 8px; color: var(--lantern); font-size: 17px; }
html:not(.reduce-motion) .intro-title { animation: title-in 1s ease-out both; }
@keyframes title-in { from { opacity: 0; } to { opacity: 1; } }
.intro.closing { opacity: 0; transition: opacity .45s; }

/* オープニングの最初（音あり・なしを選ぶ） */
.intro-start { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 16px;
  background: radial-gradient(600px 400px at 50% 40%, #1a2358 0%, #070a1b 70%); }
.intro-start h1 { margin: 0; font-size: clamp(34px, 8vw, 56px); color: #ffe7b0; text-shadow: 0 0 24px rgba(255, 196, 90, .6); }
.intro-start p { margin: 0 0 12px; color: var(--lantern); font-size: 17px; }
.intro-start .stack { width: min(280px, 80vw); }
.intro-stage { transition: opacity .45s; }
.intro-stage.dark { opacity: 0; }
html.reduce-motion .intro-stage { transition: none; }

/* 塔 */
.tower-card { background: linear-gradient(160deg, #26306e, var(--panel) 70%); }
.tower-hero { position: relative; height: 300px; margin: 0 0 14px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #070a1b; }
.tower-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tower-hero.fallback { height: 0; border: 0; }
.zone { border-left: 4px solid var(--zc, var(--line)); }
.zone-head { display: flex; align-items: baseline; gap: 10px; }
.zone-head h3 { margin: 0; }
.zone-range { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.zone-locked { opacity: .6; }
.zone-stone { --zc: #7380ad; } .zone-forest { --zc: #4f9a5c; } .zone-town { --zc: #d8ab80; } .zone-vending { --zc: #e0474f; } .zone-library { --zc: #9a6a44; }
.zone-candy { --zc: #ffa8c8; } .zone-aquarium { --zc: #3fa3bb; } .zone-clouds { --zc: #e6ecfb; } .zone-cosmos { --zc: #7c5ce0; } .zone-summit { --zc: #f5d36e; }
.layer-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.layer-btn { display: grid; place-items: center; gap: 0; min-height: 52px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.2); color: var(--text); text-decoration: none; font-variant-numeric: tabular-nums; }
.layer-btn b { font-size: 17px; line-height: 1.1; }
.layer-btn small { font-size: 11px; color: var(--muted); }
.layer-btn.done { border-color: rgba(255, 210, 122, .5); background: rgba(255, 210, 122, .08); }
.layer-btn.now { border-color: var(--lantern); box-shadow: 0 0 14px rgba(255, 210, 122, .35); }
.layer-btn.locked { opacity: .45; pointer-events: none; }
.layer-btn:hover { border-color: var(--lantern); color: var(--text); }
.maze-rank.no.boss { font-size: 20px; }
.maze-card.locked { opacity: .55; }
.chip.treasure { border-color: rgba(224, 160, 80, .6); }
.treasure-note { color: #ffd9a0; }
.invisible { visibility: hidden; }

/* プレイ中：何階か・鍵 */
.play-badges { position: absolute; z-index: 1; left: 10px; top: 10px; display: grid; gap: 6px; pointer-events: none; }
.pbadge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(11, 16, 38, .82); border: 1px solid var(--line); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pbadge.on { border-color: #ffd27a; color: #ffe7a6; }
.practice-tip-space .play-badges { top: 80px; }
.target-ind.other-floor { width: auto; padding: 0 10px; border-radius: 999px; font-size: 16px; }
.lg.stairs { background: #f3dca0; } .lg.key { background: #ffe066; border-radius: 50%; } .lg.chest { background: #e0a050; }

/* 結果：層の突破・宝箱 */
.celebrate { text-align: center; border-color: rgba(255, 210, 122, .6); box-shadow: 0 0 30px rgba(255, 196, 90, .15); }
.celebrate .big { font-size: 40px; line-height: 1.2; }
.got-item { display: grid; justify-items: center; gap: 6px; margin: 8px auto; width: min(220px, 70%); }

/* 衣装部屋 */
.swatch.lantern { border-radius: 50%; width: 26px; }
.mystery-swatch { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #1b2552 0 6px, #151d44 6px 12px); color: var(--muted); font-weight: 700; }
.skin-card.mystery b { color: var(--muted); }

/* オープニング：映画のような上下の帯と、ゆっくり現れる字幕 */
.intro-bars { position: absolute; inset: 0; pointer-events: none; }
.intro-bars::before, .intro-bars::after { content: ''; position: absolute; left: 0; right: 0; height: 7vh; background: #000; }
.intro-bars::before { top: 0; } .intro-bars::after { bottom: 0; }
.intro-caption { z-index: 1; opacity: 0; transition: opacity .6s; }
.intro-caption.show { opacity: 1; }
html.reduce-motion .intro-caption { transition: none; opacity: 1; }
.intro-sub { color: var(--muted) !important; font-size: 14px !important; }
.intro-title { animation: introTitle 1s ease-out; }
@keyframes introTitle { from { opacity: 0; } to { opacity: 1; } }
html.reduce-motion .intro-title { animation: none; }
.boss-progress { height: 8px; border-radius: 999px; background: rgba(0,0,0,.3); overflow: hidden; margin-top: 10px; }
.boss-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--lantern-2), var(--lantern)); }
.maze-card.locked .lock-note { grid-column: 3; color: var(--muted); font-size: 12px; }

/* ポイント（ひかりのつぶ） */
.hero-points { position: absolute; z-index: 1; left: 10px; bottom: 10px; background: rgba(11,16,38,.75); font-variant-numeric: tabular-nums; }
.points-card { text-align: center; background: linear-gradient(160deg, #3a2f12, var(--panel) 75%); }
.points-big { font-size: 40px; font-weight: 800; color: var(--lantern); text-shadow: 0 0 18px rgba(255, 196, 90, .45); font-variant-numeric: tabular-nums; }
.bundle-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.bundle { display: grid; gap: 2px; place-items: center; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; }
.bundle:hover { border-color: var(--lantern); }
.bundle b { font-size: 17px; color: var(--lantern); }
.bundle .bonus { font-size: 12px; color: var(--ok); }
.bundle small { color: var(--muted); font-size: 12px; }
.reward-ad .dialog { max-width: 380px; }
.ad-label { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.ad-test-box { display: grid; place-items: center; height: 150px; margin: 12px 0; border-radius: 12px; border: 1px dashed var(--line); background: repeating-linear-gradient(45deg, #151d44 0 10px, #1b2552 10px 20px); font-size: 42px; }
.ad-bar { height: 8px; border-radius: 999px; background: rgba(0,0,0,.3); overflow: hidden; }
.ad-bar span { display: block; height: 100%; width: 0; background: var(--lantern); }
.hint-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hint-head h2 { margin: 0; }
.points-chip { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--lantern); color: var(--lantern); text-decoration: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.hint-card.selected { border-color: var(--lantern); box-shadow: 0 0 16px rgba(255, 210, 122, .35); }
.badge.price { background: rgba(255, 210, 122, .15); color: var(--lantern); border: 1px solid rgba(255, 210, 122, .5); }
.badge.price.short { opacity: .6; }

/* ひかりのつぶ（宝石のアイコン） */
.gem-wrap { display: inline-flex; vertical-align: -0.2em; }
.gem { width: 1.15em; height: 1.15em; filter: drop-shadow(0 0 3px rgba(255, 186, 80, .65)); }
.points-big .gem { width: 1em; height: 1em; filter: drop-shadow(0 0 10px rgba(255, 186, 80, .8)); }
.gem-pile { display: flex; justify-content: center; align-items: flex-end; height: 34px; margin-bottom: 2px; }
.gem-pile .gem { width: 22px; height: 22px; }
.gem-pile .gem-wrap + .gem-wrap { margin-left: -8px; }
.gem-pile.n1 .gem { width: 28px; height: 28px; }
.gem-pile.n3 .gem-wrap:nth-child(2) .gem, .gem-pile.n5 .gem-wrap:nth-child(3) .gem { width: 30px; height: 30px; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.reduce-motion) .points-big .gem { animation: gemGlow 2.8s ease-in-out infinite; }
}
@keyframes gemGlow { 0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 186, 80, .6)); } 50% { filter: drop-shadow(0 0 16px rgba(255, 200, 100, .95)); } }

/* 画面の上：ロゴと持っているポイント */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar .brand { min-width: 0; }
.top-points { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 1px solid rgba(255, 210, 122, .55); background: rgba(42, 28, 0, .45); color: var(--lantern); text-decoration: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.top-points:hover { border-color: var(--lantern); color: #ffe3a8; box-shadow: 0 0 14px rgba(255, 196, 90, .3); }
.shop-card { background: linear-gradient(160deg, #3a2f12, var(--panel) 70%); }
.shop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shop-row h2 { margin: 0; }
.shop-bal { font-size: 22px; font-weight: 800; color: var(--lantern); font-variant-numeric: tabular-nums; }

/* 全画面の広告枠（層クリア時） */
.overlay.interstitial { z-index: 60; padding: 0; display: flex; flex-direction: column; background: radial-gradient(120% 80% at 50% 30%, #1d2a66 0%, #0b1026 60%, #05081a 100%); }
.ist-top { width: 100%; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; padding: max(12px, env(safe-area-inset-top)) 16px 8px; }
.ist-label { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; background: rgba(11, 16, 38, .6); }
.ist-skip { min-width: 112px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: rgba(11, 16, 38, .7); color: var(--text); font: inherit; font-size: 14px; padding: 6px 14px; cursor: pointer; }
.ist-skip:disabled { color: var(--muted); cursor: default; }
.ist-skip:not(:disabled) { border-color: var(--lantern); color: var(--lantern); }
.ist-body { flex: 1; display: grid; place-items: center; padding: 8px 16px max(20px, env(safe-area-inset-bottom)); overflow: auto; }
.ist-sponsor { display: block; max-width: min(100%, 540px); }
.ist-sponsor img { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; border-radius: 12px; }
.ist-adv { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.ist-house { max-width: 420px; width: 100%; text-align: center; }
.ist-house h2 { font-size: clamp(22px, 6vw, 30px); margin: 4px 0 10px; line-height: 1.35; }
.ist-house > p { color: var(--muted); line-height: 1.7; margin: 0 0 14px; }
.ist-kicker { letter-spacing: .2em; text-transform: uppercase; font-size: 12px; color: var(--lantern); margin: 8px 0 0; }
.ist-glow { width: 96px; height: 96px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(255, 196, 90, .35), rgba(255, 196, 90, 0) 70%); }
.ist-glow svg { width: 64px; height: 64px; }
.ist-facts { list-style: none; padding: 0; margin: 0 0 18px; text-align: left; display: grid; gap: 8px; }
.ist-facts li { background: rgba(21, 29, 68, .8); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 10px 34px; position: relative; font-size: 14px; }
.ist-facts li::before { content: ''; position: absolute; left: 13px; top: 15px; width: 9px; height: 9px; border-radius: 50%; background: var(--lantern); box-shadow: 0 0 8px var(--lantern); }
@media (prefers-reduced-motion: no-preference) {
  html:not(.reduce-motion) .overlay.interstitial:not(.calm) .ist-house { animation: title-in .5s ease-out both; }
}

/* 利用規約・プライバシーポリシー */
.prose.legal { line-height: 1.8; }
.prose.legal ol, .prose.legal ul { padding-left: 1.4em; margin: 4px 0 10px; }
.prose.legal li { margin: 2px 0; }
.prose.legal .note { color: var(--muted); font-size: 13px; margin-top: 20px; }
.prose.legal .msg { margin-bottom: 12px; }
