:root {
  --bg: #f6f1e8;
  --surface: rgba(255, 252, 247, 0.82);
  --surface-strong: rgba(255, 251, 245, 0.96);
  --line: rgba(98, 78, 54, 0.12);
  --text: #24190f;
  --muted: #6e5f50;
  --shadow: 0 22px 70px rgba(50, 35, 20, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 118px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(238, 187, 125, 0.28), transparent 30%),
    radial-gradient(circle at top right, rgba(91, 124, 255, 0.14), transparent 26%),
    radial-gradient(circle at bottom right, rgba(243, 122, 97, 0.16), transparent 22%),
    linear-gradient(180deg, #fbf7f1 0%, #f2eadf 100%);
}

body::before,
body::after {
  position: fixed;
  inset: auto;
  content: "";
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: 110px;
  right: -40px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(83, 114, 255, 0.12), transparent 70%);
}

body::after {
  left: -80px;
  bottom: 40px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 150, 74, 0.14), transparent 72%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.page-content {
  display: grid;
  gap: 22px;
}

.masthead {
  position: sticky;
  top: 14px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 251, 245, 0.8);
  box-shadow: 0 10px 32px rgba(72, 47, 20, 0.08);
  backdrop-filter: blur(18px);
  transition:
    top 220ms ease,
    padding 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease,
    border-color 220ms ease,
    transform 220ms ease;
}

.page-home .masthead.masthead--scrolled {
  top: 10px;
  padding: 12px 16px;
  background: rgba(255, 251, 245, 0.92);
  box-shadow: 0 14px 36px rgba(55, 37, 18, 0.12);
}

.masthead--compact {
  margin-bottom: 32px;
}

.page-detail .masthead {
  background: rgba(255, 251, 245, 0.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 18px;
  border: 1px solid rgba(84, 63, 42, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(233, 223, 208, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  font-weight: 800;
  transition:
    width 220ms ease,
    height 220ms ease,
    border-radius 220ms ease,
    font-size 220ms ease;
}

.page-home .masthead.masthead--scrolled .brand__mark {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  font-size: 0.92rem;
}

.brand__text {
  display: grid;
  gap: 4px;
}

.brand__text strong {
  font-size: 1rem;
}

.brand__text strong,
.brand__text small {
  transition: font-size 220ms ease, opacity 220ms ease;
}

.page-home .masthead.masthead--scrolled .brand__text strong {
  font-size: 0.95rem;
}

.page-home .masthead.masthead--scrolled .brand__text small {
  opacity: 0.82;
}

.brand__text small,
.inline-link,
.quick-nav a,
.box-detail__copy p,
.box-detail__badge {
  color: var(--muted);
}

.quick-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.page-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  padding: 12px 18px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.page-tab:hover {
  transform: translateY(-2px);
  color: var(--text);
}

.page-tab--active {
  color: var(--text);
  box-shadow: 0 14px 28px rgba(74, 50, 23, 0.12);
}

.page-tab--active-home {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 232, 220, 0.94));
}

.page-tab--active-gacha {
  background:
    linear-gradient(135deg, rgba(255, 244, 216, 0.98), rgba(255, 221, 159, 0.96));
}

.quick-nav a,
.inline-link {
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.page-home .masthead .quick-nav a {
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    padding 220ms ease;
}

.page-home .masthead.masthead--scrolled .quick-nav a {
  padding: 9px 14px;
}

.quick-nav a:hover,
.inline-link:hover,
.box-card:hover {
  transform: translateY(-2px);
}

.tier-section,
.box-detail__panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tier-section::before,
.box-detail__panel::before {
  position: absolute;
  content: "";
  inset: auto;
  border-radius: 50%;
  pointer-events: none;
}

.tier-section__heading h2,
.box-card__body h3,
.box-detail__copy h1,
.empty-state h1 {
  margin: 0;
  line-height: 1.08;
}

.box-detail__badge {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
}

.tier-stack {
  display: grid;
  gap: 22px;
}

.tier-section {
  padding: 28px;
}

.tier-section::before {
  top: -90px;
  right: -50px;
  width: 230px;
  height: 230px;
  background: radial-gradient(circle, var(--tier-glow), transparent 72%);
}

.tier-section__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.tier-section__heading h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.03em;
}

.tier-section__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(42, 31, 20, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: var(--tier-accent);
  font-weight: 800;
}

.box-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
  gap: 18px;
  justify-content: start;
  align-items: start;
}

.box-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 12px;
  min-height: 100%;
  border: 1px solid rgba(56, 40, 22, 0.1);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 240, 231, 0.86));
  box-shadow: 0 16px 44px rgba(66, 45, 20, 0.09);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.box-card:hover {
  border-color: color-mix(in srgb, var(--tier-accent) 38%, rgba(55, 39, 22, 0.18));
  box-shadow: 0 20px 50px rgba(66, 45, 20, 0.13);
}

.box-card__media {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 0.94;
  padding: 14px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.94), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(243, 235, 225, 0.9));
  border: 1px solid rgba(77, 57, 35, 0.08);
  cursor: zoom-in;
}

.box-card__media img {
  width: min(88%, 220px);
  max-height: 100%;
  transform: scale(1);
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(42, 24, 8, 0.16));
}

.box-card__body {
  display: grid;
  gap: 12px;
}

.box-card__body h3 {
  font-size: 1.25rem;
}

.box-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 4px;
  color: var(--text);
  font-weight: 700;
}

.box-card__link::after {
  content: "\2192";
  color: var(--tier-accent);
}

.box-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.box-card__zoom {
  appearance: none;
  border: 1px solid rgba(69, 50, 27, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font: inherit;
}

.box-card__zoom:not(.box-card__media),
.box-card__link,
.image-modal__close {
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(69, 50, 27, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.box-card__link {
  color: var(--text);
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.image-modal[hidden] {
  display: none;
}

.image-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 18, 13, 0.58);
  backdrop-filter: blur(10px);
}

.image-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 28px), 980px);
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  background: rgba(255, 250, 244, 0.95);
  box-shadow: 0 30px 80px rgba(13, 8, 3, 0.32);
}

.image-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.image-modal__body {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: min(70vh, 760px);
  padding: clamp(8px, 2vw, 18px);
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.96), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 234, 224, 0.92));
}

.image-modal__body img {
  max-width: 100%;
  max-height: min(64vh, 720px);
  object-fit: contain;
  filter: drop-shadow(0 24px 32px rgba(33, 21, 10, 0.18));
}

.box-detail {
  display: grid;
  gap: 22px;
}

.box-detail__panel {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(18px, 2.6vw, 28px);
  padding: clamp(18px, 2.6vw, 28px);
}

.box-detail__panel::before {
  right: -70px;
  bottom: -90px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--tier-glow), transparent 74%);
}

.box-detail__media {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: min(100%, 300px);
  justify-self: start;
  align-self: start;
  padding: clamp(12px, 2vw, 18px);
  border-radius: 24px;
  border: 1px solid rgba(71, 51, 28, 0.1);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.96), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 236, 226, 0.9));
}

.box-detail__media img {
  width: min(82%, 240px);
  max-height: 300px;
  object-fit: contain;
  filter: drop-shadow(0 20px 28px rgba(40, 26, 12, 0.16));
}

.box-detail__copy {
  display: grid;
  align-content: start;
  gap: 16px;
}

.box-detail__copy h1 {
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  letter-spacing: -0.04em;
}

.box-detail__copy p {
  margin: 0;
  line-height: 1.8;
}

.box-detail__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.box-detail__badge {
  padding: 12px 16px;
}

.gacha-stage {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--tier-accent) 14%, rgba(255, 244, 223, 0.92)), transparent 34%),
    linear-gradient(135deg, rgba(255, 251, 246, 0.96), rgba(243, 233, 221, 0.9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.gacha-stage::before {
  position: absolute;
  top: -110px;
  right: -40px;
  width: 280px;
  height: 280px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, var(--tier-glow), transparent 72%);
  pointer-events: none;
}

.gacha-stage__hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.gacha-stage__media {
  appearance: none;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 380px;
  padding: clamp(18px, 3vw, 28px);
  border-radius: 30px;
  border: 1px solid rgba(71, 51, 28, 0.1);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.98), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 236, 226, 0.92));
  cursor: zoom-in;
}

.gacha-stage__halo {
  position: absolute;
  width: min(76%, 320px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tier-accent) 24%, rgba(255, 216, 166, 0.58)), transparent 70%);
  filter: blur(4px);
  animation: gacha-halo-float 4800ms ease-in-out infinite;
}

.gacha-stage__media img {
  position: relative;
  z-index: 1;
  max-height: 500px;
  object-fit: contain;
  filter: drop-shadow(0 26px 34px rgba(39, 24, 10, 0.2));
}

.gacha-stage__copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 18px;
}

.gacha-stage__eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 10px 14px;
  border: 1px solid rgba(77, 56, 34, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--tier-accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gacha-stage__copy h1 {
  margin: 0;
  font-size: clamp(2.6rem, 4vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.gacha-stage__copy p {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.8;
}

.gacha-stage__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gacha-stage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gacha-stage__link,
.gacha-stage__secondary,
.gacha-box-card__primary,
.gacha-box-card__secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 136px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(69, 50, 27, 0.1);
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.gacha-stage__link,
.gacha-box-card__primary {
  background: color-mix(in srgb, var(--tier-accent) 16%, rgba(255, 255, 255, 0.92));
  box-shadow: 0 14px 28px color-mix(in srgb, var(--tier-accent) 16%, rgba(55, 38, 20, 0.1));
}

.gacha-stage__secondary,
.gacha-box-card__secondary {
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
}

.gacha-stage__link:hover,
.gacha-stage__secondary:hover,
.gacha-box-card__primary:hover,
.gacha-box-card__secondary:hover {
  transform: translateY(-2px);
}

.gacha-browser {
  display: grid;
  gap: 22px;
}

.gacha-browser__header {
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 252, 247, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.gacha-browser__header h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.04;
}

.gacha-browser__header p {
  margin: 12px 0 0;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.8;
}

.gacha-tier-group {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.gacha-tier-group::before {
  position: absolute;
  top: -90px;
  right: -50px;
  width: 230px;
  height: 230px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, var(--tier-glow), transparent 72%);
  pointer-events: none;
}

.gacha-box-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.gacha-box-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(56, 40, 22, 0.1);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 240, 231, 0.88));
  box-shadow: 0 16px 36px rgba(66, 45, 20, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.gacha-box-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tier-accent) 38%, rgba(55, 39, 22, 0.18));
  box-shadow: 0 20px 42px rgba(66, 45, 20, 0.12);
}

.gacha-box-card--active {
  border-color: color-mix(in srgb, var(--tier-accent) 46%, rgba(55, 39, 22, 0.2));
  box-shadow: 0 22px 48px color-mix(in srgb, var(--tier-accent) 18%, rgba(66, 45, 20, 0.16));
}

.gacha-box-card__media {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1.04;
  padding: 10px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.96), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 235, 225, 0.92));
  border: 1px solid rgba(77, 57, 35, 0.08);
}

.gacha-box-card__media img {
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(42, 24, 8, 0.14));
}

.gacha-box-card__body {
  display: grid;
  gap: 12px;
}

.gacha-box-card__body h3 {
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.08;
}

.gacha-box-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gacha-box-card__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gacha-box-card--active .gacha-box-card__status {
  background: color-mix(in srgb, var(--tier-accent) 14%, rgba(255, 255, 255, 0.9));
  color: var(--text);
}

.gacha-box-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card-library,
.pull-simulator {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.pull-simulator > * {
  position: relative;
  z-index: 1;
}

.pull-simulator::before,
.pull-simulator::after {
  position: absolute;
  content: "";
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}

.pull-simulator::before {
  inset: -26%;
  background:
    radial-gradient(circle, var(--pull-hit-core, rgba(255, 214, 159, 0.44)) 0%, transparent 56%);
  transform: scale(0.72);
}

.pull-simulator::after {
  inset: 8% -12%;
  background:
    conic-gradient(
      from 180deg at 50% 50%,
      transparent 0deg,
      var(--pull-hit-spark, rgba(255, 239, 201, 0.46)) 24deg,
      transparent 54deg,
      transparent 110deg,
      var(--pull-hit-spark, rgba(255, 239, 201, 0.46)) 138deg,
      transparent 166deg,
      transparent 222deg,
      var(--pull-hit-spark, rgba(255, 239, 201, 0.46)) 248deg,
      transparent 276deg,
      transparent 332deg,
      var(--pull-hit-spark, rgba(255, 239, 201, 0.46)) 356deg,
      transparent 360deg
    );
  filter: blur(4px);
  transform: scale(0.76);
}

.card-library__header,
.pull-simulator__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-library__header h2,
.pull-simulator__header h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
  line-height: 1.08;
}

.card-library__count,
.pull-simulator__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(42, 31, 20, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 700;
}

.pull-simulator__header p {
  margin: 10px 0 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.7;
}

.pull-simulator__announcement {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 156px;
  max-width: min(100%, 280px);
  margin: 0 auto 16px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 251, 239, 0.96), rgba(255, 238, 206, 0.9));
  box-shadow: 0 18px 34px rgba(102, 60, 18, 0.18);
  color: #4d3115;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  animation: pull-announcement-pop 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pull-simulator__announcement[hidden] {
  display: none;
}

.pull-simulator__bundles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.pull-simulator__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(69, 50, 27, 0.1);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--tier-accent) 12%, rgba(255, 255, 255, 0.94)), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 237, 228, 0.9));
}

.pull-simulator__bar-copy {
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.pull-simulator__status {
  display: grid;
  gap: 4px;
}

.pull-simulator__status strong {
  font-size: 1rem;
  line-height: 1.1;
}

.pull-simulator__status span {
  color: var(--muted);
  line-height: 1.6;
}

.pull-simulator__stats {
  display: inline-flex;
  align-items: center;
  align-self: start;
  padding: 10px 14px;
  border: 1px solid rgba(69, 50, 27, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: color-mix(in srgb, var(--text) 76%, #6f583f);
  font-size: 0.95rem;
  font-weight: 700;
}

.pull-simulator__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.pull-simulator__reset,
.pull-simulator__action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 999px;
  font: inherit;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.pull-simulator__reset {
  min-width: 148px;
  border: 1px solid rgba(69, 50, 27, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: color-mix(in srgb, var(--text) 72%, #7a6248);
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(56, 37, 14, 0.08);
}

.pull-simulator__reset:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tier-accent) 28%, rgba(69, 50, 27, 0.14));
  box-shadow: 0 16px 28px color-mix(in srgb, var(--tier-accent) 14%, rgba(44, 29, 12, 0.14));
}

.pull-simulator__reset:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pull-simulator__action {
  min-width: 172px;
  border: 1px solid color-mix(in srgb, var(--tier-accent) 36%, rgba(69, 50, 27, 0.1));
  background: color-mix(in srgb, var(--tier-accent) 16%, rgba(255, 255, 255, 0.9));
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 16px 28px color-mix(in srgb, var(--tier-accent) 16%, rgba(44, 29, 12, 0.12));
}

.pull-simulator__action:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px color-mix(in srgb, var(--tier-accent) 18%, rgba(44, 29, 12, 0.16));
}

.pull-simulator__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.pull-simulator__summary[hidden] {
  display: none;
}

.pull-simulator__results {
  align-content: start;
}

.pull-simulator__empty {
  padding: 30px 22px;
  border: 1px dashed rgba(88, 63, 34, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.pull-simulator--hit[data-hit-rarity="sp"] {
  --pull-hit-core: rgba(255, 197, 97, 0.46);
  --pull-hit-spark: rgba(255, 241, 186, 0.72);
}

.pull-simulator--hit[data-hit-rarity="se"] {
  --pull-hit-core: rgba(255, 109, 99, 0.5);
  --pull-hit-spark: rgba(255, 214, 152, 0.78);
}

.pull-simulator--hit[data-hit-rarity="mr"] {
  --pull-hit-core: rgba(179, 128, 255, 0.48);
  --pull-hit-spark: rgba(225, 205, 255, 0.76);
}

.pull-simulator--hit[data-hit-rarity="cr"] {
  --pull-hit-core: rgba(104, 192, 255, 0.46);
  --pull-hit-spark: rgba(195, 239, 255, 0.78);
}

.pull-simulator--burst::before {
  animation: pull-hit-flash 1200ms ease-out both;
}

.pull-simulator--burst::after {
  animation: pull-hit-sparks 1500ms ease-out both;
}

.pull-simulator--hit .pull-simulator__bar {
  border-color: color-mix(in srgb, var(--pull-hit-core) 62%, rgba(101, 62, 20, 0.14));
  box-shadow: 0 18px 38px color-mix(in srgb, var(--pull-hit-core) 36%, rgba(59, 38, 16, 0.12));
}

.box-detail__badge--showcase {
  position: relative;
  overflow: hidden;
  border-color: transparent;
  color: #412713;
  font-weight: 800;
  box-shadow: 0 14px 28px var(--showcase-shadow, rgba(139, 95, 44, 0.16));
  animation: pull-badge-pulse 1.6s ease-in-out infinite;
}

.box-detail__badge--showcase::after {
  position: absolute;
  inset: -30% -50%;
  content: "";
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.72) 50%, transparent 70%);
  transform: translateX(-52%) rotate(12deg);
  animation: pull-badge-shine 1800ms ease-in-out infinite;
}

.box-detail__badge--showcase-sp {
  --showcase-shadow: rgba(192, 138, 44, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 246, 221, 0.98), rgba(255, 219, 150, 0.96));
}

.box-detail__badge--showcase-se {
  --showcase-shadow: rgba(211, 95, 72, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 239, 217, 0.98), rgba(255, 189, 171, 0.96));
}

.box-detail__badge--showcase-mr {
  --showcase-shadow: rgba(129, 95, 214, 0.26);
  background:
    linear-gradient(135deg, rgba(245, 237, 255, 0.98), rgba(212, 187, 255, 0.96));
}

.box-detail__badge--showcase-cr {
  --showcase-shadow: rgba(67, 142, 204, 0.24);
  background:
    linear-gradient(135deg, rgba(233, 248, 255, 0.98), rgba(178, 226, 255, 0.96));
}

.simulator-result__slot {
  color: color-mix(in srgb, var(--tier-accent) 74%, #6e5f50);
  opacity: 1;
  letter-spacing: 0.04em;
  text-transform: none;
}

.simulator-result--showcase {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 240, 231, 0.92)) padding-box,
    linear-gradient(135deg, var(--showcase-edge-start), var(--showcase-edge-end)) border-box;
  box-shadow: 0 22px 46px var(--showcase-shadow, rgba(124, 83, 32, 0.18));
  animation: rare-card-float 1700ms ease-in-out infinite alternate;
}

.simulator-result--showcase .card-entry__media {
  background:
    radial-gradient(circle at top, var(--showcase-glow, rgba(255, 235, 193, 0.58)), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 236, 226, 0.92));
}

.simulator-result--showcase .card-entry__media::after {
  position: absolute;
  inset: -14% -26%;
  content: "";
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.76) 50%, transparent 70%);
  transform: translateX(-68%) rotate(14deg);
  animation: rare-card-shine 1500ms ease-in-out infinite;
}

.simulator-result--showcase .card-entry__meta strong,
.simulator-result--showcase .card-entry__meta small {
  color: #442913;
}

.simulator-result--showcase-sp {
  --showcase-edge-start: rgba(255, 233, 169, 0.96);
  --showcase-edge-end: rgba(227, 154, 49, 0.96);
  --showcase-glow: rgba(255, 220, 139, 0.62);
  --showcase-shadow: rgba(183, 125, 34, 0.26);
}

.simulator-result--showcase-se {
  --showcase-edge-start: rgba(255, 229, 176, 0.96);
  --showcase-edge-end: rgba(229, 100, 80, 0.96);
  --showcase-glow: rgba(255, 181, 151, 0.64);
  --showcase-shadow: rgba(190, 84, 68, 0.28);
}

.simulator-result--showcase-mr {
  --showcase-edge-start: rgba(236, 222, 255, 0.96);
  --showcase-edge-end: rgba(136, 104, 236, 0.96);
  --showcase-glow: rgba(204, 179, 255, 0.64);
  --showcase-shadow: rgba(116, 88, 205, 0.26);
}

.simulator-result--showcase-cr {
  --showcase-edge-start: rgba(223, 247, 255, 0.96);
  --showcase-edge-end: rgba(78, 178, 232, 0.96);
  --showcase-glow: rgba(171, 229, 255, 0.62);
  --showcase-shadow: rgba(58, 142, 195, 0.24);
}

@keyframes pull-hit-flash {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }

  18% {
    opacity: 0.92;
    transform: scale(1.08);
  }

  100% {
    opacity: 0;
    transform: scale(1.38);
  }
}

@keyframes pull-hit-sparks {
  0% {
    opacity: 0;
    transform: scale(0.78) rotate(0deg);
  }

  20% {
    opacity: 0.76;
  }

  100% {
    opacity: 0;
    transform: scale(1.24) rotate(18deg);
  }
}

@keyframes pull-announcement-pop {
  0% {
    opacity: 0;
    transform: translateY(-14px) scale(0.92);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pull-badge-pulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 14px 28px var(--showcase-shadow, rgba(139, 95, 44, 0.16));
  }

  50% {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px var(--showcase-shadow, rgba(139, 95, 44, 0.22));
  }
}

@keyframes pull-badge-shine {
  0% {
    transform: translateX(-58%) rotate(12deg);
  }

  100% {
    transform: translateX(68%) rotate(12deg);
  }
}

@keyframes rare-card-float {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-6px);
  }
}

@keyframes rare-card-shine {
  0% {
    transform: translateX(-70%) rotate(14deg);
  }

  100% {
    transform: translateX(82%) rotate(14deg);
  }
}

@keyframes gacha-halo-float {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.78;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.card-library__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.card-filter {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(69, 50, 27, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font: inherit;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.card-filter:hover {
  transform: translateY(-2px);
}

.card-filter span {
  color: inherit;
  opacity: 0.76;
}

.card-filter--active {
  border-color: color-mix(in srgb, var(--tier-accent) 40%, rgba(69, 50, 27, 0.1));
  background: color-mix(in srgb, var(--tier-accent) 14%, rgba(255, 255, 255, 0.88));
  color: var(--text);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.card-library__grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-entry {
  appearance: none;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(56, 40, 22, 0.1);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 240, 231, 0.86));
  box-shadow: 0 14px 34px rgba(66, 45, 20, 0.07);
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card-entry:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tier-accent) 38%, rgba(55, 39, 22, 0.18));
  box-shadow: 0 18px 40px rgba(66, 45, 20, 0.12);
}

.card-entry__media {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 7.3;
  padding: 6px;
  border-radius: 16px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.95), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 234, 224, 0.9));
  border: 1px solid rgba(77, 57, 35, 0.08);
}

.card-entry__media img {
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(42, 24, 8, 0.14));
}

.card-entry__meta {
  display: grid;
  gap: 4px;
}

.card-entry__meta strong {
  font-size: 0.98rem;
  line-height: 1.1;
}

.card-entry__meta small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty-state {
  padding: 42px 28px;
  text-align: center;
  border: 1px dashed rgba(88, 63, 34, 0.18);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.62);
}

.empty-state h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.empty-state p {
  margin: 14px auto 0;
  max-width: 54ch;
  color: var(--muted);
  line-height: 1.7;
}

.site-footer {
  margin-top: 26px;
  padding: 10px 14px;
  border: 1px solid rgba(84, 63, 42, 0.06);
  border-radius: 16px;
  background: rgba(255, 251, 245, 0.42);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.site-footer__label {
  display: inline-block;
  margin-bottom: 4px;
  color: rgba(110, 95, 80, 0.78);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0;
  max-width: 78ch;
  color: rgba(110, 95, 80, 0.82);
  font-size: 0.82rem;
  line-height: 1.6;
}

.site-footer p + p {
  margin-top: 6px;
}

@media (max-width: 920px) {
  .masthead,
  .tier-section__heading,
  .box-detail__panel,
  .card-library__header,
  .pull-simulator__header {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .quick-nav {
    justify-content: flex-start;
  }

  .page-tabs {
    width: 100%;
    margin-inline: 0;
    justify-content: stretch;
  }

  .page-tab {
    flex: 1 1 0;
    min-width: 0;
  }

  .tier-section__count {
    width: fit-content;
  }

  .box-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .box-detail__media {
    width: min(100%, 360px);
    justify-self: center;
  }

  .gacha-box-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gacha-stage__hero {
    grid-template-columns: 1fr;
  }

  .card-library__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pull-simulator__bar {
    flex-direction: column;
    align-items: stretch;
  }

  .pull-simulator__actions {
    flex-direction: column;
  }

  .pull-simulator__reset,
  .pull-simulator__action {
    width: 100%;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 104px;
  }

  .site-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding-top: 14px;
    padding-bottom: 34px;
  }

  .masthead,
  .tier-section,
  .box-detail__panel,
  .gacha-browser__header,
  .gacha-tier-group,
  .gacha-stage,
  .pull-simulator {
    border-radius: 24px;
  }

  .box-grid {
    grid-template-columns: 1fr;
  }

  .gacha-box-grid {
    grid-template-columns: 1fr;
  }

  .card-library__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-tabs {
    padding: 6px;
  }

  .page-tab {
    padding: 11px 14px;
    font-size: 0.94rem;
  }

  .box-card {
    border-radius: 22px;
  }

  .gacha-stage__media {
    min-height: 300px;
    border-radius: 24px;
  }

  .image-modal__dialog {
    width: min(calc(100% - 16px), 980px);
    margin: 8px auto;
    padding: 12px;
    border-radius: 24px;
  }

  .image-modal__body {
    min-height: auto;
  }
}

@media (max-width: 420px) {
  .card-library__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pull-simulator::before,
  .pull-simulator::after,
  .pull-simulator__announcement,
  .box-detail__badge--showcase,
  .box-detail__badge--showcase::after,
  .simulator-result--showcase,
  .simulator-result--showcase .card-entry__media::after {
    animation: none !important;
  }
}
