:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07060a;
  --bg-2: #0e0c12;
  --surface: rgba(22, 18, 26, 0.72);
  --surface-solid: #16121a;
  --surface-2: rgba(34, 27, 38, 0.78);
  --surface-hi: rgba(52, 40, 56, 0.85);
  --field: rgba(10, 8, 13, 0.7);
  --glass-blur: 18px;
  --ink: #f5ede1;
  --ink-2: #cdbfae;
  --muted: #8f8374;
  --faint: #5c5349;
  --cran: #e5486b;
  --cran-2: #b8284c;
  --cran-deep: #6e1030;
  --gold: #d9b77a;
  --gold-2: #f1d9a6;
  --gold-deep: #8a6a33;
  --ok: #5fcf98;
  --warn: #f3b857;
  --danger: #ff5d73;
  --line: rgba(217, 183, 122, 0.16);
  --line-2: rgba(217, 183, 122, 0.32);
  --line-soft: rgba(255, 255, 255, 0.06);
  --glow-cran: 0 0 0 1px rgba(229, 72, 107, 0.45), 0 10px 40px rgba(229, 72, 107, 0.28);
  --glow-gold: 0 0 0 1px rgba(217, 183, 122, 0.5), 0 10px 40px rgba(217, 183, 122, 0.22);
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 24px 60px rgba(0, 0, 0, 0.55);
  --grad-cran: linear-gradient(135deg, #f0587a 0%, #c42a52 55%, #8e1b3a 100%);
  --grad-gold: linear-gradient(135deg, #f7e2b4 0%, #d9b77a 45%, #9c7438 100%);
  --grad-surface: linear-gradient(180deg, rgba(40, 31, 44, 0.66) 0%, rgba(18, 14, 21, 0.78) 100%);
  --page-bg:
    radial-gradient(1200px 700px at 12% -10%, rgba(142, 27, 58, 0.30), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(217, 183, 122, 0.10), transparent 60%),
    radial-gradient(1000px 800px at 50% 120%, rgba(110, 16, 48, 0.25), transparent 60%),
    linear-gradient(180deg, #0b090e 0%, #07060a 100%);
  --scroll: rgba(217, 183, 122, 0.28);
  --grain-opacity: 0.07;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4ede2;
  --bg-2: #ebe1d2;
  --surface: rgba(255, 251, 245, 0.78);
  --surface-solid: #fffbf5;
  --surface-2: rgba(248, 240, 228, 0.9);
  --surface-hi: rgba(255, 255, 255, 0.95);
  --field: rgba(255, 255, 255, 0.85);
  --ink: #1d1418;
  --ink-2: #4a3a3f;
  --muted: #7b6a62;
  --faint: #ad9d90;
  --cran: #b8284c;
  --cran-2: #8e1b3a;
  --cran-deep: #5b0f26;
  --gold: #9c7438;
  --gold-2: #7a5624;
  --gold-deep: #5d4118;
  --line: rgba(92, 60, 30, 0.14);
  --line-2: rgba(92, 60, 30, 0.28);
  --line-soft: rgba(92, 60, 30, 0.08);
  --glow-cran: 0 0 0 1px rgba(184, 40, 76, 0.35), 0 10px 30px rgba(184, 40, 76, 0.18);
  --glow-gold: 0 0 0 1px rgba(156, 116, 56, 0.4), 0 10px 30px rgba(156, 116, 56, 0.16);
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 6px 18px rgba(60, 36, 20, 0.08);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 20px 50px rgba(60, 36, 20, 0.14);
  --grad-surface: linear-gradient(180deg, rgba(255, 252, 247, 0.9) 0%, rgba(246, 237, 225, 0.9) 100%);
  --page-bg:
    radial-gradient(1200px 700px at 10% -10%, rgba(184, 40, 76, 0.10), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(217, 183, 122, 0.22), transparent 60%),
    linear-gradient(180deg, #f7f0e6 0%, #efe5d6 100%);
  --scroll: rgba(92, 60, 30, 0.25);
  --grain-opacity: 0.035;
}

:root {
  --display: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 140ms;
  --dur-2: 260ms;
  --dur-3: 520ms;
  --nav-h: 64px;
  --content: 1240px;
  --rar-common: #a7adb8;
  --rar-uncommon: #5fcf98;
  --rar-rare: #5b9dff;
  --rar-epic: #b26bff;
  --rar-legendary: #f3b857;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: #07060a; -webkit-text-size-adjust: 100%; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--page-bg);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::selection { background: rgba(229, 72, 107, 0.35); color: var(--ink); }

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0;
}
h1 { font-size: clamp(40px, 5.4vw, 76px); }
h2 { font-size: clamp(28px, 3vw, 40px); }
h3 { font-size: 22px; }
p { margin: 0; }
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.muted { color: var(--muted); }
.gold-text {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn {
  --btn-bg: var(--grad-cran);
  --btn-ink: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 24px rgba(196, 42, 82, 0.35);
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), filter var(--dur-2) var(--ease);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 12px 32px rgba(196, 42, 82, 0.45); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
.btn-gold { --btn-bg: var(--grad-gold); --btn-ink: #1b1206; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 8px 24px rgba(217, 183, 122, 0.28); }
.btn-ghost {
  --btn-bg: var(--surface-2);
  --btn-ink: var(--ink);
  box-shadow: 0 0 0 1px var(--line-2) inset;
  backdrop-filter: blur(var(--glass-blur));
}
.btn-ghost:hover { box-shadow: 0 0 0 1px var(--gold) inset; filter: none; }
.btn-quiet { --btn-bg: transparent; --btn-ink: var(--ink-2); box-shadow: none; }
.btn-quiet:hover { --btn-ink: var(--ink); box-shadow: none; background: var(--line-soft); }
.btn-danger { --btn-bg: transparent; --btn-ink: var(--danger); box-shadow: 0 0 0 1px rgba(255, 93, 115, 0.45) inset; }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 16px; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn-icon { width: 44px; padding: 0; }

.field, input[type="text"], input[type="password"], input[type="search"], input[type="number"], input:not([type]), select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--field);
  color: var(--ink);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(217, 183, 122, 0.12); }
select {
  appearance: none;
  color-scheme: dark;
  padding-right: 40px;
  background-color: var(--surface-solid);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23d9b77a' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
select option {
  background: #16121a;
  color: #f5ede1;
}
label { display: block; }
.label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }

input[type="checkbox"], input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  border: 1.5px solid var(--line-2);
  border-radius: 6px;
  background: var(--field);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::after {
  content: "";
  width: 10px;
  height: 6px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) scale(0);
  margin-top: -2px;
  transition: transform var(--dur-1) var(--ease-spring);
}
input[type="radio"]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform var(--dur-1) var(--ease-spring); }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--cran-2); border-color: var(--cran); }
input[type="checkbox"]:checked::after { transform: rotate(-45deg) scale(1); }
input[type="radio"]:checked::after { transform: scale(1); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-hi);
  box-shadow: 0 0 0 1px var(--line-2) inset;
  position: relative;
  flex: none;
  transition: background var(--dur-2) var(--ease);
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink-2);
  transition: transform var(--dur-2) var(--ease-spring), background var(--dur-2) var(--ease);
}
.switch input:checked + .track { background: var(--cran-2); }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }

.glass {
  background: var(--grad-surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
}
.panel { padding: var(--space-5); }
.hairline { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); border: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line) inset;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip-cran { color: #fff; background: rgba(229, 72, 107, 0.2); box-shadow: 0 0 0 1px rgba(229, 72, 107, 0.45) inset; }
.chip-gold { color: var(--gold-2); background: rgba(217, 183, 122, 0.12); box-shadow: 0 0 0 1px rgba(217, 183, 122, 0.4) inset; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px currentColor; }

[data-rarity="common"] { --rar: var(--rar-common); }
[data-rarity="uncommon"] { --rar: var(--rar-uncommon); }
[data-rarity="rare"] { --rar: var(--rar-rare); }
[data-rarity="epic"] { --rar: var(--rar-epic); }
[data-rarity="legendary"] { --rar: var(--rar-legendary); }
.rarity-text { color: var(--rar); }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-hi), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rise-in { animation: rise-in var(--dur-3) var(--ease) both; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1000;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: var(--r-md);
  background: var(--surface-solid);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2);
  color: var(--ink);
  font-weight: 600;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

[data-tip] { cursor: help; }
.tip-pop {
  position: fixed;
  z-index: 9000;
  max-width: min(260px, calc(100vw - 16px));
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-3);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}
.tip-pop.is-on { opacity: 1; transform: none; }
.tip-pop::after {
  content: "";
  position: absolute;
  left: var(--tip-arrow-x, 50%);
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: var(--surface-solid);
  border: 1px solid var(--line-2);
}
.tip-pop:not(.is-below)::after {
  bottom: -5px;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}
.tip-pop.is-below::after {
  top: -5px;
  border-bottom: 0;
  border-right: 0;
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
