:root {
  --bg: #060810;
  --bg-soft: #0a0d1a;
  --panel: rgba(14, 18, 34, 0.72);
  --panel-strong: rgba(17, 22, 42, 0.92);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f1e8;
  --muted: #9aa4bf;
  --muted-strong: #c5ccdc;
  --gold: #f4d58a;
  --gold-bright: #ffe9b0;
  --cyan: #74f6e5;
  --violet: #a98aff;
  --rose: #ff819c;
  --danger: #ff8b8b;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --font-sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.2, 0.9, 0.2, 1.15);
}

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

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(64, 74, 140, 0.22), transparent 60%),
    linear-gradient(180deg, #060810 0%, #080a14 42%, #05070e 100%);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

::selection {
  color: #071018;
  background: var(--cyan);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.5;
  will-change: transform;
}

.ambient-one {
  top: -18vw;
  left: -12vw;
  width: 48vw;
  height: 48vw;
  background: radial-gradient(circle, rgba(49, 105, 176, 0.34), transparent 68%);
  animation: ambientDriftOne 24s ease-in-out infinite alternate;
}

.ambient-two {
  top: 18vh;
  right: -18vw;
  width: 46vw;
  height: 46vw;
  background: radial-gradient(circle, rgba(116, 75, 172, 0.25), transparent 67%);
  animation: ambientDriftTwo 28s ease-in-out infinite alternate;
}

.ambient-three {
  bottom: -28vw;
  left: 28vw;
  width: 52vw;
  height: 52vw;
  background: radial-gradient(circle, rgba(50, 148, 137, 0.15), transparent 68%);
  animation: ambientDriftThree 34s ease-in-out infinite alternate;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0.18;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.app-shell {
  position: relative;
  z-index: 3;
  display: flex;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 64px);
  flex-direction: column;
}

/* Header */
.site-header {
  display: flex;
  min-height: 94px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  gap: 13px;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 47px;
  height: 47px;
  color: var(--gold);
  place-items: center;
  filter: drop-shadow(0 0 12px rgba(244, 213, 138, 0.24));
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.brand-text strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.view-tabs {
  display: flex;
  align-items: center;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 13, 25, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  gap: 3px;
}

.tab {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  gap: 8px;
  letter-spacing: 0.08em;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.tab svg {
  width: 16px;
  height: 16px;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.tab-count {
  display: inline-flex;
  min-width: 38px;
  height: 21px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid rgba(244, 213, 138, 0.22);
  border-radius: 999px;
  background: rgba(244, 213, 138, 0.08);
  color: var(--gold-bright);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-stat {
  display: flex;
  padding-right: 16px;
  border-right: 1px solid var(--line);
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.header-stat span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.header-stat strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.icon-button {
  display: grid;
  width: 41px;
  height: 41px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  cursor: pointer;
  place-items: center;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.icon-button:hover {
  border-color: rgba(116, 246, 229, 0.28);
  background: rgba(116, 246, 229, 0.07);
  color: var(--cyan);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button .sound-off {
  display: none;
}

.icon-button.is-muted .sound-off {
  display: block;
}

.icon-button.is-muted .sound-on {
  display: none;
}

/* Layout */
.main-content {
  padding: 28px 0 80px;
  flex: 1;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: viewIn 460ms var(--ease-out) both;
}

/* Hero */
.hero {
  position: relative;
  display: grid;
  min-height: 570px;
  align-items: center;
  padding: clamp(30px, 4.5vw, 66px) 0 clamp(26px, 3vw, 46px);
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  gap: clamp(30px, 4vw, 70px);
}

.hero::before {
  position: absolute;
  top: 0;
  left: 42%;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.08) 35%, rgba(255, 255, 255, 0.08) 65%, transparent);
  content: "";
  opacity: 0.7;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  margin-bottom: 28px;
  padding: 8px 13px;
  border: 1px solid rgba(116, 246, 229, 0.17);
  border-radius: 999px;
  background: rgba(116, 246, 229, 0.055);
  color: #b8fff2;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  gap: 9px;
}

.pulse-dot {
  position: relative;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.pulse-dot::after {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(116, 246, 229, 0.4);
  border-radius: 50%;
  content: "";
  animation: pulseRing 2.4s ease-out infinite;
}

.hero h1 {
  margin: 0;
  color: #fbf8ef;
  font-family: var(--font-display);
  font-size: clamp(54px, 7.2vw, 104px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.96;
  text-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.hero h1 em {
  display: inline-block;
  background: linear-gradient(112deg, #f7e8b7 5%, #8cf8e9 39%, #b397ff 72%, #f6c7d8 96%);
  background-clip: text;
  color: transparent;
  font-style: normal;
  -webkit-background-clip: text;
  filter: drop-shadow(0 8px 40px rgba(116, 246, 229, 0.14));
}

.hero-lead {
  max-width: 510px;
  margin: 25px 0 0;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.03em;
  line-height: 1.9;
}

.hero-metrics {
  display: flex;
  margin-top: 35px;
  gap: 0;
}

.metric {
  display: flex;
  min-width: 114px;
  padding: 0 26px;
  border-left: 1px solid var(--line);
  flex-direction: column;
  gap: 4px;
}

.metric:first-child {
  padding-left: 0;
  border-left: 0;
}

.metric strong {
  color: #f8f5ec;
  font-family: var(--font-display);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.metric .best-rarity {
  background: linear-gradient(120deg, #ffe4a6, #ff9ac4, #8ef7e7);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
}

.draw-actions {
  display: flex;
  margin-top: 38px;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 12px;
}

.summon-button {
  position: relative;
  display: inline-flex;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  overflow: hidden;
  gap: 14px;
  transition: transform 220ms var(--ease-spring), box-shadow 220ms ease, border-color 220ms ease;
  -webkit-tap-highlight-color: transparent;
}

.summon-button:hover {
  transform: translateY(-2px);
}

.summon-button:active {
  transform: translateY(0) scale(0.985);
}

.summon-button-primary {
  min-width: 232px;
  background: linear-gradient(135deg, #f6e3ad 0%, #d7b66c 47%, #f4d58a 100%);
  box-shadow: 0 16px 38px rgba(218, 180, 96, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  color: #1a160c;
}

.summon-button-primary:hover {
  box-shadow: 0 20px 50px rgba(218, 180, 96, 0.31), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.button-glow {
  position: absolute;
  top: -80%;
  left: -30%;
  width: 60%;
  height: 260%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  opacity: 0.4;
  transform: rotate(22deg);
  animation: buttonSweep 4.8s ease-in-out infinite;
}

.summon-icon {
  display: grid;
  width: 33px;
  height: 33px;
  border: 1px solid rgba(26, 22, 12, 0.22);
  border-radius: 50%;
  place-items: center;
}

.summon-icon svg {
  width: 17px;
  height: 17px;
}

.summon-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.summon-label small {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.22em;
  opacity: 0.56;
}

.summon-times {
  position: relative;
  z-index: 1;
  margin-left: 3px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  opacity: 0.62;
}

.summon-button-secondary {
  min-width: 176px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.summon-button-secondary:hover {
  border-color: rgba(244, 213, 138, 0.35);
  background: rgba(244, 213, 138, 0.065);
}

.summon-button-secondary .summon-label {
  font-size: 15px;
  letter-spacing: 0.1em;
}

.summon-button.compact {
  min-width: 150px;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 15px;
}

.hero-note {
  display: flex;
  margin: 19px 0 0;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.07em;
  gap: 7px;
}

.hero-note svg {
  width: 12px;
  height: 12px;
  color: var(--gold);
}

/* Hero visual */
.hero-visual {
  position: relative;
  display: flex;
  min-height: 530px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.orbit-system {
  position: relative;
  display: grid;
  width: min(100%, 480px);
  aspect-ratio: 1;
  place-items: center;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.orbit::before,
.orbit::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.orbit-outer {
  inset: 2%;
  border-color: rgba(244, 213, 138, 0.14);
  animation: spin 46s linear infinite;
}

.orbit-outer::before {
  top: 6%;
  left: 22%;
  width: 5px;
  height: 5px;
  background: var(--gold);
  box-shadow: 0 0 16px 4px rgba(244, 213, 138, 0.5);
}

.orbit-outer::after {
  right: 13%;
  bottom: 17%;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
}

.orbit-mid {
  inset: 13%;
  border-color: rgba(116, 246, 229, 0.12);
  border-style: dashed;
  animation: spinReverse 32s linear infinite;
}

.orbit-mid::before {
  top: 50%;
  left: -3px;
  width: 6px;
  height: 6px;
  background: var(--cyan);
  box-shadow: 0 0 20px 5px rgba(116, 246, 229, 0.35);
}

.orbit-inner {
  inset: 25%;
  border-color: rgba(169, 138, 255, 0.16);
  animation: spin 24s linear infinite;
}

.orbit-inner::after {
  top: 30%;
  right: 4%;
  width: 4px;
  height: 4px;
  background: var(--violet);
  box-shadow: 0 0 16px 4px rgba(169, 138, 255, 0.42);
}

.orbit-node {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: white;
  opacity: 0.7;
}

.node-one {
  top: 16%;
  right: 26%;
  box-shadow: 0 0 11px 2px rgba(255, 255, 255, 0.5);
}

.node-two {
  bottom: 19%;
  left: 17%;
}

.node-three {
  top: 48%;
  left: 4%;
  background: var(--rose);
  box-shadow: 0 0 12px 3px rgba(255, 129, 156, 0.5);
}

.orbit-label {
  position: absolute;
  z-index: 2;
  color: rgba(255, 255, 255, 0.32);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.28em;
  writing-mode: vertical-rl;
}

.label-top {
  top: 11%;
  right: 8%;
}

.label-bottom {
  bottom: 11%;
  left: 8%;
  transform: rotate(180deg);
}

.promo-card-wrap {
  position: relative;
  z-index: 3;
  width: clamp(190px, 19vw, 255px);
  perspective: 1100px;
  transform: translateY(-2px);
}

.promo-card {
  position: relative;
  transform: rotateX(var(--tilt-x, 4deg)) rotateY(var(--tilt-y, -12deg)) rotateZ(2deg);
  transform-style: preserve-3d;
  transition: transform 240ms ease-out;
  animation: promoFloat 7s ease-in-out infinite;
}

.promo-card::after {
  position: absolute;
  right: 4%;
  bottom: -8%;
  left: 4%;
  height: 16%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  content: "";
  filter: blur(20px);
  transform: translateZ(-40px);
}

.promo-card .card-surface {
  box-shadow:
    0 35px 80px rgba(0, 0, 0, 0.6),
    0 0 55px rgba(var(--rarity-rgb), 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.visual-caption {
  display: flex;
  margin-top: -6px;
  align-items: center;
  flex-direction: column;
  z-index: 3;
  gap: 7px;
}

.visual-caption span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.visual-caption strong {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.09em;
}

/* Section headings */
.shelf-section {
  margin-top: clamp(22px, 3vw, 48px);
}

.section-heading {
  display: flex;
  margin-bottom: 22px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.section-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.section-heading p {
  max-width: 370px;
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  text-align: right;
}

.text-button {
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 11px;
  gap: 7px;
  letter-spacing: 0.07em;
  transition: color 180ms ease;
}

.text-button svg {
  width: 14px;
  height: 14px;
  transition: transform 180ms ease;
}

.text-button:hover {
  color: var(--gold-bright);
}

.text-button:hover svg {
  transform: translateX(3px);
}

.danger-text:hover {
  color: var(--danger);
}

/* Sigils */
.sigil-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.sigil-card {
  position: relative;
  display: flex;
  min-height: 146px;
  align-items: center;
  padding: 22px 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 50% 12%, rgba(var(--family-rgb), 0.12), transparent 60%),
    rgba(255, 255, 255, 0.022);
  overflow: hidden;
  cursor: pointer;
  flex-direction: column;
  gap: 9px;
  transition: transform 240ms var(--ease-out), border-color 240ms ease, background 240ms ease;
}

.sigil-card::after {
  position: absolute;
  inset: auto 18% 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--family-rgb), 0.7), transparent);
  content: "";
  opacity: 0;
  transition: opacity 240ms ease;
}

.sigil-card:hover {
  border-color: rgba(var(--family-rgb), 0.34);
  background:
    radial-gradient(circle at 50% 12%, rgba(var(--family-rgb), 0.2), transparent 64%),
    rgba(255, 255, 255, 0.038);
  transform: translateY(-4px);
}

.sigil-card:hover::after {
  opacity: 1;
}

.sigil-icon {
  display: grid;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(var(--family-rgb), 0.25);
  border-radius: 50%;
  background: rgba(var(--family-rgb), 0.08);
  color: rgb(var(--family-rgb));
  place-items: center;
  transition: transform 300ms var(--ease-spring);
}

.sigil-card:hover .sigil-icon {
  transform: rotate(8deg) scale(1.06);
}

.sigil-icon svg {
  width: 30px;
  height: 30px;
}

.sigil-name {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.sigil-progress {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}

.sigil-progress strong {
  color: rgba(var(--family-rgb), 0.95);
  font-weight: 500;
}

/* Recent */
.recent-rail {
  display: grid;
  min-height: 176px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.025), transparent 50%),
    rgba(8, 11, 22, 0.42);
  grid-auto-flow: column;
  grid-auto-columns: minmax(96px, 1fr);
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.recent-item {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  gap: 7px;
}

.recent-item .card-surface {
  width: 100%;
  transition: transform 220ms var(--ease-out), filter 220ms ease;
}

.recent-item:hover .card-surface {
  transform: translateY(-4px);
  filter: brightness(1.08);
}

.recent-name {
  width: 100%;
  color: var(--muted-strong);
  font-size: 9px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-empty {
  display: flex;
  grid-column: 1 / -1;
  min-height: 140px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-direction: column;
  gap: 9px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-align: center;
}

.recent-empty svg {
  width: 34px;
  height: 34px;
  color: rgba(244, 213, 138, 0.4);
}

.recent-empty strong {
  color: var(--muted-strong);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
}

.new-badge {
  position: absolute;
  top: -7px;
  right: -5px;
  z-index: 4;
  display: inline-flex;
  height: 19px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(116, 246, 229, 0.4);
  border-radius: 999px;
  background: #0d2c2c;
  color: var(--cyan);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.16em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Cards */
.card-visual {
  --rarity: #9ca8bd;
  --rarity-rgb: 156, 168, 189;
  position: relative;
  width: 100%;
  aspect-ratio: 0.696;
  border-radius: 12px;
  perspective: 900px;
  isolation: isolate;
}

.card-surface {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(var(--rarity-rgb), 0.55);
  border-radius: inherit;
  background:
    radial-gradient(circle at 55% 26%, rgba(var(--rarity-rgb), 0.16), transparent 58%),
    linear-gradient(155deg, #151c31 0%, #0b0e1b 46%, #060811 100%);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 35px rgba(var(--rarity-rgb), 0.09);
  overflow: hidden;
}

.card-surface::before {
  position: absolute;
  inset: 5px;
  z-index: 6;
  border: 1px solid rgba(var(--rarity-rgb), 0.32);
  border-radius: calc(12px - 3px);
  content: "";
  pointer-events: none;
}

.card-surface::after {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(112deg, transparent 18%, rgba(255, 255, 255, 0.12) 38%, transparent 54%);
  content: "";
  opacity: 0.45;
  pointer-events: none;
  transform: translateX(-105%);
  transition: transform 700ms var(--ease-out);
}

.recent-item:hover .card-surface::after,
.collection-item:hover .card-surface::after {
  transform: translateX(105%);
}

.card-art {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.card-topline {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.58);
  font-size: 6px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
}

.rarity-chip {
  display: inline-flex;
  min-width: 24px;
  height: 15px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 1px solid rgba(var(--rarity-rgb), 0.5);
  border-radius: 999px;
  background: rgba(7, 10, 20, 0.58);
  color: rgb(var(--rarity-rgb));
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.08em;
  backdrop-filter: blur(4px);
}

.card-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  padding: 42px 13px 14px;
  background: linear-gradient(180deg, transparent 0%, rgba(4, 6, 13, 0.72) 32%, rgba(4, 6, 13, 0.96) 100%);
  flex-direction: column;
  text-align: center;
  pointer-events: none;
}

.card-family {
  margin-bottom: 4px;
  color: rgba(var(--rarity-rgb), 0.95);
  font-size: 5px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.card-caption h3 {
  max-width: 100%;
  margin: 0;
  color: #fffaf0;
  font-family: var(--font-display);
  font-size: clamp(11px, 1.15vw, 16px);
  font-weight: 500;
  letter-spacing: 0.045em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.card-stars {
  display: flex;
  margin-top: 6px;
  align-items: center;
  gap: 2px;
}

.mini-star {
  display: block;
  width: 5px;
  height: 5px;
  background: rgb(var(--rarity-rgb));
  clip-path: polygon(50% 0%, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0% 38%, 38% 36%);
  filter: drop-shadow(0 0 3px rgba(var(--rarity-rgb), 0.7));
}

.card-index {
  position: absolute;
  top: 50%;
  left: 9px;
  z-index: 4;
  color: rgba(255, 255, 255, 0.22);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: 0.12em;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: left top;
}

.card-foil {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    conic-gradient(from calc(var(--foil-angle, 0deg) + 20deg), transparent, rgba(255, 120, 180, 0.1), transparent, rgba(116, 246, 229, 0.11), transparent, rgba(255, 220, 130, 0.1), transparent);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}

.rarity-4 .card-foil,
.rarity-5 .card-foil,
.rarity-6 .card-foil,
.rarity-7 .card-foil {
  opacity: 0.8;
  animation: foilShift 7s linear infinite;
}

.rarity-6 .card-surface,
.rarity-7 .card-surface {
  border-color: rgba(255, 241, 190, 0.68);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.44),
    0 0 30px rgba(var(--rarity-rgb), 0.17),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 0 38px rgba(var(--rarity-rgb), 0.13);
}

.rarity-7 .card-surface {
  border-color: rgba(255, 232, 175, 0.78);
  background:
    radial-gradient(circle at 55% 26%, rgba(255, 230, 163, 0.19), transparent 58%),
    linear-gradient(155deg, #1b2035 0%, #0c1020 46%, #060811 100%);
}

.rarity-7 .card-surface::before {
  border-color: rgba(255, 232, 175, 0.48);
}

.rarity-0 {
  --rarity: #9ca8bd;
  --rarity-rgb: 156, 168, 189;
}

.rarity-1 {
  --rarity: #66d8b8;
  --rarity-rgb: 102, 216, 184;
}

.rarity-2 {
  --rarity: #64b5ff;
  --rarity-rgb: 100, 181, 255;
}

.rarity-3 {
  --rarity: #ad8cff;
  --rarity-rgb: 173, 140, 255;
}

.rarity-4 {
  --rarity: #ffb45b;
  --rarity-rgb: 255, 180, 91;
}

.rarity-5 {
  --rarity: #ff7e9d;
  --rarity-rgb: 255, 126, 157;
}

.rarity-6 {
  --rarity: #83f7e8;
  --rarity-rgb: 131, 247, 232;
}

.rarity-7 {
  --rarity: #ffe6a3;
  --rarity-rgb: 255, 230, 163;
}

/* Card backs */
.card-back {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(244, 213, 138, 0.32);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 45%, rgba(116, 246, 229, 0.11), transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(75, 66, 135, 0.22), transparent 65%),
    linear-gradient(150deg, #14182b, #080b17 55%, #0d1121);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.card-back::before {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(244, 213, 138, 0.18);
  border-radius: 8px;
  content: "";
}

.card-back::after {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(116, 246, 229, 0.08);
  border-radius: 7px;
  content: "";
  background:
    radial-gradient(circle at 50% 50%, transparent 30%, rgba(255, 255, 255, 0.06) 30.5%, transparent 31%),
    radial-gradient(circle at 50% 50%, transparent 43%, rgba(255, 255, 255, 0.035) 43.5%, transparent 44%);
}

.card-back-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
}

.back-emblem {
  width: 42%;
  max-width: 84px;
  color: rgba(244, 213, 138, 0.76);
  filter: drop-shadow(0 0 12px rgba(244, 213, 138, 0.18));
  animation: backGlow 4s ease-in-out infinite;
}

.back-emblem svg {
  display: block;
  width: 100%;
}

.back-title {
  color: rgba(244, 213, 138, 0.38);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
}

.card-back-lines {
  position: absolute;
  inset: 22%;
  border: 1px dashed rgba(116, 246, 229, 0.12);
  border-radius: 50%;
  animation: spin 26s linear infinite;
}

/* Collection */
.collection-view {
  animation: viewIn 460ms var(--ease-out) both;
}

.collection-hero {
  display: grid;
  align-items: center;
  padding: clamp(20px, 3vw, 40px) 0 44px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
}

.collection-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(43px, 5.5vw, 72px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

.collection-heading p {
  max-width: 560px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.collection-progress-card {
  display: flex;
  min-width: 380px;
  align-items: center;
  padding: 20px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 18% 50%, rgba(244, 213, 138, 0.09), transparent 44%),
    rgba(255, 255, 255, 0.025);
  gap: 24px;
}

.progress-ring {
  --progress: 0;
  position: relative;
  display: grid;
  width: 98px;
  height: 98px;
  flex: 0 0 98px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--progress) * 1%), rgba(255, 255, 255, 0.08) 0);
  place-items: center;
  transition: background 500ms ease;
}

.progress-ring::before {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #0a0d19;
  content: "";
}

.progress-ring-inner {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 2px;
}

.progress-ring-inner strong {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.progress-ring-inner span {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.collection-stats {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.collection-stats div {
  display: flex;
  min-width: 160px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.collection-stats span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.collection-stats strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.collection-toolbar {
  position: sticky;
  top: 10px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(8, 11, 22, 0.82);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(22px);
  gap: 18px;
}

.family-filters {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.family-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.04em;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
  white-space: nowrap;
}

.filter-chip:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.filter-chip.is-active {
  border-color: rgba(var(--family-rgb, 244, 213, 138), 0.22);
  background: rgba(var(--family-rgb, 244, 213, 138), 0.09);
  color: rgb(var(--family-rgb, 244, 213, 138));
}

.rarity-filter-wrap {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.rarity-filter-wrap label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.select-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.select-shell select {
  height: 36px;
  padding: 0 33px 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  appearance: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.select-shell svg {
  position: absolute;
  right: 12px;
  width: 11px;
  height: 11px;
  color: var(--muted);
  pointer-events: none;
}

.select-shell option {
  background: #0d1120;
  color: var(--text);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(13px, 1.8vw, 24px);
}

.collection-item {
  display: flex;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.collection-card-visual {
  position: relative;
  width: 100%;
}

.collection-item .card-surface {
  transition: transform 250ms var(--ease-out), filter 250ms ease, box-shadow 250ms ease;
}

.collection-item:hover .card-surface {
  transform: translateY(-6px) rotateX(2deg);
  filter: brightness(1.08);
  box-shadow:
    0 26px 50px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(var(--rarity-rgb), 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.collection-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px;
  gap: 8px;
}

.collection-item-footer strong {
  max-width: 76%;
  color: var(--muted-strong);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-item-footer span {
  color: var(--muted);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.owned-count {
  position: absolute;
  top: 9px;
  left: 10px;
  z-index: 7;
  display: inline-flex;
  height: 18px;
  align-items: center;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 6px;
  background: rgba(5, 8, 16, 0.64);
  color: rgba(255, 255, 255, 0.75);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.04em;
  backdrop-filter: blur(5px);
}

.collection-item.is-locked {
  cursor: pointer;
}

.locked-card {
  position: relative;
  width: 100%;
  aspect-ratio: 0.696;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.035), transparent 38%),
    linear-gradient(155deg, rgba(20, 25, 42, 0.55), rgba(7, 9, 18, 0.72));
  overflow: hidden;
}

.locked-card::before {
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  content: "";
}

.locked-card::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.025) 48%, transparent 64%);
  content: "";
  transform: translateX(-100%);
  transition: transform 700ms var(--ease-out);
}

.collection-item:hover .locked-card::after {
  transform: translateX(100%);
}

.locked-emblem {
  position: absolute;
  top: 43%;
  left: 50%;
  width: 34%;
  max-width: 72px;
  color: rgba(255, 255, 255, 0.09);
  transform: translate(-50%, -50%);
}

.locked-emblem svg {
  display: block;
  width: 100%;
}

.locked-label {
  position: absolute;
  right: 0;
  bottom: 16%;
  left: 0;
  color: rgba(255, 255, 255, 0.2);
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.24em;
  text-align: center;
}

.locked-number {
  position: absolute;
  top: 13px;
  left: 13px;
  color: rgba(255, 255, 255, 0.15);
  font-size: 6px;
  letter-spacing: 0.14em;
}

.collection-item.is-locked .collection-item-footer strong {
  color: rgba(255, 255, 255, 0.25);
}

.collection-empty {
  display: flex;
  min-height: 380px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.collection-empty[hidden] {
  display: none;
}

.empty-sigil {
  width: 88px;
  color: var(--gold);
  opacity: 0.55;
}

.empty-sigil svg {
  width: 100%;
}

.collection-empty h3 {
  margin: 20px 0 4px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
}

.collection-empty p {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 11px;
}

.collection-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  gap: 20px;
}

.collection-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.site-footer {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.28);
  font-size: 8px;
  letter-spacing: 0.16em;
  gap: 16px;
}

/* Summon overlay */
.summon-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  visibility: hidden;
  align-items: stretch;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease, visibility 280ms ease;
}

.summon-overlay.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.overlay-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(33, 45, 85, 0.38), transparent 64%),
    rgba(3, 5, 11, 0.94);
  backdrop-filter: blur(12px);
}

.overlay-aurora {
  position: absolute;
  top: 4%;
  left: 50%;
  width: min(85vw, 1100px);
  height: 48vh;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(116, 246, 229, 0.13), transparent 52%),
    radial-gradient(ellipse at 70% 50%, rgba(169, 138, 255, 0.13), transparent 52%),
    radial-gradient(ellipse at 50% 70%, rgba(244, 213, 138, 0.1), transparent 54%);
  filter: blur(70px);
  opacity: 0.8;
  transform: translateX(-50%);
  animation: auroraBreathe 6s ease-in-out infinite alternate;
}

.overlay-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent 80%);
}

.summon-shell {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(1180px, 100%);
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px clamp(18px, 3vw, 48px) 24px;
  flex-direction: column;
  overflow: hidden;
}

.summon-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.summon-title-wrap h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 47px);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.summon-header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.summon-status {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  gap: 8px;
}

.summon-status::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  content: "";
  animation: statusBlink 1.4s ease-in-out infinite;
}

.skip-button {
  min-height: 35px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.08em;
  transition: border-color 180ms ease, color 180ms ease;
}

.skip-button:hover {
  border-color: rgba(244, 213, 138, 0.3);
  color: var(--gold-bright);
}

.reveal-stage {
  display: grid;
  flex: 1;
  min-height: 0;
  width: 100%;
  align-content: center;
  justify-content: center;
  padding: 26px 0;
  grid-template-columns: repeat(5, minmax(0, 146px));
  gap: clamp(10px, 1.4vw, 20px);
}

.reveal-stage.is-single {
  grid-template-columns: minmax(0, 268px);
}

.flip-card {
  position: relative;
  width: 100%;
  aspect-ratio: 0.696;
  opacity: 0;
  perspective: 1100px;
  transform: translateY(32px) scale(0.82);
  transition: opacity 450ms var(--ease-out), transform 600ms var(--ease-spring);
}

.flip-card.is-dealt {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.flip-card.is-single {
  transform: translateY(42px) scale(0.74);
}

.flip-card.is-single.is-dealt {
  transform: translateY(0) scale(1);
}

.flip-card::after {
  position: absolute;
  inset: -14%;
  z-index: -1;
  border-radius: 40%;
  background: radial-gradient(circle, rgba(var(--rarity-rgb), 0.36), transparent 66%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms ease;
}

.flip-card.is-revealed[data-rarity="4"]::after,
.flip-card.is-revealed[data-rarity="5"]::after,
.flip-card.is-revealed[data-rarity="6"]::after,
.flip-card.is-revealed[data-rarity="7"]::after {
  opacity: 0.8;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform var(--flip-duration, 1000ms) cubic-bezier(0.3, 0.05, 0.15, 1);
  transform-style: preserve-3d;
}

.flip-card.is-flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-front {
  transform: rotateY(180deg);
}

.flip-front .card-surface {
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(var(--rarity-rgb), 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.flip-card.is-revealed .flip-front .card-surface {
  animation: revealedPulse 1s var(--ease-out);
}

.flip-card[data-rarity="6"].is-revealed::before,
.flip-card[data-rarity="7"].is-revealed::before {
  position: absolute;
  inset: -35%;
  z-index: -2;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 232, 160, 0.34), transparent 30%, rgba(126, 248, 230, 0.28), transparent 58%, rgba(255, 152, 195, 0.28), transparent 82%);
  content: "";
  animation: spin 8s linear infinite;
  filter: blur(16px);
}

.summon-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 90px;
  gap: 26px;
}

.summon-summary p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.summon-summary .summary-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.summon-summary strong {
  color: var(--gold-bright);
  font-weight: 500;
}

.summon-actions {
  display: flex;
  opacity: 0;
  pointer-events: none;
  gap: 10px;
  transform: translateY(8px);
  transition: opacity 320ms ease, transform 320ms var(--ease-out);
}

.summon-actions.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.flip-card.is-new .flip-front .card-surface::before {
  border-color: rgba(116, 246, 229, 0.6);
  box-shadow: inset 0 0 16px rgba(116, 246, 229, 0.14);
}

.flip-new-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 9;
  color: var(--cyan);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-shadow: 0 0 8px rgba(116, 246, 229, 0.7);
}

.screen-flash {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: radial-gradient(circle at 50% 50%, rgba(255, 249, 218, 0.9), rgba(255, 255, 255, 0.12) 28%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  animation: screenFlash 900ms ease-out both;
}

.spark {
  position: fixed;
  z-index: 110;
  width: var(--spark-size, 4px);
  height: var(--spark-size, 4px);
  border-radius: 50%;
  background: var(--spark-color, #ffe6a3);
  pointer-events: none;
  box-shadow: 0 0 8px 1px currentColor;
  animation: sparkFly var(--spark-duration, 900ms) ease-out forwards;
}

/* Detail modal */
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  visibility: hidden;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.detail-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.detail-veil {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 11, 0.86);
  backdrop-filter: blur(16px);
}

.detail-panel {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(820px, 100%);
  max-height: calc(100vh - 48px);
  align-items: center;
  padding: clamp(22px, 3.5vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse at 0% 0%, rgba(116, 246, 229, 0.06), transparent 45%),
    radial-gradient(ellipse at 100% 100%, rgba(169, 138, 255, 0.08), transparent 48%),
    #0a0d19;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.65);
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  overflow-y: auto;
  transform: translateY(14px) scale(0.98);
  transition: transform 300ms var(--ease-out);
}

.detail-modal.is-open .detail-panel {
  transform: translateY(0) scale(1);
}

.detail-card-wrap {
  width: 100%;
}

.detail-card-wrap .card-surface {
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.62),
    0 0 50px rgba(var(--rarity-rgb), 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.detail-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(31px, 4vw, 45px);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.12;
}

.detail-rarity {
  display: flex;
  margin-top: 14px;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.detail-rarity .rarity-chip {
  height: 24px;
  padding: 0 10px;
  font-size: 9px;
}

.rarity-label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.detail-stars {
  display: flex;
  align-items: center;
  gap: 3px;
}

.detail-stars .mini-star {
  width: 8px;
  height: 8px;
}

.detail-copy > p {
  margin: 22px 0 0;
  color: var(--muted-strong);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.9;
}

.detail-meta {
  display: grid;
  margin: 25px 0 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.detail-meta div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-meta dt {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.detail-meta dd {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.detail-draw {
  margin-top: 24px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  cursor: pointer;
  place-items: center;
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.modal-close:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
  transform: rotate(90deg);
}

.modal-close svg {
  width: 15px;
  height: 15px;
}

/* Toasts */
.toast-region {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 200;
  display: flex;
  align-items: center;
  pointer-events: none;
  flex-direction: column;
  gap: 8px;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 0 18px;
  border: 1px solid rgba(244, 213, 138, 0.24);
  border-radius: 12px;
  background: rgba(12, 16, 29, 0.94);
  color: var(--text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  font-size: 11px;
  gap: 9px;
  letter-spacing: 0.04em;
  animation: toastIn 300ms var(--ease-out) both;
  backdrop-filter: blur(10px);
}

.toast::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 9px rgba(244, 213, 138, 0.8);
  content: "";
}

.toast.is-leaving {
  animation: toastOut 240ms ease both;
}

/* Animations */
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ambientDriftOne {
  to { transform: translate3d(7vw, 5vh, 0) scale(1.08); }
}

@keyframes ambientDriftTwo {
  to { transform: translate3d(-7vw, 7vh, 0) scale(0.94); }
}

@keyframes ambientDriftThree {
  to { transform: translate3d(3vw, -6vh, 0) scale(1.05); }
}

@keyframes pulseRing {
  0% { opacity: 0.9; transform: scale(0.5); }
  70%, 100% { opacity: 0; transform: scale(1.6); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  to { transform: rotate(-360deg); }
}

@keyframes promoFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

@keyframes buttonSweep {
  0%, 55% { left: -40%; }
  75%, 100% { left: 120%; }
}

@keyframes backGlow {
  0%, 100% { opacity: 0.62; }
  50% { opacity: 0.95; }
}

@keyframes foilShift {
  to { --foil-angle: 360deg; }
}

@keyframes screenShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  18% { transform: translate3d(-5px, 2px, 0); }
  36% { transform: translate3d(4px, -2px, 0); }
  54% { transform: translate3d(-3px, 1px, 0); }
  72% { transform: translate3d(2px, -1px, 0); }
}

.summon-overlay.is-shaking .summon-shell {
  animation: screenShake 460ms ease-in-out;
}

@keyframes auroraBreathe {
  to { opacity: 1; transform: translateX(-50%) scale(1.04); }
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes revealedPulse {
  0% { filter: brightness(1); }
  22% { filter: brightness(1.65); }
  100% { filter: brightness(1); }
}

@keyframes screenFlash {
  0% { opacity: 0; }
  13% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes sparkFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--spark-x), var(--spark-y)) scale(0);
  }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

/* Responsive */
@media (max-width: 1180px) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.9fr);
  }

  .hero::before {
    left: 46%;
  }

  .hero-visual {
    min-height: 460px;
  }

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

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

@media (max-width: 980px) {
  .site-header {
    flex-wrap: wrap;
    padding: 14px 0;
    gap: 14px 18px;
  }

  .brand {
    margin-right: auto;
  }

  .view-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .tab {
    flex: 1;
    justify-content: center;
  }

  .hero {
    min-height: 0;
    padding-top: 42px;
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .hero::before {
    display: none;
  }

  .hero-copy {
    max-width: 680px;
  }

  .hero-visual {
    min-height: 430px;
  }

  .orbit-system {
    width: min(100%, 410px);
  }

  .collection-hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .collection-progress-card {
    width: 100%;
    min-width: 0;
  }

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

  .detail-panel {
    grid-template-columns: minmax(170px, 230px) minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 0 17px;
  }

  .site-header {
    min-height: 0;
  }

  .brand-mark {
    width: 41px;
    height: 41px;
  }

  .brand-text strong {
    font-size: 18px;
  }

  .header-stat {
    display: none;
  }

  .hero {
    padding-top: 35px;
  }

  .eyebrow-pill {
    margin-bottom: 22px;
    font-size: 8px;
  }

  .hero h1 {
    font-size: clamp(48px, 14vw, 76px);
  }

  .hero-lead {
    font-size: 12px;
  }

  .hero-metrics {
    margin-top: 28px;
  }

  .metric {
    min-width: 0;
    padding: 0 16px;
    flex: 1;
  }

  .metric strong {
    font-size: 23px;
  }

  .metric span {
    font-size: 8px;
  }

  .draw-actions {
    margin-top: 28px;
  }

  .summon-button {
    min-height: 62px;
    padding: 0 18px;
    border-radius: 15px;
  }

  .summon-button-primary {
    min-width: 0;
    flex: 1;
  }

  .summon-button-secondary {
    min-width: 132px;
  }

  .summon-label {
    font-size: 15px;
  }

  .summon-button-secondary .summon-label {
    font-size: 13px;
  }

  .hero-note {
    font-size: 9px;
  }

  .hero-visual {
    min-height: 390px;
  }

  .orbit-system {
    width: min(100%, 340px);
  }

  .promo-card-wrap {
    width: 180px;
  }

  .visual-caption strong {
    font-size: 16px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .section-heading p {
    text-align: left;
  }

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

  .sigil-card {
    min-height: 126px;
  }

  .recent-rail {
    grid-auto-columns: 96px;
  }

  .collection-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .family-filters {
    padding-bottom: 2px;
  }

  .rarity-filter-wrap {
    padding: 0 4px 4px;
    justify-content: space-between;
  }

  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .collection-item-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .collection-item-footer strong {
    max-width: 100%;
    font-size: 10px;
  }

  .collection-progress-card {
    padding: 18px;
    gap: 18px;
  }

  .progress-ring {
    width: 82px;
    height: 82px;
    flex-basis: 82px;
  }

  .progress-ring-inner strong {
    font-size: 20px;
  }

  .collection-stats {
    flex: 1;
  }

  .collection-stats div {
    min-width: 0;
  }

  .collection-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    align-items: flex-start;
    padding: 18px 0;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
  }

  .summon-shell {
    padding: 18px 12px 16px;
  }

  .summon-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .summon-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .summon-title-wrap h2 {
    font-size: 30px;
  }

  .reveal-stage {
    align-content: start;
    padding: 22px 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    overflow-y: auto;
  }

  .reveal-stage.is-single {
    align-content: center;
    grid-template-columns: minmax(0, 220px);
  }

  .summon-footer {
    align-items: stretch;
    min-height: 0;
    flex-direction: column;
    gap: 12px;
  }

  .summon-summary {
    display: none;
  }

  .summon-actions {
    width: 100%;
  }

  .summon-actions .summon-button {
    flex: 1;
  }

  .detail-modal {
    padding: 12px;
  }

  .detail-panel {
    max-height: calc(100vh - 24px);
    padding: 44px 20px 26px;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .detail-card-wrap {
    width: min(230px, 72vw);
    margin: 0 auto;
  }

  .detail-copy h2 {
    text-align: center;
  }

  .detail-rarity {
    justify-content: center;
  }

  .detail-copy > p {
    text-align: center;
  }

  .detail-draw {
    width: 100%;
  }

  .modal-close {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 420px) {
  .view-tabs {
    padding: 4px;
  }

  .tab {
    padding: 0 10px;
    font-size: 11px;
  }

  .tab-count {
    min-width: 34px;
    font-size: 9px;
  }

  .hero-metrics {
    gap: 0;
  }

  .metric {
    padding: 0 11px;
  }

  .draw-actions {
    flex-direction: column;
  }

  .summon-button-secondary {
    width: 100%;
  }

  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }

}

@media (max-width: 350px) {
  .reveal-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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