:root {
  --bg: #0e0b16;
  --bg2: #17112a;
  --panel: #1e1733;
  --line: #2f2549;
  --text: #f1ecff;
  --muted: #a59bc4;
  --accent: #9147ff;
  --accent2: #c77dff;
  --nav-h: 64px;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; color: var(--text);
  background:
    radial-gradient(900px 500px at 50% -160px, #3b1f7d 0%, transparent 65%),
    var(--bg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; }

/* ===== ヘッダー ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; max-width: 640px; margin: 0 auto;
  background: rgba(14,11,22,.85); backdrop-filter: blur(10px);
}
.logo { font-weight: 900; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.logo b { color: var(--accent2); }
.logo-mark {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #ff4fd8); font-size: 12px; color: #fff;
}
.points {
  font-weight: 900; font-size: 18px; font-variant-numeric: tabular-nums;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
.points small { font-size: 11px; color: var(--muted); margin-left: 3px; }

main { max-width: 640px; margin: 0 auto; padding: 4px 16px 24px; }
.view { display: none; }
.view.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== パック選択 ===== */
.packs { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 10px; scrollbar-width: none; }
.packs::-webkit-scrollbar { display: none; }
.pack-chip {
  flex: none; padding: 9px 16px; border-radius: 999px; font-weight: 800; font-size: 14px;
  background: var(--panel); border: 1px solid var(--line); white-space: nowrap;
}
.pack-chip small { margin-left: 6px; font-size: 11px; color: var(--muted); }
.pack-chip.is-active { background: #fff; color: #120d20; border-color: #fff; }
.pack-chip.is-locked { color: var(--muted); }
.pack-chip:disabled { opacity: .35; cursor: not-allowed; }

.lead { text-align: center; color: var(--muted); font-size: 14px; line-height: 1.8; margin: 8px 0 4px; }
.lead b { color: var(--text); }

/* ===== パック ===== */
.pack-stage { display: grid; place-items: center; padding: 24px 0 16px; perspective: 800px; }
.pack {
  --rc: var(--accent2);
  position: relative; width: 190px; aspect-ratio: 5 / 7; border-radius: 14px;
  background: linear-gradient(160deg, #2a1a52, #120c24 70%);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 20px 50px rgba(0,0,0,.5), inset 0 0 0 6px rgba(255,255,255,.03);
  overflow: hidden; animation: float 3.2s ease-in-out infinite;
}
.pack[data-pack="lol"]      { background: linear-gradient(160deg, #0f3b52, #08151f 70%); }
.pack[data-pack="valo"]     { background: linear-gradient(160deg, #5a1520, #1a080c 70%); }
.pack[data-pack="tarkov"]   { background: linear-gradient(160deg, #3d3a22, #12110a 70%); }
.pack[data-pack="vtuber_f"] { background: linear-gradient(160deg, #6b2457, #1f0a19 70%); }
.pack[data-pack="irl"]      { background: linear-gradient(160deg, #1d4d3a, #08170f 70%); }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.pack-foil {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.22) 45%, transparent 60%);
  background-size: 250% 100%; animation: shine 3s ease-in-out infinite;
}
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.pack-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.pack-mark {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, var(--accent), #ff4fd8); box-shadow: 0 6px 20px rgba(145,71,255,.5);
}
.pack-title { font-weight: 900; letter-spacing: .12em; font-size: 15px; line-height: 1.3; }
.pack-name { font-size: 12px; color: rgba(255,255,255,.75); padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.35); }
.pack-tear { position: absolute; left: 0; right: 0; top: 12%; border-top: 2px dashed rgba(255,255,255,.18); }

.pack-info { text-align: center; }
.pack-label { font-weight: 900; font-size: 16px; }
.pack-label span { margin-right: 2px; }
.pack-progress { color: var(--muted); font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.rates-line { color: var(--muted); font-size: 11px; margin-top: 8px; line-height: 1.6; }

/* 引くボタン: ガチャ画面と演出画面で同じ位置・同じ幅に固定 */
:root {
  --pull-bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  --pull-w: min(440px, calc(100vw - 32px));
  --pull-h: 58px;
}
#view-gacha { padding-bottom: calc(var(--pull-h) + 28px); }
.pull-bar {
  position: fixed; z-index: 25; left: 50%; transform: translateX(-50%);
  bottom: var(--pull-bottom); width: var(--pull-w); height: var(--pull-h);
  display: flex; gap: 10px;
}
/* ボタンの後ろ〜下のメニューまでを背景色で隠す（スクロールした文字がすき間から透けないように） */
.pull-bar::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: calc((var(--pull-w) - 100vw) / 2); right: calc((var(--pull-w) - 100vw) / 2);
  top: -22px; bottom: calc(-1 * (var(--pull-bottom) + 2px));
  background: linear-gradient(to bottom, rgba(14,11,22,0), var(--bg) 22px);
}
.pull-bar .btn { height: 100%; }
.pull-bar #pull1 { flex: 1.4; }
.pull-bar #pull10 { flex: 1; }
.btn {
  border: 0; border-radius: 999px; font-weight: 900; padding: 14px 26px; font-size: 16px;
  transition: transform .1s ease, filter .15s ease; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-main { background: #fff; color: #120d20; min-width: 150px; font-size: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.btn-sub {
  background: linear-gradient(135deg, var(--accent), #ff4fd8); color: #fff;
  flex-direction: column; padding: 8px 22px; line-height: 1.15; box-shadow: 0 10px 30px rgba(145,71,255,.4);
}
.btn-sub.is-locked { background: var(--panel); border: 1px solid var(--line); box-shadow: none; color: var(--muted); }
.btn-top { font-size: 16px; }
.btn-bottom { font-size: 11px; opacity: .85; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 10px 18px; }
.btn-twitch { background: var(--accent); color: #fff; width: 100%; padding: 12px; font-size: 15px; }
/* 特別ガチャ（UR以上確定10連） */
.royal {
  position: relative; margin-top: 16px; padding: 14px 14px 14px 16px; border-radius: 18px;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(#17112a, #17112a) padding-box,
    linear-gradient(120deg, #ff6ad5, #ffc93c, #4fc3ff, #b17bff) border-box;
  border: 2px solid transparent;
  box-shadow: 0 0 28px rgba(255,106,213,.18);
}
.royal-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.royal-text b { font-size: 16px; font-weight: 900; }
.royal-text small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.royal-btn {
  flex-direction: column; padding: 8px 16px; line-height: 1.15; color: #1a1426; white-space: nowrap;
  background: linear-gradient(120deg, #ff6ad5, #ffc93c 45%, #4fc3ff); box-shadow: 0 8px 24px rgba(255,201,60,.3);
}
.royal-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.royal-actions .btn { width: 100%; }
.royal-ad-btn {
  flex-direction: column; padding: 7px 14px; line-height: 1.15; white-space: nowrap; color: #fff;
  background: linear-gradient(135deg, #eb0400, #ff4f7a); box-shadow: 0 6px 18px rgba(235,4,0,.3);
}
.royal-ad-btn .btn-top { font-size: 13px; }
.royal-ad-btn.is-used { background: var(--panel); border: 1px solid var(--line); box-shadow: none; color: var(--muted); }
.royal-ad-btn.is-busy { opacity: .7; }
/* ローカル確認用の仮の動画（reward-ads.js の ?ads-preview=1） */
.reward-fake { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.85); display: grid; place-items: center; }
.reward-fake-box { width: min(320px, 86vw); padding: 24px; border-radius: 16px; background: #222; text-align: center; color: #fff; }
.reward-fake-box p { margin: 0 0 8px; font-size: 13px; color: #bbb; }
.reward-fake-count { display: block; font-size: 56px; margin-bottom: 14px; }
.reward-fake-close { border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 800; background: #fff; color: #111; }
.royal-btn.is-short { background: var(--panel); border: 1px solid var(--line); box-shadow: none; color: var(--muted); }

.disclaimer { color: #6f6690; font-size: 11px; line-height: 1.7; margin-top: 18px; }
.disclaimer p { margin: 0 0 6px; }
.disclaimer b { color: #9d93bf; font-weight: 800; }

/* ===== 広告枠（ads.js が広告の有効なときだけ表示する） =====
   ・ガチャ画面の一番下 / 図鑑・実績の一番下: 横長バナー（高さ50px・最大468px）
   ・PCの左右: 縦長バナー160×600（横幅1000px以上・高さ700px以上の画面だけ）
   ボタンのすぐ近くに置かない（誤クリック防止）。高さは先に確保して、読み込みで画面がずれないようにする */
.ad-slot { text-align: center; }
.ad-slot-label { margin: 0 0 6px; color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .1em; }
.ad-banner { margin: 56px auto 8px; }
.ad-banner .ad-slot-content { width: 100%; max-width: 468px; height: 50px; margin: 0 auto; }
/* 図鑑・実績の一番下の枠はガチャ画面では出さない */
#view-gacha.is-active ~ .ad-banner { display: none; }
/* ガチャ画面の枠が「引く」ボタンにくっつかないよう、下の余白を広げる */
body.has-ads #view-gacha { padding-bottom: calc(var(--pull-h) + 72px); }
.ad-side { display: none; }
@media (min-width: 1000px) and (min-height: 700px) {
  .ad-side {
    display: block; position: fixed; z-index: 5; top: max(84px, calc(50vh - 316px)); width: 160px;
  }
  .ad-side .ad-slot-content { width: 160px; height: 600px; }
  .ad-side-left { left: calc(50% - var(--app-w) / 2 - 48px - 160px); }
  .ad-side-right { right: calc(50% - var(--app-w) / 2 - 48px - 160px); }
}
/* プレビュー（localhost の ?ads-preview=1）での枠の見た目 */
.site-ad-preview {
  display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 8px;
  background: var(--panel); color: var(--muted); font-size: 11px; white-space: pre-line; line-height: 1.6;
}
.policy-main { padding-top: 16px; font-size: 14px; line-height: 1.9; }
.policy-main h1 { font-size: 22px; }
.policy-main h2 { margin-top: 28px; font-size: 17px; }
.policy-main a { text-underline-offset: 3px; }

/* ===== 図鑑 ===== */
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 0 12px; }
.section-head h2 { margin: 0; font-size: 22px; }
.dex-total { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.rarity-summary { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin-bottom: 12px; }
.rs { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 2px; text-align: center; }
.rs b { display: block; color: var(--rc); font-size: 13px; }
.rs span { font-size: 10px; letter-spacing: -.02em; color: var(--muted); font-variant-numeric: tabular-nums; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; }
.filters select {
  flex: 1; min-width: 0; text-overflow: ellipsis; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 14px;
}
.dex-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dex-grid .card { cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 検索 */
.search-box { position: relative; margin-bottom: 6px; }
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .7; pointer-events: none; }
.search-box input {
  width: 100%; padding: 12px 14px 12px 38px; border-radius: 12px; font: inherit; font-size: 16px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); outline: none;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(145,71,255,.25); }
.search-info { margin: 0 0 8px; min-height: 1.2em; font-size: 12px; color: var(--muted); }
.card.is-locked { cursor: default; }
.card.is-locked .mc-img img, .card.is-locked .mc-img .avatar-fallback { filter: grayscale(1) brightness(.45); }
.card.is-locked .mc-name { color: var(--muted); }
.card.is-locked .rar-pill { opacity: .55; }
.locked-tag {
  position: absolute; inset: auto 0 0 0; z-index: 2; text-align: center; font-size: 10px; font-weight: 900;
  color: #fff; background: rgba(0,0,0,.6); padding: 2px 0;
}
.dex-more { display: block; margin: 14px auto 0; }

/* 開発者メニュー */
.dev-panel { position: fixed; inset: 0; z-index: 65; background: rgba(6,4,12,.88); display: grid; place-items: center; padding: 20px; }
.dev-box { width: min(380px, 92vw); background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px 20px; }
.dev-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dev-head h2 { margin: 0; font-size: 18px; }
.dev-login { display: flex; flex-direction: column; gap: 10px; }
.dev-login p { margin: 0; color: var(--muted); font-size: 13px; }
.dev-login input { padding: 12px 14px; border-radius: 12px; font: inherit; font-size: 16px; background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.dev-error { color: #ff6b81 !important; font-weight: 800; }
.dev-tools { display: flex; flex-direction: column; gap: 8px; }
.dev-note { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.dev-btn { justify-content: flex-start; background: var(--panel); border: 1px solid var(--line); font-size: 15px; padding: 13px 16px; }
.danger-zone { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ===== 実績 ===== */
.ach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ach {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
}
.ach.is-done { border-color: #ffc93c55; background: linear-gradient(90deg, #2c2140, var(--panel)); }
.ach-ico { font-size: 22px; width: 32px; text-align: center; filter: grayscale(1); opacity: .6; }
.ach.is-done .ach-ico { filter: none; opacity: 1; }
.ach-main { flex: 1; min-width: 0; }
.ach-title { font-weight: 900; font-size: 15px; }
.ach-desc { font-size: 12px; color: var(--muted); }
.ach-bar { height: 4px; background: var(--line); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.ach-bar div { height: 100%; background: linear-gradient(90deg, var(--accent), #ff4fd8); }
.ach-summary { font-size: 13px; color: var(--muted); margin: -4px 0 14px; font-variant-numeric: tabular-nums; }
.ach-summary b { color: #ffc93c; font-size: 18px; }
.ach-bar-all { height: 6px; margin-top: 6px; }
.ach-bar-all div { background: linear-gradient(90deg, #ffc93c, #ff4fd8); }
.ach-cat { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 2px 2px; font-weight: 900; font-size: 15px; }
.ach-cat:first-child { margin-top: 0; }
.ach-cat small { color: var(--muted); font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.ach-reward { text-align: right; font-weight: 900; font-size: 13px; color: #ffc93c; white-space: nowrap; }
.ach-reward small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; font-variant-numeric: tabular-nums; }
.danger-zone { text-align: center; margin-top: 28px; }

/* ===== 下ナビ ===== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; justify-content: center;
  background: rgba(18,13,32,.95); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.nav-btn {
  flex: 1; max-width: 213px; background: none; border: 0; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 700;
  position: relative;
}
.nav-ico { font-size: 20px; line-height: 1; }
.nav-btn.is-active { color: var(--text); }
.nav-dot { position: absolute; top: 10px; left: calc(50% + 10px); width: 8px; height: 8px; border-radius: 50%; background: #eb0400; }

/* ===== カード ===== */
.card { --rc: #999; position: relative; }
.rar-pill {
  display: inline-block; font-weight: 900; font-size: 11px; line-height: 1; letter-spacing: .04em;
  padding: 4px 9px; border-radius: 6px; color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 80%, #fff), var(--rc));
  box-shadow: 0 2px 0 color-mix(in srgb, var(--rc) 60%, #000), inset 0 1px 0 rgba(255,255,255,.4);
  text-shadow: 0 1px 1px rgba(0,0,0,.35);
}
.card.r-N .rar-pill, .card.r-HN .rar-pill { color: #1a1426; text-shadow: none; }
.card.r-LR .rar-pill { background: linear-gradient(90deg, #ff6ad5, #ffc93c, #4fc3ff, #b17bff); box-shadow: 0 2px 0 #7a2b8f; }
.card-new {
  position: absolute; left: 6px; bottom: 6px; z-index: 1;
  font-size: 11px; font-weight: 900; background: #eb0400; color: #fff; padding: 2px 7px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
/* 配信中バッジ（位置は絶対配置なのでカードの大きさは変わらない） */
.card-live {
  position: absolute; left: 6px; top: 6px; z-index: 1;
  font-size: 10px; font-weight: 900; letter-spacing: .04em; background: #eb0400; color: #fff;
  padding: 2px 6px; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.mc-img .card-live { left: 3px; top: 3px; font-size: 8px; padding: 1px 4px; }
.cb-img .card-live { left: 8px; top: 8px; font-size: 13px; padding: 3px 9px; border-radius: 6px; }
.cb-meta .cb-live { color: #ff6b6b !important; }
.btn-channel.is-live { background: #eb0400; border-color: #eb0400; color: #fff; box-shadow: 0 6px 20px rgba(235,4,0,.35); }
.btn-channel.is-live .tw-ico { background: #fff; color: #eb0400; }
.live-info { color: #ff8a8a; font-size: 12px; font-weight: 800; margin-top: 4px; }
.pack[data-pack="live"] { background: linear-gradient(160deg, #6a1010, #1c0606 70%); }
.pack[data-pack="live"] .pack-mark { background: linear-gradient(135deg, #eb0400, #ff4f7a); box-shadow: 0 6px 20px rgba(235,4,0,.5); }
.card-dup { position: absolute; right: 6px; bottom: 6px; z-index: 1; font-size: 11px; font-weight: 900; background: rgba(0,0,0,.7); color: #fff; padding: 2px 7px; border-radius: 999px; }
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-fallback { display: grid; place-items: center; font-weight: 900; font-size: 36px; color: rgba(255,255,255,.7); width: 100%; height: 100%; }
@keyframes rainbow { to { background-position: 300% 0; } }
@keyframes cardShine { from { background-position: 150% 0; } to { background-position: -100% 0; } }

/* 小カード（10連・図鑑） */
.card:not(.card-big) {
  border-radius: 10px; padding: 5px 5px 6px; display: flex; flex-direction: column; gap: 4px;
  background: linear-gradient(180deg, #221a38, #17112a);
  border: 2px solid color-mix(in srgb, var(--rc) 70%, #2a2240);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}
.card.r-SR:not(.card-big) { box-shadow: 0 0 12px color-mix(in srgb, var(--rc) 45%, transparent); }
.card.r-SSR:not(.card-big), .card.r-UR:not(.card-big) { border-width: 3px; box-shadow: 0 0 16px color-mix(in srgb, var(--rc) 65%, transparent); }
.card.r-LR:not(.card-big) {
  border: 3px solid transparent;
  background: linear-gradient(180deg, #221a38, #17112a) padding-box, linear-gradient(135deg, #ff6ad5, #ffc93c, #4fc3ff, #b17bff, #ff6ad5) border-box;
  background-size: 100% 100%, 300% 300%; animation: rainbow 4s linear infinite;
  box-shadow: 0 0 18px rgba(255,106,213,.6);
}
.card:not(.card-big) { min-width: 0; overflow: hidden; }
.mc-name {
  font-weight: 900; font-size: 11px; line-height: 1.25; height: 2.5em; flex: none; padding: 0 1px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all;
}
.mc-img { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: color-mix(in srgb, var(--rc) 25%, #120d20); }
.card.r-SSR .mc-img::after, .card.r-UR .mc-img::after, .card.r-LR .mc-img::after,
.card.r-SSR .cb-img::after, .card.r-UR .cb-img::after, .card.r-LR .cb-img::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.3) 45%, transparent 60%);
  background-size: 250% 100%; animation: cardShine 2.6s ease-in-out infinite;
}
.mc-foot { text-align: center; }
.mc-img .card-new { font-size: 9px; padding: 1px 5px; left: 3px; bottom: 3px; }
.mc-img .card-dup { font-size: 9px; padding: 1px 5px; right: 3px; bottom: 3px; }

/* 大カード（1回・詳細） */
.card-big {
  width: min(340px, 84vw); margin: 0 auto; border-radius: 22px; padding: 8px 8px 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--rc) 85%, #fff), color-mix(in srgb, var(--rc) 70%, #000));
  box-shadow: 0 18px 40px color-mix(in srgb, var(--rc) 35%, transparent), 0 0 0 1px rgba(255,255,255,.15) inset;
}
.card-big.r-LR { background: linear-gradient(135deg, #ff6ad5, #ffc93c, #4fc3ff, #b17bff, #ff6ad5); background-size: 300% 300%; animation: rainbow 4s linear infinite; }
.card-big.r-HN { background: linear-gradient(160deg, #b9c0cf, #6f7789); }
.card-big.r-N { background: linear-gradient(160deg, #7a8290, #454c59); }
.cb-inner { background: #17112a; border-radius: 16px; padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.cb-head { display: flex; align-items: flex-start; gap: 10px; }
.cb-name { flex: 1; font-weight: 900; font-size: 18px; line-height: 1.3; word-break: break-word; }
.card-big .rar-pill { font-size: 15px; padding: 6px 10px; border-radius: 8px; }
.cb-img { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--rc) 25%, #120d20); }
.cb-img .card-new { left: auto; right: 8px; bottom: auto; top: 8px; font-size: 13px; padding: 3px 10px; border-radius: 6px; }
.cb-img .card-dup { font-size: 13px; padding: 3px 10px; }

/* Twitchパートナー ✓ と N+・HN+・R+ */
.partner-mark {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: #9147ff; color: #fff; font-size: 11px; font-weight: 900; line-height: 1;
  box-shadow: 0 0 0 2px rgba(0,0,0,.35); vertical-align: 2px;
}
.mc-img .partner-mark { position: absolute; top: 3px; right: 3px; z-index: 1; width: 15px; height: 15px; font-size: 9px; }
.partner-label { font-size: 11px; font-weight: 800; color: #c9a3ff; margin-left: 4px; vertical-align: 3px; }
.card.is-plus .rar-pill {
  background: linear-gradient(135deg, color-mix(in srgb, var(--rc) 80%, #fff), #9147ff);
  box-shadow: 0 2px 0 #4b1f8f, 0 0 10px rgba(145,71,255,.7), inset 0 1px 0 rgba(255,255,255,.4);
  color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.4);
}
.card.is-plus:not(.card-big) {
  border-color: #9147ff;
  box-shadow: 0 0 10px rgba(145,71,255,.55);
}
.card.is-plus .mc-img::after, .card.is-plus .cb-img::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(201,163,255,.28) 47%, transparent 58%);
  background-size: 250% 100%; animation: cardShine 3.2s ease-in-out infinite;
}
.card-big.is-plus { background: linear-gradient(160deg, color-mix(in srgb, var(--rc) 80%, #fff), #9147ff 70%, #4b1f8f); }
.card-big.is-plus .cb-foot { color: #fff; }
.cb-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); background: rgba(255,255,255,.04); border-radius: 8px; padding: 7px 10px; }
.cb-meta span:first-child { color: var(--text); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-meta span:last-child { white-space: nowrap; }
.cb-desc { margin: 0; font-size: 13px; line-height: 1.65; color: #d6cfee; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.cb-fl { display: flex; justify-content: space-between; align-items: flex-end; border-top: 2px solid var(--rc); padding-top: 8px; }
.cb-fl span { font-size: 12px; color: var(--muted); }
.cb-fl b { font-size: 44px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.cb-fl b small { font-size: 16px; margin-left: 2px; letter-spacing: 0; }
.cb-foot { display: flex; justify-content: space-between; padding: 7px 8px 8px; font-size: 11px; font-weight: 900; color: rgba(255,255,255,.9); letter-spacing: .03em; }
.card-big.r-HN .cb-foot { color: #1a1426; }

/* 横並び（連打ボタンから離すため高さを抑える） */
.result-links { display: flex; gap: 8px; width: min(340px, 84vw); margin: 0 auto; }
/* 演出画面の1回の結果は、下の連打ボタンとの間にすき間ができるよう少しだけ小さく */
.stage .card-big { width: min(340px, 84vw, 36vh); }
.stage .result-links { width: min(340px, 84vw, 36vh); min-width: 290px; }
.stage .cb-desc { -webkit-line-clamp: 2; }
.result-links > * { flex: 1; width: auto; padding: 12px 8px; font-size: 14px; white-space: nowrap; }
.result-links .tw-ico { width: 24px; height: 18px; font-size: 9px; }
.xpost-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 100%; padding: 14px; border-radius: 999px;
  background: #000; border: 1px solid #3a3a3a; color: #fff;
  font-weight: 900; font-size: 15px; text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.xpost-btn small { font-size: 12px; color: #c9a3ff; }
.xpost-btn:active, .btn-channel:active { transform: scale(.97); }
.btn-channel {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: min(340px, 84vw); margin: 0 auto; padding: 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font-weight: 900; font-size: 15px; text-decoration: none;
}
.tw-ico { display: inline-grid; place-items: center; width: 30px; height: 22px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 11px; }

/* ===== ガチャ演出ステージ ===== */
body.no-scroll { overflow: hidden; }
.stage {
  position: fixed; inset: 0; z-index: 40; overflow: hidden;
  background: radial-gradient(600px 420px at 50% 32%, #2a1a52, #0b0814 72%);
  display: flex; flex-direction: column;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.stage::after {
  content: ""; position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 1;
  transition: opacity .35s ease;
}
.stage.dark::after { opacity: .75; }
.stage-top {
  position: relative; z-index: 3; display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 14px; max-width: 640px; width: 100%; margin: 0 auto; flex: none;
}
.stage-count { margin-right: auto; font-weight: 900; color: #ffc93c; font-size: 14px; letter-spacing: .05em; }
.chip {
  position: relative; display: inline-flex; align-items: baseline; gap: 4px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); border-radius: 999px;
  padding: 8px 14px; font-size: 13px; color: var(--muted); white-space: nowrap;
}
.chip b { color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.chip-gain {
  position: absolute; right: 8px; top: -6px; font-weight: 900; font-size: 13px; color: #ffc93c; opacity: 0; pointer-events: none;
}
.chip-gain.show { animation: gain .8s ease-out; }
@keyframes gain { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); font-size: 17px; }

.stage-scroll {
  position: relative; z-index: 2; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: calc(var(--pull-bottom) + var(--pull-h) + 16px);
}
.stage-main {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 4px 16px 0; max-width: 640px; width: 100%; margin: 0 auto;
}
.stage-main.single { justify-content: flex-start; padding-top: 8px; }
.stage-main.single .pack-big { margin-top: 12vh; }

/* 固定ボタン（ガチャ画面の引くボタンと同じ位置） */
.stage-bottom {
  position: absolute; z-index: 6; left: 50%; transform: translateX(-50%);
  bottom: var(--pull-bottom); width: var(--pull-w);
}
.stage-bottom::before {
  content: ""; position: absolute; left: -50vw; right: -50vw; top: -28px; bottom: calc(-1 * var(--pull-bottom));
  background: linear-gradient(transparent, rgba(8,5,16,.92) 34%); pointer-events: none; z-index: -1;
}
.btn-again {
  width: 100%; height: var(--pull-h); font-size: 20px; letter-spacing: .04em;
  background: #fff; color: #120d20; box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.btn-again.is-running { background: rgba(255,255,255,.12); color: rgba(255,255,255,.75); box-shadow: none; font-size: 16px; border: 1px solid rgba(255,255,255,.15); }
.stage-hint { position: absolute; left: 0; right: 0; top: calc(100% + 10px); margin: 0; text-align: center; color: var(--muted); font-size: 12px; }

/* 画面ゆれ */
.stage.shake-1 .stage-main { animation: shake1 .18s linear; }
.stage.shake-2 .stage-main { animation: shake2 .26s linear; }
.stage.shake-3 .stage-main { animation: shake3 .34s linear; }
@keyframes shake1 { 25% { transform: translate(-3px, 2px); } 75% { transform: translate(3px, -2px); } }
@keyframes shake2 { 20% { transform: translate(-7px, 4px); } 40% { transform: translate(6px, -5px); } 60% { transform: translate(-5px, -3px); } 80% { transform: translate(4px, 4px); } }
@keyframes shake3 { 15% { transform: translate(-12px, 6px) rotate(-1deg); } 30% { transform: translate(10px, -8px) rotate(1deg); } 45% { transform: translate(-9px, -5px); } 60% { transform: translate(8px, 7px) rotate(-1deg); } 80% { transform: translate(-4px, 3px); } }

/* パック（演出中） */
.stage .pack-big { width: min(220px, 56vw); animation: packIn .16s ease-out; --gc: #fff; --gl: 0; }
@keyframes packIn { from { transform: scale(.85); opacity: 0; } }
.pack-big.stall {
  animation: stallPop .22s cubic-bezier(.2,1.6,.4,1) forwards;
  box-shadow: 0 0 calc(14px + var(--gl) * 16px) var(--gc), 0 0 calc(var(--gl) * 40px) color-mix(in srgb, var(--gc) 50%, transparent);
}
/* 大きさは変えず、明るさと光で溜める */
@keyframes stallPop { 0% { filter: brightness(1); } 30% { filter: brightness(2.2); } 100% { filter: brightness(1.15); } }
.pack-big.beat { animation: beat .32s ease-out forwards; }
@keyframes beat { 0% { filter: brightness(1); } 20% { filter: brightness(1.9); } 40% { filter: brightness(1.05); } 60% { filter: brightness(1.6); } 100% { filter: brightness(1.15); } }
.pack-big.rainbow { animation: stallPop .22s cubic-bezier(.2,1.6,.4,1) forwards, hue .8s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }
.pack-big.tearing { animation: tear .16s ease-in forwards; }
@keyframes tear { to { transform: scale(1.35); opacity: 0; filter: brightness(3); } }
.cracks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.cracks path { fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; filter: drop-shadow(0 0 3px #fff); stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw .18s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* 1回の結果 */
.reveal { animation: pop .26s cubic-bezier(.2,1.5,.4,1); }
.reveal.r-SSR, .reveal.r-UR, .reveal.r-LR { animation: popBig .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: rotateY(70deg); opacity: 0; } }
@keyframes popBig { 0% { transform: rotateY(90deg); opacity: 0; filter: brightness(3); } 60% { transform: none; opacity: 1; filter: brightness(1.8); } 100% { filter: none; } }

/* 10連 */
.stage-main.multi { justify-content: flex-start; padding-top: 4vh; gap: 16px; }
.total { text-align: center; }
.total small { display: block; color: var(--muted); font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.total b { display: inline-block; font-size: clamp(44px, 13vw, 64px); font-weight: 900; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.total b small { display: inline; font-size: .55em; color: var(--text); margin-left: 2px; letter-spacing: 0; }
.total b.bump { animation: bump .2s ease-out; }
@keyframes bump { 40% { transform: scale(1.06); } }
/* minmax(0,1fr): 長い名前でも列幅が広がらない＝全カード同じ大きさ */
.mgrid { width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .mgrid { gap: 6px; } }
.mgrid-hint { margin: 0; color: var(--muted); font-size: 13px; min-height: 1.4em; }
.mcell { position: relative; min-width: 0; animation: cellIn .2s calc(var(--i) * 22ms) ease-out both; }
@keyframes cellIn { from { transform: translateY(14px); opacity: 0; } }
/* 裏面は表面と同じ構造なので高さも同じ */
.card.card-back {
  --gc: #fff; --gl: 0;
  background: repeating-linear-gradient(45deg, #2a1d48 0 7px, #1d1533 7px 14px);
  border-color: #3b2e5c;
}
.card-back .mc-img { background: rgba(0,0,0,.25); display: grid; place-items: center; color: #6b55a3; font-size: 18px; }
.card-back .rar-pill { visibility: hidden; }
.card-back.stall { animation: stallPop .22s ease-out forwards; border-color: var(--gc); box-shadow: 0 0 calc(10px + var(--gl) * 10px) var(--gc), inset 0 0 calc(var(--gl) * 8px) var(--gc); }
.card-back.beat { animation: beat .32s ease-out forwards; }
.card-back.rainbow { animation: stallPop .22s forwards, hue .8s linear infinite; }
.mcell.focus { z-index: 2; }
.mcell.open { animation: flipIn .2s ease-out; }
@keyframes flipIn { from { transform: rotateY(90deg); } }
.mcell.open.r-SSR, .mcell.open.r-UR, .mcell.open.r-LR { animation: flipBig .45s ease-out; z-index: 1; }
@keyframes flipBig { 0% { transform: rotateY(90deg); filter: brightness(3); } 50% { transform: none; filter: brightness(2); } 100% { filter: none; } }
.mcell .card { cursor: pointer; }

/* エフェクト層 */
.fx-layer { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.onoma {
  position: absolute; transform: translate(-50%, -50%) rotate(var(--rot));
  font-size: calc(30px * var(--sz)); font-weight: 900; white-space: nowrap; letter-spacing: .02em;
  color: var(--oc); -webkit-text-stroke: 2px #1a0f33; paint-order: stroke fill;
  text-shadow: 0 0 12px var(--oc), 0 4px 0 #1a0f33;
  animation: onoma .75s cubic-bezier(.2,1.6,.4,1) forwards;
}
@keyframes onoma {
  0% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(.3); opacity: 0; }
  25% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(1.15); opacity: 1; }
  70% { transform: translate(-50%, -60%) rotate(var(--rot)) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -75%) rotate(var(--rot)) scale(1); opacity: 0; }
}
.bolt { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; animation: bolt .3s steps(3) forwards; }
.bolt polyline { fill: none; stroke: #bff3ff; vector-effect: non-scaling-stroke; stroke-width: 3px; filter: drop-shadow(0 0 6px #4fc3ff) drop-shadow(0 0 14px #4fc3ff); }
@keyframes bolt { 0% { opacity: 1; } 33% { opacity: .2; } 66% { opacity: 1; } 100% { opacity: 0; } }
.spark {
  position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--sc);
  box-shadow: 0 0 10px var(--sc); transform: translate(-50%, -50%);
  animation: spark .7s cubic-bezier(.1,.8,.3,1) forwards;
}
@keyframes spark { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); opacity: 0; } }
.stage-flash { position: fixed; inset: 0; z-index: 5; pointer-events: none; background: var(--fc, #fff); opacity: 0; }
.stage-flash.go { animation: flash .22s ease-out; }
.stage-flash.go-strong { animation: flashStrong .5s ease-out; }
@keyframes flash { 0% { opacity: .55; } 100% { opacity: 0; } }
@keyframes flashStrong { 0% { opacity: .9; } 30% { opacity: .5; } 100% { opacity: 0; } }

/* 効果音ボタン */
.top-right { display: flex; align-items: center; gap: 8px; }
.sound-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); font-size: 16px; }

/* ===== 詳細 ===== */
.detail { position: fixed; inset: 0; z-index: 60; background: rgba(6,4,12,.88); display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.detail-box { display: flex; flex-direction: column; gap: 14px; align-items: center; width: min(340px, 88vw); }

/* ===== トースト ===== */
/* 演出中は上端（図鑑・pt の行）に出して、合計フォロワーやカードを隠さない。タップも邪魔しない */
body.no-scroll .toast { top: calc(env(safe-area-inset-top) + 6px); pointer-events: none; font-size: 12px; padding: 8px 14px; }
.toast {
  position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 70;
  background: #fff; color: #120d20; font-weight: 800; font-size: 13px; line-height: 1.6;
  padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  max-width: 90vw; text-align: center; animation: drop .3s ease;
}
@keyframes drop { from { transform: translate(-50%, -10px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 開発者メニューへの入口（目立たないよう一番下に小さく） */
.dev-link {
  display: block; margin: 48px auto 0; padding: 6px 10px;
  background: none; border: 0; color: #4a4163; font-size: 11px; letter-spacing: .05em;
}
.dev-link:hover, .dev-link:focus-visible { color: var(--muted); }

/* 𝕏 シェア（上部にいつも出るボタン） */
.xpost-chip {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  height: 38px; padding: 0 14px; border-radius: 999px;
  background: #000; border: 1px solid #3a3a3a; color: #fff;
  font-weight: 900; font-size: 13px; text-decoration: none; white-space: nowrap;
}
.xpost-chip:active { transform: scale(.96); }
.xpost-bonus { margin: 16px 0 8px; text-align: center; }
.xpost-bonus .xpost-chip { height: 42px; font-size: 14px; gap: 10px; }
.xpost-bonus b { color: #d6b8ff; }
.xpost-bonus p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.stage-top .xpost-chip { height: 42px; animation: xpostIn .25s ease-out; }
@keyframes xpostIn { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 400px) {
  .stage-top { gap: 6px; padding: 12px 10px; }
  .stage-top .chip { padding: 8px 10px; }
  .stage-top .xpost-chip { padding: 0 11px; }
}

/* 人気カテゴリーのパック色 */
.pack[data-pack="apex"] { background: linear-gradient(160deg, #6b1f17, #1f0806 70%); }
.pack[data-pack="chat"] { background: linear-gradient(160deg, #4a2b7a, #150c26 70%); }
.pack[data-pack="gta"]  { background: linear-gradient(160deg, #1f5130, #08180e 70%); }
.pack[data-pack="ow"]   { background: linear-gradient(160deg, #7a4614, #221206 70%); }
.pack[data-pack="dbd"]  { background: linear-gradient(160deg, #3a1010, #0f0404 70%); }
.pack[data-pack="sf6"]  { background: linear-gradient(160deg, #6b5a12, #1f1a05 70%); }

/* ヘッダー: ロゴは折り返さない。スマホでは 𝕏 を丸アイコンにして幅を空ける */
.topbar { gap: 10px; }
.logo { white-space: nowrap; flex-shrink: 0; }
.top-right { min-width: 0; }
.points { white-space: nowrap; }
@media (max-width: 480px) {
  .topbar { padding: 10px 14px; }
  .logo { font-size: 17px; gap: 7px; }
  .logo-mark { width: 24px; height: 24px; font-size: 11px; }
  .top-right { gap: 6px; }
  .topbar .xpost-chip { width: 36px; height: 36px; padding: 0; justify-content: center; font-size: 16px; }
  .topbar .xp-label { display: none; }
  .sound-btn { width: 36px; height: 36px; font-size: 15px; }
  .points { font-size: 16px; padding: 6px 11px; }
}

/* いない配信者をリクエスト */
.req-open {
  display: block; margin: 18px auto 0; padding: 13px 24px; font-size: 14px;
  background: transparent; border: 1px solid var(--line); color: var(--text);
}
.req-result { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.req-result p { margin: 0; font-size: 14px; line-height: 1.6; }
.req-ok { color: #9ff0c0; font-weight: 800; }
.req-ng { color: #ff8aa0; font-weight: 800; }
.req-sub { color: var(--muted); font-size: 12px !important; }
.req-card { width: 120px; }
.req-note { margin: 14px 0 0; font-size: 11px; color: var(--muted); line-height: 1.7; }
.req-label { font-size: 12px; font-weight: 800; color: var(--text); margin-top: 4px; }
#reqMessage {
  padding: 12px 14px; border-radius: 12px; font: inherit; font-size: 16px; resize: vertical; min-height: 76px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
}

/* 縦が短いスマホ（Safariのツールバー表示中など）: パックの絵を小さくして、
   パック名・人数・排出率が「引く」ボタンより上に収まるようにする */
.lead { text-wrap: balance; }
@media (max-height: 760px) {
  .lead { font-size: 13px; line-height: 1.65; margin: 4px 0 0; }
  .pack-stage { padding: 14px 0 10px; }
  .pack { width: 132px; }
  .pack-mark { width: 40px; height: 40px; font-size: 16px; border-radius: 12px; }
  .pack-title { font-size: 12px; }
  .pack-name { font-size: 11px; }
}
@media (max-height: 640px) {
  .lead { display: none; }
  .pack-stage { padding: 10px 0 6px; }
  .pack { width: 112px; }
}

/* ===== PC（横幅700px以上）: スマホと同じ画面を、スマホ幅のまま中央に置く =====
   画面を広げると図鑑のカード等が大きくなりすぎるので、レイアウトはスマホのまま。
   ヘッダー・下のメニュー・引くボタン・結果画面もすべて同じ幅（--app-w）にそろえ、
   左右には枠線と淡い背景だけを足す */
@media (min-width: 700px) {
  :root {
    --app-w: 480px;
    --pull-w: calc(var(--app-w) - 32px);
  }
  body {
    background:
      radial-gradient(700px 460px at 50% -160px, #3b1f7d 0%, transparent 65%),
      radial-gradient(800px 640px at 0% 100%, rgba(145,71,255,.10), transparent 70%),
      radial-gradient(800px 640px at 100% 100%, rgba(255,79,216,.08), transparent 70%),
      #08060e;
  }
  /* アプリの列（スマホ1台分）の背景と左右の枠線 */
  body::before {
    content: ""; position: fixed; z-index: -1; top: 0; bottom: 0; left: 50%; width: var(--app-w);
    transform: translateX(-50%); pointer-events: none;
    background: radial-gradient(520px 420px at 50% -120px, #3b1f7d 0%, transparent 70%), var(--bg);
    border-left: 1px solid rgba(255,255,255,.06); border-right: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 0 80px rgba(0,0,0,.6);
  }
  .topbar { max-width: var(--app-w); }
  main { max-width: var(--app-w); }
  .bottom-nav {
    left: 50%; right: auto; width: var(--app-w); transform: translateX(-50%);
    border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  }
  /* ボタンの後ろの目隠しも列の幅だけ */
  .pull-bar::before { left: -16px; right: -16px; }
  /* 結果画面も同じ幅の列に */
  .stage {
    left: 50%; right: auto; width: var(--app-w); transform: translateX(-50%);
    border-left: 1px solid rgba(255,255,255,.08); border-right: 1px solid rgba(255,255,255,.08);
  }
  .stage-top, .stage-main { max-width: var(--app-w); }
  .card-big, .result-links { width: min(340px, calc(var(--app-w) - 60px)); }
  /* マウスで押せる所は、乗せたら少し明るく */
  .pack-chip:not(.is-active):not(:disabled):hover { border-color: var(--accent2); }
  .dex-grid .card:hover { filter: brightness(1.08); }
  .pull-bar .btn:not(:disabled):hover, .royal-btn:not(:disabled):hover { filter: brightness(1.08); }
}
@media (min-width: 700px) {
  /* 結果画面の外側（列の左右）は暗くして、ガチャ画面が透けないように */
  .stage { box-shadow: 0 0 0 100vmax rgba(5,3,10,.82); }
}
/* プライバシーポリシー等のページのロゴ（リンク） */
a.logo { text-decoration: none; color: var(--text); }

/* ===== LR専用の演出 =====
   背景の虹の光線（.lr-layer は stage の一番後ろ）・確定の帯・紙吹雪・カードの虹の光。
   カードの大きさは変えない（光と背景だけで豪華にする） */
.lr-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; animation: lrIn .5s ease-out both; }
.lr-rays {
  position: absolute; left: 50%; top: 42%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  background: repeating-conic-gradient(from 0deg,
    rgba(255,106,213,.30) 0deg 7deg, transparent 7deg 15deg,
    rgba(255,201,60,.26) 15deg 22deg, transparent 22deg 30deg,
    rgba(79,195,255,.28) 30deg 37deg, transparent 37deg 45deg,
    rgba(177,123,255,.30) 45deg 52deg, transparent 52deg 60deg);
  animation: lrSpin 14s linear infinite;
  -webkit-mask-image: radial-gradient(circle at center, #000 0 18%, transparent 55%);
          mask-image: radial-gradient(circle at center, #000 0 18%, transparent 55%);
}
.lr-glow-bg {
  position: absolute; inset: 0;
  background: radial-gradient(520px 420px at 50% 42%, rgba(255,255,255,.16), transparent 70%);
  animation: lrPulse 1.8s ease-in-out infinite;
}
.stage.lr-confirm .lr-rays { animation-duration: 3s; }
.stage.lr-confirm .lr-glow-bg { background: radial-gradient(600px 500px at 50% 42%, rgba(255,255,255,.35), transparent 70%); }
@keyframes lrIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lrSpin { to { transform: rotate(360deg); } }
@keyframes lrPulse { 50% { opacity: .55; } }

/* 帯の文字（確定!! / LEGEND RARE） */
.lr-banner {
  position: absolute; left: 0; right: 0; top: 30%; z-index: 6; text-align: center; pointer-events: none;
  font-weight: 900; letter-spacing: .04em; line-height: 1.05;
}
.lr-banner b, .lr-banner small {
  display: block;
  background: linear-gradient(90deg, #ff6ad5, #ffc93c, #4fc3ff, #b17bff, #ff6ad5); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(255,255,255,.55)) drop-shadow(0 4px 0 rgba(0,0,0,.5));
  animation: rainbow 1.2s linear infinite;
}
.lr-banner-confirm small { font-size: 22px; letter-spacing: .5em; margin-bottom: 4px; }
.lr-banner-confirm b { font-size: 64px; }
.lr-banner-confirm { animation: lrStamp 1.4s cubic-bezier(.2,1.4,.4,1) both; }
.lr-banner-reveal { top: 36%; }  /* 1回: カードの写真の上を横切る */
.lr-banner-reveal.is-mini { top: 58%; }  /* 10連: カードの並びの下 */
.lr-banner-reveal b { font-size: 40px; font-style: italic; }
.lr-banner-reveal { animation: lrSweep 2.6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes lrStamp {
  0% { opacity: 0; transform: scale(2.2); } 25% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08); }
}
@keyframes lrSweep {
  0% { opacity: 0; transform: translateX(-60%) skewX(-12deg); } 18% { opacity: 1; transform: translateX(0) skewX(-12deg); }
  80% { opacity: 1; transform: translateX(0) skewX(-12deg); } 100% { opacity: 0; transform: translateX(60%) skewX(-12deg); }
}

/* 紙吹雪 */
.confetti {
  position: absolute; top: -20px; z-index: 5; width: 8px; height: 14px; border-radius: 2px; pointer-events: none;
  background: var(--cc); animation: confettiFall 3s cubic-bezier(.3,.6,.5,1) both;
}
.confetti:nth-child(3n) { width: 6px; height: 6px; border-radius: 50%; }
@keyframes confettiFall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate(var(--dx), 105vh) rotate(var(--rz)); opacity: 0; }
}

/* LRのカードの周りの虹の光（大きさは変えず、影の色だけ回す） */
.lr-glow .card { animation: rainbow 4s linear infinite, lrCardGlow 1.6s linear infinite; }
.mcell.lr-glow { z-index: 2; }
@keyframes lrCardGlow {
  0%, 100% { box-shadow: 0 0 22px 4px rgba(255,106,213,.75), 0 0 60px 10px rgba(255,106,213,.35); }
  25% { box-shadow: 0 0 22px 4px rgba(255,201,60,.75), 0 0 60px 10px rgba(255,201,60,.35); }
  50% { box-shadow: 0 0 22px 4px rgba(79,195,255,.75), 0 0 60px 10px rgba(79,195,255,.35); }
  75% { box-shadow: 0 0 22px 4px rgba(177,123,255,.75), 0 0 60px 10px rgba(177,123,255,.35); }
}
.mcell.lr-glow .card { animation: lrCardGlow 1.6s linear infinite; }

/* 動きを減らす設定の端末では、回転と紙吹雪を止める */
@media (prefers-reduced-motion: reduce) {
  .lr-rays, .lr-glow-bg, .lr-glow .card, .lr-banner b, .lr-banner small { animation: none; }
  .confetti { display: none; }
}
