/* Vagario — design system commun (site + jeu) */
@font-face { font-family: "Clash Display"; src: url("/fonts/clashdisplay-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Clash Display"; src: url("/fonts/clashdisplay-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Clash Display"; src: url("/fonts/clashdisplay-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/fonts/switzer-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/fonts/switzer-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/fonts/switzer-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/fonts/switzer-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg-0: #05060a;
  --bg-1: #0b0d14;
  --bg-2: #11141e;
  --bg-3: #181c29;
  --surface: rgba(14, 17, 26, .72);
  --surface-2: rgba(255, 255, 255, .04);
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);
  --text: #f4f5f8;
  --text-2: #9ba1b3;
  --text-3: #5e6478;

  /* accent signature : vert « agar » */
  --accent: #5ef0a8;
  --accent-2: #2fd98b;
  --accent-ink: #03140b;
  --accent-soft: rgba(94, 240, 168, .12);
  --blue: #6c8cff;
  --violet: #9b7bff;
  --gold: #e9c47d;
  --gold-2: #c99a45;
  --gold-soft: rgba(233, 196, 125, .12);
  --red: #ff5a6e;
  --green: #5ef0a8;
  --cyan: #5ef0a8; /* alias historique */
  --pink: #ff6fae;

  --grad-primary: linear-gradient(180deg, #7af5b9 0%, #3ee096 100%);
  --grad-gold: linear-gradient(180deg, #f3d595 0%, #d6a858 100%);
  --grad-play: var(--grad-primary);

  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 20px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 60px -20px rgba(0, 0, 0, .7);
  --glow-cyan: 0 0 0 1px rgba(94, 240, 168, .45), 0 0 28px rgba(94, 240, 168, .25);
  --glow-gold: 0 0 0 1px rgba(233, 196, 125, .5), 0 0 28px rgba(233, 196, 125, .25);

  --font-display: "Clash Display", "Switzer", system-ui, sans-serif;
  --font: "Switzer", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(94, 240, 168, .3); }

.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.accent { color: var(--accent); }
.grad-text { color: var(--accent); }
.gold-text { color: var(--gold); }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font: 600 11px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }

/* Icônes */
.i { width: 1em; height: 1em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.125em; }
.i.fill { fill: currentColor; stroke: none; }

/* Boutons */
.btn {
  --h: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 20px;
  border: 0; border-radius: 12px; cursor: pointer;
  font: 600 15px/1 var(--font); letter-spacing: .01em;
  color: var(--text); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: transform .15s ease, background .15s ease, box-shadow .2s ease, filter .15s;
  user-select: none; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .07); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .i { font-size: 18px; }
.btn-primary, .btn-play {
  background: linear-gradient(180deg, #7cf4ba 0%, #45e19b 100%); color: var(--accent-ink);
  /* relief net : reflet en haut, bord sombre fin, ombre courte (plus de halo coloré) */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .14), 0 0 0 1px rgba(6, 60, 34, .55), 0 1px 2px rgba(0, 0, 0, .4);
}
.btn-primary:hover, .btn-play:hover { background: linear-gradient(180deg, #8af7c4 0%, #4fe6a3 100%); }
.btn-play { --h: 58px; font-size: 17px; font-weight: 700; padding: 0 34px; border-radius: 14px; letter-spacing: .01em; position: relative; overflow: hidden; }
.btn-gold {
  background: linear-gradient(180deg, #f5dba2 0%, #d9ab5c 100%); color: #241703;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .14), 0 0 0 1px rgba(80, 52, 10, .6), 0 1px 2px rgba(0, 0, 0, .4);
}
.btn-gold:hover { background: linear-gradient(180deg, #f8e2b0 0%, #e0b468 100%); }
/* reflet qui traverse le bouton au survol */
.btn-play::after, .nav-play::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-130%); transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}
.btn-play:hover::after, .nav-play:hover::after { transform: translateX(130%); }

/* Bouton « Jouer » du menu */
.nav-play {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 16px 0 5px; border-radius: 12px;
  font: 700 14px/1 var(--font); letter-spacing: .01em; color: var(--accent-ink);
  background: linear-gradient(180deg, #7cf4ba 0%, #45e19b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .14), 0 0 0 1px rgba(6, 60, 34, .55), 0 1px 2px rgba(0, 0, 0, .4);
  transition: background .15s, transform .15s;
}
.nav-play:hover { background: linear-gradient(180deg, #8af7c4 0%, #4fe6a3 100%); }
.nav-play:active { transform: scale(.97); }
.np-ic {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: #06261a; color: #7cf4ba;
  box-shadow: inset 0 0 0 1px rgba(124, 244, 186, .18), 0 1px 0 rgba(255, 255, 255, .35);
}
.np-ic .i { font-size: 13px; margin-left: 2px; }
.btn-ghost { background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-sm { --h: 38px; font-size: 14px; padding: 0 14px; border-radius: 10px; }
.btn-block { width: 100%; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 19px; padding: 0 7px; border-radius: 6px;
  font: 700 10px/1 var(--font); letter-spacing: .08em; text-transform: uppercase;
  vertical-align: middle; flex-shrink: 0; border: 1px solid transparent;
}
.badge .i { font-size: 11px; stroke-width: 2.2; }
.badge-staff { background: rgba(255, 90, 110, .12); color: #ff8b99; border-color: rgba(255, 90, 110, .35); }
.badge-vip { background: var(--gold-soft); color: var(--gold); border-color: rgba(233, 196, 125, .4); }
.badge-potw { background: rgba(155, 123, 255, .14); color: #c3b0ff; border-color: rgba(155, 123, 255, .45); }
.badge-guest { background: rgba(255, 255, 255, .05); color: var(--text-2); border-color: var(--line-strong); }

/* Avatar (skin) */
.avatar {
  --s: 36px;
  width: var(--s); height: var(--s); border-radius: 50%; flex-shrink: 0;
  background: var(--bg-3) center/cover no-repeat;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .1);
  display: inline-grid; place-items: center;
  font: 600 calc(var(--s) * .4)/1 var(--font-display); color: rgba(255, 255, 255, .92);
}
.avatar.vip { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(233, 196, 125, .3); }

/* Surfaces */
.glass {
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, 0) 40%), var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset;
}

/* Formulaires */
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input {
  height: 48px; padding: 0 14px; border-radius: 12px; width: 100%;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: rgba(94, 240, 168, .6); box-shadow: 0 0 0 4px rgba(94, 240, 168, .1); }
.form-error { color: var(--red); font-size: 14px; min-height: 1.2em; }

/* Progression */
.progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad-primary); box-shadow: 0 0 12px rgba(94, 240, 168, .5); transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.lvl {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 6px; font: 600 11px/1 var(--font); letter-spacing: .04em;
  background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(94, 240, 168, .3);
}

/* Toasts */
.toasts { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; pointer-events: none; justify-items: center; }
.toast { padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; background: rgba(17, 20, 30, .92); border: 1px solid var(--line-strong); backdrop-filter: blur(12px); box-shadow: var(--shadow); animation: toast-in .3s cubic-bezier(.2, .9, .3, 1.2), toast-out .3s ease-in 2.6s forwards; }
.toast.gold { color: var(--gold); border-color: rgba(233, 196, 125, .4); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

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

/* Écusson / tag d'équipe */
.emblem { --s: 48px; position: relative; display: inline-grid; place-items: center; width: var(--s); height: calc(var(--s) * 1.125); flex-shrink: 0; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45)); }
.emblem svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.emblem b { position: relative; margin-top: -8%; font: 700 calc(var(--s) * .24)/1 var(--font); letter-spacing: .04em; color: #05060a; }
.team-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; font: 700 10px/1 var(--font); letter-spacing: .06em; color: #05060a; background: var(--tc, var(--accent)); flex-shrink: 0; }
.role-pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.role-pill.leader { color: var(--gold); box-shadow: inset 0 0 0 1px rgba(233, 196, 125, .4); background: var(--gold-soft); }
.role-pill.coleader { color: #c3b0ff; box-shadow: inset 0 0 0 1px rgba(155, 123, 255, .4); }
.role-pill.elder { color: var(--accent); box-shadow: inset 0 0 0 1px rgba(94, 240, 168, .35); }

/* Barres de défilement discrètes */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .24); }
::-webkit-scrollbar-corner { background: transparent; }

/* Fenêtre de confirmation */
.cdlg { width: min(400px, calc(100vw - 32px)); padding: 26px 22px 20px; border: 1px solid var(--line-strong); border-radius: 22px; background: linear-gradient(180deg, #131622, #0c0e16); color: var(--text); box-shadow: var(--shadow); text-align: center; display: grid; gap: 10px; justify-items: center; }
.cdlg[open] { animation: cdlg-in .22s cubic-bezier(.2, .9, .3, 1.2); }
.cdlg.closing { animation: cdlg-out .14s ease-in forwards; }
.cdlg::backdrop { background: rgba(5, 6, 10, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cdlg h2 { margin: 0; font: 600 22px/1.2 var(--font-display); letter-spacing: -.01em; }
.cdlg p { margin: 0; font-size: 14.5px; line-height: 1.5; }
.cdlg-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; color: var(--accent); background: var(--accent-soft); margin-bottom: 4px; }
.cdlg-ic.danger { color: #ff8b99; background: rgba(255, 90, 110, .12); }
.cdlg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 8px; }
.btn-danger { background: #ff5a6e; color: #fff; box-shadow: 0 10px 26px -10px rgba(255, 90, 110, .7); }
.btn-danger:hover { background: #ff6c7e; }
@keyframes cdlg-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes cdlg-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* Jetons : montant précédé de la pièce dorée */
.tok { display: inline-flex; align-items: center; gap: .32em; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.tok::before { content: ""; width: 1.05em; height: 1.05em; flex-shrink: 0; background: url("/img/jeton.svg") center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.tok.dim { font-weight: 600; }
.tok-lg { font-size: 20px; }
.tok-xl { font: 600 34px/1 var(--font-display); letter-spacing: -.02em; }
/* l'espace des milliers de Clash Display est très étroit : on l'élargit (« 1 000 ») */
.tok-xl, .feat-price, .price-row b { word-spacing: .18em; }
.gold-link { color: var(--gold); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Fenêtres de confirmation : panneau qui monte du bas sur mobile (pouce), carte centrée sur grand écran */
@media (max-width: 560px) {
  .cdlg { width: 100%; max-width: none; margin: auto 0 0; border-radius: 24px 24px 0 0; padding: 28px 20px calc(20px + var(--safe-b)); border-bottom: 0; animation: cdlg-up .22s cubic-bezier(.2, .9, .3, 1); }
  .cdlg-actions { display: grid !important; grid-template-columns: 1fr; gap: 8px; width: 100%; }
  .cdlg-actions .btn { --h: 50px; width: 100%; }
  .cdlg-actions .btn:last-child { order: -1; }
}
@keyframes cdlg-up { from { transform: translateY(40px); opacity: 0; } }
