/* ============================================================
   ILTA Web — Hextech/VOID theme (violet & gold)
   ============================================================ */

:root {
  --bg-0: #050308;
  --bg-1: #0a0714;
  --bg-2: #0d0a18;
  --panel: #100c1e;
  --panel-edge: rgba(200, 170, 110, .28);
  --panel-edge-soft: rgba(200, 170, 110, .14);
  --gold: #c8aa6e;
  --gold-bright: #f0e6d2;
  --gold-dim: #785a28;
  --violet: #a86bff;
  --violet-deep: #6d3df0;
  --gem-blue: #4f8dff;
  --text: #cfc6dd;
  --muted: #8d84a5;

  --r-common:    #95a5a6;
  --r-rare:      #3498db;
  --r-epic:      #9b59b6;
  --r-legendary: #f1c40f;
  --r-mythic:    #ff4d6d;
  --r-prestige:  #ffd700;
  --r-ultimate:  #00e5ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(109, 61, 240, .16) 0%, transparent 55%),
    radial-gradient(900px 500px at 15% 20%, rgba(79, 141, 255, .08) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-0) 0%, #030206 100%);
  color: var(--text);
  font-family: "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* fixed art backdrop under everything — heavy cinematic vignette */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(5, 3, 8, .82) 0%, rgba(3, 2, 6, .94) 58%, #030206 100%),
    url("/backgrounds/menu.png") center top / cover no-repeat;
}

h1, h2, .brand, .stat-num {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: .1em;
}
h1, .page-title { text-transform: uppercase; }
a { color: var(--gold); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: Consolas, monospace; }
.gold-text { color: var(--gold-bright); }
.blue-text { color: var(--r-rare); }

/* ornate gold frame with corner brackets */
.frame {
  position: relative;
  border: 1px solid var(--panel-edge);
  background: linear-gradient(180deg, rgba(13, 10, 24, .92), rgba(7, 5, 12, .95));
}
.frame::before, .frame::after {
  content: ""; position: absolute; width: 26px; height: 26px;
  border-color: var(--gold); border-style: solid; pointer-events: none;
}
.frame::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.frame::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.collection-head {
  display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.mini-stats { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; }
.mini-stats b { color: var(--gold-bright); }

/* ---------- top navigation ---------- */
.topnav {
  display: flex; align-items: center; gap: 22px;
  padding: 12px 28px;
  background: linear-gradient(180deg, rgba(8, 6, 14, .97), rgba(5, 3, 9, .94));
  border-bottom: 1px solid var(--panel-edge);
  box-shadow: 0 2px 30px rgba(0, 0, 0, .7);
  position: sticky; top: 0; z-index: 50;
}
.topnav a {
  color: var(--muted); letter-spacing: .16em; text-transform: uppercase;
  font-size: .82rem;
}
.topnav a:hover { color: var(--gold-bright); text-shadow: 0 0 12px rgba(200,170,110,.45); }
.brand {
  font-size: 1.3rem; letter-spacing: .22em; color: var(--gold) !important;
  text-shadow: 0 0 18px rgba(200, 170, 110, .4);
}
.spacer { flex: 1; }
.nav-ava { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--gold-dim); }

.container { flex: 1; width: min(1180px, 94%); margin: 0 auto; padding: 30px 0 60px; }

.footer {
  padding: 14px; text-align: center; font-size: .8rem; color: var(--muted);
  border-top: 1px solid var(--panel-edge);
  background: rgba(14, 10, 30, .6);
}

/* ---------- buttons ---------- */
.btn-gold, .btn-outline {
  display: inline-block; padding: 10px 24px; border-radius: 2px;
  letter-spacing: .12em; text-transform: uppercase; font-size: .82rem;
  cursor: pointer; transition: all .15s ease;
}
.btn-gold {
  background: linear-gradient(180deg, rgba(200, 170, 110, .22), rgba(120, 90, 40, .28));
  color: var(--gold-bright) !important;
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 18px rgba(200, 170, 110, .08), 0 4px 20px rgba(0, 0, 0, .55);
}
.btn-gold:hover {
  filter: brightness(1.25);
  box-shadow: inset 0 0 24px rgba(200,170,110,.16), 0 0 22px rgba(200,170,110,.35);
}
.btn-gold:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-outline {
  background: rgba(13, 10, 24, .6); color: var(--gold) !important;
  border: 1px solid var(--panel-edge);
}
.btn-outline:hover {
  border-color: var(--gold); color: var(--gold-bright) !important;
  box-shadow: 0 0 16px rgba(200, 170, 110, .25);
}
.btn-lg { padding: 13px 34px; font-size: 1.05rem; }
.btn-sm { padding: 6px 14px; font-size: .74rem; }

/* ---------- hero / home ---------- */
.hero { text-align: center; padding: 60px 0 40px; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem); margin: 0; color: var(--gold-bright);
  letter-spacing: .12em;
  text-shadow: 0 0 24px rgba(168,107,255,.55), 0 0 60px rgba(109,61,240,.35);
}
.hero h1 span { display: block; font-size: .45em; color: var(--text); letter-spacing: .05em; margin-top: 8px; }
.hero .lead { max-width: 560px; margin: 18px auto 30px; line-height: 1.55; }
.hero .btn-gold, .hero .btn-outline { margin: 0 8px; }

.stat-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 26px 0; }
.stat-row.tight { justify-content: flex-start; margin: 10px 0 20px; }
.stat-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--panel-edge); border-top: 2px solid var(--violet-deep);
  padding: 16px 26px; min-width: 150px; text-align: center; border-radius: 4px;
  box-shadow: 0 4px 22px rgba(0,0,0,.35);
}
.stat-num { font-size: 1.6rem; color: var(--gold-bright); }
.stat-num.gold { color: var(--gold); }
.stat-num.blue { color: var(--r-rare); }
.stat-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: 4px; }

.rarity-showcase { text-align: center; padding: 12px 0 40px; }
.chip {
  display: inline-block; margin: 4px; padding: 4px 14px; font-size: .8rem;
  letter-spacing: .06em; border-radius: 2px;
  background: var(--bg-2); border: 1px solid currentColor;
}

/* rarity chips/text/borders */
.r-common,    .chip-r-common    { color: var(--r-common); }
.r-rare,      .chip-r-rare      { color: var(--r-rare); }
.r-epic,      .chip-r-epic      { color: var(--r-epic); }
.r-legendary, .chip-r-legendary { color: var(--r-legendary); }
.r-mythic,    .chip-r-mythic    { color: var(--r-mythic); }
.r-prestige,  .chip-r-prestige  { color: var(--r-prestige); }
.r-ultimate,  .chip-r-ultimate  { color: var(--r-ultimate); }

/* ---------- codex filters ---------- */
.page-title { color: var(--gold-bright); letter-spacing: .08em; }
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 16px; margin-bottom: 14px;
  background: rgba(23, 16, 52, .82); border: 1px solid var(--panel-edge); border-radius: 4px;
}
.filters input[type=text] {
  flex: 1 1 240px; padding: 9px 12px;
  background: var(--bg-2); color: var(--gold-bright);
  border: 1px solid #3a2a6b; border-radius: 3px; outline: none;
}
.filters input[type=text]:focus { border-color: var(--violet); box-shadow: 0 0 10px rgba(168,107,255,.3); }
.filters select {
  padding: 9px; background: var(--bg-2); color: var(--text);
  border: 1px solid #3a2a6b; border-radius: 3px;
}

/* ---------- card grid & tiles ---------- */
.card-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.card-row {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  margin-bottom: 30px;
}
.owned-wrap { position: relative; }
.own-badge {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  background: rgba(9,16,25,.85); color: var(--gold-bright);
  border: 1px solid var(--gold-dim); border-radius: 3px;
  font-size: .75rem; padding: 2px 7px;
}

.card-tile {
  position: relative; display: block; overflow: hidden; border-radius: 6px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--panel-edge);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card-tile .tile-img {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block;
  transition: transform .25s ease;
}
.card-tile:hover { transform: translateY(-5px) scale(1.02); z-index: 2; }
.card-tile:hover .tile-img { transform: scale(1.04); }
.card-tile.r-common:hover    { box-shadow: 0 10px 26px rgba(149,165,166,.28), inset 0 0 0 1px var(--r-common); }
.card-tile.r-rare:hover      { box-shadow: 0 10px 26px rgba(52,152,219,.34), inset 0 0 0 1px var(--r-rare); }
.card-tile.r-epic:hover      { box-shadow: 0 10px 26px rgba(155,89,182,.38), inset 0 0 0 1px var(--r-epic); }
.card-tile.r-legendary:hover { box-shadow: 0 10px 26px rgba(241,196,15,.36), inset 0 0 0 1px var(--r-legendary); }
.card-tile.r-mythic:hover    { box-shadow: 0 10px 26px rgba(255,77,109,.4), inset 0 0 0 1px var(--r-mythic); }
.card-tile.r-prestige:hover  { box-shadow: 0 10px 26px rgba(255,215,0,.42), inset 0 0 0 1px var(--r-prestige); }
.card-tile.r-ultimate:hover  { box-shadow: 0 10px 26px rgba(0,229,255,.42), inset 0 0 0 1px var(--r-ultimate); }

.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 26px; }

/* ---------- card detail ---------- */
.detail-shell {
  display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 34px;
  padding: 28px; border-radius: 8px;
  background: linear-gradient(180deg, rgba(23,16,52,.92), rgba(14,10,30,.94));
  border: 1px solid var(--panel-edge);
}
.r-border-epic      { box-shadow: inset 0 0 0 2px rgba(155,89,182,.35); }
.r-border-legendary { box-shadow: inset 0 0 0 2px rgba(241,196,15,.4); }
.r-border-mythic    { box-shadow: inset 0 0 0 2px rgba(255,77,109,.4); }
.r-border-prestige  { box-shadow: inset 0 0 0 2px rgba(255,215,0,.45), 0 0 30px rgba(255,215,0,.15); }
.r-border-ultimate  { box-shadow: inset 0 0 0 2px rgba(0,229,255,.45), 0 0 30px rgba(0,229,255,.18); }

.detail-art .tilt { position: relative; perspective: 800px; }
.art-img {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block;
  border-radius: 6px; transform-style: preserve-3d;
  transition: transform .12s ease-out;
}
.art-img.noimg { background: linear-gradient(160deg,#1d1436,#0a1626); }
.holo {
  pointer-events: none; position: absolute; inset: 0; border-radius: 5px;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.14) 46%,
              rgba(200,230,255,.22) 50%, rgba(255,255,255,.12) 54%, transparent 70%);
  mix-blend-mode: overlay; opacity: 0; transition: opacity .2s;
}
.tilt:hover .holo { opacity: 1; }
.detail-art .chip { margin-top: 10px; }

.skin-name { color: var(--gold); font-weight: 400; margin: 4px 0 18px; }
.stat-trio { display: flex; gap: 12px; margin: 14px 0; }
.stat-pill {
  padding: 8px 18px; border-radius: 3px; font-size: 1.1rem;
  background: var(--bg-2); border: 1px solid #26436a; color: var(--gold-bright);
}
.stat-pill.atk { border-color: rgba(229,57,53,.5); }
.stat-pill.def { border-color: rgba(52,152,219,.5); }
.stat-pill.hp  { border-color: rgba(46,204,113,.5); }
.owned-line { color: var(--gold-bright); }

.ability-block {
  margin: 20px 0; padding: 16px 20px; border-left: 3px solid var(--gold);
  background: rgba(200,170,110,.06);
}
.ab-title { font-size: .78rem; letter-spacing: .22em; color: var(--gold); }
.ab-name { font-size: 1.2rem; color: var(--gold-bright); margin: 6px 0; font-family: Georgia, serif; }
.ab-desc { line-height: 1.6; margin: 6px 0; }

.quote {
  margin: 20px 0; padding: 14px 20px; font-style: italic; line-height: 1.6;
  border-left: 3px solid #26436a; color: #b9c4d0; background: rgba(38,67,106,.08);
}
.lore-block { margin-top: 18px; }
.sec-label { font-size: .76rem; letter-spacing: .2em; color: var(--muted); margin-bottom: 6px; }
.sec-title { color: var(--gold-bright); margin: 34px 0 14px; letter-spacing: .06em; }
.back-link { margin-top: 26px; }

/* ---------- profile ---------- */
.profile-head { display: flex; gap: 22px; align-items: center; margin-bottom: 8px; }
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  border: 3px solid var(--gold-dim);
  box-shadow: 0 0 0 2px var(--bg-0), 0 0 22px rgba(200,170,110,.3);
}
.profile-id h1 { margin: 0; color: var(--gold-bright); }
.rank-line { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.rank-badge {
  padding: 3px 14px; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rc, var(--gold)); border: 1px solid currentColor; border-radius: 2px;
}
.xp-bar {
  width: 320px; max-width: 70vw; height: 8px; border-radius: 4px;
  background: var(--bg-2); border: 1px solid #26436a; overflow: hidden;
}
.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-bright));
  box-shadow: 0 0 10px rgba(200,170,110,.6);
}

/* ---------- leaderboard ---------- */
.lb-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.lb-table th, .lb-table td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid #1b2b3d;
}
.lb-table th { color: var(--gold); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.lb-table tr:hover td { background: rgba(200,170,110,.05); }

.center-box { text-align: center; padding: 80px 0; }

@media (max-width: 820px) {
  .detail-shell { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; text-align: center; }
  .rank-line, .xp-bar { margin-inline: auto; justify-content: center; }
}

/* ============================================================
   Deck builder + pack opening
   ============================================================ */

/* ---------- deck slots ---------- */
.deck-slots {
  display: flex; gap: 20px; justify-content: flex-start; flex-wrap: wrap;
  margin: 18px 0 8px;
}
.deck-slot { width: 168px; }
.slot-card {
  position: relative; border-radius: 8px; overflow: hidden;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--panel-edge); box-shadow: 0 4px 18px rgba(0,0,0,.45);
}
.slot-card img {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block;
}
.slot-remove {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px;
  border-radius: 50%; border: 1px solid var(--gold-dim);
  background: rgba(14, 10, 30, .85); color: var(--gold-bright);
  cursor: pointer; font-size: .85rem; line-height: 1;
}
.slot-remove:hover { background: #5a2020; }
.slot-empty {
  aspect-ratio: 2 / 3; border: 2px dashed #3a2a6b; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #54428c;
}
.slot-empty span {
  font-size: 2rem; display: flex; flex-direction: column; align-items: center;
  font-family: Georgia, serif;
}
.slot-empty small { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- deck picker overlays ---------- */
.tile-overlay.in-deck {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 22, 38, .72);
  color: var(--gold-bright); letter-spacing: .14em; text-transform: uppercase;
  font-size: .8rem;
}
.tile-add {
  position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%);
  z-index: 3; padding: 5px 12px; font-size: .78rem;
  background: rgba(120, 90, 40, .95); color: var(--gold-bright);
  border: 1px solid var(--gold); border-radius: 3px; cursor: pointer;
  opacity: 0; transition: opacity .15s ease, filter .15s ease;
}
.owned-wrap:hover .tile-add { opacity: 1; }
.tile-add:hover { filter: brightness(1.25); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(14,10,30,.96); color: var(--gold-bright);
  border: 1px solid var(--panel-edge); border-left: 3px solid var(--violet);
  padding: 12px 22px; border-radius: 4px; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-left-color: #e53935; }

/* ---------- packs grid ---------- */
.packs-grid {
  display: grid; gap: 20px; margin-top: 20px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.pack-card {
  position: relative; text-align: center; padding: 18px 14px 16px;
  background: linear-gradient(180deg, rgba(23,16,52,.9), rgba(14,10,30,.94));
  border: 1px solid var(--panel-edge); border-radius: 6px;
  transition: transform .15s ease;
}
.pack-card:hover { transform: translateY(-4px); }
.pack-art img {
  width: 128px; aspect-ratio: 3/4; object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.55));
  transition: transform .2s ease;
}
.pack-card:hover .pack-art img { transform: scale(1.06) rotate(-1.5deg); }
.pack-art img.noimg { visibility: hidden; }
.pack-name { color: var(--text); margin: 8px 0 2px; font-size: .92rem; }
.pack-qty { color: var(--gold-bright); font-family: Georgia, serif; margin-bottom: 10px; }
.pack-qty::before { content: "?"; opacity: .7; }

/* ---------- reveal overlay ---------- */
.reveal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: radial-gradient(900px 500px at 50% 30%, rgba(30,52,80,.88), rgba(5,9,15,.96));
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .25s ease;
}
.reveal-overlay[hidden] { display: none !important; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reveal-stage { text-align: center; max-width: 94vw; }
.reveal-title {
  font-family: Georgia, serif; font-size: 1.4rem; color: var(--gold-bright);
  letter-spacing: .16em; text-transform: uppercase; margin-bottom: 26px;
  animation: titleGlow 2s ease infinite alternate;
}
@keyframes titleGlow {
  from { text-shadow: 0 0 10px rgba(200,170,110,.3); }
  to   { text-shadow: 0 0 26px rgba(200,170,110,.75); }
}
.reveal-cards {
  display: flex; gap: 22px; justify-content: center; flex-wrap: wrap;
  perspective: 1100px; min-height: 280px;
}

/* flip card */
.reveal-card {
  width: 190px; height: 285px; position: relative; cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.2,.7,.25,1.1);
}
.reveal-card.flipped { transform: rotateY(180deg); cursor: default; }
.reveal-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 8px;
  overflow: hidden; border: 2px solid var(--gold-dim);
  box-shadow: 0 10px 34px rgba(0,0,0,.6);
}
.reveal-back {
  background:
    radial-gradient(circle at 50% 42%, rgba(168,107,255,.3), transparent 62%),
    linear-gradient(165deg, #1c1238, #0b0716);
  display: flex; align-items: center; justify-content: center;
}
.reveal-back::before {
  content: "?"; font-size: 3rem; color: var(--gold-dim);
  animation: backPulse 1.6s ease infinite alternate;
}
@keyframes backPulse { from { transform: scale(.92); opacity:.6; } to { transform: scale(1.08); opacity:1; } }
.reveal-front { transform: rotateY(180deg); background: var(--bg-2); }
.reveal-front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reveal-champion { color: var(--gold-bright); font-size: .86rem; line-height: 1.1; }
.reveal-skin { color: var(--muted); font-size: .68rem;
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* rarity glow once flipped */
.reveal-card.flipped.r-common    .reveal-front { box-shadow: 0 0 24px rgba(149,165,166,.35), 0 10px 34px rgba(0,0,0,.6); border-color: var(--r-common); }
.reveal-card.flipped.r-rare      .reveal-front { box-shadow: 0 0 26px rgba(52,152,219,.45), 0 10px 34px rgba(0,0,0,.6); border-color: var(--r-rare); }
.reveal-card.flipped.r-epic      .reveal-front { box-shadow: 0 0 28px rgba(155,89,182,.5),  0 10px 34px rgba(0,0,0,.6); border-color: var(--r-epic); }
.reveal-card.flipped.r-legendary .reveal-front { box-shadow: 0 0 32px rgba(241,196,15,.55), 0 10px 34px rgba(0,0,0,.6); border-color: var(--r-legendary); }
.reveal-card.flipped.r-mythic    .reveal-front { box-shadow: 0 0 36px rgba(255,77,109,.6),   0 10px 34px rgba(0,0,0,.6); border-color: var(--r-mythic); }
.reveal-card.flipped.r-prestige  .reveal-front { box-shadow: 0 0 42px rgba(255,215,0,.65),   0 10px 34px rgba(0,0,0,.6); border-color: var(--r-prestige); }
.reveal-card.flipped.r-ultimate  .reveal-front { box-shadow: 0 0 46px rgba(0,229,255,.7),    0 10px 34px rgba(0,0,0,.6); border-color: var(--r-ultimate); }

/* NEW badge */
.badge-new {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: var(--gold); color: #14100a; font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; padding: 2px 8px; border-radius: 2px;
}

/* rarity gem badge on revealed card */
.reveal-gem {
  position: absolute; top: 7px; right: 7px; z-index: 2;
  line-height: 0; display: inline-flex; padding: 3px;
  background: rgba(9, 16, 25, .55); border-radius: 50%;
}
.reveal-gem svg { filter: drop-shadow(0 0 5px currentColor); }
.reveal-rarity {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
}
.reveal-rarity svg { flex: none; filter: drop-shadow(0 0 3px currentColor); }
/* glow the whole front border with the card's rarity color */
.reveal-card.flipped .reveal-front {
  box-shadow: 0 0 22px color-mix(in srgb, var(--rc, #95a5a6) 55%, transparent),
              0 10px 34px rgba(0,0,0,.6);
  border-color: var(--rc, var(--gold-dim));
}

/* entrance for each card */
.reveal-card.enter { animation: cardIn .45s cubic-bezier(.2,.8,.3,1.2) backwards; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(46px) scale(.7); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.reveal-continue { margin-top: 30px; }

/* ============================================================
   Economy & shop
   ============================================================ */

.shop-grid {
  display: grid; gap: 18px; margin-bottom: 26px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.shop-card {
  position: relative; display: flex; flex-direction: column;
  padding: 16px; border-radius: 6px;
  background: linear-gradient(180deg, rgba(23,16,52,.9), rgba(14,10,30,.94));
  border: 1px solid var(--panel-edge);
  transition: transform .15s ease, border-color .15s ease;
}
.shop-card:hover { transform: translateY(-4px); border-color: var(--gold-dim); }
.shop-art {
  height: 110px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.shop-art img {
  max-height: 110px; max-width: 82%; object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.55));
}
.shop-art img.noimg { display: none; }
.shop-emoji { font-size: 3rem; filter: drop-shadow(0 4px 12px rgba(168,107,255,.4)); }
.shop-name { color: var(--gold-bright); font-size: .95rem; }
.shop-desc { flex: 1; margin-top: 6px; line-height: 1.45; }
.shop-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 12px;
}
.shop-price { color: var(--gold); font-family: Georgia, serif; white-space: nowrap; }
.shop-card .own-badge { top: 8px; right: 8px; }
.shop-buy:disabled { opacity: .45; cursor: not-allowed; filter: none; }

.eco-panels {
  display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin: 20px 0 8px;
}
.eco-panel {
  padding: 18px 20px; border-radius: 6px;
  background: linear-gradient(180deg, rgba(23,16,52,.9), rgba(14,10,30,.94));
  border: 1px solid var(--panel-edge); border-top: 2px solid var(--violet-deep);
}
.eco-panel h3 {
  margin: 0 0 6px; color: var(--gold-bright); font-family: Georgia, serif;
  letter-spacing: .06em;
}
.eco-panel p { margin: 4px 0 14px; }

.give-form { display: flex; flex-direction: column; gap: 10px; }
.give-form input {
  padding: 9px 12px; background: var(--bg-2); color: var(--gold-bright);
  border: 1px solid #3a2a6b; border-radius: 3px; outline: none; width: 100%;
}
.give-form input:focus { border-color: var(--violet); box-shadow: 0 0 10px rgba(168,107,255,.3); }

.inv-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-bottom: 12px;
}
.inv-card {
  padding: 12px 14px; border-radius: 5px;
  background: rgba(23,16,52,.7); border: 1px solid var(--panel-edge);
}
.inv-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inv-name { color: var(--text); font-size: .92rem; }
.eco-ledger { width: 100%; max-width: 720px; }

/* ============================================================
   Battle Pass — «Пепел Рассвета»
   ============================================================ */

.gem-dot {
  display: inline-block; width: 9px; height: 9px; margin: 0 2px;
  background: linear-gradient(135deg, #9cc4ff, var(--gem-blue) 55%, #2c5cc5);
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(79, 141, 255, .8);
}

.pass-wrap {
  display: grid; grid-template-columns: 280px 1fr; gap: 26px;
  align-items: start;
}

/* ---------- sidebar ---------- */
.bp-side { padding: 26px 22px; text-align: center; }
.bp-emblem img {
  width: 120px; aspect-ratio: 1; object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(79, 141, 255, .45));
}
.bp-emblem img.noimg { display: none; }
.bp-emblem::after {
  content: ""; display: block; margin: 10px auto 0; width: 60%;
  height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.bp-side-title {
  font-family: Georgia, serif; font-size: 1.5rem; letter-spacing: .18em;
  color: var(--gold-bright); margin-top: 12px;
  text-shadow: 0 0 18px rgba(200, 170, 110, .35);
}
.bp-side-season { color: var(--muted); letter-spacing: .1em; margin-top: 4px; }
.bp-timer { margin-top: 14px; }
.bp-timer b { color: var(--gold-bright); }
.bp-premium-state {
  margin-top: 18px; padding: 12px; letter-spacing: .1em;
  border: 1px solid var(--panel-edge); color: var(--gold);
  background: rgba(200, 170, 110, .06);
}
.bp-premium-state em { color: #7dd487; font-style: normal; display: block; margin-top: 4px; }
.bp-premium-state .bp-crown { color: var(--gold); margin-right: 6px; }
.bp-upgrade { width: 100%; margin-top: 18px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.bp-price { font-size: 1rem; letter-spacing: .04em; text-transform: none; }
.bp-hint { margin-top: 18px; line-height: 1.6; }

/* ---------- hero header ---------- */
.bp-main { min-width: 0; }
.bp-hero {
  position: relative; padding: 30px 34px 24px;
  background: linear-gradient(180deg, rgba(10, 7, 16, .9), rgba(5, 3, 9, .6));
  border: 1px solid var(--panel-edge-soft);
  overflow: hidden;
}
.bp-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(560px 300px at 82% 20%, rgba(200, 170, 110, .16), transparent 60%),
    radial-gradient(420px 260px at 90% 80%, rgba(79, 141, 255, .12), transparent 60%);
}
.bp-title {
  margin: 0; font-size: clamp(1.9rem, 4vw, 3rem);
  color: var(--gold-bright); letter-spacing: .22em;
  text-shadow: 0 0 30px rgba(200, 170, 110, .4);
}
.bp-subtitle {
  letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
  font-size: .8rem; margin-top: 6px;
}
.bp-wallet { position: absolute; top: 22px; right: 26px; display: flex; gap: 12px; }
.cur-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; font-family: Georgia, serif; color: var(--gold-bright);
  background: rgba(5, 3, 9, .8); border: 1px solid var(--panel-edge);
  border-radius: 2px; min-width: 96px; justify-content: center;
}
.cur-pill.blue { color: #bcd6ff; border-color: rgba(79, 141, 255, .4); }

.bp-progress-row { display: flex; align-items: center; gap: 20px; margin-top: 22px; flex-wrap: wrap; }
.bp-progress-info { flex: 1; min-width: 220px; }
.bp-xp-bar { width: 100%; max-width: none; height: 10px; border-color: #2a2440; }

/* ---------- diamond level badge ---------- */
.lvl-diamond {
  width: 74px; height: 74px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #171226, #0a0714);
  border: 2px solid var(--gold);
  box-shadow: 0 0 22px rgba(200, 170, 110, .35), inset 0 0 14px rgba(200, 170, 110, .12);
}
.lvl-diamond > * { transform: rotate(-45deg); }
.lvl-diamond b { font-family: Georgia, serif; font-size: 1.5rem; color: var(--gold-bright); }
.lvl-diamond small { font-size: .52rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- reward track ---------- */
.bp-track-scroll {
  margin-top: 22px; padding: 22px 18px 16px;
  background: linear-gradient(180deg, rgba(10, 7, 16, .88), rgba(5, 3, 9, .92));
  border: 1px solid var(--panel-edge-soft);
  overflow-x: auto;
}
.bp-track { display: flex; gap: 14px; min-width: max-content; }
.bp-col { display: flex; flex-direction: column; gap: 10px; width: 118px; }

.lvl-node {
  align-self: center; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(45deg); margin: 8px 0 10px;
  background: #0a0714; border: 1px solid #3a3352;
  font-family: Georgia, serif;
}
.lvl-node span { transform: rotate(-45deg); color: var(--muted); font-size: .95rem; }
.lvl-node.reached { border-color: var(--gold); box-shadow: 0 0 12px rgba(200, 170, 110, .35); }
.lvl-node.reached span { color: var(--gold-bright); }
.bp-col.now .lvl-node { border-width: 2px; box-shadow: 0 0 18px rgba(200, 170, 110, .55); }
.diamond-lg { width: 52px; height: 52px; }

.bp-cell {
  position: relative; height: 128px; cursor: default;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 8px 6px;
  background: linear-gradient(180deg, rgba(16, 12, 30, .85), rgba(8, 6, 14, .95));
  border: 1px solid var(--panel-edge-soft);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bp-cell.premium { background: linear-gradient(180deg, rgba(24, 16, 40, .9), rgba(10, 6, 18, .95)); }
.cell-art { height: 58px; display: flex; align-items: center; justify-content: center; }
.cell-art img { max-height: 58px; max-width: 84%; object-fit: contain; }
.cell-art img.noimg { display: none; }
.cell-emoji { font-size: 1.9rem; filter: drop-shadow(0 0 10px rgba(79, 141, 255, .4)); }
.cell-qty { font-size: .78rem; color: var(--gold-bright); font-family: Georgia, serif; }
.cell-lock, .cell-check {
  position: absolute; bottom: 6px; right: 8px; font-size: .7rem; opacity: 0;
}
.bp-cell.locked .cell-lock { opacity: .7; }
.bp-cell.claimed .cell-check {
  opacity: 1; color: #7dd487; text-shadow: 0 0 8px rgba(125, 212, 135, .8);
}
.bp-cell.claimable {
  cursor: pointer; border-color: var(--gold);
  box-shadow: 0 0 16px rgba(200, 170, 110, .3), inset 0 0 14px rgba(200, 170, 110, .08);
  animation: cellPulse 1.8s ease infinite alternate;
}
.bp-cell.claimable:hover { filter: brightness(1.25); }
.bp-cell.claimable .cell-lock { opacity: .85; color: var(--gold); }
.bp-cell.claimed { border-color: rgba(125, 212, 135, .4); }
.bp-cell.premium_locked { border-style: dashed; border-color: rgba(200, 170, 110, .35); }
.bp-cell.busy { pointer-events: none; opacity: .6; }
@keyframes cellPulse {
  from { box-shadow: 0 0 10px rgba(200, 170, 110, .22); }
  to   { box-shadow: 0 0 22px rgba(200, 170, 110, .5); }
}

.bp-col.final .bp-cell { height: 158px; border-width: 2px; }
.bp-col.final .cell-art img { max-height: 84px; }
.bp-col.final .lvl-node { border-color: var(--violet); }
.bp-col.final .lvl-node span { color: var(--gold-bright); }

.bp-track-labels {
  display: flex; gap: 26px; margin-top: 12px;
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
}
.lbl-free { color: var(--muted); }
.lbl-premium { color: var(--gold); }

/* ---------- daily quests strip ---------- */
.bp-quests-head {
  display: flex; align-items: baseline; gap: 16px; margin: 24px 0 12px;
}
.bp-quests-head h2 { margin: 0; font-size: 1rem; color: var(--gold-bright); letter-spacing: .2em; text-transform: uppercase; }
.bp-quests {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.bp-quest {
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(16, 12, 30, .85), rgba(8, 6, 14, .95));
  border: 1px solid var(--panel-edge-soft);
}
.q-line { display: flex; align-items: center; gap: 12px; }
.q-line + .q-line { margin-top: 10px; }
.q-name { flex: 1; font-size: .88rem; color: var(--text); }
.q-xp { color: var(--gem-blue); font-family: Georgia, serif; }
.q-prog {
  flex: 1; height: 6px; background: var(--bg-2);
  border: 1px solid #2a2440; border-radius: 3px; overflow: hidden;
}
.q-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-bright));
  box-shadow: 0 0 8px rgba(200, 170, 110, .6);
}
.q-count { font-size: .74rem; color: var(--muted); }
.q-claim:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 980px) {
  .pass-wrap { grid-template-columns: 1fr; }
  .bp-wallet { position: static; margin-top: 16px; }
}

/* ============================================================
   Quests & Achievements
   ============================================================ */

.quests-board { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.quest-card.quest-card { transition: border-color .2s, box-shadow .2s; }
.quest-card.claimed { opacity: .55; }
.quest-claim:disabled { opacity: .5; cursor: not-allowed; filter: none; }

.ach-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.ach-card { display: flex; flex-direction: column; gap: 4px; }
.ach-card.unlocked {
  border-color: rgba(125, 212, 135, .45);
  box-shadow: inset 0 0 18px rgba(125, 212, 135, .06);
}
.ach-desc { flex: 1; margin: 0; line-height: 1.4; }
.ach-title {
  color: var(--gold); font-family: Georgia, serif;
  font-size: .8rem; letter-spacing: .04em; white-space: nowrap;
}
.ach-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ach-name { color: var(--gold-bright); font-size: .95rem; }
.ach-check {
  color: #7dd487; font-weight: bold;
  text-shadow: 0 0 8px rgba(125, 212, 135, .7);
}
.ach-reward {
  margin-top: 10px; padding-top: 8px;
  border-top: 1px solid var(--panel-edge-soft);
  color: var(--gem-blue); font-family: Georgia, serif;
}
