/* アズさがし — 小さく、静かに、洗練。紙色＋インク＋アクセント1色。 */
:root {
  --paper: #f7f5f0;
  --card: #fffdf9;
  --ink: #23211d;
  --sub: #8a857b;
  --line: #e5e0d5;
  --accent: #b8562a;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  background:
    radial-gradient(120% 60% at 50% -8%, #fffdf6 0%, rgba(255,253,246,0) 55%),
    radial-gradient(90% 40% at 50% 108%, #efe9dc 0%, rgba(239,233,220,0) 60%),
    var(--paper);
  color: var(--ink);
  line-height: 1.75;
  font-size: 15px;
}
.wrap { max-width: 480px; margin: 0 auto; padding: 20px 18px 28px; min-height: 100svh; display: flex; flex-direction: column; }
.screen { display: none; }
.screen.active { display: block; animation: fadein .45s cubic-bezier(.22,.8,.3,1); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen.active { animation: none; } }

/* タイトル */
.brand { font-size: 11px; letter-spacing: .32em; color: var(--sub); text-align: center; margin-top: 26px; }
.title-art { display: flex; justify-content: center; padding: 26px 0 2px; }
.title-art svg { filter: drop-shadow(0 6px 14px rgba(35,33,29,.14)); animation: artfloat 5.5s ease-in-out infinite alternate; }
@keyframes artfloat { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .title-art svg { animation: none; } }
.game-title { font-size: 32px; font-weight: 700; text-align: center; letter-spacing: .06em; }
.tagline { text-align: center; color: #55524b; margin-top: 12px; font-size: 14px; }
.stage-list { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.stage-card {
  appearance: none; text-align: left; font: inherit; cursor: pointer;
  background: linear-gradient(180deg, #fffefa, var(--card)); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 1px;
  box-shadow: 0 1px 2px rgba(35,33,29,.05), 0 8px 20px -14px rgba(35,33,29,.25);
  transition: transform .25s cubic-bezier(.22,.8,.3,1), border-color .25s, box-shadow .25s;
}
.stage-card:active { transform: scale(.98); }
.stage-card { position: relative; }
.stage-card.cleared::after { content: ""; position: absolute; top: 15px; right: 15px; width: 8px; height: 8px; border-radius: 50%; background: #5b8c5a; box-shadow: 0 0 0 4px rgba(91,140,90,.13); }
.stage-card.cleared .stage-best { color: var(--accent); font-weight: 700; }
.stage-no { font-size: 10px; letter-spacing: .26em; color: var(--accent); font-weight: 700; }
.stage-name { font-size: 17px; font-weight: 700; }
.stage-sub { font-size: 12.5px; color: #55524b; }
.stage-best { font-size: 12px; color: var(--sub); margin-top: 4px; }
.title-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 26px; }
.btn {
  appearance: none; border: 1px solid var(--ink); background: var(--card); color: var(--ink);
  font: inherit; font-size: 15px; padding: 11px 34px; border-radius: 999px; cursor: pointer;
  transition: transform .25s cubic-bezier(.22,.8,.3,1), background .25s;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.small { padding: 5px 16px; font-size: 13px; }
.btn:active { transform: scale(.97); }
.howto-link { text-align: center; margin-top: 26px; font-size: 13px; }
.howto-link a, .foot a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); }
.fineprint { text-align: center; color: var(--sub); font-size: 12px; margin-top: 14px; }

/* プレイ */
.play-head { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 4px; }
#play-stage-label { font-size: 10px; letter-spacing: .26em; color: var(--accent); font-weight: 700; }
#play-title { font-size: 20px; font-weight: 700; line-height: 1.4; }
.hud { display: flex; gap: 14px; align-items: baseline; margin-top: 10px; padding: 8px 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; color: #55524b; }
.hud-remain { font-size: 17px; font-weight: 700; color: var(--ink); display: inline-block; }
.hud-dots { display: inline-flex; gap: 5px; align-items: center; padding-bottom: 2px; }
.hud-dot { width: 7px; height: 7px; border-radius: 50%; background: #ddd5c2; transition: background .3s cubic-bezier(.22,.8,.3,1), transform .3s cubic-bezier(.22,.8,.3,1), box-shadow .3s; }
.hud-dot.on { background: var(--accent); transform: scale(1.18); box-shadow: 0 0 0 3px rgba(184,86,42,.12); }
#hud-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.play-note { font-size: 12.5px; color: var(--sub); margin-top: 10px; }
.scene-box { margin-top: 12px; }
.screen.active .scene-box { animation: scenein .55s cubic-bezier(.22,.8,.3,1) both; }
.screen.active figure.scene-box:nth-of-type(2) { animation-delay: .09s; }
@keyframes scenein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen.active .scene-box { animation: none; } }
.scene-box figcaption { font-size: 11px; letter-spacing: .18em; color: var(--sub); margin-bottom: 5px; }
.scene-holder { background: linear-gradient(180deg, #fffefa, var(--card)); border: 1px solid #ddd5c2; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(35,33,29,.06), 0 16px 30px -16px rgba(35,33,29,.38), inset 0 0 0 1px rgba(255,255,255,.5); }
.scene { display: block; width: 100%; height: auto; cursor: pointer; touch-action: manipulation; }
.found-ring { fill: none; stroke: var(--accent); stroke-width: 3.2; stroke-linecap: round; opacity: .92; animation: ringin .35s cubic-bezier(.22,.8,.3,1); }
.found-ring-soft { fill: none; stroke: var(--accent); stroke-width: 8; opacity: .14; }
.tap-ripple { fill: none; stroke: var(--accent); stroke-width: 2; opacity: .55; pointer-events: none; }
.fx-dot { pointer-events: none; }
@keyframes ringin { from { opacity: 0; } to { opacity: .92; } }
.miss-ring { fill: none; stroke: #a8adb6; stroke-width: 2.4; opacity: .8; }
.miss-note { min-height: 1.6em; font-size: 13px; color: var(--accent); margin-top: 10px; text-align: center; }
.miss-note.note-pop { animation: notepop .38s cubic-bezier(.22,.8,.3,1); }
@keyframes notepop { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .miss-note.note-pop { animation: none; } }
/* クリア画面：つぎのステージへの静かな呼吸 */
#screen-clear .btn.primary { animation: breathe 2.8s ease-in-out infinite alternate; }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.025); } }
@media (prefers-reduced-motion: reduce) { #screen-clear .btn.primary { animation: none; } }

/* クリア */
.end-title { font-size: 24px; text-align: center; margin-top: 22px; }
.end-stage { text-align: center; color: var(--sub); font-size: 13px; margin-top: 6px; letter-spacing: .08em; }
.end-stats { margin: 26px auto 0; max-width: 300px; border-top: 1px solid var(--line); }
.end-stats > div { display: flex; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.end-stats dt { color: var(--sub); font-size: 13px; }
.end-stats dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.record-note { text-align: center; color: var(--accent); font-size: 13px; font-weight: 700; margin-top: 12px; min-height: 1em; }
.clear-rank { text-align: center; color: var(--accent); font-size: 15px; font-weight: 700; letter-spacing: .1em; margin-top: 14px; }
.clear-praise { text-align: center; color: #55524b; font-size: 13.5px; margin-top: 6px; padding: 0 12px; }
#screen-clear { position: relative; }
.clear-fx { position: absolute; inset: 0 0 auto 0; height: 0; pointer-events: none; overflow: visible; }
.confetti { position: absolute; top: 0; width: 7px; height: 10px; border-radius: 2px; opacity: 0; }

/* 音トグル */
.sound-row { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.sound-row.compact { justify-content: flex-end; margin-top: 8px; }
.snd-btn {
  appearance: none; font: inherit; font-size: 12px; letter-spacing: .06em; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); color: var(--sub); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
  transition: transform .22s cubic-bezier(.22,.8,.3,1), background .22s, color .22s, border-color .22s;
}
.snd-btn:active { transform: scale(.96); }
.snd-btn .snd-state { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--sub); }
.snd-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #f5f2ea; }
.snd-btn[aria-pressed="true"] .snd-state { color: #e9b98f; }

.foot { margin-top: auto; padding-top: 28px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--sub); }
.foot span { margin-right: auto; }

/* ガイドページ */
.guide h1 { font-size: 24px; line-height: 1.45; margin-top: 14px; }
.guide h2 { font-size: 17px; margin: 28px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.guide p { margin: 8px 0; }
.guide ul, .guide ol { margin: 8px 0 8px 1.3em; }
.guide li { margin: 4px 0; }
.guide .back { display: inline-block; margin-top: 26px; color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); }

/* === Webアプリ化 (2026-10-28): ゲーム本編ページ専用 (body.app スコープ)。guide/terms は対象外 === */
html:has(body.app){overscroll-behavior:none}
body.app{position:fixed;inset:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none;touch-action:manipulation}
body.app .wrap{height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;padding-bottom:calc(28px + env(safe-area-inset-bottom))}

/* === 再点検パス (2026-10-29): 新条件一式 ===
   長押し全廃／収納の再編／チップ被り回避／プレイヤーチップ／ショップ／
   プログレス線／ネイティブ級演出。場面絵（scenes.js）・差分・判定・数値は無変更。 */
/* --- 長押しポップアップ全廃（本作に入力欄はないため面全体に徹底） --- */
.wrap, .wrap *, .az-intro-overlay, .az-intro-overlay * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
/* --- CENTERチップ被り回避（本作側・共通キット無変更）: プレイ中は隠し、他画面は上部の帯で回避 --- */
body.play-active #azc-chip, body.play-active #azc-menu { display: none !important; }
/* --- 終了画面の選択肢を覆わない（2026-11-01）: ホーム追加カード（.azip-card）は
   プレイ中とクリア画面では出さない（CENTERチップと同じ扱い）。従来はプレイ画面
   下段の絵の差分タップと、クリア画面の「ステージ選択へ」がカードに覆われて
   押せなかった。タイトル等では従来どおり出す。 */
body.play-active .azip-card, body.end-active .azip-card { display: none !important; }
#screen-shop { padding-top: 34px; }
#screen-clear { padding-top: 18px; }
/* --- プログレス線: 本作の基調（アクセント）に溶ける細さ・点滅なし --- */
#az-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1200; pointer-events: none; opacity: 0; transition: opacity .3s cubic-bezier(.22,.8,.3,1); }
#az-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, rgba(184,86,42,.45), #b8562a 70%); border-radius: 0 2px 2px 0; box-shadow: 0 1px 5px rgba(184,86,42,.35); }
/* --- CENTERアバター／名前（プレイヤー本人・全タイトル共通の見せ方） --- */
.az-player { display: flex; align-items: center; gap: 9px; }
.azp-av { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none; background: #e9e2d2; box-shadow: 0 0 0 1px var(--line), 0 3px 7px rgba(35,33,29,.13); }
.azp-av svg, .azp-av img { width: 36px; height: 36px; display: block; object-fit: cover; }
.azp-meta { display: flex; flex-direction: column; line-height: 1.3; text-align: left; min-width: 0; }
.azp-name { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 44vw; }
.azp-sub { font-size: 10px; color: var(--sub); letter-spacing: .1em; font-weight: 700; }
.title-player { justify-content: center; width: fit-content; max-width: 100%; margin: 16px auto 0; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 16px 5px 5px; box-shadow: 0 6px 14px rgba(35,33,29,.06); }
.res-player { justify-content: center; margin: 14px 0 2px; }
/* --- 案内役ミッケ（差分に触れない周辺配置のみ。場面絵の中には置かない） --- */
.guide-row { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 18px; }
.guide-row.center { margin-top: 16px; }
.guide-char { width: 56px; height: 56px; flex: none; filter: drop-shadow(0 4px 8px rgba(35,33,29,.16)); animation: artfloat 5.5s ease-in-out infinite alternate; }
.guide-char.small { width: 44px; height: 44px; }
.guide-meta { text-align: left; }
.guide-name { font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.guide-line { font-size: 12px; color: var(--sub); line-height: 1.55; }
@media (prefers-reduced-motion: reduce) { .guide-char { animation: none; } }
/* --- プレイ画面の収納再編: 縦の chrome を畳み、場面絵を横いっぱいに広げて両枚＋情報が 844 内に収まる形（縮小ではなく再編で大きく） --- */
/* バグ修正 (2026-10-29): hidden だと 844px 未満の画面で2枚目の下部が切れて到達不能になる。
   収まる画面ではスクロールが発生しないため見た目は不変。溢れる画面だけスクロールで救済する。 */
body.play-active .wrap { overflow-y: auto; padding: 14px 10px 12px; }
body.play-active .foot { display: none; }
body.play-active .azi-strip { display: none !important; }
#screen-play .play-head { margin-top: 0; }
#screen-play .hud { margin-top: 6px; padding: 5px 2px; }
#screen-play .play-note { margin-top: 6px; }
#screen-play .sound-row.compact { margin-top: 5px; }
#screen-play .sound-row.compact .snd-btn { padding: 4px 11px; }
#screen-play .scene-box { margin-top: 7px; }
#screen-play .scene-box figcaption { margin-bottom: 3px; }
#screen-play .miss-note { margin-top: 6px; min-height: 1.5em; }
/* 低い画面ではプレイ画面が縦に溢れて下の絵・ヒントボタンが押せなくなるため、
   絵（4:3×2枚）の幅をビューポート高から逆算し、画面内に必ず収める（2026-11-02） */
#screen-play .scene-box { width: min(100%, max(150px, calc((100svh - 314px) * 0.6667))); margin-inline: auto; }
/* 低い画面ではクリア画面の選択肢ボタンが画面下に落ちて押せなくなるため、
   低い画面だけ余白・行間を詰めて全ボタンを画面内に収める（2026-11-02） */
@media (max-height: 720px) {
  #screen-clear .end-title { margin-top: 6px; font-size: 20px; }
  #screen-clear .clear-rank { margin-top: 6px; }
  #screen-clear .clear-praise { margin-top: 4px; }
  #screen-clear .end-stats { margin-top: 10px; }
  #screen-clear .end-stats > div { padding: 5px 2px; }
  #screen-clear .record-note { margin-top: 4px; }
  #screen-clear .title-actions { margin-top: 12px; gap: 8px; }
  #screen-clear .btn { padding-top: 7px; padding-bottom: 7px; }
  #screen-clear .howto-link { margin-top: 8px; }
}
/* --- ネイティブアプリ級の演出（静かなイージングのみ）: タイトルのスタッガード登場 --- */
@keyframes riseIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
#screen-title.active > * { animation: riseIn .55s cubic-bezier(.22,1,.36,1) both; }
#screen-title.active > *:nth-child(2) { animation-delay: .05s; }
#screen-title.active > *:nth-child(3) { animation-delay: .1s; }
#screen-title.active > *:nth-child(4) { animation-delay: .15s; }
#screen-title.active > *:nth-child(5) { animation-delay: .2s; }
#screen-title.active > *:nth-child(6) { animation-delay: .25s; }
#screen-title.active > *:nth-child(7) { animation-delay: .3s; }
#screen-title.active .stage-card { animation: riseIn .45s cubic-bezier(.22,1,.36,1) both; }
#screen-title.active .stage-card:nth-child(2) { animation-delay: .05s; }
#screen-title.active .stage-card:nth-child(3) { animation-delay: .1s; }
/* --- ショップ導線（タイトル） --- */
.menu-row {
  appearance: none; width: 100%; margin-top: 14px; display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-size: 14.5px; font-weight: 700; color: var(--ink); padding: 13px 16px; cursor: pointer;
  transition: transform .16s cubic-bezier(.22,1,.36,1);
}
.menu-row:active { transform: scale(.985); }
.menu-row .mr-sub { font-size: 11.5px; color: var(--sub); font-weight: 400; }
/* --- ショップ画面 --- */
.shop-head { display: flex; align-items: center; gap: 10px; }
.shop-title { font-size: 19px; letter-spacing: .05em; flex: 1; }
.shop-note { font-size: 12px; color: var(--sub); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; line-height: 1.65; margin-top: 14px; }
.shop-cat-head { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--sub); margin: 18px 2px 2px; }
.shop-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.shop-item .s-main { flex: 1; min-width: 0; }
.shop-item .s-main b { font-size: 14.5px; }
.shop-item .s-effect { flex: 0 0 100%; color: var(--sub); font-size: 12px; line-height: 1.65; }
.shop-item .s-price { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shop-item .s-tax { font-size: 10px; color: var(--sub); font-weight: 700; margin-left: 3px; }
.shop-ic-wrap { width: 36px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center; background: #fffdf8; border: 1px solid var(--line); border-radius: 10px; }
.shop-ic { width: 23px; height: 23px; display: block; }
.shop-badge-design { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: #b8562a; background: rgba(184,86,42,.12); border-radius: 99px; padding: 2px 7px; margin-left: 7px; vertical-align: 2px; }
.btn-disabled { font-size: 12px; font-weight: 700; color: var(--sub); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; white-space: nowrap; font: inherit; }
.catalog-btn:disabled { opacity: .85; cursor: default; }
#screen-shop.active .catalog-row, #screen-shop.active .ref-item { animation: riseIn .34s cubic-bezier(.22,1,.36,1) both; }
@media (prefers-reduced-motion: reduce) {
  #screen-title.active > *, #screen-title.active .stage-card, #screen-shop.active .catalog-row, #screen-shop.active .ref-item { animation: none; }
}

/* === アイテムショップ大型化＋効果反映（ITEM-SHOP-SPEC） === */
/* === アイテムショップ大型化（ITEM-SHOP-SPEC・フラッグシップ選択欄の文法） === */
.azs-balance { display: flex; align-items: baseline; gap: 10px; margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.azs-balance-label { font-size: 11px; letter-spacing: .08em; color: var(--sub); font-weight: 700; }
.azs-balance-num { font-size: 20px; font-variant-numeric: tabular-nums; }
.azs-balance-link { margin-left: auto; font-size: 12px; color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); }
.azs-guest { margin-top: 18px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 16px; }
.azs-guest p { font-size: 13.5px; line-height: 1.7; margin-bottom: 14px; }
.azs-stage { display: flex; align-items: center; gap: 4px; margin-top: 18px; }
.azs-arrow { appearance: none; border: none; background: none; font-size: 30px; line-height: 1; color: var(--sub); cursor: pointer; padding: 10px 6px; flex: none; transition: transform .25s cubic-bezier(.22,.8,.3,1), color .25s; -webkit-tap-highlight-color: transparent; }
.azs-arrow:active { transform: scale(.9); color: var(--ink); }
.azs-focus { flex: 1; height: 218px; border-radius: 20px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; transition: background .45s cubic-bezier(.22,.8,.3,1); }
.azs-focus .shop-ic { width: 132px; height: 132px; animation: azsIn .5s cubic-bezier(.22,.8,.3,1) both; }
@keyframes azsIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.azs-info { text-align: center; margin-top: 16px; }
.azs-kind { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--sub); }
.azs-name { font-size: 22px; letter-spacing: .03em; margin-top: 4px; }
.azs-effect { font-size: 13px; color: #55524b; line-height: 1.7; margin-top: 8px; min-height: 2.6em; }
.azs-price { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 6px; }
.azs-price-unit { font-size: 13px; font-weight: 700; color: var(--sub); }
.azs-owned { font-size: 12.5px; color: var(--accent); font-weight: 700; min-height: 1.4em; margin-top: 4px; }
.azs-action { width: 100%; margin-top: 10px; padding: 14px 26px; font-size: 16px; }
.azs-action:disabled { opacity: .45; cursor: default; }
.azs-note { font-size: 11.5px; color: var(--sub); margin-top: 10px; }
.azs-note a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); }
.azs-dots { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.azs-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--line); transition: background .3s, width .3s cubic-bezier(.22,.8,.3,1); }
.azs-dot.on { background: var(--ink); width: 18px; }
.azs-strip { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.azs-thumb { position: relative; appearance: none; width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .25s cubic-bezier(.22,.8,.3,1), border-color .25s; -webkit-tap-highlight-color: transparent; }
.azs-thumb .shop-ic { width: 30px; height: 30px; }
.azs-thumb.on { border-color: var(--ink); transform: translateY(-2px); }
.azs-thumb-owned { position: absolute; right: 3px; bottom: 3px; font-size: 9px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 99px; padding: 1px 5px; }
.azs-sheet-wrap { position: fixed; inset: 0; z-index: 60; }
.azs-sheet-backdrop { position: absolute; inset: 0; background: rgba(28,26,22,.42); animation: azsFade .25s ease both; }
.azs-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--card); border-radius: 20px 20px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto; animation: azsSheet .38s cubic-bezier(.22,.8,.3,1) both; }
@keyframes azsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes azsSheet { from { transform: translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }
.azs-sheet-kind { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--sub); }
.azs-sheet-name { font-size: 19px; margin-top: 3px; }
.azs-sheet-rows { margin-top: 14px; border-top: 1px solid var(--line); }
.azs-sheet-rows > div { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.azs-sheet-rows b { font-size: 16px; font-variant-numeric: tabular-nums; }
.azs-sheet-note { font-size: 11.5px; color: var(--sub); margin-top: 12px; }
.azs-sheet-note a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); }
.azs-sheet-error { font-size: 13px; color: #b03a30; margin-top: 10px; }
.azs-sheet-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.azs-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); background: var(--ink); color: #fff; font-size: 13.5px; padding: 11px 18px; border-radius: 99px; opacity: 0; pointer-events: none; transition: opacity .35s cubic-bezier(.22,.8,.3,1), transform .35s cubic-bezier(.22,.8,.3,1); z-index: 70; max-width: 88vw; text-align: center; }
.azs-toast.on { opacity: 1; transform: translate(-50%, 0); }

.play-items { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.item-qty { font-weight: 700; color: var(--accent); }
.hint-ring { fill: none; stroke: #d9a441; stroke-width: 3.2; stroke-dasharray: 7 5; opacity: .95; pointer-events: none; animation: ringin .35s cubic-bezier(.22,.8,.3,1); }
.hint-area { fill: rgba(217,164,65,.13); stroke: #d9a441; stroke-width: 2; stroke-dasharray: 9 6; pointer-events: none; }
/* スキン：真鍮のルーペ（発見の輪が金の輪に） */
body.skin-ring-brass .found-ring { stroke: #b08a2e; stroke-width: 4.4; }
body.skin-ring-brass .found-ring-soft { stroke: #d9a441; stroke-width: 10; opacity: .22; }
/* スキン：木の額縁（場面絵の額縁が木に） */
body.skin-frame-wood .scene-holder { border: 6px solid #8a6844; border-radius: 8px; box-shadow: inset 0 0 0 2px #c9a06a, 0 1px 2px rgba(35,33,29,.08), 0 16px 30px -16px rgba(90,60,25,.5); }
/* スキン：AZRIONプレミアム（輪に金のライン＋額縁に金の縁） */
body.skin-ring-azrion .found-ring { stroke: #d9a441; stroke-width: 4.2; }
body.skin-ring-azrion .found-ring-soft { stroke: #d9a441; opacity: .2; }
body.skin-ring-azrion .scene-holder { box-shadow: inset 0 0 0 2px rgba(217,164,65,.8), 0 1px 2px rgba(35,33,29,.06), 0 16px 30px -16px rgba(35,33,29,.38); border-color: #c9a441; }
/* テーマ：ギャラリーの壁（画面まわりが美術館の壁の色合い） */
body.theme-gallery-day { --paper: #efe9dc; --card: #fffdf6; --line: #ddd2ba; }
body.theme-gallery-day .scene-holder { border-color: #cbbfa5; }
/* テーマ：夜の展示室（画面全体が夜の静かな灯り） */
body.theme-gallery-night { --paper: #171a26; --card: #232838; --ink: #ece9e1; --sub: #9aa0ae; --line: #343a47; --accent: #d9a441; }
body.theme-gallery-night .azs-effect { color: #c9cdd6; }
body.theme-gallery-night .hud { color: #c9cdd6; }
body.theme-gallery-night .scene-holder { border-color: #343a47; }
body.theme-gallery-night .azs-focus { border-color: #343a47; }

.azs-banner{display:block;margin:30px 0 2px;width:100vw;max-width:100vw;margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);border-radius:0;overflow:hidden;line-height:0;aspect-ratio:4/1;background:#16222e;transition:transform .12s ease}
.azs-banner img{display:block;width:100%;height:100%;object-fit:cover}
.azs-banner:active{transform:scale(.99)}

/* === ノースクロール是正 (2026-11-01 FIX1): タイトル画面を 375×812 に収める ===
   構造のみの是正（文言・導線・世界観は不変）。ステージ一覧は縦積みカードから
   2列グリッドへ組み替え、装飾と余白のリズムを詰める。 */
body.app .wrap { padding-top: 14px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
#screen-title .brand { margin-top: 8px; }
#screen-title .title-art { padding: 10px 0 0; }
#screen-title .title-art svg { width: 58px; height: 58px; }
#screen-title .game-title { font-size: 29px; line-height: 1.3; }
#screen-title .tagline { margin-top: 8px; line-height: 1.6; }
#screen-title .guide-row { margin-top: 10px; gap: 10px; }
#screen-title .guide-char { width: 42px; height: 42px; }
#screen-title .guide-name { font-size: 12.5px; }
#screen-title .guide-line { font-size: 11.5px; line-height: 1.45; }
#screen-title .title-player { margin-top: 10px; padding: 4px 14px 4px 4px; }
#screen-title .title-player .azp-av, #screen-title .title-player .azp-av svg, #screen-title .title-player .azp-av img { width: 30px; height: 30px; }
#screen-title .stage-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
#screen-title .stage-card { padding: 9px 12px; gap: 0; line-height: 1.4; border-radius: 12px; }
#screen-title .stage-card.cleared::after { top: 10px; right: 10px; }
#screen-title .stage-no { font-size: 9.5px; }
#screen-title .stage-name { font-size: 15.5px; line-height: 1.35; margin-top: 1px; }
#screen-title .stage-sub { font-size: 11.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#screen-title .stage-best { font-size: 11px; margin-top: 2px; }
#screen-title .menu-row { margin-top: 10px; padding: 11px 16px; }
#screen-title .sound-row { margin-top: 12px; }
#screen-title .howto-link { margin-top: 12px; }
#screen-title .fineprint { font-size: 11px; line-height: 1.55; margin-top: 10px; }
#screen-title .azs-banner { margin-top: 16px; }
.foot { padding-top: 16px; }

/* === ノースクロール是正 第2段 (2026-11-01 FIX1): ステージカード横組み＋最終圧縮 ===
   カード内マークアップは不変。flex の並べ替えだけで「NO＋名前＋ベスト／サブ」の
   2段カードに組み替える。 */
#screen-title .stage-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
#screen-title .stage-card { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 8px; padding: 8px 12px; }
#screen-title .stage-no { order: 1; font-size: 9.5px; }
#screen-title .stage-name { order: 2; flex: 1 1 auto; font-size: 15.5px; line-height: 1.35; margin-top: 0; }
#screen-title .stage-best { order: 3; font-size: 11px; margin-top: 0; }
#screen-title .stage-sub { order: 4; flex: 1 1 100%; font-size: 11.5px; line-height: 1.4; display: block; overflow: visible; margin-top: 1px; }
#screen-title .stage-card.cleared::after { top: 8px; right: 8px; }
#screen-title .brand { margin-top: 4px; line-height: 1.4; }
#screen-title .title-art { padding-top: 6px; }
#screen-title .title-art svg { width: 44px; height: 44px; }
#screen-title .game-title { font-size: 26px; line-height: 1.25; }
#screen-title .tagline { margin-top: 6px; font-size: 13.5px; }
#screen-title .guide-row { margin-top: 8px; }
#screen-title .guide-char { width: 38px; height: 38px; }
#screen-title .guide-name { line-height: 1.3; }
#screen-title .guide-line { line-height: 1.4; }
#screen-title .title-player { margin-top: 8px; padding: 3px 12px 3px 3px; }
#screen-title .title-player .azp-av, #screen-title .title-player .azp-av svg, #screen-title .title-player .azp-av img { width: 28px; height: 28px; }
#screen-title .menu-row { margin-top: 8px; padding: 10px 16px; }
#screen-title .sound-row { margin-top: 8px; }
#screen-title .sound-row .snd-btn { padding: 5px 12px; }
#screen-title .howto-link { margin-top: 8px; line-height: 1.5; }
#screen-title .fineprint { font-size: 10.5px; line-height: 1.5; margin-top: 6px; }
#screen-title .azs-banner { margin-top: 12px; height: 46px; aspect-ratio: auto; }
#screen-title .azs-banner img { object-position: center 42%; }
.foot { padding-top: 12px; line-height: 1.5; }

/* === ノースクロール是正 第3段 (2026-11-01 FIX1): 仕上げの圧縮 === */
body.app .wrap { padding-top: 12px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
#screen-title .brand { margin-top: 2px; }
#screen-title .title-art { padding-top: 2px; }
#screen-title .title-art svg { width: 40px; height: 40px; }
#screen-title .game-title { line-height: 1.2; }
#screen-title .tagline { line-height: 1.5; }
#screen-title .guide-row { margin-top: 8px; }
#screen-title .guide-char { width: 34px; height: 34px; }
#screen-title .title-player { margin-top: 8px; padding: 2px 11px 2px 2px; }
#screen-title .title-player .azp-av, #screen-title .title-player .azp-av svg, #screen-title .title-player .azp-av img { width: 26px; height: 26px; }
#screen-title .stage-list { gap: 7px; margin-top: 8px; }
#screen-title .stage-card { padding: 7px 12px; }
#screen-title .stage-name { font-size: 15px; }
#screen-title .stage-sub { font-size: 11px; line-height: 1.35; }
#screen-title .menu-row { margin-top: 8px; padding: 9px 16px; }
#screen-title .sound-row { margin-top: 8px; }
#screen-title .sound-row .snd-btn { padding: 4px 12px; }
#screen-title .howto-link { margin-top: 6px; }
#screen-title .fineprint { line-height: 1.45; }
#screen-title .azs-banner { margin-top: 10px; height: 38px; }
.foot { padding-top: 10px; font-size: 11.5px; }
.azi-strip { padding-top: 10px !important; padding-bottom: 10px !important; }
.azi-strip-title { line-height: 1.35 !important; }
.azi-strip-sub { line-height: 1.4 !important; }

/* === タイトル圧縮（2026-11-02 ステージ増量対応） ===
   ステージが6枚になり、タイトル下部のリンク行がホーム追加カードに
   覆われるようになったため、カードと装飾の寸法・余白のみ詰める。
   構造・文言は不変。 */
#screen-title .stage-card { padding: 5px 12px; }
#screen-title .stage-name { font-size: 16px; }
#screen-title .stage-list { gap: 6px; }
#screen-title .title-art { padding-top: 0; }
#screen-title .title-art svg { width: 34px; height: 34px; }
#screen-title .stage-list { margin-top: 6px; }

/* 低い画面（375×667等）ではステージ一覧を3枚ずつのページ送りにして、
   タイトル全体をホーム追加カードの上端より上に収める（ゲームの作法：
   収まらない一覧はページ送りで見せる）。 */
.stage-pager { display: none; }
@media (max-height: 720px) {
  #screen-title .stage-list[data-page="0"] .stage-card:nth-child(n+4) { display: none; }
  #screen-title .stage-list[data-page="1"] .stage-card:nth-child(-n+3) { display: none; }
  .stage-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; }
  .pager-btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 17px; width: 40px; height: 30px; border-radius: 999px; cursor: pointer; line-height: 1; }
  .pager-btn:disabled { opacity: .35; cursor: default; }
  .pager-label { font-size: 12px; color: var(--sub); letter-spacing: .12em; }
  /* 案内役の行も少しだけ詰めて、下部のリンク行をカードの上に逃がす */
  #screen-title .guide-row { margin: 0; }
  #screen-title .guide-char { width: 26px; height: 26px; }
  #screen-title .guide-line { display: none; }
  #screen-title .tagline { line-height: 1.35; margin: 2px 0; }
}

/* タイトルでホーム追加カードが開いている間は、アズサババナーを退ける
   （カードを閉じれば戻る。バナーは広告枠で、覆われたままにしない） */
body:has(#screen-title.active):has(.azip-card.open) #screen-title .azs-banner { display: none; }
