:root {
  --bg: #120e1c;
  --bg2: #1c1630;
  --panel: #231c3a;
  --line: #3a2f5c;
  --text: #f3eefc;
  --sub: #a99fc4;
  --accent: #ff5f9e;
  --accent2: #ffb35c;
  --radius: 14px;
  --bar-h: 132px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  padding-bottom: calc(var(--bar-h) + var(--safe-b));
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% -10%, #3b1d4d 0%, transparent 60%),
    radial-gradient(800px 500px at 110% 10%, #1d2a55 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.6;
  overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

/* ---------- ボタン ---------- */
.btn {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; padding: 12px 24px;
  font-weight: 800; text-decoration: none; color: var(--text); user-select: none;
  transition: transform .1s, filter .12s, opacity .12s;
}
.btn:active { transform: scale(.94); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn small { font-size: 11px; font-weight: 700; opacity: .85; }
.btn-main {
  background: linear-gradient(135deg, var(--accent), #ff7d6b 55%, var(--accent2));
  color: #2a0d1c;
  box-shadow: 0 6px 20px -6px rgba(255, 95, 158, .7), inset 0 -3px 0 rgba(0,0,0,.15), inset 0 2px 0 rgba(255,255,255,.35);
}
.btn-ghost { background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.btn-ghost.is-on { border-color: var(--accent); color: var(--accent); }

/* ---------- 年齢確認 ---------- */
.age {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(10, 6, 18, .97); backdrop-filter: blur(8px);
}
.age-box { width: 100%; max-width: 360px; text-align: center; }
.age-logo { font-size: 44px; font-weight: 900; margin: 0 0 12px; }
.age-logo span, .logo span { color: var(--accent); }
.age-q { color: var(--sub); margin: 0 0 24px; }
.age-btns { display: flex; flex-direction: column; gap: 10px; }
.age-btns .btn { padding: 16px; font-size: 17px; }
.age-ng { color: #ff8a8a; margin-top: 16px; }

/* ---------- ヘッダー・タブ ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 4px;
}
.logo { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: .02em; }
.logo small { font-size: 10px; margin-left: 4px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--sub); vertical-align: middle; }
.mute { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg2); font-size: 18px; }
.tabs {
  position: sticky; top: 0; z-index: 10; display: flex; gap: 4px; padding: 6px 10px;
  background: rgba(18, 14, 28, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.tab { flex: 1; border: 0; background: none; padding: 8px 4px; border-radius: 10px; color: var(--sub); font-weight: 800; font-size: 14px; }
.tab b { font-size: 11px; background: var(--line); color: var(--text); padding: 0 6px; border-radius: 999px; margin-left: 2px; }
.tab.is-on { color: var(--text); background: var(--panel); box-shadow: inset 0 -2px 0 var(--accent); }
.sample-note { margin: 0; padding: 5px 14px; text-align: center; font-size: 11px; background: #3a2a10; color: #ffd48a; }

main { max-width: 980px; margin: 0 auto; padding: 14px 14px 8px; }
.panel { animation: fade .25s; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* ---------- 絞り込み ---------- */
.filters { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.seg { display: flex; width: 100%; max-width: 360px; padding: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; }
.seg-btn { flex: 1; border: 0; background: none; padding: 10px 0; border-radius: 999px; font-weight: 800; color: var(--sub); transition: background .2s, color .2s; }
.seg-btn.is-on { background: var(--text); color: var(--bg); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chips-scroll {
  flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; width: calc(100% + 28px); margin: 0 -14px; padding: 2px 14px;
  scrollbar-width: none; -webkit-mask: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
.chips-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--bg2); padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--sub); white-space: nowrap; transition: transform .1s;
}
.chip:active { transform: scale(.94); }
.chip.is-on { border-color: var(--accent); color: var(--text); background: rgba(255, 95, 158, .18); }
.sale-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; cursor: pointer; user-select: none; padding: 4px 8px; }
.sale-check input { width: 22px; height: 22px; accent-color: var(--accent); }

/* ---------- カードパック ---------- */
.pack {
  --tear: 0;
  position: relative; width: 200px; aspect-ratio: 5 / 7; border-radius: 10px;
  background: linear-gradient(160deg, var(--p1), var(--p2));
  box-shadow: 0 18px 40px -14px rgba(0,0,0,.8), inset 0 0 0 2px rgba(255,255,255,.18);
  color: #fff; user-select: none;
}
/* 上下のギザギザ（シール部分） */
.pack::before, .pack::after {
  content: ""; position: absolute; left: 0; right: 0; height: 9px; z-index: 1;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,.18) 50%) 0 0 / 9px 9px, linear-gradient(225deg, transparent 50%, rgba(0,0,0,.18) 50%) 0 0 / 9px 9px;
}
.pack::before { top: 0; border-radius: 10px 10px 0 0; }
.pack::after { bottom: 0; transform: scaleY(-1); border-radius: 10px 10px 0 0; }
.pack-top {
  position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 13%; border-radius: 10px 10px 0 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--p1) 80%, #000), color-mix(in srgb, var(--p2) 85%, #000));
  transform-origin: 0% 100%;
  transform: rotate(calc(var(--tear) * -7deg)) translateY(calc(var(--tear) * -5px));
  transition: transform .08s;
}
.tear { position: absolute; z-index: 3; left: 6px; right: 6px; top: 13%; height: 0; border-top: 2px dashed rgba(255,255,255,.75); }
.tear-fill {
  position: absolute; left: 0; top: -3px; height: 4px; width: calc(var(--tear) * 100%); border-radius: 2px;
  background: #fff; box-shadow: 0 0 8px 2px var(--rc, #fff), 0 0 calc(10px + var(--tear) * 30px) calc(var(--tear) * 8px) var(--rc, #fff);
}
.tear-fill::after {
  content: ""; position: absolute; right: -6px; top: -6px; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--rc, #fff) 45%, transparent 70%); opacity: calc(var(--tear) * 8);
}
.pack-body { position: absolute; inset: 13% 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10px; overflow: hidden; }
.pack-body p { margin: 0; text-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pack-brand { font-size: 12px; font-weight: 900; letter-spacing: .2em; opacity: .9; }
.pack-icon { font-size: 54px; line-height: 1.2; margin: 6px 0 !important; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); }
.pack-name { font-size: 20px; font-weight: 900; line-height: 1.2; }
.pack-sub { font-size: 11px; font-weight: 700; opacity: .9; margin-top: 4px !important; }
.pack-count { margin-top: 10px !important; font-size: 11px; font-weight: 900; padding: 2px 10px; border-radius: 99px; background: rgba(0,0,0,.25); }
.pack-foil {
  position: absolute; inset: 0; z-index: 4; border-radius: inherit; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.75) 45%, transparent 60%) 0 0 / 260% 100%;
  animation: foil 3.2s ease-in-out infinite;
}
@keyframes foil { from { background-position: 130% 0; } 55%, to { background-position: -120% 0; } }

/* ガチャ画面の扇形の3パック */
.pack-show { position: relative; height: 310px; margin-top: 10px; display: grid; place-items: center; }
.pack-show .pack { grid-area: 1 / 1; }
.pack-show .fan-l { transform: translateX(-74px) rotate(-13deg) scale(.86); filter: brightness(.7); }
.pack-show .fan-r { transform: translateX(74px) rotate(13deg) scale(.86); filter: brightness(.7); }
.pack-show .fan-c { animation: float 3s ease-in-out infinite; }
.pack-show .tear { opacity: 0; }
@keyframes float { 50% { transform: translateY(-8px) rotate(1deg); } }
.pack-show.is-shaking .fan-c { animation: rattle .12s linear infinite; }
.pack-show.is-shaking .fan-l, .pack-show.is-shaking .fan-r { transition: transform .3s; transform: scale(.8); }
@keyframes rattle { 25% { transform: translate(-3px, 1px) rotate(-3deg); } 75% { transform: translate(3px, -1px) rotate(3deg); } }


.pool { margin: 12px 0 6px; text-align: center; font-weight: 800; font-size: 14px; }

.rates-box { margin: 8px auto 0; max-width: 460px; }
.rates-box summary { list-style: none; text-align: center; color: var(--sub); font-size: 12px; cursor: pointer; padding: 6px; }
.rates-box summary::-webkit-details-marker { display: none; }
.rates-box summary::after { content: " ▾"; }
.rates-box[open] summary::after { content: " ▴"; }
.rates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 12px; }
.rate {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  padding: 6px 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); border-left: 3px solid var(--rc);
}
.rate b { color: var(--rc); font-size: 14px; }
.rate-pct { font-weight: 800; }
.rate-cond { width: 100%; color: var(--sub); font-size: 10px; }
.rate.is-none { opacity: .4; }
.rates-note { color: var(--sub); font-size: 11px; text-align: center; margin: 8px 0 0; }

/* ---------- 画面下の引くボタン ---------- */
.pullbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px 14px calc(12px + var(--safe-b));
  background: linear-gradient(rgba(18,14,28,0), rgba(18,14,28,.97) 14px, #120e1c);
}
.pity { max-width: 460px; margin: 0 auto 8px; display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--sub); }
.pity-label { white-space: nowrap; }
.pity-label b { color: var(--text); font-size: 15px; margin: 0 2px; }
.pity-label b.is-near { color: #ffd36e; animation: pulse 1s infinite; display: inline-block; }
.meter { flex: 1; height: 8px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #b17bff, #ffc93c); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.pity.is-near .meter span { background: linear-gradient(90deg, #ffc93c, #ff5c7a); box-shadow: 0 0 10px #ffc93c; }
.pull-btns { max-width: 460px; margin: 0 auto; display: flex; gap: 10px; }
.btn-pull { flex: 1; padding: 13px 8px; font-size: 20px; line-height: 1.2; }
.btn-ten { flex: 1.35; background: linear-gradient(135deg, #ffe066, #ff9a4d 55%, var(--accent)); animation: breathe 2.2s ease-in-out infinite; overflow: hidden; }
.btn-ten::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.65) 50%, transparent 65%);
  transform: translateX(-120%); animation: shine 3s ease-in-out infinite;
}
.btn-ten:disabled, .btn-ten:disabled::after { animation: none; }
@keyframes breathe { 50% { box-shadow: 0 6px 26px -2px rgba(255, 170, 80, .8), inset 0 -3px 0 rgba(0,0,0,.15); } }
@keyframes shine { 60%, 100% { transform: translateX(120%); } }
@keyframes pulse { 50% { transform: scale(1.25); } }

/* ---------- カード ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; width: 100%; padding: 0; text-align: left;
  border: 2px solid var(--rc); border-radius: var(--radius); background: var(--panel); overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 8px 18px -10px var(--rc);
}
button.card:active { transform: scale(.97); }
.img { position: relative; aspect-ratio: 4 / 3; background: #0d0a15; display: grid; place-items: center; overflow: hidden; }
.img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.img-ph { background: linear-gradient(135deg, color-mix(in srgb, var(--rc, #6b5fa0) 50%, #1a1430), #1a1430); align-content: center; gap: 2px; }
.ph-icon { font-size: 32px; line-height: 1; }
.ph-type { font-size: 11px; color: rgba(255,255,255,.7); }
.badge {
  position: absolute; top: 6px; left: 6px; padding: 1px 8px; border-radius: 6px;
  background: var(--rc); color: #160f22; font-weight: 900; font-size: 12px; letter-spacing: .03em;
}
.rar-LR .badge { background: linear-gradient(90deg, #ff7ae0, #ffd36e, #7cf0ff, #c58bff); background-size: 200%; animation: rainbow 2s linear infinite; }
@keyframes rainbow { to { background-position: 200% 0; } }
.tr { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.new { padding: 0 6px; border-radius: 6px; background: #fff; color: #e0245e; font-weight: 900; font-size: 11px; }
.sale-tag { padding: 0 6px; border-radius: 6px; background: #e0245e; color: #fff; font-weight: 800; font-size: 11px; }
.card-body { padding: 8px 10px 10px; }
.card-title {
  margin: 0; font-size: 13px; font-weight: 800; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em;
}
.card-star { margin: 4px 0 0; font-size: 11px; color: var(--accent2); }
.rar-SSR, .rar-UR, .rar-LR { animation: glow 2.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 0 22px 2px var(--rc); } }
.rar-SSR::after, .rar-UR::after, .rar-LR::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%);
  background-size: 250% 100%; animation: sheen 2.8s ease-in-out infinite;
}
@keyframes sheen { from { background-position: 150% 0; } 60%, to { background-position: -100% 0; } }

/* 大きいカード（演出用） */
.card-big .card-title { font-size: 18px; -webkit-line-clamp: 3; min-height: 0; }
.card-big .card-star { font-size: 14px; }
.card-big .badge { font-size: 16px; padding: 2px 10px; }
.card-maker { margin: 2px 0 0; font-size: 12px; color: var(--sub); }
.card-price { margin: 4px 0 0; font-size: 13px; }
.card-price s { color: var(--sub); }
.card-price b { font-size: 16px; }

/* ---------- 演出 ---------- */
.stage {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto; overscroll-behavior: contain;
  background: radial-gradient(circle at 50% 42%, #2c2048, #0b0812 72%);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: calc(56px + env(safe-area-inset-top, 0px)) 16px calc(96px + var(--safe-b));
  user-select: none; -webkit-user-select: none;
}
.stage.shake { animation: sshake .35s; }
.stage.shake-strong { animation: sshake2 .55s; }
@keyframes sshake { 25% { transform: translate(-4px, 2px); } 50% { transform: translate(4px, -2px); } 75% { transform: translate(-2px, 1px); } }
@keyframes sshake2 { 15% { transform: translate(-9px, 4px) rotate(-.6deg); } 30% { transform: translate(8px, -5px) rotate(.6deg); } 45% { transform: translate(-6px, 3px); } 60% { transform: translate(5px, -2px); } 80% { transform: translate(-2px, 1px); } }
.stage-top { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; z-index: 2; }
.stage-count { font-weight: 900; font-size: 15px; color: var(--sub); font-variant-numeric: tabular-nums; }
.skip-btn { border: 1px solid var(--line); background: rgba(0,0,0,.4); padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--sub); }
.stage-hint { margin: 18px 0 0; color: var(--text); font-weight: 800; font-size: 15px; animation: blink 1.2s infinite; text-align: center; }
@keyframes blink { 50% { opacity: .35; } }
.stage-inner { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; margin-top: auto; }
/* 中身が画面より短いときは上下中央、長いときは上から並べてスクロール */
.stage-hint { margin-bottom: auto !important; }
.stage-inner:has(+ .stage-hint[hidden]) { margin-bottom: auto; }

.flash { position: fixed; inset: 0; pointer-events: none; z-index: 3; background: radial-gradient(circle, #fff 0%, var(--rc) 40%, transparent 75%); animation: flashout .6s ease-out forwards; }
@keyframes flashout { from { opacity: .95; } to { opacity: 0; } }
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 90; }

/* 演出中のパック */
.stage.is-tearing { touch-action: none; }
.pack.is-stage { width: min(62vw, 250px); animation: packin .6s cubic-bezier(.3,1.5,.6,1); filter: drop-shadow(0 0 calc(14px + var(--tear) * 36px) color-mix(in srgb, var(--rc) 75%, transparent)); cursor: grab; }
.pack.is-stage .pack-icon { font-size: 72px; }
.pack.is-stage .pack-name { font-size: min(22px, 7.4vw); white-space: nowrap; }
.pack.is-stage .tear { border-top-width: 3px; }
@keyframes packin { from { transform: translateY(-70vh) rotate(-25deg) scale(.7); } }
.pack.wiggle { animation: wiggle .5s ease-in-out; }
.pack.hit { animation: hit .25s ease-out; }
.pack.upgraded { filter: drop-shadow(0 0 60px var(--rc)) brightness(1.12); }
@keyframes wiggle { 20% { transform: rotate(-5deg); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(1deg); } }
@keyframes hit { 40% { transform: scale(.95, 1.04) rotate(-2deg); } }
/* 開封: 上の帯が飛び、中から光が出てパックは下へ */
.pack.is-open { animation: packout .7s .2s ease-in forwards; }
.pack.is-open .pack-top { transition: transform .45s cubic-bezier(.3,.6,.4,1), opacity .45s; transform: translate(150px, -190px) rotate(40deg); opacity: 0; }
.pack.is-open .tear { opacity: 0; }
.pack.is-open .pack-body::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: -40%; height: 80%;
  background: radial-gradient(ellipse at 50% 0%, #fff, var(--rc) 35%, transparent 70%); animation: beam .6s ease-out forwards;
}
@keyframes beam { from { opacity: 0; transform: scaleY(.2); transform-origin: top; } 40% { opacity: 1; } }
@keyframes packout { to { transform: translateY(70vh) scale(.9); opacity: 0; } }

/* 1枚ずつめくる（後ろにカードの山） */
.deck { position: relative; width: min(78vw, 320px); animation: rise .35s cubic-bezier(.2,1.4,.5,1); }
.deck-card {
  position: absolute; inset: 0; border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, #2b2246 0 12px, #241d3c 12px 24px);
  border: 2px solid #4a3d73; box-shadow: 0 6px 14px -6px rgba(0,0,0,.7);
  transform: translate(calc(var(--k) * 5px), calc(var(--k) * 6px)) rotate(calc(var(--k) * 1.6deg));
}
.is-reveal .flip { position: relative; width: 100%; perspective: 900px; transition: transform .17s ease-in, opacity .17s; }
.flip.fly { transform: translateX(-140%) rotate(-20deg); opacity: 0; }
@keyframes rise { from { transform: translateY(40px) scale(.85); opacity: 0; } }
.flip-back, .flip .card { backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .5s cubic-bezier(.3,1.3,.5,1); }
.flip-back {
  position: absolute; inset: 0; border-radius: var(--radius); z-index: 1;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--rc) 40%, transparent), transparent 60%), repeating-linear-gradient(45deg, #2b2246 0 12px, #241d3c 12px 24px);
  border: 2px solid var(--rc); box-shadow: 0 0 24px -4px var(--rc);
}
.flip .card { transform: rotateY(180deg); }
.flip.is-open .flip-back { transform: rotateY(-180deg); }
.flip.is-open .card { transform: rotateY(0); }
.rays {
  position: absolute; left: 50%; top: 42%; width: 900px; height: 900px; margin: -450px 0 0 -450px; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 40%, transparent) 0 8deg, transparent 8deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 10%, transparent 60%); mask: radial-gradient(circle, #000 10%, transparent 60%);
  animation: spin 14s linear infinite, fadein .6s;
}
.lv-UR .rays, .lv-LR .rays { animation-duration: 6s, .6s; }
.lv-LR .rays { background: repeating-conic-gradient(#ff7ae080 0 8deg, transparent 8deg 15deg, #7cf0ff80 15deg 23deg, transparent 23deg 30deg, #ffd36e80 30deg 38deg, transparent 38deg 45deg); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; } }
.rar-label { margin: 16px 0 0; display: flex; flex-direction: column; align-items: center; opacity: 0; transform: scale(.4); }
.rar-label.is-on { animation: stamp .45s cubic-bezier(.2,1.8,.5,1) forwards; }
.rar-label b { font-size: 44px; line-height: 1; font-weight: 900; color: var(--rc); text-shadow: 0 0 18px var(--rc), 0 2px 0 rgba(0,0,0,.5); letter-spacing: .04em; }
.lv-LR .rar-label b { background: linear-gradient(90deg, #ff7ae0, #ffd36e, #7cf0ff, #c58bff, #ff7ae0); background-size: 200%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rainbow 1.5s linear infinite; }
.lv-N .rar-label b, .lv-R .rar-label b { font-size: 30px; }
.rar-label span { font-size: 13px; font-weight: 800; color: var(--sub); }
.pity-hit { margin-top: 4px; color: #ffd36e !important; }
@keyframes stamp { to { opacity: 1; transform: scale(1); } }

/* 10連の一覧 */
.is-summary { max-width: 900px; }
.sum-head { text-align: center; margin-bottom: 12px; }
.sum-best { margin: 0; font-size: 28px; font-weight: 900; color: var(--rc); text-shadow: 0 0 16px var(--rc); }
.sum-new { margin: 0; font-weight: 900; color: #fff; }
.sum-grid { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sum-grid .card { animation: popin .35s cubic-bezier(.2,1.5,.5,1) both; }
.sum-grid .rar-SSR, .sum-grid .rar-UR, .sum-grid .rar-LR { animation: popin .35s cubic-bezier(.2,1.5,.5,1) both, glow 2.2s ease-in-out infinite .4s; }
@keyframes popin { from { transform: scale(.6); opacity: 0; } }

.stage-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; justify-content: center; gap: 10px;
  padding: 16px 14px calc(14px + var(--safe-b)); background: linear-gradient(transparent, rgba(11,8,18,.96) 35%);
}
.stage-foot .btn { flex: 1; max-width: 220px; padding: 14px; font-size: 17px; }

/* ---------- 詳細 ---------- */
.detail { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; background: rgba(6, 4, 12, .7); backdrop-filter: blur(4px); }
.detail-box {
  position: relative; width: 100%; max-width: 520px; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--panel); border: 2px solid var(--rc); border-bottom: 0; border-radius: 20px 20px 0 0; overflow: hidden;
  animation: sheet .3s cubic-bezier(.2,1.1,.4,1);
}
@keyframes sheet { from { transform: translateY(100%); } }
.detail-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); font-size: 22px; line-height: 1; }
.detail-img, .detail-body { flex: none; }
.detail-body { padding: 12px 18px 6px; overflow-y: auto; flex: 1 1 auto; }
.d-rar { margin: 0; font-weight: 900; color: var(--rc); font-size: 13px; }
.detail-box h2 { margin: 2px 0; font-size: 19px; line-height: 1.35; }
.d-maker { margin: 0; color: var(--sub); font-size: 13px; }
.d-meta { margin: 8px 0 0; font-size: 13px; }
.d-price { margin: 6px 0 0; font-size: 15px; }
.d-price s { color: var(--sub); }
.d-price b { font-size: 20px; }
.d-off { color: #ff6b8f; font-weight: 900; }
.d-end { color: var(--sub); font-size: 12px; }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); color: var(--sub); }
.d-note { margin: 10px 0 0; font-size: 11px; color: var(--sub); }
.d-btns { display: flex; gap: 10px; padding: 12px 16px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--panel); }
.d-btns .btn { padding: 14px 16px; }
.btn-dl { flex: 1; flex-direction: row; gap: 8px; font-size: 16px; }
.btn-dl small { font-size: 10px; padding: 0 5px; border: 1px solid currentColor; border-radius: 4px; }

/* ---------- 図鑑 ---------- */
.book-head { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.book-head .meter { width: 100%; max-width: 360px; flex: none; height: 10px; }
.book-progress { margin: 0; font-weight: 700; font-size: 14px; }
.book-progress b { font-size: 24px; color: var(--accent); }
.empty { text-align: center; color: var(--sub); margin: 40px 0; }

.toast {
  position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); z-index: 95; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 999px; font-weight: 900; white-space: nowrap;
  background: linear-gradient(135deg, #ffe066, #ff9a4d); color: #2a0d1c; box-shadow: 0 10px 30px -8px rgba(255,170,80,.8);
}
.toast.is-on { animation: toastin .5s cubic-bezier(.2,1.6,.5,1); }
@keyframes toastin { from { transform: translate(-50%, -80px); } }

.foot { max-width: 980px; margin: 24px auto 0; padding: 16px 16px 20px; border-top: 1px solid var(--line); color: var(--sub); font-size: 11px; text-align: center; }
.foot p { margin: 4px 0; }
.foot b { border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-right: 4px; }

/* ---------- PC ---------- */
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
  .sum-grid { grid-template-columns: repeat(5, 1fr); }
  .chips-scroll { flex-wrap: wrap; justify-content: center; width: auto; margin: 0; -webkit-mask: none; }
  .detail { align-items: center; padding: 16px; }
  .detail-box { border-radius: 20px; border-bottom: 2px solid var(--rc); }
  .tabs { justify-content: center; }
  .tab { flex: 0 1 160px; }
}

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