/* アズメモリー — 小さく、静かに、洗練。紙色＋インク＋金アクセント。 */
:root {
  --paper: #f7f5f0;
  --card: #fffdf9;
  --ink: #23211d;
  --sub: #8a857b;
  --line: #e5e0d5;
  --gold: #c9a227;
  --gold-soft: #efe3b8;
  --navy: #1c2742;
  --navy-deep: #141c31;
  --radius: 12px;
}
* { 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: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}
.wrap { max-width: 480px; margin: 0 auto; padding: 20px 16px 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; } }

/* タイトル */
.brand { font-size: 11px; letter-spacing: .32em; color: var(--sub); text-align: center; margin-top: 24px; }
.title-cards { display: flex; justify-content: center; gap: 10px; padding: 30px 0 6px; }
.mini-card {
  width: 64px; height: 88px; border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(28,39,66,.14); background: var(--navy);
  display: flex; align-items: center; justify-content: center;
}
.mini-card img.mark { width: 34px; height: auto; opacity: .95; }
.mini-card img.face { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; display: block; }
.mini-card.tilt-l { transform: rotate(-4deg); }
.mini-card.tilt-r { transform: rotate(4deg); }
.game-title { font-size: 32px; font-weight: 800; text-align: center; letter-spacing: .06em; margin-top: 10px; }
.tagline { text-align: center; color: #55524b; margin-top: 10px; font-size: 14px; }
.diff-label { text-align: center; font-size: 11px; letter-spacing: .24em; color: var(--sub); margin-top: 28px; }
.diff-row { display: flex; gap: 8px; margin-top: 10px; }
.diff-btn {
  flex: 1; appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; padding: 12px 4px 10px; border-radius: var(--radius); cursor: pointer;
  transition: transform .25s cubic-bezier(.22,.8,.3,1), border-color .25s, background .25s;
}
.diff-btn .d-name { display: block; font-size: 15px; font-weight: 700; }
.diff-btn .d-sub { display: block; font-size: 11px; color: var(--sub); margin-top: 1px; }
.diff-btn .d-best { display: block; font-size: 11px; color: var(--gold); margin-top: 4px; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.diff-btn.on { border-color: var(--gold); background: #fdfaf0; box-shadow: inset 0 0 0 1px var(--gold); }
.diff-btn:active { transform: scale(.97); }
.btn {
  appearance: none; border: 1px solid var(--ink); background: var(--card); color: var(--ink);
  font: inherit; font-size: 15px; padding: 12px 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:active { transform: scale(.97); }
.title-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 22px; }
.howto-link { text-align: center; margin-top: 24px; font-size: 13px; }
.howto-link a, .foot a { color: #8a6d1b; text-decoration: none; border-bottom: 1px solid var(--line); }
.fineprint { text-align: center; color: var(--sub); font-size: 12px; margin-top: 12px; }

/* プレイ画面 */
.hud { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.hud .h-diff { font-size: 11px; letter-spacing: .2em; color: var(--sub); }
.hud .h-stat { margin-left: auto; display: flex; gap: 16px; font-variant-numeric: tabular-nums; }
.hud .h-stat div { text-align: right; }
.hud .h-stat span { display: block; font-size: 9.5px; letter-spacing: .14em; color: var(--sub); line-height: 1.3; }
.hud .h-stat b { font-size: 19px; line-height: 1.2; font-weight: 700; }
.progress-line { height: 3px; background: #ece8de; border-radius: 999px; margin-top: 10px; overflow: hidden; }
#progress-fill { height: 100%; width: 0%; background: var(--gold); border-radius: 999px; transition: width .5s cubic-bezier(.22,.8,.3,1); }
.board { display: grid; gap: 8px; margin-top: 14px; }
.board.cols-4 { grid-template-columns: repeat(4, 1fr); }
.board.cols-6 { grid-template-columns: repeat(6, 1fr); gap: 6px; }
.mcard {
  appearance: none; border: none; background: none; padding: 0; cursor: pointer;
  aspect-ratio: 3 / 4; perspective: 700px; -webkit-tap-highlight-color: transparent;
}
.mcard .inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .48s cubic-bezier(.25,.7,.3,1);
}
.mcard.flipped .inner, .mcard.matched .inner { transform: rotateY(180deg); }
.mcard .face {
  position: absolute; inset: 0; border-radius: 10px; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.mcard .back {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), inset 0 0 0 5px var(--navy), inset 0 0 0 6px rgba(201,162,39,.55);
}
.mcard .back img { width: 42%; height: auto; opacity: .96; }
.mcard .front {
  transform: rotateY(180deg); background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  display: flex; flex-direction: column;
}
.mcard .front .art { flex: 1; min-height: 0; }
.mcard .front .art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; display: block; }
.mcard .front .cname {
  font-size: 10.5px; text-align: center; padding: 3px 1px 4px; line-height: 1.3;
  color: var(--ink); background: var(--card); white-space: nowrap; overflow: hidden;
}
.board.cols-6 .cname { font-size: 8.5px; padding: 2px 0 3px; }
.mcard.matched { cursor: default; }
.mcard.matched .front { box-shadow: inset 0 0 0 2px var(--gold); }
.mcard.matched .front .cname { background: #fdf6dd; }
.game-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.btn.small { padding: 9px 22px; font-size: 13.5px; }

/* クリア画面 */
.clear-badge { text-align: center; margin-top: 34px; font-size: 11px; letter-spacing: .3em; color: var(--gold); font-weight: 700; }
.clear-title { font-size: 26px; text-align: center; margin-top: 10px; font-weight: 800; letter-spacing: .04em; }
.clear-copy { text-align: center; color: #55524b; font-size: 14px; margin-top: 10px; }
.new-record { text-align: center; margin-top: 14px; }
.new-record span { display: inline-block; background: var(--gold); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .12em; padding: 4px 14px; border-radius: 999px; }
.clear-stats { margin: 24px auto 0; max-width: 300px; border-top: 1px solid var(--line); }
.clear-stats div { display: flex; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.clear-stats dt { color: var(--sub); }
.clear-stats dd { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ガイド・規約 */
.guide h1 { font-size: 22px; margin: 18px 0 10px; }
.guide h2 { font-size: 16px; margin: 26px 0 8px; }
.guide p, .guide li { font-size: 14px; color: #3d3a34; }
.guide ul, .guide ol { padding-left: 1.3em; }
.guide .back { display: inline-block; margin-top: 28px; color: #8a6d1b; }
.char-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.char-grid figure { text-align: center; }
.char-grid img { width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: 50% 20%; border-radius: 8px; display: block; }
.char-grid figcaption { font-size: 11px; color: var(--sub); margin-top: 3px; }

.foot {
  margin-top: auto; padding-top: 30px; display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--sub); align-items: center;
}
@media (prefers-reduced-motion: reduce) {
  .screen.active { animation: none; }
  .mcard .inner { transition: none; }
}

/* === 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-28): 音トグル / カード裏面・台紙 / 手応え / 称号 === */
/* 紙の質感（ごく薄い粒子と光） */
body.app {
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(255,255,255,.75), rgba(255,255,255,0) 60%),
    radial-gradient(rgba(35,33,29,.035) 1px, transparent 1px);
  background-size: auto, 22px 22px;
}
/* タイトルのミニカード：静かな浮遊（スッと） */
.mini-card { animation: floaty 5.2s cubic-bezier(.45,.05,.35,1) infinite; }
.mini-card.tilt-l { animation-name: floaty-l; }
.mini-card.tilt-r { animation-name: floaty-r; animation-delay: .7s; }
.mini-card:not(.tilt-l):not(.tilt-r) { animation-delay: .35s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes floaty-l { 0%,100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-3px); } }
@keyframes floaty-r { 0%,100% { transform: rotate(4deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-3px); } }

/* 難易度：盤面プレビュー（小さなカード格子）と選択時の持ち上がり */
.diff-btn { position: relative; }
.diff-btn.on { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--gold), 0 5px 14px rgba(120,96,20,.12); }
.d-grid { display: grid; gap: 2px; justify-content: center; width: fit-content; margin: 7px auto 1px; }
.d-grid i { display: block; width: 5px; height: 7px; border-radius: 1.5px; background: #ddd6c4; transition: background .25s; }
.diff-btn.on .d-grid i { background: var(--gold); opacity: .75; }
.diff-btn.on .d-grid i:nth-child(even) { opacity: .45; }

/* 音トグル */
.sound-btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-size: 12px; letter-spacing: .08em; padding: 7px 16px; border-radius: 999px; cursor: pointer;
  transition: transform .25s cubic-bezier(.22,.8,.3,1), border-color .25s, color .25s;
}
.sound-btn:active { transform: scale(.96); }
.sound-btn.off { color: var(--sub); border-style: dashed; }
.hud-sound { margin-left: 2px; padding: 5px 12px; font-size: 11px; align-self: center; }

/* 盤面の台紙 */
.board {
  background:
    linear-gradient(165deg, rgba(255,255,255,.65), rgba(255,255,255,0) 45%),
    linear-gradient(180deg, #efeade, #eae3d2);
  border: 1px solid #ddd5bf;
  border-radius: 16px;
  padding: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -8px 18px rgba(120,100,50,.06), 0 2px 8px rgba(60,50,20,.05);
}
.board.cols-6 { padding: 8px; }

/* 配布アニメーション：下から静かに並ぶ */
.mcard.deal { animation: dealin .5s cubic-bezier(.22,.8,.3,1) both; }
@keyframes dealin { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

/* めくり：ホバーで僅かに浮き、押下で沈む（未オープン時のみ） */
@media (hover: hover) {
  .mcard:not(.flipped):not(.matched):hover .inner { transform: translateY(-2px); }
}
.mcard:not(.flipped):not(.matched):active .inner { transform: scale(.965); }
.mcard .inner { box-shadow: 0 1px 3px rgba(28,39,66,.10); border-radius: 10px; }
.mcard:not(.flipped):not(.matched) .back { box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 2px 6px rgba(20,28,49,.18); }

/* カード裏面：紺地に金の二重枠＋ダイヤ格子＋メダリオン */
.mcard .back {
  background:
    radial-gradient(90% 70% at 50% 30%, rgba(255,255,255,.09), rgba(255,255,255,0) 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.045) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.045) 0 1px, transparent 1px 9px),
    linear-gradient(160deg, #22304f 0%, var(--navy) 45%, var(--navy-deep) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.mcard .back::before {
  content: ""; position: absolute; inset: 5px; border: 1px solid rgba(201,162,39,.6); border-radius: 7px; pointer-events: none;
}
.mcard .back::after {
  content: ""; position: absolute; inset: 8px; border: 1px solid rgba(255,255,255,.16); border-radius: 5px; pointer-events: none;
}
.mcard .back img {
  width: 52%; padding: 7px; border: 1px solid rgba(201,162,39,.55); border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, rgba(255,255,255,.13), rgba(255,255,255,.02) 70%);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}
.mcard .back-label {
  position: absolute; left: 0; right: 0; bottom: 9px; text-align: center;
  font-size: 6.5px; letter-spacing: .22em; color: rgba(255,255,255,.55); pointer-events: none;
}
.board.cols-6 .back-label { bottom: 6px; font-size: 5px; letter-spacing: .14em; }
.board.cols-6 .back img { padding: 4px; }
.board.cols-6 .back::before { inset: 3px; }
.board.cols-6 .back::after { inset: 5.5px; }

/* ペア成立：小さな弾みと金の灯り。失敗：小さく揺れるだけ */
.mcard.just-matched { animation: matchpop .55s cubic-bezier(.22,.8,.3,1); z-index: 2; }
@keyframes matchpop { 0% { transform: scale(1); } 35% { transform: scale(1.05); } 100% { transform: scale(1); } }
.mcard.just-matched .front { animation: matchglow .6s ease-out; }
@keyframes matchglow {
  0% { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 0 rgba(201,162,39,.35); }
  100% { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 10px rgba(201,162,39,0); }
}
.mcard.miss { animation: misssway .45s ease-in-out; }
@keyframes misssway { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-2.5px); } 75% { transform: translateX(2.5px); } }

/* 残りペア：ドットと「あと◯ペア」 */
.pairs-line { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding: 0 2px; }
.pair-pips { display: flex; gap: 5px; flex-wrap: wrap; }
.pair-pips .pip {
  width: 7px; height: 7px; border-radius: 50%; background: #e0d9c6;
  transition: background .4s, transform .4s cubic-bezier(.22,.8,.3,1);
}
.pair-pips .pip.on { background: var(--gold); transform: scale(1.18); }
#pairs-left { font-size: 11.5px; color: var(--sub); letter-spacing: .1em; font-variant-numeric: tabular-nums; transition: color .3s; }
#pairs-left.last { color: var(--gold); font-weight: 700; animation: lastpulse 1.2s ease-in-out infinite; }
#pairs-left.done { color: var(--gold); font-weight: 700; }
@keyframes lastpulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* クリア：称号ランクと花びら、ベスト更新の見せ方 */
#screen-clear { position: relative; overflow: hidden; }
#clear-petals { position: absolute; inset: 0; pointer-events: none; }
#clear-petals .petal {
  position: absolute; top: -14px; width: 7px; height: 10px; border-radius: 70% 30% 70% 30%;
  background: var(--gold-soft); opacity: 0; animation: petalfall 3.4s cubic-bezier(.3,.6,.4,1) forwards;
}
#clear-petals .petal:nth-child(even) { background: var(--gold); }
#clear-petals .petal:nth-child(3n) { background: #e8dcc0; }
@keyframes petalfall {
  0% { opacity: 0; transform: translate3d(0,-8px,0) rotate(0deg); }
  12% { opacity: .85; }
  100% { opacity: 0; transform: translate3d(var(--sway, 10px), 300px, 0) rotate(250deg); }
}
.clear-rank {
  width: 82px; height: 82px; margin: 18px auto 0; border: 1.5px solid var(--gold); border-radius: 50%;
  background: #fdfaf0; color: var(--gold); font-size: 42px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(160,128,30,.14), inset 0 0 0 4px #fffdf9, inset 0 0 0 5px var(--gold-soft);
  animation: rankin .65s cubic-bezier(.22,.8,.3,1) both .1s;
}
@keyframes rankin { from { opacity: 0; transform: scale(.78) translateY(6px); } to { opacity: 1; transform: none; } }
.clear-rank-title { text-align: center; font-size: 19px; font-weight: 700; letter-spacing: .1em; margin-top: 12px; }
.clear-rank-copy { text-align: center; color: #55524b; font-size: 13.5px; margin-top: 3px; }
#prev-best-line { text-align: center; color: #8a6d1b; font-size: 12.5px; font-weight: 700; margin-top: 10px; font-variant-numeric: tabular-nums; }
#prev-best-line:empty { display: none; }
.new-record span { animation: recordpop .6s cubic-bezier(.22,.8,.3,1) both .25s; }
@keyframes recordpop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .mini-card, .mcard.deal, .mcard.just-matched, .mcard.just-matched .front, .mcard.miss,
  .clear-rank, .new-record span { animation: none; }
  #pairs-left.last { animation: none; }
  #clear-petals { display: none; }
}

/* === 品質改修2 (2026-10-28): SE/BGM分離トグル＋成立スパーク === */
.sound-row { display: flex; gap: 8px; justify-content: center; }
.game-actions { align-items: center; flex-wrap: wrap; }
.mcard { position: relative; }
.spark {
  position: absolute; left: 50%; top: 38%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
  border-radius: 50%; background: var(--gold); box-shadow: 0 0 4px rgba(201,162,39,.7);
  pointer-events: none; z-index: 3; opacity: 0;
  animation: sparkfly .55s cubic-bezier(.22,.8,.3,1) forwards;
}
@keyframes sparkfly {
  0% { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx, 20px), var(--dy, -16px)) scale(.35); }
}
@media (prefers-reduced-motion: reduce) { .spark { display: none; } }

/* === リアル化改修 (2026-10-29): カードの素材感・盤面の奥行き・面の光・離さなさ演出 ===
   描画のみ。キャラ公式アートの画像ファイルは無変更（面の光・影・枠はカード側の重ねで表現）。 */
/* 画面全体：暖かい光だまりと奥の陰りで「卓」の空気を作る */
body.app {
  background-image:
    radial-gradient(110% 55% at 50% -8%, rgba(255,255,255,.85), rgba(255,255,255,0) 60%),
    radial-gradient(90% 45% at 50% 108%, rgba(120,96,40,.07), rgba(120,96,40,0) 65%),
    radial-gradient(rgba(35,33,29,.035) 1px, transparent 1px);
}
/* 盤面（卓のトレイ）：光の落ちる面＋彫りの深さ＋卓への接地影 */
.board {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.55), rgba(255,255,255,0) 55%),
    radial-gradient(95% 65% at 50% 118%, rgba(96,74,30,.10), rgba(96,74,30,0) 62%),
    linear-gradient(180deg, #f2ecdd 0%, #eae2cf 55%, #e0d6ba 100%);
  border-color: #d6cdb1;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -14px 24px rgba(120,100,50,.10),
    inset 0 12px 20px rgba(255,255,255,.30),
    0 12px 26px rgba(60,50,20,.10),
    0 2px 6px rgba(60,50,20,.06);
}
/* カードの厚み：持ち上がりと影の応答を面に付ける */
.mcard { perspective: 900px; }
.mcard .inner {
  transition: transform .48s cubic-bezier(.3,.72,.28,1), box-shadow .48s cubic-bezier(.3,.72,.28,1);
  box-shadow: 0 1px 2px rgba(28,39,66,.13), 0 5px 11px rgba(28,39,66,.11);
}
@media (hover: hover) {
  .mcard:not(.flipped):not(.matched):hover .inner {
    box-shadow: 0 2px 3px rgba(28,39,66,.12), 0 9px 18px rgba(28,39,66,.15);
  }
}
.mcard:not(.flipped):not(.matched):active .inner {
  box-shadow: 0 1px 2px rgba(28,39,66,.14), 0 2px 5px rgba(28,39,66,.12);
}
.mcard.flipped .inner, .mcard.matched .inner {
  box-shadow: -1px 1px 2px rgba(28,39,66,.11), -3px 6px 13px rgba(28,39,66,.12);
}
/* カード裏面：紺のラッカー面（斜めのツヤ・縁の落ち影・メダリオンの奥行き） */
.mcard .back {
  background:
    radial-gradient(130% 90% at 50% -10%, rgba(148,178,255,.17), rgba(148,178,255,0) 55%),
    radial-gradient(90% 70% at 50% 30%, rgba(255,255,255,.10), rgba(255,255,255,0) 60%),
    linear-gradient(115deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,0) 38%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.045) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.045) 0 1px, transparent 1px 9px),
    linear-gradient(165deg, #26355a 0%, var(--navy) 42%, var(--navy-deep) 78%, #10182c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    inset 0 -12px 20px rgba(0,0,0,.30),
    inset 0 0 0 1px rgba(255,255,255,.14);
}
.mcard .back img {
  background: radial-gradient(circle at 50% 36%, rgba(255,255,255,.17), rgba(255,255,255,.03) 72%);
  box-shadow: inset 0 1px 3px rgba(255,255,255,.22), inset 0 -3px 6px rgba(0,0,0,.28), 0 2px 5px rgba(0,0,0,.30);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)) brightness(1.04);
}
/* カード表面：紙の面＋アートへの光と影の重ね（画像ファイル自体は無変更） */
.mcard .front {
  background: linear-gradient(180deg, #fffefa 0%, var(--card) 55%, #f6efdf 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -9px 15px rgba(120,100,50,.08),
    inset 0 0 0 1px var(--line);
}
.mcard .front .art { position: relative; }
.mcard .front .art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.17), rgba(255,255,255,0) 26%),
    linear-gradient(0deg, rgba(22,17,8,.15), rgba(22,17,8,0) 23%),
    radial-gradient(125% 105% at 50% 38%, rgba(0,0,0,0) 60%, rgba(22,17,8,.13) 100%);
  box-shadow: inset 0 0 0 1px rgba(35,33,29,.05), inset 0 -12px 15px -11px rgba(22,17,8,.30);
}
.mcard .front .cname {
  background: linear-gradient(180deg, #fffdf8, #faf3e2);
  border-top: 1px solid rgba(120,100,50,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -1px 0 rgba(120,100,50,.07);
  position: relative;
}
/* 成立カード：暖かい光が残り、盤面に「そろった場所」が積み上がって見える */
.mcard.matched .front {
  box-shadow:
    inset 0 0 0 2px var(--gold),
    inset 0 1px 0 rgba(255,255,255,.85),
    inset 0 -11px 17px rgba(201,162,39,.14),
    0 3px 10px rgba(160,128,30,.14);
}
.mcard.matched .front .art::after {
  background:
    linear-gradient(180deg, rgba(255,226,140,.13), rgba(255,226,140,0) 34%),
    linear-gradient(0deg, rgba(22,17,8,.12), rgba(22,17,8,0) 23%),
    radial-gradient(125% 105% at 50% 38%, rgba(0,0,0,0) 60%, rgba(22,17,8,.11) 100%);
}
.mcard.matched .front .cname { background: linear-gradient(180deg, #fdf9e6, #fdf6dd); }
/* タイトルのミニカードと難易度・ボタンの面 */
.mini-card {
  box-shadow: 0 1px 2px rgba(28,39,66,.15), 0 9px 19px rgba(28,39,66,.17), inset 0 1px 0 rgba(255,255,255,.22);
}
.diff-btn {
  background: linear-gradient(180deg, #fffefa, var(--card) 60%, #fbf6ea);
  box-shadow: 0 1px 3px rgba(60,50,20,.07), inset 0 1px 0 rgba(255,255,255,.9);
}
.diff-btn.on {
  background: linear-gradient(180deg, #fffdf4, #fdfaf0 60%, #faf3dc);
  box-shadow: inset 0 0 0 1px var(--gold), inset 0 1px 0 rgba(255,255,255,.9), 0 6px 15px rgba(120,96,20,.13);
}
.btn {
  background: linear-gradient(180deg, #fffefa, var(--card) 65%, #faf5e9);
  box-shadow: 0 2px 6px rgba(60,50,20,.08), inset 0 1px 0 rgba(255,255,255,.9);
}
.btn.primary {
  background: linear-gradient(180deg, #36332d, var(--ink) 58%, #1a1916);
  box-shadow: 0 5px 13px rgba(35,33,29,.22), inset 0 1px 0 rgba(255,255,255,.15);
}
/* 進捗：金の流れに艶と、成立ごとの静かな脈動。ペア数の小さな弾み */
#progress-fill {
  background: linear-gradient(90deg, #b8931f, var(--gold) 55%, #dcbc4a);
  box-shadow: 0 0 7px rgba(201,162,39,.35);
}
.progress-line.pulse #progress-fill { animation: fillpulse .55s ease-out; }
@keyframes fillpulse { 0% { filter: brightness(1.3); } 100% { filter: brightness(1); } }
.pair-pips .pip.on {
  box-shadow: 0 0 0 2px rgba(201,162,39,.16), 0 1px 3px rgba(160,128,30,.28);
  animation: pippop .45s cubic-bezier(.22,.8,.3,1);
}
@keyframes pippop { 0% { transform: scale(.7); } 55% { transform: scale(1.35); } 100% { transform: scale(1.18); } }
.hud .h-stat b { display: inline-block; }
.hud .h-stat b.bump { animation: numbump .45s cubic-bezier(.22,.8,.3,1); }
@keyframes numbump { 0% { transform: scale(1); } 35% { transform: scale(1.15); } 100% { transform: scale(1); } }
/* 成立の輪と粉（JSが付ける .spark の追加層） */
.spark.ring {
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  background: none; border: 1.5px solid rgba(201,162,39,.55); box-shadow: none;
  animation: ringexpand .55s cubic-bezier(.22,.8,.3,1) forwards;
}
@keyframes ringexpand { 0% { opacity: .85; transform: scale(.32); } 100% { opacity: 0; transform: scale(1.18); } }
.spark.dust {
  width: 8px; height: 8px; margin: -4px 0 0 -4px;
  background: radial-gradient(circle, rgba(239,227,184,.9), rgba(239,227,184,0) 70%);
  box-shadow: none; animation-duration: .7s;
}
/* クリア：金メダリオンの金属感と花びらの奥行き、「もう一度」の静かな呼吸 */
.clear-rank {
  background: radial-gradient(circle at 34% 27%, #fffdf4, #fdf6dd 55%, #f1e2ac);
  box-shadow:
    0 7px 21px rgba(160,128,30,.17),
    inset 0 0 0 4px #fffdf9,
    inset 0 0 0 5px var(--gold-soft),
    inset 0 -7px 13px rgba(160,128,30,.16),
    inset 0 3px 6px rgba(255,255,255,.8);
}
#clear-petals .petal:nth-child(4n) { filter: blur(.7px); opacity: 0; }
#btn-again { animation: againbreath 3s ease-in-out infinite; }
@keyframes againbreath {
  0%, 100% { box-shadow: 0 5px 13px rgba(35,33,29,.22), inset 0 1px 0 rgba(255,255,255,.15); }
  50% { box-shadow: 0 5px 19px rgba(35,33,29,.30), 0 0 0 5px rgba(201,162,39,.10), inset 0 1px 0 rgba(255,255,255,.15); }
}
@media (prefers-reduced-motion: reduce) {
  .progress-line.pulse #progress-fill, .pair-pips .pip.on, .hud .h-stat b.bump,
  .spark.ring, #btn-again { animation: none; }
  .spark.dust { display: none; }
  .mcard .inner { transition: none; }
}

/* === 再点検パス (2026-10-29): 新条件一式 ===
   長押し全廃／収納の再編／チップ被り回避／プレイヤーチップ／ショップ／
   プログレス線／ネイティブ級演出。公式アートの画像ファイル・判定・数値は無変更。 */
/* --- 長押しポップアップ全廃（本作に入力欄はないため面全体に徹底） --- */
.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） ---
   1) セクションを flex で縮めない: 従来は背の高い画面（クリア画面）でセクションが
      縮み、内容が溢れてフッターが「もう一度あそぶ」の上に重なっていた。自然高にして
      .wrap のスクロールに任せ、フッターは内容の後ろに置く。
      （#screen-game は ID セレクタ側の flex:1 が優先され従来どおり）
   2) ホーム追加カード（.azip-card）は、プレイ中とクリア画面では出さない:
      CENTERチップと同じ扱い。従来はプレイ画面の「タイトルへ」とクリア画面の
      「難易度をかえる」がカードに覆われて押せなかった。タイトル等では従来どおり出す。 */
.wrap > .screen { flex: 0 0 auto; }
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(201,162,39,.45), #c9a227 70%); border-radius: 0 2px 2px 0; box-shadow: 0 1px 5px rgba(201,162,39,.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: 14px 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: 16px 0 0; }
/* --- プレイ画面の収納再編: 縦の chrome を畳み盤面を横いっぱいに広げ、操作列は下端に置く
       ネイティブ配置（縮小ではなく再編で大きく）。フッターとインストール帯はプレイ中畳む --- */
body.play-active .wrap { overflow-y: hidden; padding: 14px 10px calc(12px + env(safe-area-inset-bottom)); }
body.play-active .foot { display: none; }
body.play-active .azi-strip { display: none !important; }
#screen-game.active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#screen-game .hud { margin-top: 0; }
#screen-game .board { margin-top: 16px; }
#screen-game .game-actions { margin-top: auto; padding-top: 14px; }
/* --- ネイティブアプリ級の演出（静かなイージングのみ）: タイトルのスタッガード登場 --- */
@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 > *:nth-child(8) { animation-delay: .35s; }
/* --- ショップ導線（タイトル） --- */
.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: #8a6d1b; background: rgba(201,162,39,.16); 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-shop.active .catalog-row, #screen-shop.active .ref-item { animation: none; }
}

/* --- プロフィール/設定系の作法（2026-10-29 15:19）: 小さいグレーの見出しで設定群を明快にグルーピング
       （難易度の見出しと同じ文法。対象はタイトル画面の設定群のみで、プレイ画面は対象外） --- */
.set-label { text-align: center; font-size: 11px; letter-spacing: .24em; color: var(--sub); margin-top: 2px; }

/* === アイテムショップ大型化＋効果反映（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(--gold); 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(--gold); 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(--gold); 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(--gold); 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(--gold); 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: 12px; flex-wrap: wrap; }
.item-qty { font-weight: 700; color: var(--gold); }
.mcard.hint-glow .inner { box-shadow: 0 0 0 3px rgba(201,162,39,.9), 0 0 18px rgba(201,162,39,.55); }
/* スキン：金のメダリオン（裏面が深い金の仕上がり） */
body.skin-back-gold .mcard .back { background: radial-gradient(90% 70% at 50% 30%, rgba(255,240,190,.28), rgba(255,240,190,0) 60%), repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 1px, transparent 1px 9px), linear-gradient(165deg, #7d6414 0%, #a5851f 45%, #6b5410 100%); }
body.skin-back-gold .mcard .back::before { border-color: rgba(255,233,168,.95); }
body.skin-back-gold .mcard .back::after { border-color: rgba(255,255,255,.35); }
body.skin-back-gold .mcard .back img { border-color: #ffe9a8; background: radial-gradient(circle at 50% 38%, rgba(255,244,200,.5), rgba(120,96,20,.25) 72%); }
/* スキン：漆黒のラッカー（裏面が紺から漆黒へ） */
body.skin-back-lacquer .mcard .back { background: radial-gradient(110% 80% at 30% 0%, rgba(255,255,255,.16), rgba(255,255,255,0) 45%), linear-gradient(160deg, #26262e 0%, #101018 55%, #050508 100%); }
body.skin-back-lacquer .mcard .back::before { border-color: rgba(255,255,255,.4); }
body.skin-back-lacquer .mcard .back::after { border-color: rgba(255,255,255,.18); }
body.skin-back-lacquer .mcard .back img { border-color: rgba(255,255,255,.55); }
/* スキン：AZRIONプレミアム（表面の金の枠と名前帯＋裏面メダリオン） */
body.skin-frame-azrion .mcard .front { box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 4px #fffdf9, inset 0 0 0 5px rgba(201,162,39,.65), inset 0 -9px 15px rgba(120,100,50,.08); }
body.skin-frame-azrion .mcard .front .cname { background: linear-gradient(180deg, #f3d97b, #e6c454); color: #3d2f05; font-weight: 700; }
body.skin-frame-azrion .mcard .back::before { border-color: rgba(255,233,168,.95); }
body.skin-frame-azrion .mcard .back img { border-color: #ffe9a8; }
/* テーマ：胡桃の卓（盤面トレイが胡桃の木目） */
body.theme-table-walnut .board { background: repeating-linear-gradient(93deg, rgba(70,45,20,.14) 0 2px, transparent 2px 26px), linear-gradient(180deg, #9a744c 0%, #86603a 55%, #75522f 100%); border-color: #5f452a; box-shadow: inset 0 1px 0 rgba(255,235,200,.5), inset 0 -14px 24px rgba(50,30,10,.28), 0 12px 26px rgba(60,40,15,.16); }
/* テーマ：夜の対戦卓（画面全体が夜の灯り） */
body.theme-table-night { --paper: #12172a; --card: #1d2742; --ink: #ece9e1; --sub: #9aa3b8; --line: #33405e; }
body.theme-table-night .azs-effect { color: #c9cdd6; }
body.theme-table-night .hud .h-stat b { color: var(--ink); }
body.theme-table-night .azs-focus { border-color: #33405e; }

.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 に収める ===
   構造のみの是正（文言・導線・世界観は不変）。装飾カード・難易度カード・
   ボタン群を詰め、余白のリズムを圧縮する。 */
body.app .wrap { padding-top: 12px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
#screen-title .brand { margin-top: 2px; line-height: 1.4; }
#screen-title .title-cards { padding: 10px 0 2px; gap: 8px; }
#screen-title .mini-card { width: 46px; height: 62px; border-radius: 8px; }
#screen-title .mini-card img.mark { width: 25px; }
#screen-title .game-title { font-size: 26px; line-height: 1.25; }
#screen-title .tagline { margin-top: 6px; font-size: 13.5px; line-height: 1.5; }
#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 .diff-label { margin-top: 10px; }
#screen-title .diff-row { margin-top: 8px; gap: 7px; }
#screen-title .diff-btn { padding: 8px 4px 7px; line-height: 1.35; }
#screen-title .title-actions { margin-top: 12px; gap: 7px; }
#screen-title .title-actions .btn { padding: 8px 26px; }
#screen-title .menu-row { margin-top: 8px; padding: 10px 16px; }
#screen-title .howto-link { margin-top: 6px; line-height: 1.5; }
#screen-title .fineprint { font-size: 11px; line-height: 1.5; margin-top: 8px; }
#screen-title .azs-banner { margin-top: 10px; height: 38px; aspect-ratio: auto; }
#screen-title .azs-banner img { object-position: center 42%; }
.foot { padding-top: 10px; line-height: 1.5; }
.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; }

/* === ノースクロール是正 第2段 (2026-11-01 FIX1) === */
#screen-title .game-title { margin-top: 4px; }
#screen-title .title-cards { padding-top: 8px; }
#screen-title .mini-card { height: 54px; }
#screen-title .title-player { margin-top: 6px; }
#screen-title .diff-label { margin-top: 8px; }
#screen-title .diff-btn .d-best { white-space: nowrap; font-size: 10px; min-height: 0; margin-top: 3px; }
#screen-title .diff-btn .d-name { font-size: 14.5px; }
#screen-title .title-actions { margin-top: 10px; }
#screen-title .title-actions .btn { line-height: 1.3; }
#screen-title .set-label { margin: 2px 0 0; }
#screen-title .sound-row { margin-top: 5px; }
#screen-title .sound-btn { padding: 4px 12px; }
#screen-title .fineprint { line-height: 1.45; }
#screen-title .azs-banner { margin-top: 8px; }

/* === ノースクロール是正 第3段 (2026-11-01 FIX1) === */
#screen-title .diff-btn .d-grid { margin-top: 4px; }
#screen-title .diff-btn { padding: 7px 4px 6px; }
#screen-title .title-actions { gap: 5px; }
#screen-title .azs-banner { height: 34px; }
#screen-title .fineprint { margin-top: 6px; }
#screen-title .menu-row { margin-top: 6px; }

/* === ノースクロール是正 第4段 (2026-11-01 FIX1) === */
#screen-title .diff-btn .d-grid { gap: 1.5px; }
#screen-title .diff-btn .d-grid i { width: 4px; height: 5px; }
#screen-title .diff-btn .d-best { margin-top: 2px; }
#screen-title .title-cards { padding-top: 6px; }
#screen-title .tagline { margin-top: 4px; }

/* === BUG-SWEEP 2026-11-02: 購入シートと帯まわりの同型被りを予防 ===
   プレイ/クリア画面のカード抑制は 2026-11-01 に実施済み。残っていた同型:
   (1)購入シート(.azs-sheet-wrap, z80)表示中はカード(z900)が前面に出てシートのボタンを覆い得る → シート表示中はカードを出さない。
   (2)帯(.azi-strip)とカードの二重表示では帯のボタンがカードに覆われる → カード表示中は帯を畳む。 */
body:has(#azs-sheet-wrap:not([hidden])) .azip-card { display: none !important; }
body:has(.azip-card) .azi-strip { display: none !important; }
/* 同・ショップ画面はタスク画面としてカードを出さない。タイトル画面ではカード表示中だけ
   .wrap の下余白を足し、フッターリンク類(攻略ガイド/利用規約/はじめの説明)をカードの上まで
   スクロールできるようにする(従来は 375x812 で余白ゼロ・スクロール不可のまま覆われていた) */
body:has(#screen-shop.active) .azip-card { display: none !important; }
body:has(#screen-title.active):has(.azip-card.open) .wrap { padding-bottom: 160px; }
