@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --panel: #11141b;
  --line: #2b303c;
  --text: #f1f2f5;
  --muted: #a9aebb;
  --fire: #ff5249;
  --display: "Chakra Petch", "Arial Narrow", sans-serif;
  --mono: "JetBrains Mono", monospace;
  --card-ratio: 5 / 7;
}
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px Inter, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--fire); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #ff8e86; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { width: min(1192px, calc(100% - 64px)); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); background: #0e1016; }
.topbar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; font: 700 20px var(--display); text-transform: uppercase; }
.brand-icon, .demon-icon { display: block; background: currentColor; clip-path: polygon(0 0, 29% 24%, 71% 24%, 100% 0, 94% 60%, 73% 80%, 68% 100%, 32% 100%, 27% 80%, 6% 60%); }
.brand-icon { width: 23px; height: 19px; color: var(--fire); }
.topbar nav { display: flex; gap: 24px; color: var(--muted); font-size: 14px; }
.source { color: var(--muted); font: 600 12px var(--mono); white-space: nowrap; }
main { padding-top: 30px; }
.opener { min-height: 405px; display: grid; grid-template-columns: minmax(262px, .75fr) minmax(0, 1.65fr); border: 1px solid var(--line); }
.console { display: flex; min-width: 0; flex-direction: column; justify-content: center; background: var(--panel); padding: 28px clamp(19px, 3vw, 39px); border-right: 1px solid var(--line); }
.eyebrow { margin: 0; color: #ff8e83; font: 600 12px var(--mono); letter-spacing: .075em; }
.pulse { display: inline-block; vertical-align: 2px; margin-right: 5px; width: 6px; height: 6px; background: var(--fire); }
h1 { margin: 11px 0 12px; font: 700 clamp(46px, 5.65vw, 82px)/.88 var(--display); letter-spacing: -.055em; text-transform: uppercase; }
.rules { max-width: 290px; color: var(--muted); margin: 0; line-height: 1.55; font-size: 14px; }
.stock { margin-top: 29px; padding-top: 12px; border-top: 1px solid var(--line); }
.stock h2 { margin: 0 0 5px; color: var(--muted); font: 600 11px var(--mono); letter-spacing: .07em; }
#pack-storage-status { display: block; color: var(--text); font: 700 16px var(--mono); white-space: nowrap; }
#slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 8px 0; }
#slots i { height: 8px; background: #272b35; border: 1px solid #3c4353; }
#slots .filled { border-color: #fa7b70; background: repeating-linear-gradient(130deg, #f65248 0 5px, #d13a36 5px 7px); }
#timer { min-height: 15px; margin: 0; color: var(--muted); font: 500 12px var(--mono); }

.stage { min-width: 0; display: grid; grid-template-rows: minmax(295px, 1fr) minmax(58px, auto); padding: 14px 14px 10px; background: radial-gradient(ellipse at 50% 43%, #34191d, #141319 56%, #0e1117 86%); }
.stage-play { display: grid; place-items: center; position: relative; perspective: 800px; isolation: isolate; min-width: 0; }
.stage-play::before { content: ""; z-index: -1; position: absolute; inset: 0; background: linear-gradient(#bc747b20 1px, transparent 1px), linear-gradient(90deg, #bc747b20 1px, transparent 1px); background-size: 26px 26px; mask-image: radial-gradient(ellipse, black, transparent 73%); }
.stage:not([data-state="dealt"]) #reveal-all,
.stage:not([data-state="complete"]) #finish { display: none; }
.stage-controls { min-height: 52px; text-align: center; }
.stage-controls p { min-height: 19px; margin: 2px 0 6px; color: var(--muted); font: 500 12px var(--mono); }
.primary, .retry { min-height: 38px; padding: 7px 15px; background: var(--fire); color: #170706; border: 1px solid #ff8277; font: 700 14px var(--display); }
.primary:hover, .retry:hover { background: #ff7b71; }
#status { margin-top: 9px; color: #ffaaa2; font-size: 13px; }
.retry { display: block; margin-top: 8px; }

.pack-object { position: relative; display: grid; justify-items: center; gap: 12px; --rx: 0deg; --ry: 0deg; --light-x: 40%; --light-y: 28%; background: none; border: 0; padding: 6px; color: #fff0e8; touch-action: manipulation; }
.foil { position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; width: 179px; aspect-ratio: 5 / 7.6; overflow: hidden; transform: perspective(660px) rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(-8deg); transition: transform .18s ease, filter .18s ease; filter: drop-shadow(0 14px 11px #000b); background: radial-gradient(ellipse at var(--light-x) var(--light-y), #ffa48788, transparent 57%), repeating-linear-gradient(120deg, #19060700 0 17px, #ffc5b82b 18px, #1a090922 20px 24px), linear-gradient(117deg, #300b10 1%, #b71d28 19%, #ed5147 36%, #85141c 49%, #3b0a12 66%, #bd2f32 85%, #cf503e 92%, #290910); }
.foil::before { content: ""; position: absolute; inset: 13px 7px; border: 1px solid #ffafa780; pointer-events: none; }
.pack-object:hover:enabled .foil, .pack-object:focus-visible .foil { filter: drop-shadow(0 14px 16px #f837373f); }
.pack-object:active:enabled .foil { transform: scale(.96) rotateZ(-5deg); }
.pack-object:disabled:not(.opening) .foil { filter: grayscale(.85) brightness(.65); }
.seam { height: 10px; flex: none; background: repeating-linear-gradient(90deg, #fff4e78c 0 1px, #3c202a55 1px 3px), linear-gradient(#59363d, #e0b0a5 50%, #63383e); }
.foil-label { display: flex; justify-content: space-between; gap: 5px; margin: 0 13px; padding-bottom: 4px; border-bottom: 1px solid #ffb09c80; font: 700 8px var(--mono); text-shadow: 0 1px #23080c; }
.foil-bottom { padding-top: 4px; padding-bottom: 0; border-top: 1px solid #ffb09c80; border-bottom: 0; }
.foil-emblem { width: 84px; height: 74px; margin-inline: auto; display: grid; place-items: center; border: 1px solid #ffb2a778; transform: rotate(-8deg); background: #260a12b7; box-shadow: 4px 4px 0 #f35e5263; }
.demon-icon { width: 66px; height: 51px; color: #ff8d70; }
.demon-icon::after { content: ""; display: block; width: 100%; height: 100%; background: #1b0b10; clip-path: polygon(14% 38%, 42% 52%, 36% 61%, 23% 60%, 14% 38%, 86% 38%, 77% 60%, 64% 61%, 58% 52%, 86% 38%); }
.foil strong { font: 700 34px/.94 var(--display); letter-spacing: -.055em; text-shadow: 2px 2px #4f1018; }

#collection { padding: 30px 0 35px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-head h2 { margin: 0; font: 700 clamp(29px, 4vw, 44px)/1 var(--display); letter-spacing: -.04em; }
progress { display: block; width: 100%; height: 4px; margin-top: 6px; border: 0; accent-color: var(--fire); }
progress::-webkit-progress-bar { background: #292d38; }
progress::-webkit-progress-value { background: var(--fire); }
progress::-moz-progress-bar { background: var(--fire); }
.binder { border: 1px solid var(--line); background: #0e1117; }
.binder-toolbar, .filters, .search-sort, .pages { display: flex; align-items: center; }
.binder-toolbar { justify-content: space-between; gap: 9px; border-bottom: 1px solid var(--line); padding: 0 11px; }
.filters { align-self: stretch; gap: 4px; }
.filters button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 9px 10px 7px; min-height: 48px; color: var(--muted); font: 700 14px var(--display); white-space: nowrap; }
.filters button[aria-pressed=true] { border-color: var(--fire); color: var(--text); }
.search-sort { gap: 6px; padding-block: 6px; }
#collection-search, .search-sort select, .pages button { min-width: 0; min-height: 34px; padding: 5px 8px; color: var(--text); background: #151922; border: 1px solid var(--line); font-size: 13px; }
#collection-search { width: min(220px, 100%); }
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; padding: 11px; }
.grid:empty { display: none; }
.pages { justify-content: center; margin: 0 11px; padding: 9px; border-top: 1px solid var(--line); gap: 9px; font: 500 13px var(--mono); }
.pages button:disabled { opacity: .46; }
#empty { padding: 25px 14px; margin: 0; color: var(--muted); }

.card, .placeholder, .card-back { aspect-ratio: var(--card-ratio); min-width: 0; }
.card {
  --edge: #a6aebf;
  --metal: #343c4d;
  --tint: #343a50;
  --tilt-x: 0;
  --tilt-y: 0;
  --tilt-range: 4deg;
  --foil-opacity: .18;
  --foil-x: 50%;
  --foil-y: 48%;
  position: relative;
  color: var(--text);
  perspective: 700px;
  isolation: isolate;
}
.card[data-tier="top"] { --edge: #ffe2a1; --metal: #8d521e; --tint: #733228; --tilt-range: 9deg; --foil-opacity: .44; }
.card[data-tier="main"] { --edge: #ff9587; --metal: #6a2931; --tint: #5e252a; --tilt-range: 7deg; --foil-opacity: .32; }
.card[data-tier="legacy"] { --edge: #c9ab7f; --metal: #554339; --tint: #3a302a; --tilt-range: 5deg; --foil-opacity: .24; }
.card-inner, .card-rotor {
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}
.card-inner {
  transform: rotateX(calc(var(--tilt-x) * var(--tilt-range))) rotateY(calc(var(--tilt-y) * var(--tilt-range)));
  transition: transform .18s ease-out;
}
.card-rotor { transition: transform .46s cubic-bezier(.2,.7,.2,1); }
.flipped .card-rotor { transform: rotateY(180deg); }
.card-face {
  position: absolute;
  inset: 0;
  display: grid;
  padding: clamp(4px, .55vw, 8px);
  border: 1px solid var(--edge);
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px var(--metal), 0 3px 4px #0008;
  backface-visibility: hidden;
  overflow: hidden;
}
.card-front {
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  background: linear-gradient(147deg, var(--metal), #10141c 39%, #10141c 72%, var(--metal));
}
[data-tier="top"] .card-face { box-shadow: inset 0 0 0 2px var(--metal), inset 0 0 0 4px #ffe2a137, 0 3px 5px #0008; }
[data-tier="main"] .card-face { border-inline-width: 3px; }
[data-tier="extended"] .card-face { border-bottom-width: 3px; }
[data-tier="legacy"] .card-face { outline: 1px dashed #c9ab7f80; outline-offset: -4px; }
.card-header, .card-id { display: flex; justify-content: space-between; align-items: center; gap: 3px; color: var(--muted); font: 600 clamp(8px, .92vw, 11px) var(--mono); white-space: nowrap; }
.card-header { padding: 1px 1px 4px; }
.card-rank { color: #fff7ec; font-size: clamp(13px, 1.65vw, 21px); letter-spacing: -.08em; }
.tier-badge { border: 1px solid var(--edge); padding: 1px 3px; color: var(--edge); text-transform: uppercase; }
.art { display: grid; place-items: center; min-height: 0; position: relative; overflow: hidden; isolation: isolate; background: #11141a; border: 1px solid var(--edge); }
.art::before { content: ""; position: absolute; z-index: -1; inset: -35%; background: repeating-linear-gradient(var(--angle), #0000 0 10px, #ffffff1a 11px 12px), radial-gradient(ellipse, var(--tint), transparent 55%); }
.art[data-variant="1"]::before { background: repeating-radial-gradient(ellipse, #0000 0 14px, #ffffff25 15px 16px), radial-gradient(ellipse, var(--tint), transparent 60%); }
.art[data-variant="2"]::before { background: repeating-conic-gradient(from var(--angle), #fff1 0 10deg, #0000 11deg 23deg), radial-gradient(ellipse, var(--tint), transparent 60%); }
.art .demon-icon { width: 40%; height: 47%; color: var(--edge); opacity: .8; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.art img.loaded { opacity: 1; }
.card-front h3 { margin: 4px 0 3px; font: 700 clamp(12px, 1.5vw, 20px)/1.02 var(--display); overflow-wrap: anywhere; }
.credits { margin: 0; display: grid; gap: 2px; padding-block: 3px; border-block: 1px solid #ffffff25; background: #080b105e; }
.credit { min-width: 0; display: flex; justify-content: space-between; gap: 3px; font: 500 clamp(8px, .9vw, 11px)/1.15 var(--mono); }
.credit dt { color: var(--muted); }
.credit dd { min-width: 0; margin: 0; color: #f3edf0; }
.card-front dd { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-id { padding-top: 3px; }
.card-id strong { color: #ff9a91; }
.card:not(.locked) .card-id { padding-right: 35px; }
.flip-card {
  position: absolute;
  z-index: 1;
  right: 6px;
  bottom: 5px;
  border: 1px solid var(--edge);
  border-radius: 3px;
  background: #191c24;
  color: #fff2ea;
  padding: 1px 4px;
  min-height: 18px;
  font: 700 10px var(--display);
}
.flip-card::before { content: ""; position: absolute; inset: -7px -4px; }
.flip-card:hover { background: var(--metal); }
.card-reverse {
  transform: rotateY(180deg);
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 42%);
  padding-bottom: 27px;
  background: repeating-linear-gradient(124deg, #e5e4ff00 0 6px, #e5e4ff19 7px, #e5e4ff00 8px), linear-gradient(147deg, #2e171e, #11131c 50%, #321b27);
}
.card-front::after, .card-reverse::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at var(--foil-x) var(--foil-y), #fff5daa6, transparent 56%),
    repeating-linear-gradient(123deg, #ffc08433 0 7px, #f8f2ab26 9px, #7df2da32 13px, #9aa8ff22 18px, transparent 24px);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity .24s ease;
}
.card-reverse::after { opacity: calc(var(--foil-opacity) * .32); }
@media (hover: hover) {
  .card:not(.locked):hover .card-front::after,
  .card:not(.locked):hover .card-reverse::after { opacity: var(--foil-opacity); }
}
.reverse-brand { z-index: 1; color: #fff0e8; text-align: center; font: 700 clamp(9px, 1.4vw, 17px) var(--display); letter-spacing: .06em; text-shadow: 0 1px 5px #000; }
.card-reverse > .demon-icon { z-index: 1; place-self: center; width: 40%; height: 58%; color: #ffdecb; filter: drop-shadow(0 1px 6px #000); }
.full-credits { z-index: 1; min-height: 0; align-self: stretch; align-content: start; overflow: auto; padding: 4px; background: #0c0e18e6; }
.full-credits .credit { display: block; }
.full-credits dd { overflow-wrap: anywhere; }
@media (max-width: 650px) {
  .card:not(.locked) .card-id { padding-right: 0; }
  .card:not(.locked) .card-front { padding-bottom: 22px; }
  .flip-card { right: 4px; bottom: 3px; min-height: 17px; }
}

/* Responsive & interaction polish 0.3.1 */
button, select, input, .pack-object { min-height: 44px; }
button { touch-action: manipulation; }
.card-front h3, .card-reverse h3 { overflow-wrap: anywhere; word-break: break-word; }
.credits dd, .full-credits dd { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.card-front dd { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.full-credits { overflow: auto; scrollbar-width: thin; }
.status, #status { overflow-wrap: anywhere; }
.stage-skeleton .placeholder { min-height: 220px; }
.placeholder { animation-duration: 1.1s; }
.topbar nav a { min-height: 44px; display: inline-flex; align-items: center; }
.filters button, .pages button, .sound-toggle, .flip-card, .dialog-close { min-height: 44px; }
.flip-card { min-width: 44px; width: 44px; }
.dialog-close { min-width: 44px; }
@media (min-width: 1440px) {
  .shell { width: min(1320px, calc(100% - 96px)); }
  .grid { gap: 24px; }
}
@media (max-width: 768px) {
  .shell { width: calc(100% - 32px); }
  .topbar { gap: 8px; }
  .topbar nav { gap: 4px; }
  .topbar nav a { padding-inline: 8px; font-size: 12px; }
  .source { display: none; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .collection-meter { width: min(100%, 280px); text-align: left; }
  .binder-toolbar { gap: 8px; }
  .filters button { margin-right: 8px; padding-inline: 4px; }
  .search-sort { width: 100%; }
  .search-sort select { width: 100%; }
  #collection-search { min-height: 44px; }
}
@media (max-width: 430px) {
  .shell { width: calc(100% - 24px); }
  .topbar { min-height: 56px; }
  .brand { gap: 7px; font-size: 15px; }
  .brand-mark { width: 30px; height: 30px; }
  .topbar nav { flex: 1; justify-content: flex-end; }
  .topbar nav a { padding-inline: 5px; font-size: 11px; }
  .opener { margin-inline: -1px; }
  .stage { min-height: 390px; }
  .stage-play { min-height: 300px; }
  .pack-summary { max-width: 230px; line-height: 1.25; }
  .recent-strip { padding-block: 12px 16px; }
  .recent-cards { gap: 4px; }
  .recent-cards .card-face { padding: 4px; }
  .recent-cards .card-front h3 { font-size: 10px; }
  .recent-cards .credits { display: none; }
  .grid { gap: 8px; }
  .grid .card-face { padding: 6px; }
  .grid .card-front h3 { font-size: 12px; }
  .grid .credit { font-size: 8px; }
  .filters { gap: 0; }
  .filters button { margin-right: 4px; font-size: 11px; }
  footer { flex-direction: column; }
}
@media (max-width: 370px) {
  .topbar nav a { font-size: 10px; padding-inline: 3px; }
  .brand { font-size: 14px; }
  .brand-mark { width: 27px; height: 27px; }
  .grid .card-front h3 { font-size: 11px; }
  .grid .credits { padding-inline: 3px; }
}
.sync-status { display: inline-block; }
@media (max-width: 430px) { .sync-status { display: none; } }
.account-button { max-width: 120px; }
@media (max-width: 430px) {
  .account-button { max-width: 76px; padding-inline: 7px; font-size: 10px; }
}
.save-tools { justify-content: flex-start; }
@media (prefers-reduced-motion: reduce) {
  .placeholder { animation: none; }
  .card-inner, .card-rotor { transition: none; }
}

/* Visual identity 3.0: fewer layers, stronger archive language. */
:root {
  --fire: #b6d83d;
  --accent-soft: #d7ed79;
  --surface: #151812;
  --surface-raised: #1b1f17;
  --line: #30372a;
}
.masthead { background: var(--bg); }
.topbar { min-height: 72px; }
.brand-mark { color: var(--fire); }
.topbar nav { margin-left: auto; }
.topbar nav a { color: var(--muted); }
.topbar nav a:hover, .topbar nav a:focus-visible { color: var(--text); }
.account-button { border-color: var(--line); background: var(--surface); }
.stage { background: var(--surface); }
.stage-play { border-color: var(--line); background: var(--surface-raised); }
.stage-play::after { color: #707964; }
.foil { background: #28321b; border-color: var(--fire); box-shadow: 9px 9px 0 #0b0c0a; }
.pack-cue { background: var(--fire); color: #11140d; border-color: var(--fire); }
.pack-object:hover:enabled .foil, .pack-object:focus-visible .foil { filter: drop-shadow(0 10px 12px #9fbd3a30); }
.binder, .auth-dialog, .card-dialog { background: var(--surface); border-color: var(--line); }
.card-face { box-shadow: inset 0 0 0 2px var(--metal), 0 4px 0 #090a08; }
.card-front { background: var(--surface-raised); }
.art { background: #0f120d; }
.card-front h3 { font-size: clamp(14px, 1.65vw, 22px); }
.card[data-tier="top"] { --edge: #d2a74e; --metal: #42301b; --tint: #5a411f; }
.card[data-tier="main"] { --edge: #b95160; --metal: #351c24; --tint: #4a222d; }
.card[data-tier="extended"] { --edge: #879fbd; --metal: #202b38; --tint: #293a4f; }
.card[data-tier="legacy"] { --edge: #ae9885; --metal: #342d29; --tint: #463b34; }
.collection-insights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 22px; }
.insight { position: relative; overflow: hidden; padding: 11px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 600 12px var(--mono); }
.insight::after { content: ''; position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--fire); transform: scaleX(var(--progress)); transform-origin: left; }
.card-meta { min-height: 18px; color: var(--muted); font: 500 9px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.favorite-card { position: absolute; z-index: 3; top: 8px; right: 8px; width: 30px; min-height: 30px; padding: 0; border: 1px solid var(--edge); background: #11140fe8; color: var(--edge); font-size: 17px; line-height: 1; }
.favorite-card:hover, .favorite-card[aria-pressed="true"] { background: var(--edge); color: #11140f; }
.auth-provider { background: var(--surface-raised); border-color: var(--line); }
.auth-provider:hover { border-color: var(--fire); }
.profile-stats { background: var(--surface-raised); color: var(--accent-soft); }
.placeholder { background: var(--surface-raised); border-color: var(--line); }
#empty { background: var(--surface); border-color: var(--line); }
@media (max-width: 650px) {
  .topbar { min-height: 62px; }
  .brand { font-size: 16px; }
  .account-button { max-width: 92px; }
  .collection-insights { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .favorite-card { top: 5px; right: 5px; width: 30px; min-height: 30px; }
}

/* Final visual cleanup tokens. Keep this block as the single source of truth for the live theme. */
:root {
  --bg: #10110f;
  --panel: #171914;
  --line: #363a2e;
  --text: #f0f1df;
  --muted: #9da38f;
  --fire: #c9f04a;
  --display: "Chakra Petch", sans-serif;
  --mono: "Chakra Petch", sans-serif;
  --card-ratio: 5 / 7;
}
#empty { padding: 34px 18px; border-block: 1px solid var(--line); color: var(--muted); font: 600 14px var(--display); text-align: center; }
#empty::before { content: 'â—'; display: block; margin-bottom: 8px; color: var(--fire); font-size: 22px; }
.stage-play { min-height: 0; }
.stage[data-state="idle"] .stage-play { min-height: 320px; }
.stage[data-state="dealt"] .stage-play, .stage[data-state="complete"] .stage-play { min-height: 360px; }
.pack-object { min-height: 44px; }
.grid { align-items: start; }
.card { contain: layout paint; }

/* Full experience polish 0.3.0 */
.auth-dialog, .card-dialog, .binder, .stage-play { border-color: #3e4631; }
.auth-dialog, .card-dialog { animation: surface-in .18s ease-out both; }
@keyframes surface-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.stage-play::after { content: 'ARCHIVE / LIVE'; position: absolute; top: 12px; left: 14px; color: #788064; font: 600 10px var(--mono); letter-spacing: .12em; }
.stage[data-state="dealt"] .stage-play::after, .stage[data-state="complete"] .stage-play::after { content: 'PULL / REVEAL'; color: var(--fire); }
.card-reverse { background: #182017; border-color: var(--edge); }
.card-reverse::before { content: ''; position: absolute; inset: 14px; border: 1px solid var(--edge); opacity: .7; }
.card-reverse > .demon-icon { z-index: 1; width: 42%; height: 45%; }
.reverse-brand { z-index: 1; background: #11150f; }
.placeholder { border-color: #3e4631; background: #1a1e16; animation: archive-pulse 1.4s ease-in-out infinite alternate; }
@keyframes archive-pulse { from { opacity: .55; } to { opacity: 1; } }
#empty { background: #151812; }
.auth-dialog .primary { min-height: 44px; }
.account-button { border-radius: 2px; }
.topbar nav a { position: relative; }
.topbar nav a::after { content: ''; position: absolute; right: 8px; bottom: 3px; left: 8px; height: 1px; background: var(--fire); transform: scaleX(0); transform-origin: left; transition: transform .18s ease; }
.topbar nav a:hover::after { transform: scaleX(1); }
@media (max-width: 650px) {
  .topbar nav a::after { display: none; }
  .topbar nav a:first-child { display: none; }
  .topbar nav { margin-left: auto; }
  .stage-play::after { top: 8px; left: 9px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-dialog, .card-dialog { animation: none; }
  .placeholder { animation: none; }
  .topbar nav a::after { transition: none; }
}

/* Pack opening experience 0.2.2 */
.stage[data-state="opening"] .stage-play { overflow: visible; }
.pack-object.opening .foil { animation: pack-rip .52s cubic-bezier(.2,.8,.25,1) both; transform-origin: 50% 8%; }
.pack-object.opening::before { content: ''; position: absolute; top: 6%; left: 18%; width: 64%; height: 2px; background: var(--fire); box-shadow: 0 0 14px #c9f04a99; animation: tear-line .52s ease-out both; }
.pack-object.opening::after { top: 4px; height: 13px; background: repeating-linear-gradient(90deg, var(--fire) 0 1px, #36401d 1px 3px); animation: crimp-tear .52s both; }
@keyframes pack-rip {
  0% { clip-path: polygon(0 0,100% 0,100% 100%,0 100%); transform: perspective(660px) rotateZ(-6deg) scale(1); opacity: 1; }
  42% { clip-path: polygon(0 5%,14% 2%,27% 6%,42% 3%,56% 7%,71% 2%,85% 6%,100% 3%,100% 100%,0 100%); transform: perspective(660px) rotateZ(-4deg) translateY(3px) scale(1.02); }
  100% { clip-path: polygon(0 5%,14% 2%,27% 6%,42% 3%,56% 7%,71% 2%,85% 6%,100% 3%,100% 100%,0 100%); transform: perspective(660px) rotateZ(2deg) translateY(38px) scale(.86); opacity: 0; }
}
@keyframes tear-line { 0% { transform: scaleX(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scaleX(1.2) translateX(24px); opacity: 0; } }
.pulls { width: min(100%, 590px); gap: 14px; perspective: 900px; }
.pull-slot { position: relative; animation: cards-spread .42s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--delay) + 60ms); }
.pull-slot:nth-child(1) { transform: rotate(-3deg) translateY(8px); }
.pull-slot:nth-child(2) { transform: translateY(-4px); }
.pull-slot:nth-child(3) { transform: rotate(3deg) translateY(8px); }
@keyframes cards-spread { from { opacity: 0; transform: translateY(24px) scale(.9) rotate(0); } to { opacity: 1; } }
.pull-slot .card-back { animation: back-settle .3s ease-out both; animation-delay: calc(var(--delay) + 120ms); }
@keyframes back-settle { from { transform: rotateY(-70deg); opacity: 0; } to { transform: rotateY(0); opacity: 1; } }
.pull-slot.revealed .card { animation: reveal-card .34s cubic-bezier(.2,.8,.2,1) both; }
@keyframes reveal-card { from { transform: rotateY(-88deg); opacity: .3; } to { transform: rotateY(0); opacity: 1; } }
.pull-slot[data-tier="top"] .card-back { border-color: #d7a94d; color: #d7a94d; }
.pull-slot[data-tier="main"] .card-back { border-color: #bd5362; color: #bd5362; }
.pull-slot[data-tier="extended"] .card-back { border-color: #8da7c7; color: #8da7c7; }
.pull-slot[data-tier="legacy"] .card-back { border-color: #b7a08c; color: #b7a08c; }
.pack-summary { margin: 0 auto 7px; color: var(--text); font: 600 12px var(--mono); letter-spacing: .04em; }
.sound-toggle { border: 0; padding: 3px 0; color: var(--muted); background: transparent; font: 600 11px var(--mono); }
.sound-toggle:hover, .sound-toggle[aria-pressed="true"] { color: var(--fire); }
.card-id strong { position: relative; z-index: 1; }
.card-id strong { color: var(--edge); }
.card-id strong::after { content: ''; }
@media (max-width: 650px) {
  .pulls { gap: 5px; }
  .pull-slot:nth-child(1) { transform: rotate(-1.5deg) translateY(4px); }
  .pull-slot:nth-child(3) { transform: rotate(1.5deg) translateY(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .pack-object.opening .foil, .pull-slot, .pull-slot .card-back, .pull-slot.revealed .card { animation: none; }
}

/* Collection 0.3.0 â€” a binder with breathing room and archive metadata. */
#collection { padding-top: 68px; }
.recent-strip { margin: 0 0 28px; padding: 16px 0 20px; border-block: 1px solid var(--line); }
.recent-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--fire); font: 700 14px var(--display); }
.recent-heading small { color: var(--muted); font: 500 11px var(--mono); }
.recent-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; max-width: 720px; }
.recent-cards .card { max-width: 160px; }
.binder-toolbar { align-items: flex-end; padding-top: 8px; }
.filters { flex-wrap: wrap; row-gap: 0; }
.filters button[data-tier-filter] { color: var(--muted); font-size: 12px; min-height: 38px; margin-right: 14px; border-bottom-width: 1px; }
.filters button[data-tier-filter][aria-pressed="true"] { color: var(--fire); border-color: var(--fire); }
.grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding-block: 24px; }
.grid .card { width: 100%; }
.grid .card-face { padding: 12px; }
.card-dialog { width: min(440px, calc(100% - 28px)); padding: 30px; border: 1px solid var(--line); background: #171914; color: var(--text); box-shadow: 0 20px 70px #000b; }
.card-dialog::backdrop { background: #050604cc; backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 8px; right: 10px; border: 0; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.dialog-close:hover { color: var(--fire); }
.card-dialog .card { width: min(100%, 300px); margin: 0 auto; }
.card-dialog .card-face { padding: 13px; }
@media (max-width: 950px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  #collection { padding-top: 42px; }
  .recent-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .recent-cards .card { max-width: none; }
  .recent-heading { display: block; }
  .recent-heading small { display: block; margin-top: 4px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-block: 16px; }
  .grid .card-face { padding: 7px; }
  .binder-toolbar { align-items: stretch; }
  .filters button[data-tier-filter] { margin-right: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .card-inner { transform: none; }
}
.placeholder { background: linear-gradient(110deg, #161a23 20%, #282d38 42%, #161a23 63%); background-size: 220% 100%; animation: shimmer 1.35s linear infinite; border: 1px solid var(--line); }
.stage-skeleton { width: 155px; }
@keyframes shimmer { to { background-position: -185% 0; } }

.pulls, .stage-skeleton { display: grid; gap: 8px; }
.pulls { width: min(100%, 535px); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pull-slot { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; animation: deal .26s both; animation-delay: var(--delay); }
.pull-slot > * { grid-area: 1/1; }
.card-back { display: grid; place-content: center; justify-items: center; gap: 8px; border: 1px solid #b44748; background: repeating-linear-gradient(37deg, #28161c 0 6px, #3a1c25 7px 8px); color: #ffb2a8; font: 600 12px var(--mono); box-shadow: inset 0 0 0 4px #1a131a; }
.card-back:hover { background: #4a222b; }
.card-back .demon-icon { width: 45px; height: 34px; }
.pull-slot .card { animation: turn .23s both; }
@keyframes deal { from { opacity: 0; transform: translateY(12px) rotate(-5deg); } }
@keyframes turn { from { transform: rotateY(-75deg); opacity: .2; } }
footer { border-top: 1px solid var(--line); padding-block: 15px; display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font: 12px var(--mono); }
footer div { display: flex; gap: 12px; }

@media (max-width: 950px) {
  .shell { width: calc(100% - 40px); }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 24px); }
  .topbar { min-height: 54px; }
  .brand { font-size: 16px; gap: 6px; }
  .topbar nav { gap: 10px; font-size: 12px; }
  .source { display: none; }
  main { padding-top: 13px; }
  .opener { grid-template-columns: minmax(0, 1fr); }
  .console { padding: 15px; border: 0; border-bottom: 1px solid var(--line); }
  h1 { margin-block: 7px; font-size: clamp(36px, 9.5vw, 53px); }
  h1 br { display: none; }
  .rules { max-width: none; font-size: 13px; }
  .stock { margin-top: 13px; padding-top: 8px; }
  .stage { grid-template-rows: minmax(234px, 1fr) minmax(38px, auto); padding: 7px 7px 5px; }
  .foil { width: 128px; }
  .foil-emblem { scale: .78; }
  .foil strong { font-size: 24px; }
  .foil-label { margin-inline: 9px; font-size: 6px; }
  .stage-skeleton { width: 112px; }
  .pulls { gap: 4px; }
  #collection { padding-top: 22px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 6px; }
  .binder-toolbar { flex-wrap: wrap; padding-inline: 6px; gap: 0; }
  .search-sort { width: 100%; }
  .filters { width: 100%; flex-wrap: wrap; }
  #collection-search { width: 100%; }
  footer { font-size: 10px; }
}
@media (max-width: 390px) {
  .topbar nav { gap: 7px; }
  .card { padding: 3px; }
  .card-id { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .foil { transform: rotateZ(-8deg) !important; }
}

/* The detachable crimp and the torn edge share the pack's opening timing. */
.pack-object.opening::after {
  content: "";
  position: absolute;
  top: 6px;
  inset-inline: 6px;
  height: 11px;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, #f8d3c8 0 1px, #68404a 1px 3px);
  transform-origin: 50% 100%;
  animation: crimp-tear .43s both;
}
.opening .foil { animation: rip .43s both; }
@keyframes crimp-tear {
  0% { opacity: 0; transform: rotate(-8deg) translateY(-1px); }
  18% { opacity: 1; }
  65% { opacity: .8; }
  100% { opacity: 0; transform: translate(40px, -58px) rotate(24deg); }
}
@keyframes rip {
  0% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  25%, 65% {
    clip-path: polygon(0 4%, 16% 6%, 34% 3%, 51% 6%, 71% 4%, 84% 6%, 100% 3%, 100% 100%, 0 100%);
    transform: translateY(3px) rotateZ(-5deg);
  }
  100% {
    clip-path: polygon(0 4%, 16% 6%, 34% 3%, 51% 6%, 71% 4%, 84% 6%, 100% 3%, 100% 100%, 0 100%);
    transform: scale(.87) translateY(23px) rotateZ(-2deg);
    opacity: 0;
  }
}
.pack-cue {
  position: relative;
  padding: 5px 9px;
  color: #ffe4dc;
  background: #28151b;
  border: 1px solid #aa4f4d;
  font: 700 11px var(--mono);
  letter-spacing: .06em;
}
.pack-object:hover:enabled .pack-cue,
.pack-object:focus-visible .pack-cue { color: #fff; background: #672a2d; border-color: #ff8e86; }
.collection-meter { width: min(250px, 52%); text-align: right; }
.save-tools { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.save-tools button { min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font: 600 11px var(--mono); }
.save-tools button:hover { color: var(--fire); border-color: var(--fire); }
#collection-progress { display: block; font: 600 12px var(--mono); color: var(--text); }
.classified-face {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 5px;
  background: #10131b;
}
.classified-face > .card-rank { padding: 2px 3px 0; }
.classified-art {
  background: repeating-linear-gradient(0deg, #121620 0 1px, #0d1017 1px 4px);
}
@media (max-width: 650px) {
  #collection-progress { font-size: 10px; }
}

/* Card design 2.0 â€” cards read like field records, not mini dashboards. */
.card {
  --edge: #8d98aa;
  --metal: #222a36;
  --tint: #293747;
  --foil-opacity: .08;
  --tilt-range: 3deg;
  padding: 0;
}
.card[data-tier="top"] { --edge: #d7a94d; --metal: #4a321a; --tint: #62451e; --tilt-range: 4deg; }
.card[data-tier="main"] { --edge: #bd5362; --metal: #3a1d26; --tint: #52242f; --tilt-range: 3deg; }
.card[data-tier="extended"] { --edge: #8da7c7; --metal: #202c3b; --tint: #2b3b50; --tilt-range: 3deg; }
.card[data-tier="legacy"] { --edge: #b7a08c; --metal: #342d2a; --tint: #4a3e37; --tilt-range: 2deg; }
.card-inner { transform: rotateX(calc(var(--tilt-x) * var(--tilt-range))) rotateY(calc(var(--tilt-y) * var(--tilt-range))); }
.card-face { border: 1px solid var(--edge); border-radius: 2px; padding: 9px; box-shadow: inset 0 0 0 3px var(--metal), 0 5px 0 #090a08; }
.card[data-tier="top"] .card-face { box-shadow: inset 0 0 0 3px var(--metal), inset 0 0 0 5px #d7a94d33, 0 5px 0 #090a08; }
.card[data-tier="main"] .card-face { box-shadow: inset 0 0 0 3px var(--metal), inset 0 -4px 0 var(--edge), 0 5px 0 #090a08; }
.card[data-tier="extended"] .card-face { box-shadow: inset 0 0 0 3px var(--metal), inset 0 0 0 5px #8da7c733, 0 5px 0 #090a08; }
.card[data-tier="legacy"] .card-face { outline: 1px solid #b7a08c66; outline-offset: -6px; }
.card-front { grid-template-rows: auto minmax(0, 1.65fr) auto auto auto; gap: 6px; background: #171a16; }
.card-header { align-items: flex-start; padding: 1px 2px 6px; border-bottom: 1px solid var(--edge); }
.card-rank { color: var(--edge); font-size: clamp(17px, 2vw, 26px); line-height: .9; letter-spacing: -.08em; }
.tier-badge { border: 0; padding: 2px 0 0; color: var(--edge); font-size: 9px; letter-spacing: .08em; }
.art { min-height: 0; border: 0; background: #11130f; }
.art::before { opacity: .2; }
.art .demon-icon { width: 25%; height: 28%; opacity: .35; }
.art img { z-index: 1; object-fit: cover; opacity: 0; filter: saturate(.9) contrast(1.05); }
.art img.loaded { opacity: 1; }
.card-front h3 { margin: 0; color: var(--text); font-size: clamp(13px, 1.55vw, 20px); line-height: 1; letter-spacing: -.035em; }
.credits { gap: 3px; padding: 6px 7px; border: 1px solid var(--edge); background: #10120fe8; }
.credit { gap: 8px; font-size: clamp(8px, .82vw, 10px); }
.credit dt { color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.credit dd { color: var(--text); font-weight: 600; }
.card-id { padding-top: 2px; color: var(--muted); }
.card-id strong { color: var(--edge); font-size: 11px; }
.flip-card { right: 9px; bottom: 8px; border: 0; border-radius: 50%; width: 24px; min-height: 24px; padding: 0; color: var(--edge); background: var(--metal); font-size: 0; }
.flip-card::after { content: 'â†»'; font-size: 15px; line-height: 1; }
.flip-card:hover { color: var(--text); background: var(--edge); }
.card-front::after, .card-reverse::after { background: radial-gradient(ellipse at var(--foil-x) var(--foil-y), #ffffff55, transparent 42%); opacity: 0 !important; }
.card-reverse { grid-template-rows: auto minmax(0, 1fr) minmax(0, 42%); gap: 8px; background: var(--metal); }
.reverse-brand { padding: 7px 4px; color: var(--edge); border-block: 1px solid var(--edge); letter-spacing: .1em; }
.card-reverse > .demon-icon { width: 46%; height: 52%; color: var(--edge); filter: none; }
.full-credits { padding: 8px; border: 1px solid var(--edge); background: #11130fee; }
.full-credits .credit { display: block; padding-block: 5px; border-bottom: 1px solid #ffffff1a; }
.full-credits dt { margin-bottom: 3px; }
.full-credits dd { font-size: 11px; line-height: 1.25; }
.classified-face { background: var(--metal); border-color: var(--edge); }
.classified-face > .card-rank { color: var(--edge); }
.classified-art { background: #121511; border: 1px solid var(--edge); }
.card-back { border-color: var(--edge); background: var(--metal); box-shadow: inset 0 0 0 5px #0f120e; color: var(--edge); }
.card-back:hover { background: var(--tint); }
.card-back .demon-icon { color: var(--edge); }
@media (max-width: 650px) {
  .card-face { padding: 6px; }
  .card-front { gap: 4px; }
  .credits { padding: 4px 5px; }
  .flip-card { right: 5px; bottom: 5px; width: 21px; min-height: 21px; }
}

/* 0.2 identity pass â€” one sharp signal, quiet archive surfaces. */
:root {
  --bg: #10110f;
  --panel: #171914;
  --line: #363a2e;
  --text: #f0f1df;
  --muted: #9da38f;
  --fire: #c9f04a;
  --display: "Chakra Petch", sans-serif;
  --mono: "Chakra Petch", sans-serif;
}
body { background: var(--bg); font-family: Inter, sans-serif; }
.masthead { background: #10110f; border-bottom: 1px solid var(--line); }
.shell { width: min(1240px, calc(100% - 72px)); }
.topbar { min-height: 78px; }
.brand { gap: 12px; font-size: 21px; letter-spacing: -.03em; text-transform: none; }
.brand-mark { width: 35px; height: 35px; color: var(--fire); fill: currentColor; }
.brand-mark .mark-cut { fill: var(--bg); }
.brand-mark .mark-line { fill: none; stroke: var(--bg); stroke-width: 2.5; stroke-linecap: square; }
.topbar nav { gap: 31px; font-size: 14px; }
.topbar nav a:first-child { color: var(--text); }
.source { color: var(--fire); letter-spacing: .12em; }
.account-button { min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); background: transparent; color: var(--text); font: 600 12px var(--display); white-space: nowrap; overflow: hidden; max-width: 220px; text-overflow: ellipsis; }
.account-button:hover, .account-button.signed-in { border-color: var(--fire); color: var(--fire); }
.sync-status { color: var(--muted); font: 500 10px var(--mono); white-space: nowrap; }
.sync-status[data-state="busy"] { color: var(--fire); }
.sync-status[data-state="ok"] { color: #a9c86d; }
.sync-status[data-state="error"] { color: #e58b98; }
.auth-dialog { width: min(460px, calc(100% - 28px)); padding: 30px 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: #10110f; color: var(--text); text-align: center; box-shadow: 0 24px 80px #000b; }
.auth-dialog::backdrop { background: #050604d9; backdrop-filter: blur(4px); }
.auth-mark { color: var(--fire); font-size: 30px; }
.auth-brand { margin: 4px 0 22px; color: var(--muted); font: 700 12px var(--mono); letter-spacing: .1em; }
.auth-dialog h2 { margin: 0; font: 700 30px var(--display); letter-spacing: -.05em; }
.auth-copy { margin: 8px 0 20px; color: var(--muted); }
.auth-provider { display: flex; min-height: 56px; align-items: center; justify-content: center; margin-top: 12px; border: 1px solid var(--line); color: var(--text); font: 700 17px var(--display); }
.auth-provider:hover { border-color: var(--fire); color: var(--fire); }
.auth-provider.google::before { content: 'G'; display: grid; place-items: center; width: 23px; height: 23px; margin-right: 10px; border-radius: 50%; background: #fff; color: #4285f4; font: 700 15px Arial; }
.auth-provider.discord::before { content: 'â—Ź'; display: grid; place-items: center; width: 23px; height: 23px; margin-right: 10px; border-radius: 50%; background: #5865f2; color: #fff; font-size: 13px; }
.auth-guest { margin-top: 17px; border: 0; background: transparent; color: var(--muted); font: 500 14px var(--display); }
.auth-guest:hover { color: var(--text); }
.auth-error { margin: 8px 0; padding: 9px; border: 1px solid #bd5362; color: #f0a3ae; font-size: 13px; }
.profile-panel { margin-top: 16px; text-align: left; }
.profile-panel label { display: grid; gap: 5px; margin-top: 12px; color: var(--muted); font: 600 11px var(--mono); }
.profile-panel label span { font-weight: 400; }
.profile-panel input:not([type="checkbox"]) { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.profile-panel .primary { width: 100%; margin-top: 14px; }
.profile-stats { padding: 10px; border: 1px solid var(--line); color: var(--fire); font-size: 12px; }
.setting-row { display: flex !important; grid-template-columns: auto 1fr !important; align-items: center; gap: 8px !important; font-size: 12px !important; }
.profile-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 18px; }
.danger-link { border: 0; background: transparent; color: #e58b98; font: 600 11px var(--mono); }
.linked-accounts { margin-top: 20px; text-align: left; }
.linked-accounts > p { margin: 0 0 8px; color: var(--muted); font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.linked-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.linked-row button, .auth-link { min-height: 36px; padding: 5px 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 11px var(--mono); }
.linked-row button:hover, .auth-link:hover { border-color: var(--fire); color: var(--fire); }
.auth-link { display: inline-flex; align-items: center; margin: 12px 6px 0 0; text-decoration: none; }
main { padding-top: 40px; }
.opener { min-height: 590px; grid-template-columns: minmax(320px, .7fr) minmax(0, 1.65fr); border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.console { padding: 48px clamp(24px, 4vw, 65px); background: var(--panel); border-right: 1px solid var(--line); }
.eyebrow { color: var(--fire); font-size: 12px; letter-spacing: .12em; }
.pulse { background: var(--fire); width: 7px; height: 7px; }
h1 { margin: 21px 0 18px; font-size: clamp(56px, 6vw, 96px); line-height: .87; letter-spacing: -.08em; }
h1 em { color: var(--fire); font-style: normal; }
.rules { max-width: 270px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.stock { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.stock h2 { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
#pack-storage-status { font-size: 18px; }
#slots { gap: 5px; }
#slots i { height: 10px; background: #25291f; border-color: #444a38; }
#slots .filled { background: var(--fire); border-color: var(--fire); }
.stage { padding: 30px 28px 20px; background: #12130f; }
.stage-play::before { display: none; }
.stage-play { border: 1px solid var(--line); background: #191b15; }
.foil { width: 214px; background: #263217; border: 1px solid var(--fire); box-shadow: 12px 12px 0 #0b0c0a; transform: perspective(660px) rotateZ(-6deg); }
.foil::before { inset: 14px 9px; border-color: #d7fa6b90; }
.foil-emblem { border-color: var(--fire); background: #151a10; box-shadow: 5px 5px 0 var(--fire); }
.demon-icon { color: var(--fire); }
.foil strong { color: var(--text); }
.pack-cue { color: #14170e; background: var(--fire); border-color: var(--fire); }
.pack-object:hover:enabled .pack-cue, .pack-object:focus-visible .pack-cue { color: #14170e; background: #e2ff86; border-color: #e2ff86; }
.primary, .retry { background: var(--fire); border-color: var(--fire); color: #14170e; min-height: 42px; padding-inline: 18px; }
.primary:hover, .retry:hover { background: #e2ff86; }
#collection { padding-top: 55px; }
.section-head h2 { font-size: clamp(35px, 4vw, 54px); }
.binder { border: 0; border-top: 1px solid var(--line); background: transparent; }
.binder-toolbar { padding-inline: 0; border-bottom: 1px solid var(--line); }
.filters button { padding-inline: 0; margin-right: 22px; min-height: 52px; }
.filters button[aria-pressed=true] { border-color: var(--fire); color: var(--fire); }
#collection-search, .search-sort select, .pages button { background: var(--panel); border-color: var(--line); border-radius: 0; }
.grid { gap: 14px; padding: 20px 0; }
.card-face { border-radius: 0; box-shadow: inset 0 0 0 1px var(--metal), 0 4px 0 #0a0b09; }
.card-front { background: #1b1e17; }
.art { border-color: var(--edge); }
footer { margin-top: 35px; }
@media (max-width: 650px) {
  .shell { width: calc(100% - 28px); }
  .topbar { min-height: 62px; }
  .brand { font-size: 17px; }
  main { padding-top: 18px; }
  .opener { min-height: 0; }
  .console { padding: 26px 18px 22px; }
  h1 { margin-top: 15px; font-size: clamp(49px, 14vw, 70px); }
  .stage { min-height: 420px; padding: 8px; }
  .stage-play { min-height: 330px; }
  .foil { width: 165px; }
  #collection { padding-top: 35px; }
  .filters button { margin-right: 13px; }
}
