:root {
  --bg: #0b0d14;
  --panel: #141824;
  --panel-2: #1b2030;
  --line: #262c3f;
  --text: #e8eaf2;
  --muted: #8a91a8;
  --accent: #ff4d8d;
  --accent-2: #7c5cff;
  --up: #22d39b;
  --down: #ff5c6c;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1200px 500px at 80% -10%, #2a1740 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  min-height: 100vh;
}
button, input { font: inherit; color: inherit; }
.num, .wallet b, .price, .chg { font-family: 'JetBrains Mono', monospace; }

/* En-tete */
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; flex-wrap: wrap; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand small { display: block; color: var(--muted); font-size: 13px; }
.logo {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-weight: 700; letter-spacing: -1px;
}
.logo.big { width: 64px; height: 64px; font-size: 24px; margin: 0 auto 8px; border-radius: 18px; }
.wallet { display: flex; gap: 10px; }
.wallet[hidden] { display: none; }
.wallet div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; min-width: 110px; }
.wallet small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.wallet b { font-size: 16px; }

/* Bandeau defilant */
.ticker { overflow: hidden; border-block: 1px solid var(--line); background: #0f121b; }
.ticker-track { display: flex; gap: 32px; padding: 9px 0; white-space: nowrap; width: max-content; animation: scroll 60s linear infinite; font-size: 14px; }
.ticker-track span b { margin-left: 6px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Onglets */
.tabs { display: flex; gap: 6px; padding: 16px 24px 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; padding: 10px 16px; border-radius: 10px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.active { background: var(--panel-2); color: var(--text); }
main { padding: 16px 24px 60px; max-width: 1280px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; }

/* Marche */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
#search { flex: 1 1 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; }
#search:focus { border-color: var(--accent-2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.chips button.active { border-color: var(--accent); color: #fff; background: #2a1426; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  display: grid; grid-template-columns: 56px 1fr; gap: 4px 12px; cursor: pointer; transition: transform .12s, border-color .12s; text-align: left;
}
.card:hover { transform: translateY(-2px); border-color: #3a4260; }
.card img { width: 56px; height: 72px; object-fit: cover; border-radius: 10px; grid-row: span 2; background: var(--panel-2); }
.card .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .anime { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .row { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: end; margin-top: 8px; }
.card .price { font-size: 18px; font-weight: 700; }
.badge { display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 6px; background: #2a1d4d; color: #c3b4ff; margin-left: 6px; vertical-align: 2px; }
.up { color: var(--up); }
.down { color: var(--down); }
.chg { font-size: 13px; }
.spark { width: 100%; height: 34px; grid-column: 1 / -1; }
.empty { color: var(--muted); text-align: center; padding: 40px; }

/* Fiche detail */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 20px; padding: 0; width: min(720px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(5, 6, 12, .75); backdrop-filter: blur(4px); }
.d-head { display: flex; gap: 16px; padding: 20px; align-items: center; }
.d-head img { width: 84px; height: 110px; object-fit: cover; border-radius: 12px; }
.d-head h2 { margin: 0; }
.d-head .anime { color: var(--muted); }
.d-head .price { font-size: 28px; font-weight: 700; margin-top: 6px; }
.d-close { margin-left: auto; align-self: flex-start; background: var(--panel-2); border: 0; border-radius: 10px; width: 36px; height: 36px; cursor: pointer; font-size: 18px; }
.chart { padding: 0 20px; }
.chart svg { width: 100%; height: 200px; display: block; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px 20px; }
.stats div { background: var(--panel-2); border-radius: 12px; padding: 10px 12px; }
.stats small { color: var(--muted); display: block; font-size: 12px; }
.trade { display: flex; gap: 10px; padding: 0 20px 20px; flex-wrap: wrap; align-items: center; }
.qty { display: flex; align-items: center; background: var(--panel-2); border-radius: 12px; }
.qty button { background: none; border: 0; width: 40px; height: 44px; cursor: pointer; font-size: 18px; }
.qty input { width: 70px; text-align: center; background: none; border: 0; outline: none; font-family: 'JetBrains Mono', monospace; }
.total { color: var(--muted); font-size: 14px; flex: 1; min-width: 140px; }
.btn { border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 700; cursor: pointer; }
.btn.buy { background: var(--up); color: #062b1f; }
.btn.sell { background: var(--down); color: #330a10; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* Inscription */
#signup-form { padding: 28px; text-align: center; }
#signup-form p { color: var(--muted); }
#signup-name { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 8px 0; outline: none; text-align: center; font-size: 18px; }
.err { color: var(--down) !important; min-height: 1.2em; margin: 4px 0 12px; }

/* Portefeuille */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.summary small { color: var(--muted); display: block; }
.summary b { font-size: 22px; font-family: 'JetBrains Mono', monospace; }
.list { display: grid; gap: 10px; }
.pos { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; cursor: pointer; }
.pos img { width: 44px; height: 56px; object-fit: cover; border-radius: 8px; }
.pos small { color: var(--muted); display: block; }
.pos .right { text-align: right; }

/* Classement */
.board { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-width: 640px; }
.board li { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.board li.me { border-color: var(--accent); }
.board .rank { font-weight: 700; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.board li:nth-child(1) .rank { color: #ffd34d; }
.board li:nth-child(2) .rank { color: #cfd6e6; }
.board li:nth-child(3) .rank { color: #e0975a; }
.board small { color: var(--muted); display: block; }

.rules { max-width: 680px; line-height: 1.6; }
.rules li { margin-bottom: 6px; }
.note { color: var(--muted); font-size: 14px; border-left: 3px solid var(--accent-2); padding-left: 12px; }

/* Ligues */
.share-btn { width: auto; margin-bottom: 18px; }
.league-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 22px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel h3 { margin: 0 0 4px; }
.panel p { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; }
.inline input:focus { border-color: var(--accent-2); }
.inline .btn { width: auto; }
.code-input { text-transform: uppercase; font-family: 'JetBrains Mono', monospace; letter-spacing: 2px; }
.league { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.league-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.league-top h3 { margin: 0; }
.league-top small { color: var(--muted); }
.league-top .code { font-family: 'JetBrains Mono', monospace; color: var(--text); background: var(--panel-2); padding: 2px 8px; border-radius: 6px; letter-spacing: 2px; }
.league-actions { display: flex; gap: 8px; }
.btn.ghost { background: var(--panel-2); color: var(--text); }
.btn.small { padding: 8px 12px; font-size: 13px; }
.league .board { max-width: none; }
.board li { grid-template-columns: 40px 1fr auto; }

/* Succes */
.achv-head { display: flex; align-items: baseline; gap: 12px; }
.achv-head h2 { margin: 0 0 16px; }
#achv-count { color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.achv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.achv { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.achv svg { flex: none; width: 44px; height: 44px; }
.achv b { display: block; }
.achv small { color: var(--muted); }
.achv.locked { opacity: .45; }
.achv.locked svg { filter: grayscale(1); }
.achv-stack { position: fixed; top: 16px; right: 16px; display: grid; gap: 8px; z-index: 20; }
.achv-pop {
  display: flex; gap: 10px; align-items: center; background: linear-gradient(135deg, #2a1440, #1b2030); border: 1px solid var(--accent);
  border-radius: 14px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: pop .35s ease-out;
}
.achv-pop svg { width: 34px; height: 34px; }
.achv-pop small { display: block; color: #ffb3d0; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
@keyframes pop { from { transform: translateX(120%); } }

/* Carte de partage */
#share { width: min(460px, calc(100vw - 32px)); }
.share-body { padding: 18px; }
.d-headline { display: flex; align-items: center; margin-bottom: 12px; }
.d-headline h2 { margin: 0; font-size: 20px; }
#share-canvas { width: 100%; height: auto; border-radius: 14px; display: block; background: var(--panel-2); }
.share-actions { display: flex; gap: 10px; margin-top: 14px; }
.share-actions .btn { flex: 1; }

/* Notifications */
.wallet { position: relative; align-items: stretch; }
.bell { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: 46px; cursor: pointer; display: grid; place-items: center; }
.bell .dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.bell .dot[hidden], .notif-panel[hidden] { display: none; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(340px, calc(100vw - 32px)); max-height: 360px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; z-index: 15; box-shadow: 0 20px 40px rgba(0,0,0,.5); }
.notif-panel .n { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.notif-panel .n.unread { background: #20172e; }
.notif-panel .n small { color: var(--muted); display: block; margin-top: 2px; }
.notif-panel .none { padding: 18px; color: var(--muted); text-align: center; font-size: 14px; }

/* Badge Pro */
.pro-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: linear-gradient(135deg, #ffd34d, #ff8a4d); color: #2b1600; vertical-align: 2px; margin-left: 6px; letter-spacing: .5px; }
.pro-badge.big { font-size: 16px; padding: 6px 14px; border-radius: 10px; margin: 0; }
.tabs .pro-tab { color: #ffd34d; }
.tabs .pro-tab.active { color: #ffd34d; }

/* Fiche : plages, alertes, Amazon */
.ranges { display: flex; gap: 6px; padding: 0 20px 8px; }
.ranges button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; }
.ranges button.active { border-color: var(--accent-2); }
.section { padding: 0 20px 20px; }
.section h4 { margin: 0 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 500; }
.alert-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.alert-form select, .alert-form input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; outline: none; }
.alert-form input { width: 110px; font-family: 'JetBrains Mono', monospace; }
.alert-row { display: flex; justify-content: space-between; align-items: center; background: var(--panel-2); border-radius: 10px; padding: 8px 12px; margin-top: 8px; font-size: 14px; }
.alert-row button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shop a { display: block; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--text); text-decoration: none; font-size: 14px; transition: border-color .12s; }
.shop a:hover { border-color: #ff9900; }
.shop a small { display: block; color: #ff9900; font-size: 12px; margin-top: 2px; }
.aff-note { color: var(--muted); font-size: 11px; margin-top: 8px; }

/* Top semaine */
.sub { color: var(--muted); margin-top: -8px; }
.top-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.top-item { display: grid; grid-template-columns: 44px 56px 1fr auto; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.top-item .rank { font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 700; color: var(--muted); }
.top-item:nth-child(1) .rank { color: #ffd34d; }
.top-item:nth-child(2) .rank { color: #cfd6e6; }
.top-item:nth-child(3) .rank { color: #e0975a; }
.top-item img { width: 56px; height: 72px; object-fit: cover; border-radius: 10px; cursor: pointer; }
.top-item small { color: var(--muted); display: block; }
.top-item .links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.top-item .links a { font-size: 12px; color: #ff9900; text-decoration: none; border: 1px solid #4a3410; border-radius: 8px; padding: 3px 8px; }
.top-item .right { text-align: right; }

/* Page Pro */
.pro-hero { text-align: center; padding: 30px 16px; background: radial-gradient(600px 240px at 50% 0%, #3a2a10, transparent 70%); border-radius: 20px; margin-bottom: 18px; }
.pro-hero h2 { font-size: 34px; margin: 12px 0 6px; }
.pro-hero p { color: var(--muted); max-width: 520px; margin: 0 auto 16px; }
.pro-price { font-size: 18px; margin-bottom: 16px; }
.pro-price b { font-size: 34px; font-family: 'JetBrains Mono', monospace; color: #ffd34d; }
#pro-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#pro-cta .btn { width: auto; }
.btn.gold { background: linear-gradient(135deg, #ffd34d, #ff8a4d); color: #2b1600; }
.pro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.pro-grid h3 { margin: 0 0 6px; font-size: 17px; }
.pro-grid p { margin: 0; color: var(--muted); font-size: 14px; }
.pf-chart { margin-bottom: 18px; }
.pf-chart svg { width: 100%; height: 160px; display: block; }
.pf-chart .locked { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); }
.pf-chart .locked .btn { width: auto; }
.themes { margin-bottom: 12px; }
.themes button { font-size: 13px; padding: 6px 10px; }
.foot { color: var(--muted); font-size: 12px; text-align: center; padding: 0 24px 30px; line-height: 1.6; }
.foot a { color: var(--muted); }

@media (max-width: 640px) {
  .shop { grid-template-columns: 1fr; }
  .top-item { grid-template-columns: 30px 48px 1fr; }
  .top-item .right { grid-column: 3; text-align: left; }
  .top-item img { width: 48px; height: 62px; }
}

/* Bonus du jour */
.gift { display: flex; align-items: center; gap: 6px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; border-radius: 12px; padding: 0 12px; font-weight: 700; cursor: pointer; animation: wiggle 2.5s ease-in-out infinite; }
.gift[hidden] { display: none; }
@keyframes wiggle { 0%, 90%, 100% { transform: rotate(0); } 93% { transform: rotate(-6deg); } 96% { transform: rotate(6deg); } }

/* Favoris */
.card { position: relative; }
.star { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); cursor: pointer; }
.star:hover { background: var(--panel-2); }
.star.on { color: #ffd34d; }
.card .name { padding-right: 26px; }
.d-star { background: var(--panel-2); border: 0; border-radius: 10px; width: 36px; height: 36px; cursor: pointer; color: var(--muted); align-self: flex-start; margin-left: auto; }
.d-star.on { color: #ffd34d; }
.d-star + .d-close { margin-left: 8px; }

/* Duel */
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; margin-bottom: 22px; }
.duel-side { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.duel-side.picked { border-color: var(--accent); }
.duel-side.win { border-color: var(--up); }
.duel-side img { width: 120px; height: 160px; object-fit: cover; border-radius: 14px; cursor: pointer; }
.duel-side small { color: var(--muted); }
.duel-side .btn { width: 100%; margin-top: auto; }
.vs { align-self: center; font-weight: 700; font-size: 28px; color: var(--accent); }
.bar { width: 100%; height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent-2); }
.yesterday { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--muted); }
.yesterday b { color: var(--text); }

/* Classement + activite */
.two-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.col-title { font-size: 18px; margin: 0 0 12px; }
.feed { display: grid; gap: 8px; }
.feed .ev { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.feed .ev img { width: 36px; height: 46px; object-fit: cover; border-radius: 8px; cursor: pointer; }
.feed .ev small { color: var(--muted); display: block; }
[data-profile] { cursor: pointer; }
[data-profile]:hover { text-decoration: underline; }

/* Profil */
#profile { width: min(560px, calc(100vw - 32px)); }
.pf-body { padding: 20px; }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.pf-stats div { background: var(--panel-2); border-radius: 12px; padding: 10px 12px; }
.pf-stats small { color: var(--muted); display: block; font-size: 12px; }
.pf-hold { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.pf-hold div { text-align: center; font-size: 12px; }
.pf-hold img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tags span { background: #2a1d4d; color: #c3b4ff; font-size: 12px; padding: 3px 8px; border-radius: 6px; }

@media (max-width: 760px) {
  .two-cols { grid-template-columns: 1fr; }
  .duel { grid-template-columns: 1fr 1fr; }
  .vs { display: none; }
  .duel-side img { width: 90px; height: 120px; }
  .gift span { display: none; }
}

/* Collection */
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.tcg { --r: #6b7390; position: relative; border-radius: 14px; padding: 6px; background: linear-gradient(160deg, var(--r), #1b2030 70%); cursor: pointer; transition: transform .15s; }
.tcg:hover { transform: translateY(-3px) rotate(-1deg); }
.tcg img, .tcg .ghost { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; display: block; }
.tcg .ghost { background: #12151f; display: grid; place-items: center; font-size: 34px; font-weight: 700; color: #2c3248; }
.tcg .cap { font-size: 12px; padding: 6px 2px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcg .rk { position: absolute; top: 10px; left: 10px; font-size: 10px; font-weight: 700; background: rgba(0,0,0,.6); border-radius: 6px; padding: 2px 6px; }
.tcg.locked { cursor: default; opacity: .55; }
.tcg.locked:hover { transform: none; }
.r-legendaire { --r: #ffb84d; box-shadow: 0 0 18px rgba(255,184,77,.35); }
.r-epique { --r: #b06bff; }
.r-rare { --r: #4dc3ff; }
.r-commune { --r: #6b7390; }
.card-pop { display: flex; gap: 12px; align-items: center; }
.card-pop img { width: 46px; height: 60px; object-fit: cover; border-radius: 8px; }

/* Missions */
.missions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.mission { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; }
.mission .top { display: flex; justify-content: space-between; gap: 8px; }
.mission .reward { color: #ffd34d; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
.mission .bar span { background: var(--up); }
.mission small { color: var(--muted); }
.mission .btn { width: 100%; }

/* Ordres + parrainage */
.order-form select, .order-form input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; outline: none; }
.order-form input { width: 100px; font-family: 'JetBrains Mono', monospace; }
.referral { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.referral h3 { margin: 0 0 4px; }
.referral p { margin: 0; }
.referral .btn { width: auto; }

/* Episodes et saisons */
.badge.ep { background: #3a2410; color: #ffb84d; }
.ep-banner { margin: 10px 20px 0; padding: 10px 14px; border-radius: 12px; background: #2a1d0c; color: #ffcf80; font-size: 14px; }
.stats div small + small { margin-top: 2px; }
.season { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: linear-gradient(135deg, #2a1440, #141824); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; }
.season h2 { margin: 0; font-size: 20px; }
.season small { color: var(--muted); }
.season .past { font-size: 13px; color: var(--muted); }
.season .past b { color: #ffd34d; }
.trophy { display: inline-block; background: #3a2a10; color: #ffd34d; font-size: 12px; padding: 3px 8px; border-radius: 6px; margin: 4px 4px 0 0; }

/* Comptes */
#login-form { padding: 28px; text-align: center; }
#login-form p { color: var(--muted); }
#signup-pass, #login-name, #login-pass, .pw-body input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 6px 0; outline: none; text-align: center; font-size: 16px; }
#signup-name { margin-bottom: 4px; }
.link-btn { background: none; border: 0; color: #c3b4ff; margin-top: 12px; cursor: pointer; text-decoration: underline; font-size: 14px; }
.pw-body { padding: 20px; }
#password-dialog { width: min(420px, calc(100vw - 32px)); }
.pw-warn { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #2a1d0c; color: #ffcf80; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; font-size: 14px; }
.pw-warn[hidden] { display: none; }
.pw-warn .btn { width: auto; }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.account-actions .share-btn { margin-bottom: 0; }
.account-actions[hidden] { display: none; }

/* Telephone */
@media (max-width: 640px) {
  .tabs { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-top: 10px; padding-bottom: 6px; }
  #sort { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  #sort::-webkit-scrollbar { display: none; }
  #sort button { white-space: nowrap; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { grid-template-columns: 40px 1fr; gap: 2px 8px; padding: 10px; }
  .card img { width: 40px; height: 52px; border-radius: 8px; }
  .card .name { font-size: 14px; }
  .card .price { font-size: 15px; }
  .card .chg { font-size: 12px; }
  .card .badge { display: none; }
  .star { top: 4px; right: 4px; }
  .wallet div { padding: 6px 10px; }
  .wallet b { font-size: 14px; }
  .d-head { padding: 16px; gap: 12px; }
  .d-head img { width: 64px; height: 84px; }
  .d-head .price { font-size: 22px; }
  .d-head h2 { font-size: 20px; }
  .d-head .price .chg { display: block; font-size: 13px; margin-top: 2px; }
  .stats { padding: 12px 16px; }
  .stats div:last-child { grid-column: span 2; }
  .trade { padding: 0 16px 16px; gap: 8px; }
  .trade .total { order: 3; flex-basis: 100%; font-size: 13px; }
  .qty button { width: 32px; }
  .qty input { width: 40px; }
  .trade .btn { flex: 1 1 0; min-width: 0; padding: 12px 8px; }
  .section, .ranges { padding-left: 16px; padding-right: 16px; }
  .chart { padding: 0 16px; }
  .album { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tcg { min-width: 0; }
  .season { padding: 12px 14px; }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: var(--panel-2); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 12px; transition: transform .25s; z-index: 10; max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .top, main { padding-inline: 16px; }
  .tabs { padding-inline: 16px; }
  .wallet { width: 100%; }
  .wallet div { flex: 1; min-width: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .pos { grid-template-columns: 44px 1fr auto; }
  .pos .hide-sm { display: none; }
}
