/* ════════════════════════════════════════════════════════════════════
   The Worst Kids Ever — Bunt-grade dark shell
   Near-black stage; the cards (and Ronald's purple pack) supply the color.
   Motion discipline: transform + opacity only, 60fps.
   ════════════════════════════════════════════════════════════════════ */
:root {
  --bg: #07050c;
  --bg-2: #0d0a16;
  --panel: #14101f;
  --panel-2: #1a1428;
  --line: #2b2145;
  --ink: #000;
  --paper: #f4efdf;
  --muted: #a99fc4;
  --purple: #7a4fd0;
  --purple-hot: #9d6bff;
  --slime: #a8e10c;
  --yellow: #ffb700;
  --gold: #ffd23f;
  /* the one fixed rarity ladder, used everywhere */
  --r-common: #8f8a9e;
  --r-uncommon: #59d977;
  --r-rare: #3a86ff;
  --r-epic: #a06bff;
  --r-legendary: #ffb700;
  --r-filler: #c8f169;
  --topbar-h: 58px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", Verdana, Geneva, sans-serif;
  background:
    radial-gradient(1100px 500px at 50% -180px, rgba(122,79,208,.22), transparent 60%),
    var(--bg);
  color: var(--paper);
  min-height: 100vh;
}
a { color: var(--purple-hot); }
img { user-select: none; }

/* ── Top bar ─────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 1.1rem;
  padding: 0 1rem;
  background: rgba(10, 7, 18, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--paper); }
.brand-mark {
  background: linear-gradient(135deg, var(--purple), #4b238f);
  border: 2px solid var(--ink); border-radius: 9px;
  font-weight: 900; font-size: .8rem; letter-spacing: .04em;
  padding: .32rem .45rem; color: #fff;
  box-shadow: 0 3px 0 var(--ink);
}
.brand-name { font-weight: 800; font-size: 1.02rem; letter-spacing: .01em; white-space: nowrap; }
.brand-name em { font-style: normal; color: var(--slime); }
.topnav { display: flex; gap: .25rem; margin-left: .4rem; }
.topnav a {
  color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 600;
  padding: .45rem .7rem; border-radius: 8px;
  transition: color .15s, background-color .15s;
}
.topnav a:hover { color: var(--paper); }
.topnav a.active { color: var(--paper); background: var(--panel-2); }
.topnav-anon { margin-left: auto; align-items: center; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .8rem; }

.balance-pill {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: .32rem .4rem .32rem .7rem; font-weight: 800; font-size: .95rem;
}
.balance-pill .balance-num { display: inline-block; min-width: 1.4ch; text-align: right; }
.balance-pill.balance-flash { border-color: var(--gold); }
.balance-pill.balance-flash .balance-num { animation: bal-pop .65s cubic-bezier(.2,.9,.3,1.2); }
.balance-pill.balance-flash::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255,210,63,.45), transparent 70%);
  animation: bal-glow .8s ease-out forwards;
}
@keyframes bal-pop { 0% { transform: scale(1); } 35% { transform: scale(1.45); color: var(--gold); } 100% { transform: scale(1); } }
[data-balance-value] { display: inline-block; }
.balance-display-flash { animation: bal-pop .65s cubic-bezier(.2,.9,.3,1.2); color: var(--gold); }
@keyframes bal-glow { from { opacity: 1; } to { opacity: 0; } }
.balance-plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--slime); color: #10130a; font-weight: 900; text-decoration: none;
  line-height: 1; font-size: 1rem;
  transition: transform .15s;
}
.balance-plus:hover { transform: scale(1.15); }

.account-menu { position: relative; }
.account-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem;
  padding: .25rem; border-radius: 999px;
}
.account-menu summary::-webkit-details-marker { display: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-hot), var(--purple));
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; color: #fff; border: 2px solid var(--ink);
}
.account-email { font-size: .85rem; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: .45rem; box-shadow: 0 18px 40px rgba(0,0,0,.55); z-index: 70;
}
.account-menu-list a, .account-menu-list .menu-logout {
  display: block; width: 100%; text-align: left;
  padding: .55rem .65rem; border-radius: 8px;
  color: var(--paper); text-decoration: none; font-size: .92rem; font-weight: 600;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.account-menu-list a:hover, .account-menu-list .menu-logout:hover { background: var(--panel); }

/* ── Bottom nav (mobile) ─────────────────────────────────────────── */
.bottomnav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(10, 7, 18, .96); border-top: 1px solid var(--line);
  padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 700;
  padding: .3rem 0; border-radius: 10px;
}
.bottomnav a .bn-icon { font-size: 1.15rem; line-height: 1; }
.bottomnav a.active { color: var(--paper); background: var(--panel-2); }

/* ── Layout / messages / footer ──────────────────────────────────── */
main { padding: 1.4rem 1rem 2rem; max-width: 1060px; margin: 0 auto; }
.messages { list-style: none; margin: 0 auto; max-width: 1060px; padding: .8rem 1rem 0; }
.messages li {
  background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--slime);
  border-radius: 10px; padding: .6rem .9rem; margin-bottom: .5rem; font-size: .92rem;
}
.messages .error { border-left-color: #ff5d5d; color: #ffb3b3; }
.messages .success { border-left-color: var(--slime); }
.sitefoot { text-align: center; color: #6f6590; padding: 1.4rem 1rem 2rem; font-size: .82rem; }

/* ── Buttons & panels ────────────────────────────────────────────── */
.btn {
  display: inline-block; background: var(--panel-2); color: var(--paper);
  font-weight: 800; font-family: inherit; font-size: .95rem;
  border: 2px solid var(--ink); border-radius: 11px; padding: .6rem 1.15rem;
  cursor: pointer; text-decoration: none; box-shadow: 0 4px 0 var(--ink);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { filter: brightness(1.2); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--yellow); color: #22160a; }
.btn.slime { background: var(--slime); color: #10130a; }
.btn.ghost { background: transparent; border-color: var(--line); box-shadow: none; color: var(--paper); }
.btn.small { padding: .42rem .85rem; font-size: .86rem; box-shadow: 0 3px 0 var(--ink); }
.btn.big { font-size: 1.18rem; padding: .85rem 2rem; border-radius: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--purple-hot); outline-offset: 2px;
}
.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem;
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
}
.panel.wide { max-width: 960px; margin: 0 auto; }
.panel.center { text-align: center; }
.panel.narrow { max-width: 460px; margin: 0 auto; }
.panel h1 { margin-top: 0; }
.error { color: #ff9c9c; } .ok { color: #a7e8a7; }
.muted { color: var(--muted); } .fineprint { color: var(--muted); font-size: .83rem; }
.danger { color: #ff9c9c; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .75rem; word-break: break-all; }
.inline { display: inline; }

/* ── Forms ───────────────────────────────────────────────────────── */
form label { display: block; margin: .8rem 0; font-size: .9rem; font-weight: 600; color: var(--muted); }
form input[type="email"], form input[type="password"], form input[type="text"], form input[type="number"] {
  width: 100%; max-width: 430px; margin-top: .3rem;
  background: var(--bg-2); color: var(--paper);
  border: 1px solid var(--line); border-radius: 9px; padding: .6rem .7rem; font-size: 1rem;
}
form input.small { width: 90px; }
form .helptext { display: block; font-size: .8rem; color: var(--muted); margin-top: .3rem; font-weight: 400; }
form ul.errorlist { color: #ff9c9c; list-style: none; padding: 0; margin: .3rem 0; font-size: .85rem; }
.inline-form { display: flex; gap: .8rem; align-items: end; flex-wrap: wrap; }
.inline-form label { margin: 0; }

/* ── Rarity ladder (ONE fixed ladder, everywhere) ────────────────── */
.rarity-chip {
  display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; padding: .18rem .55rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--bg-2);
}
.rarity-Common   { --rar: var(--r-common); }
.rarity-Uncommon { --rar: var(--r-uncommon); }
.rarity-Rare     { --rar: var(--r-rare); }
.rarity-Epic     { --rar: var(--r-epic); }
.rarity-Legendary{ --rar: var(--r-legendary); }
.rarity-Filler   { --rar: var(--r-filler); }
.rarity-chip.rarity-Common, .rarity-chip.rarity-Uncommon, .rarity-chip.rarity-Rare,
.rarity-chip.rarity-Epic, .rarity-chip.rarity-Legendary {
  color: var(--rar); border-color: var(--rar);
}

/* ═══ HOME ════════════════════════════════════════════════════════ */
.hero { text-align: center; padding: 2.2rem 1rem 1rem; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: .2rem 0 .4rem; font-weight: 900; letter-spacing: -.01em; }
.hero h1 .kids { color: var(--slime); }
.tagline { font-size: 1.05rem; color: var(--muted); max-width: 560px; margin: 0 auto 1.2rem; }
.pack-teaser {
  max-width: 290px; width: 100%; border-radius: 14px; border: 3px solid var(--ink);
  box-shadow: 0 18px 44px rgba(0,0,0,.6), 0 0 0 1px var(--line), 0 0 44px rgba(122,79,208,.35);
}
.hero .cta { margin-top: 1.3rem; display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }

.drop-hero {
  display: grid; grid-template-columns: 300px 1fr; gap: 2rem; align-items: center;
  background: linear-gradient(120deg, rgba(122,79,208,.28), rgba(20,16,31,.4) 55%), var(--panel);
  border: 1px solid var(--line); border-radius: 20px; padding: 1.8rem;
  box-shadow: 0 18px 44px rgba(0,0,0,.4);
}
.drop-hero .pack-art { text-align: center; }
.drop-hero .pack-art img {
  width: 100%; max-width: 260px; border-radius: 14px; border: 3px solid var(--ink);
  box-shadow: 0 16px 38px rgba(0,0,0,.6), 0 0 46px rgba(122,79,208,.45);
}
.drop-hero .drop-kicker { color: var(--slime); font-weight: 900; letter-spacing: .14em; font-size: .78rem; text-transform: uppercase; }
.drop-hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); margin: .35rem 0 .5rem; font-weight: 900; line-height: 1.05; }
.drop-hero p { color: var(--muted); margin: 0 0 1.2rem; max-width: 46ch; }
.drop-hero .hero-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: 1rem; color: var(--muted); font-size: .88rem; }
.drop-hero .hero-meta strong { color: var(--paper); }

.activity-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.activity-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.05rem 1.15rem;
}
.activity-panel h3 { margin: 0 0 .35rem; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.activity-panel .big-num { font-size: 1.7rem; font-weight: 900; }
.activity-panel p { margin: .3rem 0 0; color: var(--muted); font-size: .9rem; }
.activity-panel.grant { border-color: rgba(168,225,12,.5); background: linear-gradient(180deg, rgba(168,225,12,.12), var(--panel)); }
.activity-panel.grant .big-num { color: var(--slime); }

.home-section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 1.8rem 0 .8rem; }
.home-section-title h2 { margin: 0; font-size: 1.3rem; font-weight: 900; }
.recent-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 14px;
  overflow-x: auto; padding: .4rem .2rem 1rem; scroll-snap-type: x mandatory;
}
.recent-card { scroll-snap-align: start; text-decoration: none; color: var(--paper); position: relative; }
.rc-count {
  position: absolute; top: .45rem; right: .45rem; z-index: 2;
  background: var(--slime); color: var(--ink); border: 1.5px solid var(--ink);
  border-radius: 999px; padding: .08rem .5rem;
  font-size: .78rem; font-weight: 900; letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(0,0,0,.55);
}
.recent-card img, .recent-card video {
  width: 100%; aspect-ratio: 5/7; object-fit: cover; display: block;
  border-radius: 11px; border: 2px solid var(--ink);
  transition: transform .18s;
}
.recent-card:hover img, .recent-card:hover video { transform: translateY(-4px) scale(1.02); }
.recent-card .rc-name { font-weight: 700; font-size: .86rem; margin-top: .45rem; }
.recent-card .rc-sub { color: var(--muted); font-size: .76rem; }
.empty-state {
  border: 1.5px dashed var(--line); border-radius: 14px; padding: 1.6rem;
  text-align: center; color: var(--muted);
}

/* ═══ STORE ═══════════════════════════════════════════════════════ */
.store-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.store-balance { font-size: 1.05rem; }
.pack-panel {
  display: grid; grid-template-columns: 190px 1fr; gap: 1.5rem; align-items: start;
  margin-top: 1.4rem;
  background: linear-gradient(120deg, rgba(122,79,208,.25), transparent 55%), var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem;
}
.pack-panel img { width: 100%; border-radius: 12px; border: 3px solid var(--ink); box-shadow: 0 12px 30px rgba(0,0,0,.55); }
.pack-panel h2 { margin: .1rem 0 .3rem; }
.pack-price { font-size: 1.25rem; font-weight: 900; color: var(--gold); }
.odds-table { width: 100%; max-width: 430px; border-collapse: collapse; margin-top: .8rem; font-size: .92rem; }
.odds-table th, .odds-table td { text-align: left; padding: .38rem .5rem; border-bottom: 1px solid var(--line); }
.odds-table th { color: var(--muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.odds-table .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .5rem; background: var(--rar, var(--muted)); }
.guarantees { list-style: none; padding: 0; margin: .9rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .35rem .9rem; }
.guarantees li { color: var(--muted); font-size: .9rem; }
.guarantees li::before { content: "✓ "; color: var(--slime); font-weight: 900; }
.bundles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-top: 1.2rem; }
.bundle {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.3rem 1.1rem; text-align: center;
  transition: transform .15s, border-color .15s;
}
.bundle:hover { transform: translateY(-3px); border-color: var(--purple-hot); }
.bundle.best { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 14px 30px rgba(0,0,0,.4); }
.bundle-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #22160a; font-size: .7rem; font-weight: 900;
  letter-spacing: .07em; padding: .22rem .6rem; border-radius: 999px; text-transform: uppercase; white-space: nowrap;
}
.bundle-diamonds { font-size: 1.65rem; font-weight: 900; color: var(--gold); }
.bundle-price { font-size: 1.12rem; margin: .35rem 0 .9rem; color: var(--paper); }
.bundle .fineprint code { color: var(--muted); }

/* ═══ PACK OPENING ════════════════════════════════════════════════ */
.stage-wrap { text-align: center; }
.stage-balance { font-size: 1.05rem; color: var(--muted); }
.stage-balance strong { color: var(--paper); }
.odds-chips { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin: .9rem 0 0; }
.odds-chips .chip {
  font-size: .76rem; font-weight: 700; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: .22rem .6rem; background: var(--bg-2);
}
.odds-chips .chip b { color: var(--rar, var(--paper)); }
.pack-video-frame { display: inline-block; position: relative; }
#pack-video {
  width: min(430px, 92vw); display: block;
  border-radius: 16px; border: 3px solid var(--ink); background: #000;
  box-shadow: 0 22px 54px rgba(0,0,0,.7), 0 0 60px rgba(122,79,208,.3);
}
.video-skip { position: absolute; right: 10px; bottom: 12px; z-index: 3; }

.reveal-stage { padding-top: .4rem; }
.reveal-progress { color: var(--muted); font-size: .88rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.reveal-area {
  position: relative; height: 400px; margin-top: .6rem;
  display: flex; align-items: flex-start; justify-content: center;
  perspective: 1100px;
}
.reveal-rays {
  position: absolute; top: 44%; left: 50%; width: 560px; height: 560px;
  transform: translate(-50%, -50%); border-radius: 50%; opacity: 0; pointer-events: none;
  background: repeating-conic-gradient(rgba(255,210,63,.28) 0 10deg, transparent 10deg 22deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 68%);
  mask-image: radial-gradient(circle, #000 0%, transparent 68%);
}
.reveal-rays.on { opacity: 1; animation: rays-spin 14s linear infinite; }
@keyframes rays-spin { from { transform: translate(-50%,-50%) rotate(0deg); } to { transform: translate(-50%,-50%) rotate(360deg); } }
.reveal-card {
  position: relative; z-index: 2; width: 238px; cursor: pointer;
  transform-style: preserve-3d;
}
.reveal-card img, .reveal-card video {
  width: 100%; display: block; border-radius: 14px; border: 3px solid var(--ink);
  box-shadow: 0 24px 50px rgba(0,0,0,.65);
}
.reveal-card.enter { animation: card-in .55s cubic-bezier(.2,.9,.3,1.08); }
@keyframes card-in {
  from { transform: rotateY(82deg) scale(.8) translateY(26px); opacity: 0; }
  to   { transform: rotateY(0deg) scale(1) translateY(0); opacity: 1; }
}
.reveal-card.rarity-Uncommon img, .reveal-card.rarity-Uncommon video { box-shadow: 0 0 0 2px rgba(89,217,119,.55), 0 0 30px 4px rgba(89,217,119,.4), 0 24px 50px rgba(0,0,0,.65); }
.reveal-card.rarity-Rare img, .reveal-card.rarity-Rare video { box-shadow: 0 0 34px 7px rgba(58,134,255,.75), 0 24px 50px rgba(0,0,0,.65); }
.reveal-card.rarity-Epic img, .reveal-card.rarity-Epic video { box-shadow: 0 0 40px 9px rgba(160,107,255,.8), 0 24px 50px rgba(0,0,0,.65); }
.reveal-card.rarity-Legendary img, .reveal-card.rarity-Legendary video { box-shadow: 0 0 54px 14px rgba(255,183,0,.85), 0 24px 50px rgba(0,0,0,.65); }
.reveal-info { min-height: 86px; margin-top: .4rem; }
.reveal-info .rname { font-size: 1.3rem; font-weight: 900; }
.reveal-info .rsub { color: var(--muted); font-size: .9rem; margin-top: .15rem; }
.reveal-info .rcatch { font-style: italic; color: #e8dcbb; margin-top: .35rem; font-size: .94rem; }
.burst-bit {
  position: absolute; z-index: 4; width: 9px; height: 9px; border-radius: 2px; pointer-events: none;
  animation: burst-fly .95s cubic-bezier(.1,.7,.3,1) forwards;
}
@keyframes burst-fly {
  from { transform: translate(0,0) rotate(0deg) scale(1); opacity: 1; }
  to   { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.6); opacity: 0; }
}
.reveal-strip { display: flex; gap: 10px; justify-content: center; margin-top: .8rem; }
.strip-slot {
  width: 62px; height: 87px; border-radius: 8px; overflow: hidden; position: relative;
  border: 2px solid var(--line); background: var(--bg-2);
  transition: transform .2s, border-color .2s, opacity .2s;
}
.strip-slot img, .strip-slot video { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip-slot.unrevealed { display: flex; align-items: center; justify-content: center; color: #554a75; font-weight: 900; font-size: 1.2rem; }
.strip-slot.current { border-color: var(--paper); transform: translateY(-5px) scale(1.05); }
.strip-slot.done { opacity: .92; }
.reveal-controls { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }

.summary-grid { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.summary-card { width: 148px; text-align: center; animation: card-in .5s cubic-bezier(.2,.9,.3,1.08) backwards; }
.summary-card img, .summary-card video { width: 100%; border-radius: 11px; border: 3px solid var(--ink); display: block; }
.summary-card .nm { font-weight: 800; font-size: .85rem; margin-top: .4rem; }
.summary-card.best img, .summary-card.best video { box-shadow: 0 0 36px 8px rgba(255,183,0,.55); }
.best-pull {
  display: inline-block; margin-top: 1rem; padding: .6rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--gold); color: var(--gold); font-weight: 800; background: rgba(255,183,0,.08);
}

/* ═══ COLLECTION (binder) ═════════════════════════════════════════ */
.collection-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.collection-head h1 { margin: 0; }
.binder-tools {
  display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.1rem 0 .4rem;
}
.binder-tools input[type="search"], .binder-tools select {
  background: var(--bg-2); color: var(--paper); border: 1px solid var(--line);
  border-radius: 9px; padding: .55rem .7rem; font-size: .92rem; font-family: inherit;
}
.binder-tools input[type="search"] { flex: 1 1 210px; }
.binder-count { color: var(--muted); font-size: .85rem; margin: .4rem 0 0; }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 15px; margin-top: 1rem; }
.cardcell {
  margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; cursor: pointer; text-align: left; padding: 0; color: var(--paper);
  font-family: inherit; width: 100%; position: relative;
  transition: transform .16s, border-color .16s;
}
.cc-count {
  position: absolute; top: .5rem; right: .5rem; z-index: 2;
  background: var(--slime); color: var(--ink); border: 1.5px solid var(--ink);
  border-radius: 999px; padding: .1rem .55rem;
  font-size: .82rem; font-weight: 900; letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(0,0,0,.55);
}
.cardcell:hover { transform: translateY(-4px); border-color: var(--rar, var(--purple-hot)); }
.cardcell img, .cardcell video { width: 100%; aspect-ratio: 5/7; object-fit: cover; display: block; background: var(--bg-2); }
.cardcell figcaption { padding: .55rem .65rem .65rem; }
.cardcell .cc-name { font-weight: 800; font-size: .88rem; display: block; }
.cardcell .cc-sub { color: var(--muted); font-size: .76rem; display: block; margin-top: .15rem; }
.cardcell .cc-badges { margin-top: .4rem; display: flex; gap: .3rem; flex-wrap: wrap; }
.mini-badge { font-size: .66rem; font-weight: 800; letter-spacing: .04em; border: 1px solid var(--line); border-radius: 999px; padding: .12rem .45rem; color: var(--muted); }

/* ── Inspect Mode overlay ────────────────────────────────────────── */
.inspect-overlay {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(4, 2, 9, .86); backdrop-filter: blur(6px);
  overflow-y: auto; padding: 2.2rem 1rem 3rem;
}
.inspect-overlay.open { display: block; }
.inspect-box { max-width: 880px; margin: 0 auto; position: relative; }
.inspect-close {
  position: absolute; right: 0; top: -6px; z-index: 5;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--panel-2); color: var(--paper); border: 1px solid var(--line);
  font-size: 1.05rem; cursor: pointer;
}
.inspect-grid { display: grid; grid-template-columns: 320px 1fr; gap: 2rem; align-items: start; }
.inspect-stage { perspective: 1100px; text-align: center; }
.tilt-card {
  position: relative; width: 100%; max-width: 320px; margin: 0 auto;
  transform-style: preserve-3d; transition: transform .25s ease-out;
}
.tilt-inner { position: relative; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3,.7,.3,1); }
.tilt-card.flipped .tilt-inner { transform: rotateY(180deg); }
.tilt-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.tilt-face img, .tilt-face video { width: 100%; display: block; border-radius: 14px; border: 3px solid var(--ink); box-shadow: 0 26px 56px rgba(0,0,0,.7); }
.tilt-face.back { position: absolute; inset: 0; transform: rotateY(180deg); }
.tilt-face.back img { height: 100%; object-fit: cover; }
.tilt-shine {
  position: absolute; inset: 0; border-radius: 14px; pointer-events: none; z-index: 3;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.22), transparent 45%);
  opacity: 0; transition: opacity .2s;
}
.tilt-card:hover .tilt-shine { opacity: 1; }
.inspect-details h2 { margin: .1rem 0 .2rem; font-size: 1.7rem; font-weight: 900; }
.inspect-details .id-sub { color: var(--muted); margin-bottom: .7rem; }
.inspect-details .catch { font-style: italic; color: #e8dcbb; }
.badge-row { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0; }
.stat { margin: .65rem 0; }
.stat .lbl { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: .25rem; }
.stat .bar { height: 9px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.stat .bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .7s cubic-bezier(.2,.8,.3,1); }
.stat.trouble .bar i { background: #e63946; } .stat.power .bar i { background: #3a86ff; } .stat.hygiene .bar i { background: #2a9d8f; }

/* ═══ OWNER ═══════════════════════════════════════════════════════ */
.grid-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.grid-table th, .grid-table td { border-bottom: 1px solid var(--line); padding: .45rem .4rem; text-align: left; vertical-align: middle; }
.grid-table th { color: var(--muted); font-size: .76rem; letter-spacing: .07em; text-transform: uppercase; }
.grid-table tr:hover td { background: rgba(255,255,255,.025); }
.grid-table button { font-family: inherit; cursor: pointer; }
.grid-table .grant-btn, .grid-table .del-btn {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--paper);
  border-radius: 7px; padding: .3rem .55rem; font-size: .8rem; font-weight: 700;
}
.grid-table .del-btn { color: #ff9c9c; }
.owner-scroll { overflow-x: auto; }

/* ── Owner card manager ──────────────────────────────────────────── */
.card-thumb {
  width: 42px; height: 59px; object-fit: cover; display: block;
  border-radius: 6px; border: 2px solid var(--ink); background: var(--bg-2);
}
.card-thumb.empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .6rem; text-align: center; border: 1px dashed var(--line);
}
.status-chip {
  display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; padding: .18rem .55rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--bg-2); white-space: nowrap;
}
.status-ACTIVE { color: var(--slime); border-color: var(--slime); }
.status-CHASE { color: var(--gold); border-color: var(--gold); }
.status-RETIRED { color: #ff9c9c; border-color: #ff9c9c; }
.row-actions { white-space: nowrap; }
.row-actions .btn, .row-actions form { vertical-align: middle; }
.card-filters { margin: 1rem 0; }
.card-filters select { min-width: 150px; }
.pager { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }

form select, form textarea, form input[type="url"], form input[type="file"] {
  width: 100%; max-width: 430px; margin-top: .3rem;
  background: var(--bg-2); color: var(--paper);
  border: 1px solid var(--line); border-radius: 9px; padding: .6rem .7rem; font-size: 1rem;
  font-family: inherit;
}
form textarea { max-width: 640px; resize: vertical; }
.card-form { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 1rem; }
.form-grid label { margin: .45rem 0; }
.flag-row { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: .6rem 0 1.2rem; }
.flag-row .flag { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: 600; color: var(--paper); }
.flag-row .flag input { width: 17px; height: 17px; accent-color: var(--purple-hot); }
.art-preview-row { display: flex; gap: 1.4rem; margin: 1rem 0 .4rem; }
.art-preview-row figure { margin: 0; text-align: center; }
.art-preview-row figcaption { color: var(--muted); font-size: .8rem; margin-top: .35rem; }
.art-preview {
  width: 150px; aspect-ratio: 5/7; object-fit: cover; display: block;
  border-radius: 11px; border: 2px solid var(--ink); background: var(--bg-2);
}
.art-preview.empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .8rem; border: 1.5px dashed var(--line);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .drop-hero { grid-template-columns: 1fr; text-align: center; gap: 1.1rem; }
  .drop-hero p { margin-inline: auto; }
  .drop-hero .hero-meta { justify-content: center; }
  .activity-row { grid-template-columns: 1fr; }
  .pack-panel { grid-template-columns: 1fr; }
  .pack-panel img { max-width: 210px; margin: 0 auto; display: block; }
  .inspect-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .topnav { display: none; }
  .topnav-anon { display: flex; }
  .account-email { display: none; }
  .bottomnav { display: flex; }
  body { padding-bottom: 64px; }
  .brand-name { font-size: .95rem; }
  .reveal-area { height: 356px; }
  .reveal-card { width: 205px; }
  .reveal-rays { width: 430px; height: 430px; }
}
/* ── Series packs (picker, pack visuals, progression) ─────────────────── */
.series-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px; margin-top: 1.1rem;
}
.series-pack {
  --series-hue: 265;
  display: flex; flex-direction: column; align-items: stretch; gap: .35rem;
  background: var(--panel-2); border: 2px solid var(--line); border-radius: 16px;
  padding: .7rem; cursor: pointer; text-align: left; color: var(--paper);
  font: inherit; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.series-pack:hover { transform: translateY(-2px); }
.series-pack.selected {
  border-color: hsl(var(--series-hue) 85% 65%);
  box-shadow: 0 0 0 1px hsl(var(--series-hue) 85% 65%), 0 10px 30px rgba(0,0,0,.45),
              0 0 34px hsla(var(--series-hue) 90% 60% / .35);
}
.series-pack.locked { opacity: .55; cursor: not-allowed; }
.series-pack.locked:hover { transform: none; }
.series-pack-visual { position: relative; display: block; border-radius: 10px; overflow: hidden; }
.series-pack-visual img {
  display: block; width: 100%; border-radius: 10px;
  filter: hue-rotate(calc((var(--series-hue) - 265) * 1deg)) saturate(1.15);
}
.pack-banner {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: hsl(var(--series-hue, 265) 70% 32% / .92);
  color: #fff; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  font-size: .78rem; padding: .28rem .5rem; text-align: center;
}
.pack-banner.big { font-size: 1.05rem; padding: .5rem; }
.series-pack-name { font-weight: 800; font-size: 1.02rem; }
.series-pack-meta { color: var(--muted); font-size: .82rem; }
.series-pack-state { font-size: .82rem; }
.series-pack-state.locked-note { color: var(--muted); line-height: 1.35; }
.progress {
  display: block; height: 8px; border-radius: 99px; background: #241b3d; overflow: hidden;
}
.progress i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--purple), var(--slime));
}
.pack-visual {
  position: relative; display: inline-block; border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 44px rgba(0,0,0,.6), 0 0 0 1px var(--line),
              0 0 44px hsla(var(--series-hue, 265) 90% 60% / .35);
}
.pack-visual .pack-teaser {
  display: block; border: none; box-shadow: none; border-radius: 0;
  filter: hue-rotate(calc((var(--series-hue, 265) - 265) * 1deg)) saturate(1.15);
}
.pack-visual .pack-banner { font-size: 1.05rem; }

/* ── Collection series sections ───────────────────────────────────────── */
.collection-section { margin-top: 1.6rem; }
.series-section-head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.series-section-head h2 { margin: 0; font-size: 1.35rem; }
.series-section-progress { color: var(--muted); font-size: .9rem; }
.series-section-head .progress { flex: 0 0 130px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
