/* アチーブメント（SPEC-008）：トロフィーを飾る殿堂。暗い大広間に金の棚、レアリティごとの額縁 */
:root {
  --bg: #0a0a0f;
  --panel: #14131c;
  --panel-2: #1c1a26;
  --line: rgba(232, 196, 106, .18);
  --text: #f1ece0;
  --muted: #a8a196;
  --gold: #e8c46a;
  --gold-hi: #fff1c2;
  --gold-lo: #8a6524;
  /* マイクリのレアリティの色 */
  --r-common: #b9c0cc;
  --r-uncommon: #5fe0a0;
  --r-rare: #5aaaff;
  --r-epic: #c77dff;
  --r-legendary: #ffc94d;
  --r-replica: #9fe6ea;
  --radius: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", serif;
  --latin: "Cinzel", "Shippori Mincho B1", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(900px 520px at 50% -160px, rgba(232, 196, 106, .22), transparent 70%),
    radial-gradient(600px 900px at -10% 40%, rgba(120, 60, 160, .10), transparent 70%),
    radial-gradient(600px 900px at 110% 60%, rgba(60, 90, 170, .10), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 120px),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "M PLUS 1p", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { color: inherit; }
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.hall {
  max-width: 980px;
  margin: 0 auto;
  /* 解放の光（.niche.unsealing::before は額縁の 240%）が画面の外へはみ出すと、スマホのブラウザがページ全体を縮めて右に余白ができる。
     横にはみ出したぶんは切る（clip はスクロールの箱を作らない。古いブラウザは hidden） */
  overflow-x: hidden;
  overflow-x: clip;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* ───────── 見出し ───────── */
.hall-top { text-align: center; position: relative; padding-top: 4px; }
.back { position: absolute; left: 0; top: 0; font-size: .82rem; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--gold); }
.crest { display: block; width: 64px; height: 64px; margin: 18px auto 0; filter: drop-shadow(0 0 18px rgba(232, 196, 106, .35)); }
.eyebrow { font-family: var(--latin); font-weight: 700; letter-spacing: .32em; font-size: .72rem; color: var(--gold); margin: 6px 0 0; }
h1 {
  font-family: var(--serif); font-weight: 800; font-size: clamp(1.7rem, 6vw, 2.4rem); letter-spacing: .12em; margin: 2px 0 6px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 24px rgba(232, 196, 106, .18);
}
.lead { margin: 0; color: var(--muted); font-size: .88rem; }
.lead b { color: var(--gold-hi); font-weight: 700; }
.hall-top::after { content: ""; display: block; height: 1px; margin: 16px auto 0; width: min(420px, 80%);
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .6; }

/* ───────── タブ ───────── */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 0; }
.tabs [role="tab"] {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 8px; border-radius: var(--radius); cursor: pointer;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  transition: transform .15s var(--ease), border-color .2s, box-shadow .2s;
}
.tabs [role="tab"]:active { transform: scale(.97); }
.tabs [role="tab"][aria-selected="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(232, 196, 106, .35) inset, 0 8px 24px rgba(232, 196, 106, .12);
  background: linear-gradient(180deg, #2a2316, #17140f);
}
.tab-name { font-family: var(--serif); font-weight: 800; font-size: .98rem; letter-spacing: .06em; }
.tab-count { font-family: var(--latin); font-weight: 700; font-size: 1.05rem; color: var(--gold); font-variant-numeric: tabular-nums; }
[aria-selected="false"] .tab-count { color: var(--muted); }

/* ───────── 進み具合 ───────── */
.panel { margin-top: 14px; }
.progress {
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28, 26, 38, .9), rgba(20, 19, 28, .9));
}
.progress-n { margin: 0; text-align: center; font-family: var(--latin); font-variant-numeric: tabular-nums; }
.progress-n b { font-size: 2.2rem; color: var(--gold-hi); text-shadow: 0 0 18px rgba(232, 196, 106, .4); }
.progress-n .slash { margin: 0 8px; color: var(--gold-lo); font-size: 1.4rem; }
.progress-n #total { font-size: 1.4rem; color: var(--muted); }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; margin: 8px 0 10px; border: 1px solid rgba(232, 196, 106, .15); }
.bar span { display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-lo), var(--gold), var(--gold-hi)); transition: width .6s var(--ease); }
.by-rarity { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; }
.by-rarity li { display: flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.by-rarity li b { font-family: var(--latin); font-weight: 700; letter-spacing: .04em; color: var(--rc); }

/* ───────── しぼりこみ ───────── */
.filters { display: flex; gap: 6px; overflow-x: auto; padding: 12px 2px 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: none; padding: 5px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}
.filters button[aria-pressed="true"] { background: var(--gold); color: #1d1608; border-color: var(--gold); }

.note { color: var(--muted); font-size: .82rem; line-height: 1.6; text-align: center; margin: 10px 0 0; }
.note a { color: var(--gold); }

/* ───────── 棚（レアリティごと） ───────── */
.shelf { --rc: var(--r-common); margin-top: 22px; }
.r-Uncommon { --rc: var(--r-uncommon); }
.r-Rare { --rc: var(--r-rare); }
.r-Epic { --rc: var(--r-epic); }
.r-Legendary { --rc: var(--r-legendary); }
.r-Replica { --rc: var(--r-replica); }
.plate {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 12px;
  font-family: var(--latin); font-weight: 700; font-size: .92rem; letter-spacing: .28em; color: var(--rc);
}
.plate::before, .plate::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rc) 60%, transparent)); }
.plate::after { transform: scaleX(-1); }
.plate small { font-family: "M PLUS 1p", sans-serif; letter-spacing: 0; font-size: .74rem; color: var(--muted); font-weight: 700; }
.gem { width: 10px; height: 10px; transform: rotate(45deg); background: var(--rc); box-shadow: 0 0 10px var(--rc); flex: none; }

.niches {
  display: grid; gap: 14px 10px;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  padding: 0 4px 16px; position: relative;
}
/* 棚板 */
.niches::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; border-radius: 3px;
  background: linear-gradient(180deg, #4a3a1c, #2a2012 60%, #120d06);
  box-shadow: 0 1px 0 rgba(255, 230, 160, .25) inset, 0 10px 18px rgba(0, 0, 0, .6);
}
.ext .niches { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }

/* ───────── 1 枚（ヒーローは額縁、エクステンションは台座） ───────── */
.niche {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  text-align: center; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.frame {
  position: relative; width: 100%; aspect-ratio: 4 / 5; display: grid; place-items: center; overflow: hidden;
  border-radius: 48% 48% 10px 10px / 34% 34% 10px 10px;   /* 上がアーチの額 */
  background:
    radial-gradient(80% 60% at 50% 35%, color-mix(in srgb, var(--rc) 22%, transparent), transparent 70%),
    linear-gradient(180deg, #1d1b27, #0f0e15);
  border: 2px solid color-mix(in srgb, var(--rc) 70%, #3a3122);
  box-shadow: 0 0 0 3px #15120c, 0 0 0 4px color-mix(in srgb, var(--rc) 35%, transparent), 0 10px 22px rgba(0, 0, 0, .55);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.ext .frame { aspect-ratio: 1; border-radius: 12px; }
.niche:hover .frame, .niche:focus-visible .frame { transform: translateY(-3px); box-shadow: 0 0 0 3px #15120c, 0 0 0 4px var(--rc), 0 14px 28px rgba(0, 0, 0, .6), 0 0 22px color-mix(in srgb, var(--rc) 35%, transparent); }
.niche:active .frame { transform: scale(.97); }
.frame img { width: 72%; max-width: 128px; image-rendering: pixelated; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); }
.ext .frame img { width: 70%; }
/* Legendary は光が走る */
.got.r-Legendary .frame::after {
  content: ""; position: absolute; inset: -40%; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 244, 200, .38) 50%, transparent 58%);
  animation: sheen 5.5s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 300ms);
}
@keyframes sheen { 0%, 70% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }

.plaque { display: grid; gap: 1px; width: 100%; padding: 5px 4px 6px; border-radius: 6px;
  background: linear-gradient(180deg, #2b2416, #18140c); border: 1px solid rgba(232, 196, 106, .3); }
.plaque b { font-family: var(--serif); font-weight: 800; font-size: .8rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plaque small { font-size: .62rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rlabel { font-family: var(--latin); font-weight: 700; font-size: .58rem; letter-spacing: .14em; color: var(--rc); }

/* 未獲得：影絵と「？？？」 */
.locked .frame { border-color: color-mix(in srgb, var(--rc) 28%, #2a2620); box-shadow: 0 0 0 3px #15120c, 0 10px 22px rgba(0, 0, 0, .55); background: linear-gradient(180deg, #15141c, #0c0b11); }
.locked .frame img { filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, .28)); opacity: .9; }
.locked .plaque { background: #15131a; border-color: rgba(255, 255, 255, .08); }
.locked .plaque b { color: var(--muted); letter-spacing: .1em; }

/* ───────── 完成（真のゲームクリア） ───────── */
.complete { text-align: center; padding: 16px; margin-bottom: 12px; border-radius: var(--radius);
  border: 1px solid var(--gold); background: radial-gradient(120% 140% at 50% 0%, rgba(232, 196, 106, .28), rgba(20, 16, 8, .9)); }
.complete-k { font-family: var(--latin); letter-spacing: .4em; color: var(--gold); margin: 0; font-weight: 700; }
.complete-n { font-family: var(--serif); font-weight: 800; font-size: 1.2rem; margin: 4px 0 0; }
.complete-d { color: var(--muted); font-size: .8rem; margin: 4px 0 0; }

/* ───────── 詳細 ───────── */
.relic {
  --rc: var(--gold);
  width: min(92vw, 420px); padding: 0; border-radius: 18px; color: var(--text);
  border: 1px solid color-mix(in srgb, var(--rc) 65%, transparent);
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--rc) 20%, transparent), transparent 60%), #13121a;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 40px color-mix(in srgb, var(--rc) 20%, transparent);
}
.relic[open] { animation: open .25s var(--ease); }
@keyframes open { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.relic::backdrop { background: rgba(4, 4, 8, .72); backdrop-filter: blur(3px); }
.relic-in { padding: 20px 20px 18px; text-align: center; position: relative; }
.relic .x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.relic .big { width: 168px; height: 168px; margin: 4px auto 0; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 30%, transparent), transparent); }
.relic .big img { width: 128px; height: 128px; image-rendering: pixelated; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }
.relic.is-locked .big img { filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, .3)); }
.relic .ribbon { display: inline-block; font-family: var(--latin); font-weight: 700; letter-spacing: .24em; font-size: .72rem; color: #120f08;
  background: var(--rc); padding: 3px 12px 3px 15px; border-radius: 4px; margin-top: 6px; }
.relic h2 { font-family: var(--serif); font-weight: 800; font-size: 1.35rem; margin: 10px 0 0; }
.relic .ach { margin: 6px 0 0; color: var(--gold-hi); font-weight: 700; }
.relic dl { text-align: left; margin: 14px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: .84rem; }
.relic dt { color: var(--muted); }
.relic dd { margin: 0; }
.relic .acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.relic .btn { display: inline-block; text-decoration: none; padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: .88rem; cursor: pointer; border: 0;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1d1608; transition: transform .12s var(--ease); }
.relic .btn.sub { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.relic .btn:active { transform: scale(.96); }

.hall-foot { margin-top: 28px; color: var(--muted); font-size: .72rem; line-height: 1.7; text-align: center; }
.hall-foot a { color: var(--gold); }
.error { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); background: #2a1515; color: #ffb4b4; border: 1px solid #f87171; border-radius: 10px; padding: 8px 14px; margin: 0; font-size: .85rem; }

@media (min-width: 640px) {
  .niches { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 18px 14px; }
  .ext .niches { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .plaque b { font-size: .88rem; }
}
@media (max-width: 360px) {
  .niches { grid-template-columns: repeat(3, 1fr); gap: 12px 8px; }
  .ext .niches { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .niche, .relic[open] { animation: none; }
  .got.r-Legendary .frame::after { animation: none; display: none; }
  .bar span, .frame { transition: none; }
}

/* ───────── ログインの関所（SPEC-008 3.4） ───────── */
.gate { text-align: center; margin: 22px auto 0; max-width: 460px; padding: 26px 20px; border-radius: var(--radius);
  border: 1px solid var(--line); background: radial-gradient(120% 120% at 50% 0%, rgba(232, 196, 106, .14), transparent 60%), var(--panel); }
.gate-k { font-family: var(--latin); letter-spacing: .4em; color: var(--gold); margin: 0; font-weight: 700; }
.gate-t { font-family: var(--serif); font-weight: 800; font-size: 1.15rem; margin: 8px 0 0; }
.gate-d { color: var(--muted); font-size: .84rem; line-height: 1.7; margin: 10px 0 0; }
.gate-d b { color: var(--gold-hi); }
.gate-btn { margin-top: 16px; border: 0; border-radius: 10px; padding: 11px 20px; font-weight: 700; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1d1608; transition: transform .12s var(--ease); }
.gate-btn:active { transform: scale(.96); }

/* 名鑑の番号（ヒーローだけ） */
.frame .no { position: absolute; top: 9%; left: 50%; transform: translateX(-50%); font-family: var(--latin); font-weight: 700; font-size: .6rem;
  letter-spacing: .12em; color: color-mix(in srgb, var(--rc) 75%, #fff); opacity: .85; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
.locked .frame .no { color: var(--muted); opacity: .7; }

/* マインの案内から来たとき、呼び戻したヒーロー（SPEC-008 4.3） */
.niche.hello .frame { box-shadow: 0 0 0 3px #15120c, 0 0 0 5px var(--gold), 0 0 36px rgba(255, 220, 140, .7); animation: hello 1.6s ease-in-out 3; }
@keyframes hello { 50% { box-shadow: 0 0 0 3px #15120c, 0 0 0 6px var(--gold-hi), 0 0 56px rgba(255, 230, 160, .95); } }
@media (prefers-reduced-motion: reduce) { .niche.hello .frame { animation: none; } }

/* ───────── 章・共有・前から増えたもの（SPEC-008 6 章） ───────── */
.chapter { margin: 0 0 2px; text-align: center; font-family: var(--serif); font-weight: 800; color: var(--gold); letter-spacing: .2em; font-size: .85rem; }
.share-btn { display: block; margin: 12px auto 0; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: .8rem;
  background: transparent; color: var(--gold); border: 1px solid rgba(232, 196, 106, .55); transition: transform .12s var(--ease), background .2s; }
.share-btn:hover { background: rgba(232, 196, 106, .1); }
.share-btn:active { transform: scale(.96); }
.filters .chap { color: var(--gold); border-color: rgba(232, 196, 106, .4); }
.news { margin: 12px 0 0; text-align: center; font-size: .84rem; color: var(--gold-hi); }
.news::before { content: "✦ "; color: var(--gold); }

/* 前に開いたときから増えたもの：上から額縁に収まり、NEW の札 */
.niche.placed .frame { animation: place .9s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(.2s + var(--i, 0) * 25ms); }
.niche.placed .frame img { animation: place-img .9s ease-out both; animation-delay: calc(.35s + var(--i, 0) * 25ms); }
@keyframes place { 0% { transform: translateY(-26px) scale(.9); box-shadow: 0 0 0 3px #15120c, 0 0 0 4px var(--rc), 0 0 46px var(--rc); } 60% { transform: translateY(2px); } 100% { transform: none; } }
@keyframes place-img { from { filter: brightness(3) drop-shadow(0 0 12px #fff); } }
.frame .new { position: absolute; bottom: 7px; right: 7px; font-family: var(--latin); font-weight: 700; font-size: .55rem; letter-spacing: .12em;
  color: #1d1608; background: var(--gold-hi); border-radius: 4px; padding: 1px 5px; box-shadow: 0 0 10px rgba(255, 230, 160, .7); }
.ext .frame .new { bottom: auto; top: 4px; right: 4px; }

/* 真のゲームクリア */
.finale { --rc: var(--r-legendary); width: min(94vw, 520px); }
.fin-k { margin: 6px 0 0; font-family: var(--latin); letter-spacing: .42em; color: var(--gold); font-weight: 700; }
.fin-t { margin: 6px 0 0; font-family: var(--serif); font-weight: 800; font-size: 1.4rem; background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.parade { margin: 14px -20px 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.parade-track { display: inline-flex; gap: 6px; animation: parade calc(var(--n, 50) * .35s) linear infinite; }
.parade-track img { width: 64px; height: 64px; image-rendering: pixelated; flex: none; }
@keyframes parade { to { transform: translateX(-50%); } }
.fin-talk { display: flex; gap: 12px; align-items: flex-end; text-align: left; margin-top: 12px; }
.fin-mine { width: 96px; height: 128px; image-rendering: pixelated; flex: none; }
.fin-talk p { margin: 0 0 8px; font-size: .9rem; line-height: 1.7; }
.fin-d { color: var(--muted); font-size: .8rem; margin: 8px 0 0; }

/* 共有 */
.share { width: min(94vw, 560px); }
.share-t { font-family: var(--serif); font-weight: 800; margin: 4px 0 12px; }
.share-img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); display: block; }
.share .note { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) {
  .niche.placed .frame, .niche.placed .frame img, .parade-track { animation: none; }
}

/* ───────── 解放の演出（SPEC-008 6.4） ───────── */
/* 演出を待つヒーロー：未獲得と同じ影絵 */
.sealed .frame { border-color: color-mix(in srgb, var(--rc) 28%, #2a2620); box-shadow: 0 0 0 3px #15120c, 0 10px 22px rgba(0, 0, 0, .55); background: linear-gradient(180deg, #15141c, #0c0b11); }
.sealed .frame img { filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, .28)); opacity: .9; }
.sealed .plaque { background: #15131a; border-color: rgba(255, 255, 255, .08); }
.sealed .plaque b { color: var(--muted); letter-spacing: .1em; }
.sealed .new { display: none; }

/* 影絵が震えて、光がはじけ、姿が戻る（1.4 秒。長押しのあいだは JS が 3 倍速にする） */
.niche.unsealing { position: relative; isolation: isolate; }
.niche.unsealing::before {
  content: ""; position: absolute; left: 50%; top: 40%; width: 240%; aspect-ratio: 1; z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 55%, transparent) 0 7deg, transparent 7deg 22deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent); mask-image: radial-gradient(closest-side, #000 30%, transparent);
  animation: unseal-rays 1.8s ease-out both;
}
.unsealing .frame { animation: unseal-frame 1.4s cubic-bezier(.2, .9, .3, 1.1) both; }
.unsealing .frame img { animation: unseal-img 1.4s ease-out both; }
.unsealing .frame::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(closest-side, #fff, color-mix(in srgb, var(--rc) 70%, #fff) 40%, transparent 75%);
  animation: unseal-burst 1.4s ease-out both;
}
.unsealing .plaque { animation: unseal-name 1.4s ease-out both; }
.unsealing .new { animation: unseal-new .5s 1.1s both; }
@keyframes unseal-rays { 0%, 30% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(0deg); } 45% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1) rotate(50deg); } }
@keyframes unseal-frame {
  0% { transform: none; }
  8%, 20% { transform: translateX(-2px) rotate(-1deg); }
  14%, 26% { transform: translateX(2px) rotate(1deg); }
  34% { transform: scale(.94); }
  48% { transform: scale(1.1); filter: drop-shadow(0 0 22px var(--rc)) brightness(1.15); }
  100% { transform: none; filter: none; }
}
@keyframes unseal-img {
  0%, 34% { filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, .28)); }
  46% { filter: brightness(3.2) drop-shadow(0 0 14px #fff); transform: scale(1.12); }
  100% { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); transform: none; }
}
@keyframes unseal-burst { 0%, 36% { opacity: 0; transform: scale(.2); } 46% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.8); } }
@keyframes unseal-name { 0%, 44% { opacity: .25; transform: scale(.94); } 60% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: none; } }
@keyframes unseal-new { from { opacity: 0; transform: scale(1.8); } }

/* 演出のあいだは画面を押さえる（押しているあいだは早送り）。下に名前と、スキップ */
.reveal-veil {
  position: fixed; inset: 0; z-index: 40; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  background: linear-gradient(180deg, transparent 55%, rgba(5, 5, 9, .75));
}
.reveal-cap { position: absolute; left: 16px; right: 16px; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 56px); text-align: center; opacity: 0; pointer-events: none; }
.reveal-cap.on { animation: cap-in .35s var(--ease) both; }
@keyframes cap-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal-cap b { display: block; font-family: var(--serif); font-weight: 800; font-size: clamp(1.15rem, 5vw, 1.5rem); color: var(--gold-hi); text-shadow: 0 2px 14px rgba(0, 0, 0, .9), 0 0 24px rgba(232, 196, 106, .45); }
.reveal-cap small { display: block; margin-top: 4px; font-size: .78rem; color: var(--text); opacity: .85; text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }
.reveal-ctl { position: absolute; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 14px; }
.reveal-hint { font-size: .74rem; color: var(--muted); text-shadow: 0 1px 4px #000; }
.reveal-skip { padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: .82rem; color: var(--gold-hi);
  background: rgba(20, 16, 8, .85); border: 1px solid rgba(232, 196, 106, .6); }
.reveal-skip:active { transform: scale(.96); }

/* マインの案内から未ログインで来たとき（SPEC-008 3.4） */
.preview { text-align: center; padding: 12px 14px 14px; margin-bottom: 12px; border-radius: var(--radius); border: 1px dashed rgba(232, 196, 106, .5); background: rgba(232, 196, 106, .06); }
.preview p { margin: 0; font-size: .82rem; line-height: 1.6; color: var(--text); }
.preview .gate-btn { margin-top: 10px; padding: 8px 16px; font-size: .86rem; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; margin: 0; width: max-content; max-width: calc(100vw - 32px);
  padding: 9px 14px; border-radius: 10px; font-size: .84rem; line-height: 1.5; color: var(--gold-hi); background: #1d1608; border: 1px solid var(--gold); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }

/* マインの案内（css/mine.css）：この画面では下に寄せ、名鑑が見えるように背景を暗くしすぎない */
.mine[open] { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); margin: 0 auto; }
.mine::backdrop { background: rgba(4, 4, 10, .35); backdrop-filter: none; }
.toast { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 64px); }   /* 💬（右下）と重ねない */
