/* ニコニコ動画ガチャ — シンプルな白基調。色はレアリティのためにとっておく。 */

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  --bg: #f5f5f6;
  --panel: #ffffff;
  --ink: #111214;
  --muted: #6c7079;
  --faint: #9a9ea7;
  --line: #e4e5e9;
  --radius: 18px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", Meiryo, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --c-N: #8a9099;
  --c-R: #2d7ff9;
  --c-SR: #7c5cff;
  --c-SSR: #e8a013;
  --c-UR: #e5383b;
  --c-LR: #ff4fa3;
  --rainbow: #ff4d6d, #ffb703, #fff275, #52e3a4, #3fa9ff, #b388ff, #ff7ad9, #ff4d6d;

  --card-w: min(330px, 86vw, calc((100dvh - 226px) * 0.735));
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked {
  overflow: hidden;
}
button,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: default;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}
.sp {
  display: none;
}

/* ---------- ヘッダー ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 58px;
  padding: 0 clamp(14px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand__mark {
  width: 26px;
  height: 26px;
}
.top__nav {
  display: flex;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition:
    transform 0.15s var(--ease),
    background 0.15s;
}
.pill:hover {
  background: #fafafa;
}
.pill:active {
  transform: scale(0.96);
}
.pill svg {
  width: 17px;
  height: 17px;
}
.pill b {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12.5px;
}
.pill--icon {
  width: 36px;
  padding: 0;
  justify-content: center;
}
#toggleSound .ico-off,
#toggleSound[aria-pressed="false"] .ico-on {
  display: none;
}
#toggleSound[aria-pressed="false"] .ico-off {
  display: block;
}
#toggleSound[aria-pressed="false"] {
  color: var(--faint);
}

/* ---------- ヒーロー ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(18px, 4dvh, 44px) 16px clamp(30px, 9dvh, 120px);
  min-height: calc(100dvh - 58px);
  isolation: isolate;
}
.hero::before {
  /* パックに当たるスポットライト */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(52% 46% at 50% 54%, #fff 0%, transparent 70%),
    linear-gradient(180deg, transparent 0%, #fff 46%, transparent 100%);
  -webkit-mask: linear-gradient(90deg, transparent 12%, #000 38%, #000 62%, transparent 88%);
  mask: linear-gradient(90deg, transparent 12%, #000 38%, #000 62%, transparent 88%);
  opacity: 0.9;
  pointer-events: none;
}
.hero__ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.hero__ambient .dm {
  color: rgba(17, 18, 20, 0.055);
  text-shadow: none;
  font-weight: 900;
}
.eyebrow {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.eyebrow span {
  font-family: var(--mono);
  color: var(--ink);
}
.hero__title {
  margin: 4px 0 2px;
  font-size: clamp(30px, 6.4vw, 50px);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.01em;
}
.hero__lead {
  margin: 0;
  color: var(--muted);
  font-size: clamp(13px, 2.6vw, 15px);
}

/* パック選択 */
.packs {
  display: flex;
  gap: 6px;
  max-width: 100%;
  margin-top: clamp(12px, 2.4dvh, 22px);
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.packs::-webkit-scrollbar {
  display: none;
}
.packs button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition:
    background 0.2s,
    color 0.2s;
}
.packs button i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: hsl(var(--h) calc(var(--s) * 1%) 52%);
}
.packs button[aria-checked="true"] {
  background: var(--ink);
  color: #fff;
}
.packs button:not([aria-checked="true"]):hover {
  color: var(--ink);
}

/* パック本体（ボタン） */
.pack {
  --pack-w: clamp(150px, min(50vw, 26dvh), 236px);
  position: relative;
  margin: clamp(14px, 3dvh, 30px) 0 clamp(18px, 3.4dvh, 30px);
  padding: 0;
  border: 0;
  background: none;
  perspective: 900px;
}
.pack .pk {
  animation: pack-float 5.2s ease-in-out infinite;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  filter: drop-shadow(0 18px 20px rgba(24, 28, 44, 0.16)) drop-shadow(0 2px 3px rgba(24, 28, 44, 0.14));
  transition: filter 0.3s;
}
.pack:not(:disabled):hover .pk {
  filter: drop-shadow(0 24px 26px rgba(24, 28, 44, 0.2)) drop-shadow(0 2px 3px rgba(24, 28, 44, 0.16));
}
.pack:not(:disabled):active .pk {
  animation-play-state: paused;
  scale: 0.97;
}
.pack:disabled .pk {
  opacity: 0.6;
}
.pack__floor {
  position: absolute;
  left: 50%;
  bottom: -16px;
  width: 78%;
  height: 22px;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 24, 40, 0.2), transparent);
  animation: pack-floor 5.2s ease-in-out infinite;
}
.pack__hint {
  position: absolute;
  left: 50%;
  bottom: 15.5%;
  translate: -50% 0;
  font-size: clamp(10px, calc(var(--pack-w) * 0.062), 14px);
  font-weight: 800;
  letter-spacing: 0.14em;
  white-space: nowrap;
  color: hsl(220 10% 26%);
  animation: hint-blink 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pack-float {
  0%,
  100% {
    translate: 0 0;
    rotate: -0.6deg;
  }
  50% {
    translate: 0 -8px;
    rotate: 0.6deg;
  }
}
@keyframes pack-floor {
  0%,
  100% {
    scale: 1;
    opacity: 1;
  }
  50% {
    scale: 0.88;
    opacity: 0.7;
  }
}
@keyframes hint-blink {
  0%,
  100% {
    opacity: 0.95;
  }
  50% {
    opacity: 0.4;
  }
}

/* ---------- パックの見た目（.pk） ---------- */
.pk {
  --h: 220;
  --s: 6;
  --w: var(--pack-w, 220px);
  --tooth: calc(var(--w) / 26);
  position: relative;
  display: block;
  width: var(--w);
  aspect-ratio: 5 / 7.9;
  color: hsl(var(--h) calc(var(--s) * 0.6% + 6%) 22%);
  background:
    linear-gradient(
      100deg,
      hsl(var(--h) calc(var(--s) * 1%) 76%) 0%,
      hsl(var(--h) calc(var(--s) * 1%) 95%) 13%,
      hsl(var(--h) calc(var(--s) * 1%) 83%) 29%,
      hsl(var(--h) calc(var(--s) * 1%) 93%) 47%,
      hsl(var(--h) calc(var(--s) * 1%) 75%) 67%,
      hsl(var(--h) calc(var(--s) * 1%) 90%) 85%,
      hsl(var(--h) calc(var(--s) * 1%) 79%) 100%
    );
  /* 上下のギザギザ */
  -webkit-mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 50.5% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 50.5% repeat-x;
  mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 50.5% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 50.5% repeat-x;
  overflow: hidden;
}
.pk::before {
  /* 縦方向のふくらみ */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, transparent 16%, transparent 84%, rgba(0, 0, 0, 0.1) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0%, transparent 7%, transparent 93%, rgba(0, 0, 0, 0.14) 100%);
}
.pk__crimp {
  position: absolute;
  left: 0;
  right: 0;
  height: 7.2%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.05)),
    repeating-linear-gradient(
      90deg,
      hsl(var(--h) calc(var(--s) * 1%) 52% / 0.42) 0 1.5px,
      hsl(var(--h) calc(var(--s) * 1%) 100% / 0.55) 1.5px 3.2px
    );
}
.pk__crimp--t {
  top: 0;
  border-bottom: 1px solid hsl(var(--h) calc(var(--s) * 1%) 40% / 0.28);
}
.pk__crimp--b {
  bottom: 0;
  border-top: 1px solid hsl(var(--h) calc(var(--s) * 1%) 40% / 0.28);
}
.pk__label {
  position: absolute;
  top: 11.5%;
  left: 0;
  right: 0;
  font-size: calc(var(--w) * 0.044);
  font-weight: 800;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  opacity: 0.62;
}
.pk__name {
  position: absolute;
  top: 17.5%;
  left: 50%;
  translate: -50% 0;
  padding: 0.28em 1em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 3px rgba(0, 0, 0, 0.12);
  font-size: calc(var(--w) * 0.066);
  font-weight: 800;
  white-space: nowrap;
  color: #17181b;
}
.pk__emblem {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40%;
  aspect-ratio: 1;
  translate: -50% -52%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.95), hsl(var(--h) calc(var(--s) * 1%) 86%) 62%, hsl(var(--h) calc(var(--s) * 1%) 70%));
  box-shadow:
    0 0 0 calc(var(--w) * 0.012) rgba(255, 255, 255, 0.7),
    0 0 0 calc(var(--w) * 0.02) hsl(var(--h) calc(var(--s) * 1%) 58% / 0.5),
    0 calc(var(--w) * 0.03) calc(var(--w) * 0.05) rgba(0, 0, 0, 0.18);
}
.pk__emblem svg {
  width: 56%;
  color: hsl(var(--h) calc(var(--s) * 0.9% + 8%) 28%);
}
.pk__count {
  position: absolute;
  bottom: 24.5%;
  left: 0;
  right: 0;
  font-family: var(--mono);
  font-size: calc(var(--w) * 0.056);
  font-weight: 700;
  opacity: 0.8;
}
.pk__tiers {
  position: absolute;
  bottom: 9.4%;
  left: 0;
  right: 0;
  font-family: var(--mono);
  font-size: calc(var(--w) * 0.036);
  letter-spacing: 0.12em;
  opacity: 0.5;
}
.pk__sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, transparent 34%, rgba(255, 255, 255, 0.85) 47%, transparent 59%);
  background-size: 300% 100%;
  background-position: 130% 0;
  mix-blend-mode: soft-light;
  animation: sheen 4.6s ease-in-out infinite;
}
@keyframes sheen {
  0%,
  55% {
    background-position: 130% 0;
  }
  100% {
    background-position: -40% 0;
  }
}

/* ---------- ボタン類 ---------- */
.cta {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.2s,
    background 0.2s,
    opacity 0.2s;
}
.btn:hover {
  box-shadow: 0 4px 14px rgba(20, 24, 40, 0.1);
}
.btn:active {
  transform: scale(0.96);
}
.btn:disabled {
  opacity: 0.45;
  box-shadow: none;
}
.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.btn small {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn--primary small {
  color: rgba(255, 255, 255, 0.7);
}
.btn--lg {
  height: 54px;
  min-width: 156px;
  padding: 0 26px;
  font-size: 16px;
}
.btn--sm {
  height: 38px;
  padding: 0 15px;
  font-size: 13px;
}
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn--icon {
  width: 46px;
  padding: 0;
}
.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 12.5px;
  text-decoration: underline;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* 排出率 */
.odds {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.odds li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.odds li.is-empty {
  opacity: 0.35;
}
.pity {
  margin: 8px 0 0;
  min-height: 1.6em;
  font-size: 12px;
  color: var(--faint);
}
.pity b {
  font-family: var(--mono);
  color: var(--muted);
}

/* レアリティのバッジ */
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 2.5em;
  padding: 0.12em 0.5em;
  border-radius: 0.5em;
  background: var(--c);
  color: #fff;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.5;
}
.tier-N {
  --c: var(--c-N);
}
.tier-R {
  --c: var(--c-R);
}
.tier-SR {
  --c: var(--c-SR);
}
.tier-SSR {
  --c: var(--c-SSR);
}
.tier-UR {
  --c: var(--c-UR);
}
.tier-LR {
  --c: var(--c-LR);
}
.badge.tier-LR {
  background: linear-gradient(100deg, #ff4d6d, #ffb703, #52e3a4, #3fa9ff, #b388ff);
}
.badge.tier-UR {
  background: linear-gradient(120deg, #e5383b, #ff8a3d);
}
.badge.tier-SSR {
  background: linear-gradient(120deg, #d68a00, #f5c341);
}

/* ---------- 説明セクション ---------- */
.info {
  max-width: 860px;
  margin: 0 auto;
  padding: 44px 18px 8px;
}
.info h2 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 900;
}
.info__lead {
  margin: 0 0 16px;
  color: var(--muted);
}
.info__lead b {
  color: var(--ink);
  font-family: var(--mono);
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.rtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  white-space: nowrap;
}
.rtable th,
.rtable td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.rtable tr:last-child td {
  border-bottom: 0;
}
.rtable th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.rtable .num {
  text-align: right;
  font-family: var(--mono);
}
.rtable th.num {
  font-family: var(--font);
}
.rtable .badge {
  font-size: 12px;
}
.rtable td small {
  margin-left: 8px;
  color: var(--faint);
  font-size: 12px;
}
.note {
  margin: 10px 2px 0;
  font-size: 12.5px;
  color: var(--faint);
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.steps li::before {
  content: "0" counter(step);
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}
.steps b {
  display: block;
  margin: 2px 0 4px;
  font-size: 15.5px;
}
.steps span {
  font-size: 13.5px;
  color: var(--muted);
}
.about {
  margin: 12px 0 0;
  padding: 0 0 0 1.2em;
  color: var(--muted);
  font-size: 13.5px;
}
.about li + li {
  margin-top: 4px;
}
.about b {
  color: var(--ink);
}
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
  max-width: 860px;
  margin: 44px auto 0;
  padding: 20px 18px 40px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--faint);
}

/* ---------- 開封ステージ ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 50;
  /* clip にしておくと、中の要素にフォーカスが移ってもステージ自体がスクロールしない */
  overflow: hidden;
  overflow: clip;
  color: var(--ink);
  --hint: var(--c-N);
  --stage-bg: #eeeef0;
  animation: stage-in 0.22s ease-out both;
}
@keyframes stage-in {
  from {
    opacity: 0;
  }
}
.stage__bg,
.stage__bg::after {
  position: absolute;
  inset: 0;
}
.stage__bg {
  background: radial-gradient(90% 70% at 50% 42%, #ffffff 0%, #f1f1f3 70%, #e9e9ec 100%);
}
.stage__bg::after {
  content: "";
  background: radial-gradient(90% 70% at 50% 42%, #23252e 0%, #0d0e13 62%, #05060a 100%);
  opacity: 0;
  transition: opacity 0.42s ease;
}
.stage[data-tone="dark"] {
  color: #fff;
  --stage-bg: #0a0b10;
}
.stage[data-tone="dark"] .stage__bg::after {
  opacity: 1;
}
.stage__rays {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 190vmax;
  height: 190vmax;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, var(--hint) 0deg 5deg, transparent 5deg 17deg);
  -webkit-mask: radial-gradient(closest-side, #000 4%, rgba(0, 0, 0, 0.5) 22%, transparent 52%);
  mask: radial-gradient(closest-side, #000 4%, rgba(0, 0, 0, 0.5) 22%, transparent 52%);
  opacity: 0;
  transition: opacity 0.6s ease;
  animation: spin 26s linear infinite;
  pointer-events: none;
}
.stage.has-rays .stage__rays {
  opacity: 0.34;
}
.stage.has-rays[data-tier="LR"] .stage__rays {
  background: conic-gradient(from 0deg, var(--rainbow));
  -webkit-mask:
    repeating-conic-gradient(from 0deg, #000 0deg 5deg, transparent 5deg 15deg),
    radial-gradient(closest-side, #000 4%, rgba(0, 0, 0, 0.5) 24%, transparent 54%);
  -webkit-mask-composite: source-in;
  mask:
    repeating-conic-gradient(from 0deg, #000 0deg 5deg, transparent 5deg 15deg),
    radial-gradient(closest-side, #000 4%, rgba(0, 0, 0, 0.5) 24%, transparent 54%);
  mask-composite: intersect;
  opacity: 0.6;
}
@keyframes spin {
  to {
    rotate: 360deg;
  }
}
.stage__fx,
.stage__danmaku,
.stage__flash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.stage__fx {
  z-index: 6;
}
/* コメントの重なり順は1つずつ決める（この箱には z-index を付けない）。
   1枚を大きく見せるときは、カードやボタンの後ろに通して文字を読みやすくする（.dm--behind）。 */
.stage__danmaku {
  overflow: hidden;
}
.stage .dm {
  z-index: 7;
}
.stage .dm.dm--behind {
  z-index: 1;
}
.stage__flash {
  z-index: 8;
  opacity: 0;
}
.stage__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: 56px;
  padding: 0 clamp(12px, 3vw, 22px);
}
.stage__pack {
  margin-right: auto;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0.55;
}
.stage[data-tone="dark"] .pill {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.stage[data-tone="dark"] .btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.stage[data-tone="dark"] .btn--primary {
  background: #fff;
  border-color: #fff;
  color: #111;
}
.stage[data-tone="dark"] .btn--ghost {
  background: transparent;
  border-color: transparent;
  color: rgba(255, 255, 255, 0.7);
}
.stage[data-tone="dark"] .btn small {
  color: rgba(255, 255, 255, 0.6);
}

/* 流れるコメント */
.dm {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  font-weight: 800;
  line-height: 1;
  will-change: transform;
  color: #fff;
  text-shadow:
    0 0 3px #000,
    1px 1px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000;
  pointer-events: none;
  user-select: none;
}
.stage[data-tone="light"] .dm {
  color: #24262b;
  text-shadow:
    0 0 3px #fff,
    1px 1px 0 #fff,
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff;
  opacity: 0.6;
}
.dm--fixed {
  left: 50%;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.dm--top,
.dm--top2 {
  top: 8%;
}
/* 2行目（1行目のすぐ下に重ねる） */
.dm--top2 {
  margin-top: 1.45em;
}

/* パックの開封シーン */
.stage__scene {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 4;
  --pack-w: calc(var(--card-w) * 0.86);
  width: var(--pack-w);
  aspect-ratio: 5 / 7.9;
  translate: -50% -50%;
  pointer-events: none;
}
.opack {
  position: absolute;
  inset: 0;
  --amp: 0px;
}
.opack.is-charging .opack__body {
  animation: pk-shake 0.11s linear infinite;
}
@keyframes pk-shake {
  0% {
    transform: translate(calc(var(--amp) * -1), calc(var(--amp) * 0.4)) rotate(calc(var(--amp) * -0.12deg));
  }
  25% {
    transform: translate(calc(var(--amp) * 0.8), calc(var(--amp) * -0.7)) rotate(calc(var(--amp) * 0.1deg));
  }
  50% {
    transform: translate(calc(var(--amp) * -0.5), calc(var(--amp) * -0.3)) rotate(calc(var(--amp) * -0.06deg));
  }
  75% {
    transform: translate(calc(var(--amp) * 1), calc(var(--amp) * 0.6)) rotate(calc(var(--amp) * 0.12deg));
  }
  100% {
    transform: translate(calc(var(--amp) * -1), calc(var(--amp) * 0.4)) rotate(calc(var(--amp) * -0.12deg));
  }
}
.opack__body {
  position: absolute;
  inset: 0;
  z-index: 2;
  filter: drop-shadow(0 16px 22px rgba(10, 12, 24, 0.22));
}
.opiece {
  position: absolute;
  inset: 0;
}
.opiece .pk__sheen {
  animation: none;
}
/* 封を切る位置（上から 12% あたり）をギザギザに */
.opiece--top .pk {
  clip-path: polygon(0 0, 100% 0, 100% 12.6%, 92% 11.4%, 84% 12.9%, 76% 11.5%, 68% 12.8%, 60% 11.3%, 52% 12.7%, 44% 11.4%, 36% 12.9%, 28% 11.5%, 20% 12.8%, 12% 11.4%, 5% 12.7%, 0 11.8%);
}
.opiece--main .pk {
  clip-path: polygon(0 11.8%, 5% 12.7%, 12% 11.4%, 20% 12.8%, 28% 11.5%, 36% 12.9%, 44% 11.4%, 52% 12.7%, 60% 11.3%, 68% 12.8%, 76% 11.5%, 84% 12.9%, 92% 11.4%, 100% 12.6%, 100% 100%, 0 100%);
}
.opiece--top {
  z-index: 3;
  transform-origin: 85% 12%;
}
.opiece--main {
  z-index: 2;
}
.opack__glow {
  position: absolute;
  inset: -46%;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--hint) 0%, color-mix(in srgb, var(--hint) 45%, transparent) 36%, transparent 70%);
  opacity: 0;
  scale: 0.7;
  filter: blur(6px);
  transition:
    opacity 0.3s ease,
    scale 0.4s ease;
}
.opack.is-rainbow .opack__glow {
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, 0.9) 0%, transparent 60%),
    conic-gradient(from var(--angle), var(--rainbow));
  -webkit-mask: radial-gradient(closest-side, #000 20%, transparent 72%);
  mask: radial-gradient(closest-side, #000 20%, transparent 72%);
  animation: angle-spin 1.6s linear infinite;
}
@keyframes angle-spin {
  to {
    --angle: 360deg;
  }
}
.opack__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 120%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: 3px solid var(--hint);
  box-shadow:
    0 0 26px var(--hint),
    inset 0 0 26px var(--hint);
  opacity: 0;
}
.opack__slit {
  position: absolute;
  left: -4%;
  right: -4%;
  top: 11%;
  z-index: 4;
  height: 2.2%;
  border-radius: 99px;
  background: #fff;
  box-shadow:
    0 0 10px 3px #fff,
    0 0 34px 10px var(--hint);
  opacity: 0;
}
.opack__beam {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 88%;
  z-index: 1;
  height: 130%;
  background: linear-gradient(0deg, color-mix(in srgb, var(--hint) 80%, #fff) 0%, color-mix(in srgb, var(--hint) 30%, transparent) 40%, transparent 100%);
  clip-path: polygon(8% 100%, 92% 100%, 130% 0, -30% 0);
  filter: blur(8px);
  opacity: 0;
  transform-origin: 50% 100%;
}

/* 1枚を大きく見せるエリア */
.stage__focus {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 56px 14px 16px;
}
.stage__focus.is-detail {
  z-index: 5;
}
.focus__veil {
  position: absolute;
  inset: 0;
  display: none;
  background: color-mix(in srgb, #f3f3f5 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.stage[data-tone="dark"] .focus__veil {
  background: rgba(8, 9, 13, 0.9);
}
.stage__focus.is-detail .focus__veil {
  display: block;
}
.focus__slot,
.focus__meta,
.stage__focus .actions {
  position: relative;
}
.focus__slot {
  width: var(--card-w);
  flex: none;
}
.focus__burst {
  position: absolute;
  left: 50%;
  top: 44%;
  translate: -50% -50%;
  font-size: min(46vw, 400px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--hint);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.focus__meta {
  margin: 0;
  min-height: 1.7em;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.stage[data-tone="dark"] .focus__meta {
  color: rgba(255, 255, 255, 0.72);
}
.focus__meta b {
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 6px;
  background: #ff3355;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.stage__focus .actions,
.focus__meta {
  transition:
    opacity 0.35s ease,
    translate 0.35s var(--ease);
}
.stage__focus:not(.is-ready) .actions,
.stage__focus:not(.is-ready) .focus__meta {
  opacity: 0;
  translate: 0 8px;
  pointer-events: none;
  visibility: hidden;
}
.stage__focus .actions {
  max-width: 520px;
}

/* 10連の結果 */
.stage__multi {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 62px 14px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* スクロールしたカードが上のバーの文字と重ならないように、上端をぼかして消す */
  -webkit-mask-image: linear-gradient(to bottom, transparent 38px, #000 60px);
  mask-image: linear-gradient(to bottom, transparent 38px, #000 60px);
}
.multi__grid {
  --cols: 5;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 14px);
  width: min(100%, 940px, calc((100dvh - 190px) * 2.05));
  margin-top: auto;
}
/* ボタンの場所は最初から確保しておく（めくり終わった瞬間にカードの列が動かないように） */
.multi__foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: auto;
  padding: 4px 0 6px;
  visibility: hidden;
}
.multi__foot.is-ready {
  visibility: visible;
  animation: rise-in 0.4s var(--ease) both;
}
.multi__summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  min-height: 22px;
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  opacity: 0.85;
}
.multi__summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
@keyframes rise-in {
  from {
    opacity: 0;
    translate: 0 10px;
  }
}

/* ---------- カード（大） ---------- */
.card3d {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 6.8;
  container-type: inline-size;
  perspective: 1300px;
  --frame: linear-gradient(145deg, #eceef1, #c2c7cf 40%, #f4f5f7 60%, #b3b9c3);
  --holo: 0;
  --c: var(--c-N);
}
.card3d.tier-R {
  --frame: linear-gradient(145deg, #c4dcff, #2d7ff9 38%, #dcebff 58%, #1c5fd0);
  --holo: 0.2;
}
.card3d.tier-SR {
  --frame: linear-gradient(145deg, #dfd3ff, #7c5cff 38%, #f1ebff 58%, #5a3be0);
  --holo: 0.4;
}
.card3d.tier-SSR {
  --frame: linear-gradient(145deg, #fff2c6, #e8a013 36%, #fff8df 56%, #c07c00);
  --holo: 0.55;
}
.card3d.tier-UR {
  --frame: linear-gradient(145deg, #ffd4bd, #e5383b 34%, #ffe7ad 55%, #b0101d);
  --holo: 0.7;
}
.card3d.tier-LR {
  --frame: conic-gradient(from var(--angle), var(--rainbow));
  --holo: 1;
}
.card3d__tilt,
.card3d__flip {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.card3d__tilt {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.2s ease-out;
}
.card3d__flip {
  position: relative;
  transition: transform 0.58s cubic-bezier(0.2, 0.75, 0.25, 1);
}
.card3d.is-facedown .card3d__flip {
  transform: rotateY(180deg);
}
.cface {
  position: absolute;
  inset: 0;
  border-radius: 5cqw;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow:
    0 2cqw 5cqw rgba(16, 18, 32, 0.2),
    0 0.4cqw 1cqw rgba(16, 18, 32, 0.18);
}
.cface--front {
  padding: 3.2cqw;
  background: var(--frame);
}
.card3d.tier-LR .cface--front {
  animation: angle-spin 5s linear infinite;
}
.card3d.tier-SSR .cface,
.card3d.tier-UR .cface,
.card3d.tier-LR .cface {
  box-shadow:
    0 2cqw 6cqw rgba(16, 18, 32, 0.28),
    0 0 9cqw color-mix(in srgb, var(--c) 55%, transparent);
}
.cface--back {
  transform: rotateY(180deg);
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 2.4cqw, transparent 2.4cqw 4.8cqw),
    linear-gradient(150deg, #2b2e38, #111318 55%, #23262f);
  box-shadow:
    0 2cqw 5cqw rgba(16, 18, 32, 0.24),
    0 0 0 0.6cqw rgba(255, 255, 255, 0.14) inset,
    0 0 8cqw color-mix(in srgb, var(--hint, #fff) 70%, transparent);
}
.cface--back svg {
  width: 34%;
  color: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 0 4cqw color-mix(in srgb, var(--hint, #fff) 80%, transparent));
}
.cface--back::after {
  content: "NICO GACHA";
  position: absolute;
  bottom: 9%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 3.4cqw;
  font-weight: 800;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: rgba(255, 255, 255, 0.5);
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2.5cqw;
  height: 100%;
  padding: 3.4cqw 3.6cqw 3cqw;
  border-radius: 2.6cqw;
  background: #fff;
  color: #14151a;
  text-align: left;
  overflow: hidden;
}
.card3d.tier-SSR .card {
  background: linear-gradient(180deg, #fffdf5, #fff);
}
.card3d.tier-UR .card {
  background: linear-gradient(180deg, #fff7f4, #fff);
}
.card3d.tier-LR .card {
  background: linear-gradient(160deg, #fff5fa, #f5fbff 45%, #fffdf2);
}
.card__head {
  display: flex;
  align-items: center;
  gap: 2cqw;
  min-width: 0;
}
.card__head .badge {
  font-size: 4.3cqw;
  border-radius: 1.6cqw;
}
.card__cat {
  font-size: 3.5cqw;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__id {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 3.1cqw;
  color: #8b909a;
  white-space: nowrap;
}
.card__art {
  position: relative;
  flex: none;
  border-radius: 2cqw;
  overflow: hidden;
  background: #101114;
}
/* サムネイルの上を流れるコメント（プレイヤー風） */
.card__dm {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.card__dm .dm,
.stage[data-tone="light"] .card__dm .dm {
  z-index: auto;
  color: #fff;
  opacity: 1;
  text-shadow:
    0 0 2px #000,
    1px 1px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000;
}
.card__len {
  position: absolute;
  right: 1.6cqw;
  bottom: 1.6cqw;
  padding: 0.2cqw 1.6cqw;
  border-radius: 1.2cqw;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-family: var(--mono);
  font-size: 3.2cqw;
  line-height: 1.6;
}
.card__new {
  position: absolute;
  left: 1.6cqw;
  top: 1.6cqw;
  padding: 0.2cqw 2cqw;
  border-radius: 1.2cqw;
  background: #ff3355;
  color: #fff;
  font-size: 3.1cqw;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.6;
}
.card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}
.card__play span {
  display: grid;
  place-items: center;
  width: 15cqw;
  height: 15cqw;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition:
    transform 0.2s var(--ease),
    background 0.2s;
}
.card__play svg {
  width: 6.4cqw;
  height: 6.4cqw;
  margin-left: 0.8cqw;
}
.card__play:hover span {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.7);
}
.card__title {
  margin: 0;
  min-height: 2.76em;
  font-size: 4.7cqw;
  font-weight: 800;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}
.card__views {
  display: flex;
  align-items: baseline;
  gap: 1.6cqw;
  line-height: 1;
}
.card__views strong {
  font-size: 10.6cqw;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.card3d.tier-SSR .card__views strong,
.card3d.tier-UR .card__views strong,
.card3d.tier-LR .card__views strong {
  background: var(--num, linear-gradient(120deg, #b97400, #f0b429));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.card3d.tier-UR {
  --num: linear-gradient(120deg, #c1121f, #ff7b3a);
}
.card3d.tier-LR {
  --num: linear-gradient(100deg, #ff3d7f, #ff9f1c 30%, #19b98c 55%, #2b8cff 75%, #9b5cff);
}
.card__views span {
  font-size: 3.7cqw;
  font-weight: 800;
  color: #6c7079;
}
.card__stats {
  display: flex;
  gap: 3.4cqw;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 3.4cqw;
  color: #5d626c;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.card__stats li {
  display: inline-flex;
  align-items: center;
  gap: 1cqw;
}
.card__stats svg {
  width: 3.8cqw;
  height: 3.8cqw;
  opacity: 0.7;
}
.card__tags {
  display: flex;
  gap: 1.4cqw;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask: linear-gradient(90deg, #000 86%, transparent);
  mask: linear-gradient(90deg, #000 86%, transparent);
}
.card__tags li {
  flex: none;
  padding: 0.3cqw 2cqw;
  border-radius: 99px;
  background: #f1f2f4;
  font-size: 3.1cqw;
  font-weight: 700;
  color: #4d525b;
  line-height: 1.7;
}
.card__foot {
  display: flex;
  justify-content: space-between;
  gap: 2cqw;
  margin-top: auto;
  padding-top: 2.2cqw;
  border-top: 0.3cqw solid #ecedf0;
  font-size: 3.2cqw;
  color: #7b808a;
  white-space: nowrap;
}
.card__foot b {
  color: #14151a;
  font-variant-numeric: tabular-nums;
}
/* ホログラムと照り返し */
.card__holo,
.card__glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.card__holo {
  background: linear-gradient(
    115deg,
    transparent 18%,
    rgba(255, 255, 255, 0.7) 36%,
    rgba(120, 210, 255, 0.5) 46%,
    rgba(255, 150, 225, 0.5) 54%,
    rgba(255, 240, 150, 0.5) 62%,
    transparent 80%
  );
  background-size: 260% 260%;
  background-position: calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%);
  mix-blend-mode: soft-light;
  opacity: var(--holo);
}
.card3d.tier-LR .card__holo {
  mix-blend-mode: color-dodge;
  opacity: 0.32;
}
.card__glare {
  background: radial-gradient(circle at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%), rgba(255, 255, 255, 0.5), transparent 46%);
  opacity: var(--glare, 0);
  transition: opacity 0.25s;
}

/* サムネイル */
.thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #24262d, #101114);
}
.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s;
}
.thumb.is-loaded .thumb__img {
  opacity: 1;
}
.thumb__bg {
  filter: blur(14px) saturate(1.3) brightness(0.75);
  scale: 1.25;
}
/* 古い動画は小さいサムネイル（130×100）しか無いので、ぼかした背景の上に小さめに置く */
.thumb.is-lowres.is-loaded .thumb__bg {
  opacity: 1;
}
.thumb.is-lowres .thumb__img {
  inset: 10% auto auto 50%;
  width: 71.2%;
  height: 80%;
  translate: -50% 0;
  border-radius: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}
.thumb.is-empty::after {
  content: "NO IMAGE";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
}

/* ---------- カード（小） ---------- */
.mini {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 0;
  background: none;
  container-type: inline-size;
  perspective: 800px;
  text-align: left;
  --c: var(--c-N);
}
.mini__flip {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(0.2, 0.75, 0.25, 1);
}
.mini.is-facedown .mini__flip {
  transform: rotateY(180deg);
}
.mini__face {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 7cqw;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.mini__back {
  transform: rotateY(180deg);
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 3cqw, transparent 3cqw 6cqw),
    linear-gradient(150deg, #2b2e38, #111318 55%, #23262f);
  box-shadow: 0 0 0 1cqw rgba(255, 255, 255, 0.12) inset;
  transition: box-shadow 0.3s;
}
.mini__back svg {
  width: 36%;
  color: rgba(255, 255, 255, 0.9);
}
.mini.is-hot .mini__back {
  box-shadow:
    0 0 0 1.6cqw var(--c) inset,
    0 0 14cqw var(--c) inset;
  animation: hot-pulse 0.5s ease-in-out infinite alternate;
}
@keyframes hot-pulse {
  to {
    filter: brightness(1.5);
  }
}
.mini__front {
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #14151a;
  box-shadow:
    0 0 0 2.2cqw var(--c) inset,
    0 1px 2px rgba(16, 18, 32, 0.12);
  padding: 2.2cqw;
}
.mini.tier-N .mini__front {
  box-shadow:
    0 0 0 2.2cqw #d3d7dd inset,
    0 1px 2px rgba(16, 18, 32, 0.12);
}
.mini.tier-LR .mini__front {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(120deg, var(--rainbow)) border-box;
  border: 2.2cqw solid transparent;
  box-shadow: 0 0 12cqw rgba(255, 79, 163, 0.5);
  padding: 0;
}
.mini.tier-SSR .mini__front,
.mini.tier-UR .mini__front {
  box-shadow:
    0 0 0 2.2cqw var(--c) inset,
    0 0 10cqw color-mix(in srgb, var(--c) 55%, transparent);
}
.mini .thumb {
  flex: none;
  border-radius: 5cqw 5cqw 1.5cqw 1.5cqw;
}
.mini__rarity {
  position: absolute;
  left: 4.4cqw;
  top: 4.4cqw;
  font-size: 7cqw;
  border-radius: 2.4cqw;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.mini__new {
  position: absolute;
  right: 4.4cqw;
  top: 4.4cqw;
  padding: 0 3cqw;
  border-radius: 2.4cqw;
  background: #ff3355;
  color: #fff;
  font-size: 6cqw;
  font-weight: 900;
  line-height: 1.7;
}
.mini__count {
  position: absolute;
  right: 4.4cqw;
  top: 4.4cqw;
  padding: 0 3cqw;
  border-radius: 2.4cqw;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-family: var(--mono);
  font-size: 6cqw;
  line-height: 1.7;
}
.mini__title {
  margin: 4cqw 4cqw 0;
  font-size: 7.4cqw;
  font-weight: 800;
  line-height: 1.36;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}
.mini__views {
  margin: auto 4cqw 4cqw;
  font-size: 8.4cqw;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mini__views small {
  margin-left: 1.6cqw;
  font-size: 5.8cqw;
  font-weight: 700;
  color: #7b808a;
}
.mini:not(.is-facedown):hover .mini__flip {
  transform: translateY(-3px);
}

/* ---------- 図鑑 ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 18, 26, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: stage-in 0.2s ease-out both;
}
.sheet__panel {
  max-width: 1040px;
  min-height: 100%;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 28px) 28px;
  background: var(--bg);
  animation: rise-in 0.3s var(--ease) both;
}
.sheet__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 12px;
  background: var(--bg);
}
.sheet__head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.3;
}
.sheet__head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.sheet__head p b {
  font-family: var(--mono);
  color: var(--ink);
}
.coll__tiers {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.coll__tier {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.coll__tier .badge {
  font-size: 11px;
}
.coll__tier strong {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.3;
}
.coll__tier small {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
}
.coll__tier i {
  display: block;
  height: 3px;
  margin-top: 6px;
  border-radius: 9px;
  background: var(--line);
  overflow: hidden;
}
.coll__tier i::after {
  content: "";
  display: block;
  width: calc(var(--p) * 1%);
  min-width: calc(var(--has) * 3px);
  height: 100%;
  background: var(--c);
}
.coll__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 12px;
}
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  overflow-x: auto;
  scrollbar-width: none;
}
.seg button {
  flex: none;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
}
.seg button[aria-selected="true"] {
  background: var(--ink);
  color: #fff;
}
.select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.select select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-weight: 700;
  font-size: 13px;
}
.coll__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.coll__empty {
  margin: 48px 0;
  text-align: center;
  color: var(--muted);
}
.coll__more {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}
.sheet__foot {
  margin-top: 26px;
  text-align: center;
}
.sheet__note {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--faint);
}

/* ---------- ページ内プレイヤー ---------- */
.player {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(6, 7, 10, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: stage-in 0.2s ease-out both;
}
.player__panel {
  width: min(100%, 1000px, calc((100dvh - 170px) * 16 / 9));
  color: #fff;
}
.player__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.player__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.player__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.player__meta strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.player__btns {
  display: flex;
  gap: 8px;
  flex: none;
}
.player .btn {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.player .btn--primary {
  background: #fff;
  border-color: #fff;
  color: #111;
}
.player__note {
  margin: 8px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- トースト ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  translate: -50% 0;
  max-width: min(92vw, 520px);
  padding: 11px 18px;
  border-radius: 14px;
  background: #16171b;
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: rise-in 0.3s var(--ease) both;
}

/* ---------- 画面幅ごとの調整 ---------- */
@media (max-width: 720px) {
  .sp {
    display: inline;
  }
  .brand__name {
    font-size: 14px;
  }
  /* レアリティ表: 横スクロールなしで収める（割合の列と肩書きは省く） */
  .rtable {
    font-size: 12.5px;
  }
  .rtable th,
  .rtable td {
    padding: 10px 6px;
  }
  .rtable th:first-child,
  .rtable td:first-child {
    padding-left: 12px;
  }
  .rtable th:last-child,
  .rtable td:last-child {
    padding-right: 12px;
  }
  .rtable th:nth-child(4),
  .rtable td:nth-child(4),
  .rtable td small {
    display: none;
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .coll__tiers {
    grid-template-columns: repeat(3, 1fr);
  }
  /* 10連: 2列で縦に並べ、ボタンは画面の下に固定する */
  .stage__multi {
    padding-bottom: 0;
  }
  .multi__grid {
    --cols: 2;
    width: min(100%, 400px);
    margin: 0;
  }
  .multi__foot {
    position: sticky;
    bottom: 0;
    z-index: 2;
    align-self: stretch;
    margin: auto -14px 0;
    padding: 20px 14px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, var(--stage-bg) 24%);
  }
  .player__meta {
    flex-direction: column;
    align-items: stretch;
  }
  .player__btns {
    justify-content: flex-end;
  }
}
@media (min-width: 721px) and (max-width: 980px) {
  .multi__grid {
    width: min(100%, 720px, calc((100dvh - 190px) * 2.05));
  }
}
@media (max-width: 400px) {
  .top__nav {
    gap: 5px;
  }
  .brand__name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pack .pk,
  .pack__floor,
  .pack__hint,
  .pk__sheen,
  .stage__rays {
    animation: none;
  }
}
/* スキップ中は CSS のトランジションも止める */
.stage.is-skipping * {
  transition-duration: 0s !important;
}
