/* ==================================================================
   Manga Multiverse — design system
   ================================================================== */

:root {
  --bg:            #07060F;
  --bg-soft:       #0D0B1A;
  --bg-tint:       #110E24;
  --surface:       #16122C;
  --surface-2:     #1D1838;
  --surface-3:     #241E45;
  --line:          rgba(255, 255, 255, .09);
  --line-strong:   rgba(255, 255, 255, .16);

  --brand:         #7C4DFF;
  --brand-2:       #FF4D8D;
  --brand-soft:    rgba(124, 77, 255, .16);
  --accent-cyan:   #00C2FF;
  --accent-green:  #31D0AA;
  --accent-amber:  #FFB020;
  --accent-red:    #FF5A5A;

  --text:          #F3F1FF;
  --text-soft:     #B4AECA;
  --text-dim:      #7B7595;

  --radius:        18px;
  --radius-sm:     12px;
  --radius-lg:     24px;
  --shadow:        0 10px 30px rgba(0, 0, 0, .45);
  --shadow-soft:   0 4px 16px rgba(0, 0, 0, .32);

  --nav-h:         68px;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  background-image:
    radial-gradient(1000px 600px at 12% -10%, rgba(124, 77, 255, .30), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(255, 77, 141, .18), transparent 55%),
    radial-gradient(700px 600px at 50% 120%, rgba(0, 194, 255, .14), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 29px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p  { margin: 0; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.page {
  padding-bottom: calc(var(--nav-h) + 34px + env(safe-area-inset-bottom, 0px));
}
.muted { color: var(--text-soft); }
.dim   { color: var(--text-dim); }
.small { font-size: 13px; }
.tiny  { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.row-wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------------------------- Barre du haut ---------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  padding-top: env(safe-area-inset-top, 0px);
  background: linear-gradient(180deg, rgba(10, 8, 22, .92), rgba(10, 8, 22, .62));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(124, 77, 255, .45);
}
.brand-logo svg { width: 20px; height: 20px; }
.brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.brand-sub { font-size: 10.5px; color: var(--text-dim); letter-spacing: .12em; text-transform: uppercase; }

.currencies { display: flex; gap: 8px; align-items: center; }
.currency {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 6px 11px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.currency svg { width: 15px; height: 15px; }
.currency.coins { color: var(--accent-amber); }
.currency.gems  { color: var(--accent-cyan); }
.currency.energy{ color: var(--accent-green); }

/* ---------------------------- Boutons ---------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 14px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--text);
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: transform .12s ease, filter .18s ease, background .18s ease;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #9B6BFF 55%, var(--brand-2));
  box-shadow: 0 8px 24px rgba(124, 77, 255, .38);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: rgba(255, 255, 255, .05); border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-soft { background: var(--brand-soft); border-color: rgba(124, 77, 255, .35); color: #CDBBFF; }
.btn-danger { background: rgba(255, 90, 90, .14); border-color: rgba(255, 90, 90, .4); color: #FFB3B3; }
.btn-gold { background: linear-gradient(135deg, #FFB020, #FF8A3D); color: #2A1A00; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 11px; }
.btn-xs { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: grayscale(.4); }

/* ---------------------------- Cartes / panneaux ------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}
.card-tight { padding: 14px; }
.card-click { cursor: pointer; transition: transform .12s ease, border-color .18s ease; }
.card-click:active { transform: scale(.985); }
.card-click:hover { border-color: rgba(124, 77, 255, .45); }

.panel {
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2-1 { grid-template-columns: 1.4fr .9fr; }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 30px 0 14px;
}
.section-title h2 { font-size: 20px; }
.section-title .link { color: #C4AEFF; font-size: 13.5px; font-weight: 600; }

/* ---------------------------- Hero ------------------------------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  min-height: 380px;
  display: flex; align-items: flex-end;
  margin-top: 18px;
  box-shadow: var(--shadow);
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7, 6, 15, .35) 0%, rgba(7, 6, 15, .82) 55%, rgba(7, 6, 15, .97) 100%);
}
.hero-body { position: relative; padding: 26px 22px; width: 100%; }
.hero h1 { font-size: 34px; letter-spacing: -.02em; }
.hero p { color: var(--text-soft); margin-top: 10px; max-width: 560px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line-strong);
  color: var(--text-soft);
}
.badge-brand { background: var(--brand-soft); border-color: rgba(124, 77, 255, .4); color: #CDBBFF; }

/* ---------------------------- Statistiques ----------------------- */
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.stat-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.stat-sub { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }

/* ---------------------------- Cartes de personnage --------------- */
.card-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}

.ccard {
  position: relative; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: transform .12s ease, border-color .2s ease;
  display: flex; flex-direction: column;
}
.ccard:active { transform: scale(.975); }
.ccard:hover { border-color: rgba(255, 255, 255, .28); }
.ccard-art { position: relative; aspect-ratio: 3 / 4; overflow: hidden; }
.ccard-art img { width: 100%; height: 100%; object-fit: cover; }
.ccard-art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7, 6, 15, 0) 35%, rgba(7, 6, 15, .78) 100%);
}
.ccard-emblem {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 30px; height: 30px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 6, 18, .72); border: 1px solid var(--line-strong);
}
.ccard-emblem svg { width: 16px; height: 16px; }
.ccard-level {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-size: 11.5px; font-weight: 700; font-family: var(--mono);
  background: rgba(8, 6, 18, .78); border: 1px solid var(--line-strong);
  padding: 3px 7px; border-radius: 8px;
}
.ccard-body { padding: 10px 11px 12px; }
.ccard-name { font-size: 13.8px; font-weight: 700; line-height: 1.25; }
.ccard-meta { font-size: 11.5px; color: var(--text-soft); margin-top: 3px; display: flex; gap: 6px; align-items: center; }
.ccard-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chip {
  font-size: 10.5px; font-weight: 600; padding: 3px 7px; border-radius: 7px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  color: var(--text-soft); letter-spacing: .02em;
}
.chip-locked { background: rgba(255, 255, 255, .04); color: var(--text-dim); }

.ccard.owned { border-color: rgba(124, 77, 255, .34); }
.ccard.locked .ccard-art img { filter: grayscale(1) brightness(.45); }
.ccard-copies {
  position: absolute; bottom: 8px; left: 8px; z-index: 2;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px;
  background: rgba(49, 208, 170, .18); border: 1px solid rgba(49, 208, 170, .45);
  color: #8FF0D4;
}

.rarity-commun     { box-shadow: inset 0 0 0 1px rgba(154, 166, 191, .35); }
.rarity-rare       { box-shadow: inset 0 0 0 1px rgba(63, 193, 255, .5); }
.rarity-epique     { box-shadow: inset 0 0 0 1px rgba(155, 107, 255, .55); }
.rarity-legendaire { box-shadow: inset 0 0 0 1px rgba(255, 176, 32, .6); }
.rarity-mythique   { box-shadow: inset 0 0 0 1px rgba(255, 77, 141, .65); }

.r-commun     { color: #9AA6BF; }
.r-rare       { color: #3FC1FF; }
.r-epique     { color: #B08CFF; }
.r-legendaire { color: #FFB020; }
.r-mythique   { color: #FF6BA5; }

/* ---------------------------- Onglets / filtres ------------------ */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill {
  padding: 8px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  color: var(--text-soft); cursor: pointer;
  transition: transform .12s ease, background .18s ease, color .18s ease;
}
.pill:active { transform: scale(.96); }
.pill.active {
  background: linear-gradient(135deg, rgba(124, 77, 255, .9), rgba(255, 77, 141, .75));
  color: #fff; border-color: transparent;
}
.seg {
  display: flex; gap: 4px; padding: 4px; border-radius: 14px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 0 0 auto; border: 0; background: transparent; color: var(--text-soft);
  padding: 8px 13px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.seg button.active { background: var(--surface-3); color: var(--text); }

/* ---------------------------- Formulaires ------------------------ */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 13px;
  background: rgba(8, 6, 18, .6); border: 1px solid var(--line-strong);
  color: var(--text); font-size: 15px; font-family: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: rgba(124, 77, 255, .8);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, .18);
}
select { appearance: none; background-image: none; }
textarea { min-height: 92px; resize: vertical; }
.form-note { font-size: 12px; color: var(--text-dim); margin-top: 5px; }

.alert {
  padding: 12px 14px; border-radius: 13px; font-size: 13.5px; margin-bottom: 14px;
  border: 1px solid transparent; display: flex; gap: 9px; align-items: flex-start;
}
.alert svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.alert-error { background: rgba(255, 90, 90, .13); border-color: rgba(255, 90, 90, .4); color: #FFC2C2; }
.alert-ok    { background: rgba(49, 208, 170, .12); border-color: rgba(49, 208, 170, .4); color: #A5F2DC; }
.alert-info  { background: rgba(0, 194, 255, .1); border-color: rgba(0, 194, 255, .35); color: #B6E8FF; }

/* ---------------------------- Barre du bas ----------------------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(13, 11, 26, .72);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; gap: 2px;
}
.bottom-nav a {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border-radius: 14px;
  color: var(--text-dim); font-size: 10.5px; font-weight: 600;
  transition: transform .12s ease, color .18s ease, background .18s ease;
}
.bottom-nav a svg { width: 21px; height: 21px; }
.bottom-nav a:active { transform: scale(.94); }
.bottom-nav a.active { color: #fff; background: var(--brand-soft); }
.bottom-nav a.active svg { color: var(--brand-2); }

/* ---------------------------- Modale ----------------------------- */
.modal-back {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4, 3, 10, .74);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--bg-soft); border: 1px solid var(--line-strong);
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  animation: slideUp .26s cubic-bezier(.2, .8, .3, 1);
}
@keyframes slideUp { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-close {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text-soft);
  width: 34px; height: 34px; border-radius: 11px; cursor: pointer; flex: 0 0 34px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close svg { width: 16px; height: 16px; }

.hero-card-art {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16 / 11; border: 1px solid var(--line);
}
.hero-card-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-card-art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(7, 6, 15, .9) 100%);
}
.hero-card-art .art-txt { position: absolute; left: 14px; bottom: 12px; z-index: 2; }

.stat-bars { display: grid; gap: 9px; margin-top: 14px; }
.stat-bar-row { display: grid; grid-template-columns: 62px 1fr 52px; gap: 9px; align-items: center; font-size: 12.5px; }
.bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.bar.hp > span  { background: linear-gradient(90deg, #31D0AA, #7BE0C4); }
.bar.atk > span { background: linear-gradient(90deg, #FF6B5A, #FFB020); }
.bar.def > span { background: linear-gradient(90deg, #3FA9FF, #00C2FF); }
.bar.spd > span { background: linear-gradient(90deg, #B08CFF, #FF6BA5); }

.slot-list { display: grid; gap: 10px; margin-top: 12px; }
.slot {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px;
}
.slot-ico {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; overflow: hidden;
  background: var(--surface-3); display: flex; align-items: center; justify-content: center;
}
.slot-ico img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------- Portail / tirage ------------------- */
.pack-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pack {
  position: relative; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.pack::before {
  content: ''; position: absolute; inset: -40% -10% auto -10%; height: 200px;
  background: radial-gradient(circle at 50% 0%, rgba(124, 77, 255, .45), transparent 70%);
  pointer-events: none;
}
.pack-or::before    { background: radial-gradient(circle at 50% 0%, rgba(255, 176, 32, .42), transparent 70%); }
.pack-mythe::before { background: radial-gradient(circle at 50% 0%, rgba(255, 77, 141, .45), transparent 70%); }
.pack-relique::before { background: radial-gradient(circle at 50% 0%, rgba(0, 194, 255, .42), transparent 70%); }

.reveal-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); margin-top: 8px; }
.reveal-item { animation: pop .45s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes pop { from { transform: scale(.7) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------- Combat ----------------------------- */
.arena {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); min-height: 168px;
  display: flex; align-items: flex-end;
}
.arena img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.arena-body { position: relative; padding: 16px; width: 100%; background: linear-gradient(180deg, transparent, rgba(7, 6, 15, .9)); }

.fight { display: grid; gap: 14px; }
.fight-side { display: grid; gap: 10px; }
.fighter {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px; transition: opacity .3s ease;
}
.fighter.dead { opacity: .3; filter: grayscale(1); }
.fighter.active-turn { border-color: rgba(255, 77, 141, .7); box-shadow: 0 0 0 2px rgba(255, 77, 141, .18); }
.fighter img { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; flex: 0 0 42px; }
.fighter .hpbar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-top: 5px; }
.fighter .hpbar > span { display: block; height: 100%; background: linear-gradient(90deg, #31D0AA, #7BE0C4); transition: width .35s ease; }
.fighter .hpbar.low > span { background: linear-gradient(90deg, #FF5A5A, #FFB020); }

.log {
  margin-top: 14px; max-height: 300px; overflow-y: auto;
  background: rgba(8, 6, 18, .55); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px; font-family: var(--mono); font-size: 12.3px; line-height: 1.65;
}
.log-line { display: flex; gap: 8px; padding: 3px 0; border-bottom: 1px dashed rgba(255, 255, 255, .05); }
.log-line:last-child { border-bottom: 0; }
.log-turn { color: var(--brand-2); flex: 0 0 46px; }
.log-crit { color: var(--accent-amber); }
.log-heal { color: var(--accent-green); }
.log-ko   { color: var(--accent-red); }
.log-adv  { color: var(--accent-cyan); }
.log-ally { color: #CDBBFF; }

/* ---------------------------- Tableaux --------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim); font-weight: 600; background: rgba(255, 255, 255, .03); }
tr:last-child td { border-bottom: 0; }
td .mini { display: flex; align-items: center; gap: 9px; }
td .mini img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; flex: 0 0 34px; }

.status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .03em; }
.status-active    { background: rgba(49, 208, 170, .16); color: #8FF0D4; }
.status-suspended { background: rgba(255, 90, 90, .16); color: #FFB3B3; }

/* ---------------------------- Classement ------------------------- */
.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.rank-row.me { border-color: rgba(255, 77, 141, .5); background: rgba(255, 77, 141, .07); }
.rank-pos { font-family: var(--mono); font-weight: 700; width: 30px; flex: 0 0 30px; color: var(--text-soft); }
.rank-avatar {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px;
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff;
}

/* ---------------------------- Quetes ----------------------------- */
.quest {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
}
.quest.done { border-color: rgba(49, 208, 170, .45); }
.quest-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .09); overflow: hidden; margin-top: 7px; }
.quest-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent-cyan)); }

/* ---------------------------- Toasts ----------------------------- */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom, 0px));
  z-index: 300; display: flex; flex-direction: column; gap: 8px;
  width: min(92vw, 460px); pointer-events: none;
}
.toast {
  padding: 12px 15px; border-radius: 14px; font-size: 13.5px; font-weight: 600;
  background: rgba(22, 18, 44, .96); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); animation: toastIn .24s ease both;
  display: flex; gap: 9px; align-items: center;
}
.toast.ok   { border-color: rgba(49, 208, 170, .5); color: #A5F2DC; }
.toast.err  { border-color: rgba(255, 90, 90, .5); color: #FFC2C2; }
.toast.gold { border-color: rgba(255, 176, 32, .5); color: #FFE1A6; }
.toast svg { width: 17px; height: 17px; flex: 0 0 17px; }
@keyframes toastIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------- Divers ----------------------------- */
.empty {
  padding: 34px 18px; text-align: center; border-radius: var(--radius);
  border: 1px dashed var(--line-strong); background: rgba(255, 255, 255, .02);
}
.empty svg { width: 34px; height: 34px; color: var(--text-dim); margin: 0 auto 10px; }
.skeleton {
  border-radius: var(--radius); background: linear-gradient(100deg, rgba(255,255,255,.04) 30%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.04) 70%);
  background-size: 220% 100%; animation: shine 1.3s infinite linear; min-height: 120px;
}
@keyframes shine { from { background-position: 140% 0; } to { background-position: -60% 0; } }

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .2); border-top-color: var(--brand-2);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.divider { height: 1px; background: var(--line); margin: 18px 0; }
.footer {
  margin-top: 42px; padding: 26px 0 8px; border-top: 1px solid var(--line);
  color: var(--text-dim); font-size: 12.8px;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.footer-links a:hover { color: var(--text-soft); }

.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 26px 16px calc(var(--nav-h) + 40px);
}
.auth-box { width: 100%; max-width: 420px; }

.hp-gauge { display: flex; align-items: center; gap: 8px; }
.hp-gauge .bar { flex: 1; }

.xp-line { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.xp-line .bar { flex: 1; height: 7px; }
.progress-thin { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.progress-thin > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent-cyan)); }

.equip-picker { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.equip-tile {
  border-radius: 13px; overflow: hidden; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; transition: transform .12s ease, border-color .18s ease;
}
.equip-tile:active { transform: scale(.97); }
.equip-tile.selected { border-color: rgba(255, 77, 141, .8); box-shadow: 0 0 0 2px rgba(255, 77, 141, .16); }
.equip-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.equip-tile .t-body { padding: 8px 9px 10px; }

/* ---------------------------- Collections ------------------------ */
.chip-points {
  background: rgba(255, 176, 32, .14);
  border-color: rgba(255, 176, 32, .45);
  color: #FFE1A6;
}
.chip-points b { font-family: var(--mono); }

.pick-grid {
  display: grid; gap: 9px; max-height: 320px; overflow-y: auto;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  padding: 3px;
}
.pick-tile {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 7px; border-radius: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .16s ease, background .16s ease;
}
.pick-tile:hover { border-color: rgba(124, 77, 255, .5); }
.pick-tile.selected { border-color: rgba(124, 77, 255, .9); background: rgba(124, 77, 255, .14); }
.pick-tile img { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; object-fit: cover; }
.pick-tile .p-body { min-width: 0; }
.pick-tile .p-name { font-size: 12.6px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-check {
  position: absolute; top: 6px; right: 6px; width: 20px; height: 20px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff;
}

.points-box {
  background: linear-gradient(135deg, rgba(124, 77, 255, .18), rgba(255, 176, 32, .1));
  border-color: rgba(255, 176, 32, .3);
}
.points-value {
  font-size: 30px; font-weight: 700; letter-spacing: -.02em;
  font-family: var(--mono); color: #FFD08A; line-height: 1.15;
}

.collection-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); padding: 16px;
  transition: border-color .2s ease;
}
.collection-card.ready { border-color: rgba(255, 176, 32, .5); }
.collection-card.closed { border-color: rgba(49, 208, 170, .4); opacity: .88; }
.collection-card.ready::before {
  content: ''; position: absolute; inset: -50% -10% auto -10%; height: 180px;
  background: radial-gradient(circle at 50% 0%, rgba(255, 176, 32, .28), transparent 70%);
  pointer-events: none;
}
.col-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; flex-wrap: wrap; }

.col-progress {
  height: 7px; border-radius: 999px; overflow: hidden; margin-top: 14px;
  background: rgba(255, 255, 255, .09);
}
.col-progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .3s ease;
}
.collection-card.ready .col-progress > span { background: linear-gradient(90deg, #FFB020, #FF8A3D); }
.collection-card.closed .col-progress > span { background: linear-gradient(90deg, #31D0AA, #7BE0C4); }

.col-minis { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.col-mini {
  position: relative; width: 52px; height: 52px; flex: 0 0 52px;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-3);
}
.col-mini img { width: 100%; height: 100%; object-fit: cover; }
.col-mini-lv {
  position: absolute; bottom: 3px; left: 3px; right: 3px; text-align: center;
  font-size: 10px; font-weight: 700; font-family: var(--mono);
  background: rgba(8, 6, 18, .82); border-radius: 5px; color: #CDBBFF;
}
.col-mini-lock {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 6, 18, .62); color: var(--text-dim);
}
.col-mini-lock svg { width: 16px; height: 16px; }
.col-mini:not(.got) img { filter: grayscale(1) brightness(.5); }
.col-mini.got { border-color: rgba(124, 77, 255, .5); }

.points-preview {
  border-radius: 14px; border: 1px solid rgba(255, 176, 32, .35);
  background: rgba(255, 176, 32, .08); padding: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.points-total {
  font-size: 25px; font-weight: 700; font-family: var(--mono);
  color: #FFD08A; margin-top: 4px;
}

.award-box { text-align: center; padding-top: 4px; }
.award-badge {
  width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(255, 176, 32, .3), rgba(255, 77, 141, .24));
  border: 1px solid rgba(255, 176, 32, .5);
  animation: pop .5s cubic-bezier(.2, .9, .3, 1.3) both;
}
.award-badge svg { width: 32px; height: 32px; color: #FFD08A; }
.award-box .points-preview { align-items: center; text-align: center; }

/* ---------------------------- Installation PWA ------------------- */
.install-box {
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(124, 77, 255, .14), rgba(0, 194, 255, .1));
  padding: 18px;
}
.store-logos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.store-logo {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600;
  padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line); color: var(--text-soft);
}
.store-logo svg { width: 17px; height: 17px; }

/* ---------------------------- Ecran d'ouverture ------------------ */
#app-splash {
  display: none; position: fixed; inset: 0; z-index: 99999; pointer-events: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: #0B0820;
}
#app-splash.show { display: flex; animation: splashOut .4s ease 1.2s forwards; }
#app-splash[data-admin="1"] { background: #08182B; }
#app-splash img { width: 96px; height: 96px; border-radius: 24px; }
#app-splash span { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .02em; }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }

/* ---------------------------- Responsive ------------------------- */
@media (min-width: 768px) {
  body { font-size: 15.5px; }
  .hero { min-height: 460px; }
  .hero h1 { font-size: 46px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(182px, 1fr)); }
  .modal-back { align-items: center; padding: 24px; }
  .modal { border-radius: 22px; }
}

@media (max-width: 767px) {
  h1 { font-size: 25px; }
  .grid-2, .grid-3, .grid-4, .grid-2-1 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 27px; }
  .hero { min-height: 340px; }
  .hero-body { padding: 20px 16px; }
  .stat-value { font-size: 21px; }
  .topbar-in { min-height: 56px; }
  .currencies .currency { padding: 5px 9px; font-size: 12px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 11px; }
  .pack-grid { grid-template-columns: 1fr; }
  .reveal-grid { grid-template-columns: repeat(2, 1fr); }
  .equip-picker { grid-template-columns: repeat(2, 1fr); }
  .log { max-height: 230px; font-size: 11.6px; }
  .stat-bar-row { grid-template-columns: 54px 1fr 46px; font-size: 12px; }
  .table-wrap { border-radius: 14px; }
  .section-title { margin-top: 24px; }
  .footer-links { gap: 12px; }
  .points-value { font-size: 25px; }
  .col-mini { width: 46px; height: 46px; flex: 0 0 46px; }
  .points-total { font-size: 22px; }
}

@media (max-width: 430px) {
  .brand-sub { display: none; }
  .currency { font-size: 11.5px; padding: 4px 8px; gap: 4px; }
  .currency svg { width: 13px; height: 13px; }
  .topbar-in { gap: 8px; }
}

@media (max-width: 400px) {
  .wrap { padding: 0 13px; }
  .card-grid { gap: 9px; }
  .ccard-body { padding: 9px 9px 11px; }
  .ccard-name { font-size: 12.8px; }
}
