:root {
  --bg: #0b0a14;
  --bg-2: #13111f;
  --panel: #181527;
  --panel-2: #211d33;
  --line: #2e2945;
  --text: #f1eefb;
  --muted: #9a93b5;
  --accent: #ff3d7f;
  --accent-2: #7c5cff;
  --gold: #fbbf24;
  --ok: #4ade80;
  --danger: #f43f5e;
  --radius: 16px;
  --font: 'Outfit', system-ui, sans-serif;
  --display: 'Dela Gothic One', 'Outfit', sans-serif;

  --r-C: #9aa4b2;
  --r-U: #4ade80;
  --r-R: #38bdf8;
  --r-E: #c084fc;
  --r-L: #fbbf24;
  --r-M: #f43f5e;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(124, 92, 255, .18), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(255, 61, 127, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
.muted { color: var(--muted); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 12px max(16px, calc((100vw - 1240px) / 2));
  background: rgba(11, 10, 20, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-kana {
  display: grid; place-items: center;
  width: 38px; height: 46px; border-radius: 8px;
  font-family: var(--display); font-size: 22px; color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: 0 0 18px rgba(255, 61, 127, .45), inset 0 0 12px rgba(255, 61, 127, .25);
  transform: rotate(-6deg);
}
.logo-text { font-family: var(--display); font-size: 22px; letter-spacing: .02em; display: flex; flex-direction: column; line-height: .95; }
.logo-text small { font-family: var(--font); font-weight: 600; font-size: 11px; letter-spacing: .4em; color: var(--muted); text-transform: uppercase; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; transition: .2s; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.coins {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); font-weight: 700;
}
.coin { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold) 45%, #b7791f); box-shadow: 0 0 8px rgba(251, 191, 36, .5); flex: none; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* ---------- Mobile tabbar ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  .nav { display: none; }
  .topbar { gap: 12px; }
  .logo-text small { display: none; }
  .user-chip .name { display: none; }
  .user-chip { padding: 4px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: rgba(11, 10, 20, .92); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; font-size: 11px; color: var(--muted); font-weight: 600; }
  .tabbar a span { font-family: var(--display); font-size: 18px; }
  .tabbar a.active { color: var(--accent); }
  .app { padding-bottom: 90px !important; }
}

/* ---------- Layout ---------- */
.app { max-width: 1240px; margin: 0 auto; padding: 28px 16px 60px; }
.section { margin-top: 44px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--display); font-size: clamp(22px, 3vw, 30px); font-weight: 400; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .25em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; display: block; }
.panel { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; border: 0;
  font-weight: 700; letter-spacing: .01em;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .15s, filter .15s, box-shadow .15s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #ff7a59); box-shadow: 0 8px 24px rgba(255, 61, 127, .35); color: #fff; }
.btn-violet { background: linear-gradient(135deg, var(--accent-2), #4f46e5); box-shadow: 0 8px 24px rgba(124, 92, 255, .3); color: #fff; }
.btn-gold { background: linear-gradient(135deg, #fde68a, var(--gold) 50%, #d97706); color: #2a1a00; box-shadow: 0 8px 24px rgba(251, 191, 36, .3); }
.btn-ice { background: linear-gradient(135deg, #a5f3fc, #0ea5e9 55%, #1d4ed8); color: #04122b; box-shadow: 0 8px 24px rgba(14, 165, 233, .3); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn-lg { padding: 16px 28px; font-size: 17px; border-radius: 14px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 24px;
  padding: 44px; border-radius: 24px;
  background:
    radial-gradient(600px 300px at 80% 50%, rgba(255, 61, 127, .22), transparent 70%),
    linear-gradient(135deg, #1a1530, #0f0d1c);
  border: 1px solid var(--line);
}
.hero::before {
  content: 'コレクション'; position: absolute; right: -20px; bottom: -30px;
  font-family: var(--display); font-size: 140px; color: rgba(255, 255, 255, .03); white-space: nowrap; pointer-events: none;
}
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 5.4vw, 62px); letter-spacing: -.01em; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), #ffb86b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 18px; color: var(--muted); max-width: 46ch; margin: 18px 0 26px; line-height: 1.5; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-fan { position: relative; height: 380px; }
.hero-fan .card { position: absolute; left: 50%; top: 50%; width: 190px; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.hero-fan .card:nth-child(1) { transform: translate(-50%, -50%) translateX(-150px) rotate(-16deg) scale(.86); }
.hero-fan .card:nth-child(2) { transform: translate(-50%, -50%) translateX(-75px) rotate(-8deg) scale(.93); }
.hero-fan .card:nth-child(3) { transform: translate(-50%, -50%) scale(1.04); z-index: 3; }
.hero-fan .card:nth-child(4) { transform: translate(-50%, -50%) translateX(75px) rotate(8deg) scale(.93); z-index: 2; }
.hero-fan .card:nth-child(5) { transform: translate(-50%, -50%) translateX(150px) rotate(16deg) scale(.86); z-index: 1; }
.hero-fan:hover .card:nth-child(1) { transform: translate(-50%, -50%) translateX(-190px) rotate(-20deg) scale(.86); }
.hero-fan:hover .card:nth-child(5) { transform: translate(-50%, -50%) translateX(190px) rotate(20deg) scale(.86); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 28px 22px; }
  .hero-fan { height: 280px; }
  .hero-fan .card { width: 140px; }
}
@media (max-width: 480px) {
  .hero-fan .card:nth-child(1), .hero-fan .card:nth-child(5) { display: none; }
}

/* ---------- Stats tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.tile .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile .value { font-size: 28px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tile.action { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }

.pips { display: flex; gap: 6px; margin-top: 10px; }
.pip { width: 26px; height: 34px; border-radius: 6px; border: 2px solid var(--accent); background: linear-gradient(135deg, var(--accent), #ff7a59); box-shadow: 0 0 10px rgba(255, 61, 127, .5); }
.pip.used { background: transparent; border-color: var(--line); box-shadow: none; }

.progress { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .6s; }

/* ---------- Rarity legend ---------- */
.rarities { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 860px) { .rarities { grid-template-columns: repeat(3, 1fr); } }
.rarity-chip { padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); position: relative; overflow: hidden; }
.rarity-chip::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--rc); box-shadow: 0 0 14px var(--rc); }
.rarity-chip b { display: block; color: var(--rc); font-size: 15px; }
.rarity-chip span { font-size: 13px; color: var(--muted); }
.gem { display: inline-block; width: 10px; height: 10px; transform: rotate(45deg); background: var(--rc); box-shadow: 0 0 8px var(--rc); border-radius: 2px; }

/* ---------- Feed ---------- */
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.feed-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.feed-row img { width: 40px; height: 56px; object-fit: cover; border-radius: 6px; border: 2px solid var(--rc); }
.feed-row .who { font-weight: 700; }
.feed-row .what { font-size: 14px; color: var(--muted); }
.feed-row .what b { color: var(--rc); }
.feed-row time { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

.how { display: flex; flex-direction: column; gap: 14px; }
.how > div { display: flex; gap: 14px; align-items: flex-start; }
.how b { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-weight: 800; }
.how p { margin: 4px 0 0; color: var(--muted); line-height: 1.45; }
.how strong { color: var(--text); }

.house-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: 18px; font-weight: 800; }
.house-title:first-of-type { margin-top: 4px; }
.house-title span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--hc); background: color-mix(in srgb, var(--hc) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hc) 45%, transparent); }

/* ---------- Characters ---------- */
.characters { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .characters { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.char-card { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); display: block; }
.char-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.char-card:hover img { transform: scale(1.06); }
.char-card .overlay { position: absolute; inset: auto 0 0; padding: 40px 14px 14px; background: linear-gradient(transparent, rgba(0, 0, 0, .9)); }
.char-card .overlay b { display: block; font-size: 17px; }
.char-card .overlay span { font-size: 12px; color: var(--muted); }
.char-card .overlay .progress { margin-top: 8px; height: 6px; }

/* ---------- Card ---------- */
.card {
  --rc: var(--r-C);
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg;
  position: relative; aspect-ratio: 5 / 7; border-radius: 14px;
  background: #0c0b14;
  padding: 7px;
  box-shadow: 0 0 0 2px var(--rc), 0 12px 30px rgba(0, 0, 0, .5);
  user-select: none;
}
.card[data-rarity=U] { --rc: var(--r-U); }
.card[data-rarity=R] { --rc: var(--r-R); }
.card[data-rarity=E] { --rc: var(--r-E); }
.card[data-rarity=L] { --rc: var(--r-L); }
.card[data-rarity=M] { --rc: var(--r-M); }
.card[data-rarity=E], .card[data-rarity=L] { box-shadow: 0 0 0 2px var(--rc), 0 0 22px color-mix(in srgb, var(--rc) 55%, transparent), 0 12px 30px rgba(0, 0, 0, .5); }
.card[data-rarity=M] {
  box-shadow: 0 0 26px rgba(244, 63, 94, .6), 0 12px 30px rgba(0, 0, 0, .5);
  background: conic-gradient(from var(--spin, 0deg), #f43f5e, #fbbf24, #4ade80, #38bdf8, #c084fc, #f43f5e);
  animation: spin 4s linear infinite;
}
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --spin: 360deg; } }
.card-inner { position: relative; width: 100%; height: 100%; border-radius: 9px; overflow: hidden; background: #000; }
.card-inner img { width: 100%; height: 100%; object-fit: cover; }
.card-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: linear-gradient(rgba(0, 0, 0, .75), transparent);
}
.card-top .gem { width: 9px; height: 9px; }
.card-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 9px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .92) 45%); }
.card-bottom .title { font-weight: 800; font-size: 13px; line-height: 1.15; }
.card-bottom .meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 3px; }
.card-bottom .char { font-size: 10.5px; color: var(--rc); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card-bottom .rar { flex: none; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: var(--rc); color: #0b0a14; text-transform: uppercase; letter-spacing: .05em; }
.card .holo { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; mix-blend-mode: color-dodge; opacity: 0; transition: opacity .3s; }
.card[data-rarity=R] .holo, .card[data-rarity=E] .holo, .card[data-rarity=L] .holo, .card[data-rarity=M] .holo {
  opacity: .35;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .55), transparent 40%),
    repeating-linear-gradient(115deg, transparent 0 8%, rgba(255, 80, 180, .25) 12%, rgba(80, 220, 255, .25) 16%, transparent 20% 28%);
  background-size: 100% 100%, 300% 300%;
  background-position: center, var(--mx) var(--my);
}
.card[data-rarity=M] .holo, .card[data-rarity=L] .holo { opacity: .5; }

/* Small cards in grids — scale text */
.card.sm .card-bottom .title { font-size: 11px; }
.card.sm .card-bottom .rar { display: none; }
.card.sm .card-top { font-size: 8.5px; }

.card.missing { box-shadow: 0 0 0 2px var(--line); background: var(--bg-2); animation: none; }
.card.missing .card-inner img { filter: grayscale(1) brightness(.18) blur(2px); }
.card.missing .holo { display: none; }
.card.missing .card-bottom .char { color: var(--muted); }
.card .lock { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 42px; color: rgba(255, 255, 255, .25); }
.card .count { position: absolute; top: -8px; right: -8px; z-index: 2; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--accent); box-shadow: 0 0 0 3px var(--bg); }

.tilt { transition: transform .12s ease-out; transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); }

/* ---------- Collection ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 14px; color: var(--muted); }
.chip.on { color: var(--text); background: var(--panel-2); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.select { padding: 9px 12px; border-radius: 10px; background: var(--panel); color: var(--text); border: 1px solid var(--line); font: inherit; font-weight: 600; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 18px; }
@media (max-width: 480px) { .card-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; } }
.card-grid .card { cursor: pointer; transition: transform .2s; }
.card-grid .card:hover { transform: translateY(-6px) rotate(-1deg); }
.sets-box { margin-bottom: 22px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.sets-box summary { cursor: pointer; padding: 14px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; list-style: none; }
.sets-box summary::-webkit-details-marker { display: none; }
.sets-box summary::before { content: '▸'; color: var(--muted); transition: transform .2s; }
.sets-box[open] summary::before { transform: rotate(90deg); }
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 0 14px 14px; max-height: 420px; overflow: auto; }
.set.ready { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.set-head a:hover { color: var(--accent); }
.set { padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.set-head { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.set .btn { margin-top: 2px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- Boosters ---------- */
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
@media (max-width: 640px) { .packs { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }
.pack-offer { min-width: 0; }
.pack-offer .select { width: 100%; min-width: 0; }
.pack-offer { display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: 22px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); }
.pack-offer h3 { font-size: 20px; font-weight: 800; }
.pack-offer p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.odds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; font-size: 12.5px; }
.odds div { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; background: var(--bg); }
.odds div b { margin-left: auto; font-variant-numeric: tabular-nums; }
.pack-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; flex-wrap: wrap; }
.price { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 18px; }
.free-badge { padding: 4px 10px; border-radius: 999px; background: rgba(74, 222, 128, .15); color: var(--ok); font-weight: 700; font-size: 13px; }

.pack {
  --p1: #ff3d7f; --p2: #7c5cff;
  position: relative; width: 190px; aspect-ratio: 5 / 8; margin: 6px auto 0;
  border-radius: 12px 12px 16px 16px; overflow: hidden;
  background: linear-gradient(160deg, var(--p1), var(--p2));
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(255, 255, 255, .15);
  transition: transform .3s;
}
.pack-offer:hover .pack { transform: translateY(-6px) rotate(-2deg); }
.pack.theme { --p1: #fde68a; --p2: #b45309; }
.pack.premium { --p1: #c084fc; --p2: #3b0764; }
.pack.cold { --p1: #e0f2fe; --p2: #0369a1; }
.pack .art { position: absolute; inset: 16% 10% 22%; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 3px rgba(255, 255, 255, .7); }
.pack .art img { width: 100%; height: 100%; object-fit: cover; }
.pack .crimp { position: absolute; left: 0; right: 0; height: 14px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .45) 0 4px, rgba(0, 0, 0, .15) 4px 8px); }
.pack .crimp.top { top: 0; }
.pack .crimp.bot { bottom: 0; }
.pack .name { position: absolute; left: 0; right: 0; bottom: 5%; padding: 0 10px; text-align: center; font-family: var(--display); font-size: 15px; line-height: 1.05; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.pack .brand { position: absolute; left: 0; right: 0; top: 6%; text-align: center; font-weight: 800; font-size: 11px; letter-spacing: .35em; color: rgba(255, 255, 255, .9); }
.pack .shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 45%, transparent 60%); background-size: 250% 100%; animation: shine 3.5s ease-in-out infinite; }
@keyframes shine { 0% { background-position: 150% 0; } 60%, 100% { background-position: -100% 0; } }

/* ---------- Opening overlay ---------- */
.overlay-open {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 26px;
  padding: 24px 16px;
  background: radial-gradient(circle at 50% 45%, rgba(124, 92, 255, .3), rgba(5, 4, 10, .97) 60%);
  backdrop-filter: blur(6px);
  animation: fade .3s;
  overflow: auto;
}
@keyframes fade { from { opacity: 0; } }
.overlay-open .hint { color: var(--muted); font-weight: 600; letter-spacing: .05em; text-align: center; }
.overlay-open .pack { width: 230px; cursor: pointer; animation: float 2.4s ease-in-out infinite; }
.overlay-open .pack.shake { animation: shake .5s ease-in-out infinite; }
.overlay-open .pack.burst { animation: burst .55s forwards; }
@keyframes float { 50% { transform: translateY(-12px) rotate(1.5deg); } }
@keyframes shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-4deg) scale(1.03); } 40% { transform: rotate(4deg) scale(1.05); } 60% { transform: rotate(-3deg) scale(1.07); } 80% { transform: rotate(3deg) scale(1.08); } }
@keyframes burst { to { transform: scale(1.5); opacity: 0; filter: brightness(3); } }

.reveal { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; max-width: 1100px; perspective: 1200px; }
.flip { width: 180px; aspect-ratio: 5 / 7; position: relative; cursor: pointer; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2, .8, .2, 1); animation: deal .5s backwards; }
@keyframes deal { from { transform: translateY(80px) scale(.6); opacity: 0; } }
.flip.flipped { transform: rotateY(180deg); cursor: default; }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .face.front { transform: rotateY(180deg); visibility: hidden; transition: visibility 0s linear .22s; }
.flip .face.back { transition: visibility 0s linear .22s; }
.flip.flipped .face.front { visibility: visible; }
.flip.flipped .face.back { visibility: hidden; }
.flip .face.front .card { width: 100%; height: 100%; }
.card-back {
  width: 100%; height: 100%; border-radius: 14px;
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 10px, transparent 10px 20px),
    linear-gradient(160deg, #2a1d4f, #120e24);
  box-shadow: 0 0 0 2px #3b2f6b, 0 12px 30px rgba(0, 0, 0, .5);
  font-family: var(--display); font-size: 54px; color: var(--accent);
  text-shadow: 0 0 20px rgba(255, 61, 127, .6);
}
.flip[data-tease=E] .card-back { box-shadow: 0 0 0 2px var(--r-E), 0 0 30px var(--r-E); }
.flip[data-tease=L] .card-back { box-shadow: 0 0 0 2px var(--r-L), 0 0 36px var(--r-L); animation: pulse 1s infinite; }
.flip[data-tease=M] .card-back { box-shadow: 0 0 0 2px var(--r-M), 0 0 44px var(--r-M); animation: pulse .7s infinite; }
@keyframes pulse { 50% { filter: brightness(1.5); } }
.flip:not(.flipped):hover { transform: translateY(-8px); }
.new-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%) rotateY(180deg); z-index: 3; padding: 3px 10px; border-radius: 999px; background: var(--ok); color: #052e12; font-weight: 800; font-size: 12px; letter-spacing: .08em; backface-visibility: hidden; }
.reveal-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 640px) { .flip { width: calc(50vw - 28px); } .reveal { gap: 12px; } }

.flash { position: fixed; inset: 0; pointer-events: none; z-index: 210; animation: flash .8s forwards; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }
.particle { position: fixed; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; z-index: 211; animation: particle 1s ease-out forwards; }
@keyframes particle { to { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0; } }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; background: rgba(5, 4, 10, .75); backdrop-filter: blur(6px); animation: fade .2s; }
.modal { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); position: relative; }
.modal.wide { width: min(820px, 100%); }
.modal-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--panel-2); font-size: 18px; }
.modal h2 { font-family: var(--display); font-weight: 400; font-size: 26px; margin-bottom: 4px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); margin: 18px 0; }
.tabs button { padding: 10px; border-radius: 9px; border: 0; background: transparent; font-weight: 700; color: var(--muted); }
.tabs button.on { background: var(--panel-2); color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input { padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.field input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.form-error { color: var(--danger); font-size: 14px; min-height: 20px; margin-bottom: 8px; }
.card-detail { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.card-detail .card { width: 100%; }
@media (max-width: 680px) { .card-detail { grid-template-columns: 1fr; } .card-detail .card { max-width: 260px; margin: 0 auto; } }
.detail-meta { display: flex; flex-direction: column; gap: 14px; }
.detail-meta dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.detail-meta dt { color: var(--muted); font-size: 14px; }
.detail-meta dd { margin: 0; font-weight: 700; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Leaderboard ---------- */
.board { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.board td, .board th { padding: 12px 14px; text-align: left; }
.board th { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.board tbody tr { background: var(--panel); }
.board tbody td:first-child { border-radius: 12px 0 0 12px; width: 60px; font-weight: 800; font-size: 18px; }
.board tbody td:last-child { border-radius: 0 12px 12px 0; }
.board tbody tr.me { box-shadow: 0 0 0 1px var(--accent) inset; background: var(--panel-2); }
.board .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.podium-1 { color: var(--gold); } .podium-2 { color: #cbd5e1; } .podium-3 { color: #f59e0b; }
.player { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.player:hover { color: var(--accent); }
@media (max-width: 560px) { .board .hide-sm { display: none; } }

/* ---------- Profile ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-head .avatar { width: 72px; height: 72px; font-size: 30px; }
.profile-head h1 { font-family: var(--display); font-weight: 400; font-size: 34px; }
.showcase { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 20px; justify-content: center; padding: 26px; border-radius: 22px; background: radial-gradient(circle at 50% 0, rgba(124, 92, 255, .25), transparent 70%), var(--bg-2); border: 1px solid var(--line); }
.showcase .slot { aspect-ratio: 5 / 7; border-radius: 14px; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }
@media (max-width: 560px) { .showcase { gap: 10px; padding: 14px; } }
.history { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; }
.history .h { position: relative; }
.history img { width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 8px; border: 2px solid var(--rc); }
.history .h .n { position: absolute; top: 3px; left: 3px; font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 6px; background: var(--ok); color: #052e12; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 300; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
@media (max-width: 760px) { .toasts { bottom: 86px; } }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); font-weight: 600; animation: toast .3s; }
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--ok); }
@keyframes toast { from { transform: translateY(16px); opacity: 0; } }

.countdown { font-variant-numeric: tabular-nums; }
.login-cta { text-align: center; padding: 48px 20px; }
.login-cta h2 { font-family: var(--display); font-weight: 400; margin-bottom: 10px; }
.login-cta p { color: var(--muted); margin-bottom: 20px; }

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