/* ==========================================================================
   Meatball the Cat — v2
   Un thème = un jeu de couleurs. Halloween est le thème actif ; Noël n'aura
   qu'à redéfinir les variables sous [data-theme="christmas"].
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Nunito:wght@400;600;700;800&family=Gochi+Hand&display=swap");

:root {
  --bg:        #1b1429;
  --bg-2:      #241a37;
  --surface:   #2d2245;
  --surface-2: #382a55;
  --line:      #4a3a6b;
  --text:      #f6eedf;
  --text-soft: #c9bcd9;
  --text-faint:#9586ad;
  --accent:    #f28c28;
  --accent-2:  #ffb15c;
  --accent-ink:#2a1606;
  --purple:    #9a7be0;
  --slime:     #9be36d;

  --r-common:  #c9a46a;
  --r-rare:    #7fb2ff;
  --r-holo:    #ff7ad9;
  --r-glitch:  #35f0e6;

  --display: "Fredoka", "Trebuchet MS", sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Gochi Hand", "Ink Free", "Comic Sans MS", cursive;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px -18px rgba(0,0,0,.65);
  --ease-out: cubic-bezier(.2,.8,.2,1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(154,123,224,.22), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(242,140,40,.12), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Boutons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 17px; text-decoration: none;
  transition: transform .15s var(--ease-out), box-shadow .15s, background .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn:focus-visible, .chip:focus-visible, .slot:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 0 #b3600f, 0 14px 30px -10px rgba(242,140,40,.6); }
.btn-primary:hover { background: var(--accent-2); }
.btn-primary:active { box-shadow: 0 3px 0 #b3600f; transform: translateY(3px); }
.btn-primary[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-google { background: #fff; color: #1f1f1f; font-family: var(--body); font-weight: 700; font-size: 15px; min-height: 42px; padding: 0 16px; }
.btn-google svg { width: 18px; height: 18px; }
.btn-lg { min-height: 58px; padding: 0 30px; font-size: 20px; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 15px; }

/* ---------- En-tête ------------------------------------------------------ */
.preview-bar {
  background: repeating-linear-gradient(-45deg, #3b2c12, #3b2c12 12px, #33270f 12px, #33270f 24px);
  color: #ffd9a8; font-size: 13px; text-align: center; padding: 6px 12px;
}
.preview-bar button { background: none; border: 0; text-decoration: underline; cursor: pointer; color: #fff; padding: 0 4px; }

.site-header { position: sticky; top: 0; z-index: 40; background: rgba(27,20,41,.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(74,58,107,.6); }
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--accent); }
.brand span { font-family: var(--display); font-weight: 700; font-size: 19px; white-space: nowrap; }
.brand sup { font-size: 10px; color: var(--text-faint); }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-family: var(--display); font-weight: 500; color: var(--text-soft); }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 14px; cursor: pointer; }
.user-chip .av { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--display); }
.user-chip .pts { color: var(--accent-2); }

.tabbar { display: none; }
@media (max-width: 760px) {
  .nav { display: none; }
  .brand span { font-size: 17px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr);
    position: fixed; inset: auto 0 0 0; z-index: 45;
    background: rgba(27,20,41,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 9px 0 8px; text-decoration: none; font-size: 12px; font-weight: 700; color: var(--text-faint); }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: var(--accent-2); }
  body { padding-bottom: 72px; }
}

/* ---------- Divers ------------------------------------------------------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--text-soft); }
.chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.panel { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section { padding: 64px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); }
.muted { color: var(--text-soft); }

/* ==========================================================================
   La carte. Toutes les tailles en cqw (% de la largeur de la carte) : la
   même carte marche à 90 px dans le rouleau et à 380 px en grand.
   ========================================================================== */
.mbcard {
  --frame: url("../assets/brand/frame-sm.webp");
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 1464;
  border-radius: 5.5% / 3.76%;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}
.mbcard.big { --frame: url("../assets/brand/frame.webp"); }
.mbcard .frame { position: absolute; inset: 0; background: var(--frame) center / 100% 100% no-repeat; border-radius: inherit; z-index: 0; }
.mbcard .art { position: absolute; left: 9%; top: 14.5%; width: 82%; height: 61%; z-index: 1; }
.mbcard .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1.2cqw 1.2cqw rgba(60,35,10,.35)); }
.mbcard .rar, .mbcard .num, .mbcard .title { position: absolute; z-index: 3; font-family: var(--hand); color: #6b4630; text-align: center; line-height: 1; white-space: nowrap; }
.mbcard .rar { left: 5.5%; top: 3.6%; width: 27.5%; height: 8.6%; display: grid; place-items: center; font-size: 6.4cqw; padding-top: .6cqw; }
.mbcard .num { left: 76%; top: 4.2%; width: 15%; height: 9%; display: grid; place-items: center; font-size: 6.6cqw; }
.mbcard .title { left: 14.5%; top: 77.8%; width: 70.5%; height: 8%; display: grid; place-items: center; font-size: 7cqw; overflow: hidden; }
.mbcard .title.long { font-size: 5.8cqw; }
.mbcard .fx { position: absolute; inset: 0; border-radius: inherit; z-index: 2; pointer-events: none; }

/* Rare : le même cadre passé au bleu acier. */
.mbcard.r-rare .frame { filter: hue-rotate(178deg) saturate(.75) brightness(1.12); }
.mbcard.r-rare .rar, .mbcard.r-rare .num, .mbcard.r-rare .title { color: #23405f; }

/* Holo : reflet arc-en-ciel qui suit le pointeur (--mx / --my). */
.mbcard.r-holo .frame { animation: holoHue 6s linear infinite; }
@keyframes holoHue { from { filter: hue-rotate(0deg) saturate(1.5) brightness(1.08); } to { filter: hue-rotate(360deg) saturate(1.5) brightness(1.08); } }
.mbcard.r-holo .fx {
  background:
    linear-gradient(115deg, transparent 20%, rgba(255,255,255,.55) calc(var(--mx, 50%) - 8%), transparent calc(var(--mx, 50%) + 12%)),
    linear-gradient(125deg, #ff6ec7 0%, #ffd36e 18%, #8affc1 36%, #6ecbff 54%, #b78bff 72%, #ff6ec7 90%);
  background-size: 100% 100%, 260% 260%;
  background-position: 0 0, var(--mx, 50%) var(--my, 50%);
  mix-blend-mode: color-dodge;
  opacity: .42;
}
.mbcard.r-holo .rar, .mbcard.r-holo .num, .mbcard.r-holo .title { color: #5a2a6b; }

/* Glitch : cadre sombre, décalage cyan/magenta, lignes, petits sursauts. */
.mbcard.r-glitch .frame { filter: grayscale(1) brightness(.32) contrast(1.6) drop-shadow(1cqw 0 0 rgba(53,240,230,.9)) drop-shadow(-1cqw 0 0 rgba(255,46,180,.9)); }
.mbcard.r-glitch .art img { filter: drop-shadow(1.4cqw 0 0 rgba(53,240,230,.7)) drop-shadow(-1.4cqw 0 0 rgba(255,46,180,.7)); animation: glitchJump 3.2s steps(1) infinite; }
.mbcard.r-glitch .fx { background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 .5cqw, transparent .5cqw 1.4cqw); mix-blend-mode: multiply; }
.mbcard.r-glitch .rar, .mbcard.r-glitch .num, .mbcard.r-glitch .title { color: #35f0e6; text-shadow: .5cqw 0 #ff2eb4; }
@keyframes glitchJump {
  0%, 86%, 100% { transform: none; clip-path: none; }
  88% { transform: translate(2cqw, -.5cqw) skewX(-6deg); clip-path: inset(10% 0 55% 0); }
  90% { transform: translate(-2.5cqw, .5cqw); clip-path: inset(48% 0 12% 0); }
  92% { transform: translate(1cqw, 0); clip-path: none; }
}

/* Carte manquante : silhouette. */
.mbcard.missing .frame { filter: grayscale(1) brightness(.42); }
.mbcard.missing .art img { filter: brightness(0) opacity(.5); }
.mbcard.missing .rar, .mbcard.missing .title, .mbcard.missing .num { color: #c9c2d4; opacity: .7; }

/* Dos de carte. Le conteneur est l'élément ; le décor est dans ::before
   pour que ses cqw se mesurent bien sur la carte. */
.mbcard-back {
  container-type: inline-size;
  position: absolute; inset: 0; border-radius: 5.5% / 3.76%;
  display: grid; place-items: center; overflow: hidden;
}
.mbcard-back::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background:
    radial-gradient(rgba(242,140,40,.22) 1.2cqw, transparent 1.4cqw) 0 0 / 9cqw 9cqw,
    linear-gradient(160deg, #3f2a66, #22163a);
  border: 3.4cqw solid #6b4630;
  box-shadow: inset 0 0 0 1.4cqw #c9a46a;
}
.mbcard-back img { position: relative; width: 44cqw; height: 44cqw; border-radius: 50%; border: 1.6cqw solid #c9a46a; }

/* ==========================================================================
   Accueil
   ========================================================================== */
.hero { padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(42px, 7vw, 76px); font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 19px; color: var(--text-soft); max-width: 40ch; margin: 18px 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.countdown { margin-top: 22px; display: flex; gap: 8px; flex-wrap: wrap; }
.fan { position: relative; height: 470px; perspective: 1200px; }
.fan .mbcard { position: absolute; width: 250px; top: 50%; left: 50%; transition: transform .5s var(--ease-out); box-shadow: 0 30px 50px -20px rgba(0,0,0,.7); }
.fan .c1 { transform: translate(-115%, -48%) rotate(-12deg); }
.fan .c2 { transform: translate(-50%, -54%); z-index: 2; }
.fan .c3 { transform: translate(15%, -48%) rotate(12deg); }
.fan:hover .c1 { transform: translate(-128%, -50%) rotate(-16deg); }
.fan:hover .c3 { transform: translate(28%, -50%) rotate(16deg); }
.fan .tag { position: absolute; z-index: 5; font-family: var(--display); font-weight: 600; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { padding: 24px; }
.step .n { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-weight: 700; font-size: 20px; margin-bottom: 14px; }
.step h3 { font-size: 22px; margin-bottom: 6px; }

.rarity-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.rarity-row figure { margin: 0; text-align: center; }
.rarity-row figcaption { margin-top: 12px; font-family: var(--display); font-weight: 600; }
.rarity-row figcaption small { display: block; font-family: var(--body); font-weight: 700; font-size: 13px; color: var(--text-faint); }

.prize { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 30px; }

.socials { display: flex; gap: 10px; flex-wrap: wrap; }
.social { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 700; transition: background .15s, transform .15s; }
.social:hover { background: var(--surface-2); transform: translateY(-2px); }
.social svg { width: 20px; height: 20px; fill: currentColor; }

.site-footer { border-top: 1px solid var(--line); padding: 36px 0 44px; margin-top: 40px; color: var(--text-soft); font-size: 14px; }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .fan { height: 360px; order: -1; }
  .fan .mbcard { width: 190px; }
  .steps { grid-template-columns: 1fr; }
  .rarity-row { grid-template-columns: repeat(2, 1fr); }
  .prize { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}
@media (max-width: 420px) {
  .fan { height: 300px; }
  .fan .mbcard { width: 150px; }
}

/* ==========================================================================
   Collection : machine à tirer + album
   ========================================================================== */
.col-head { padding: 34px 0 10px; display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.col-head h1 { font-size: clamp(32px, 5vw, 48px); }
.themes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.theme-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-family: var(--display); font-weight: 600; cursor: pointer; }
.theme-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.theme-tab[disabled] { opacity: .5; cursor: not-allowed; }

.machine { position: relative; margin: 22px 0 18px; padding: 22px 0 26px; overflow: hidden; }
.machine-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 22px 16px; flex-wrap: wrap; }
.machine-top h2 { font-size: 24px; }
.reel-window {
  position: relative; height: var(--reel-h, 250px); overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.reel { position: absolute; left: 0; top: 50%; display: flex; gap: var(--reel-gap, 14px); will-change: transform; transform: translate3d(0,-50%,0); }
.reel .mbcard { width: var(--reel-w, 150px); flex: none; transition: transform .35s var(--ease-out), filter .35s; }
.reel.spinning .mbcard { filter: blur(var(--blur, 0px)); }
.reel .mbcard.win { transform: scale(1.12); }
.reel.done .mbcard:not(.win) { filter: brightness(.45) saturate(.6); }
.pointer { position: absolute; left: 50%; top: 0; bottom: 0; width: 0; z-index: 4; pointer-events: none; }
.pointer::before, .pointer::after { content: ""; position: absolute; left: -13px; border: 13px solid transparent; }
.pointer::before { top: 54px; border-top-color: var(--accent); filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
.pointer::after { bottom: 58px; border-bottom-color: var(--accent); filter: drop-shadow(0 -2px 4px rgba(0,0,0,.6)); }
.pointer-line { position: absolute; left: 50%; top: 80px; bottom: 84px; width: 2px; margin-left: -1px; background: linear-gradient(transparent, rgba(255,177,92,.65), transparent); z-index: 4; }
.machine-actions { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px 22px 0; }
.next-spin { font-size: 14px; color: var(--text-soft); }
.next-spin b { font-variant-numeric: tabular-nums; color: var(--text); }
.sound-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.sound-btn svg { width: 20px; height: 20px; fill: currentColor; }

.redeem { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 18px 22px; margin-bottom: 30px; }
.redeem label { font-family: var(--display); font-weight: 600; font-size: 18px; margin-right: auto; }
.redeem label small { display: block; font-family: var(--body); font-weight: 600; font-size: 13px; color: var(--text-faint); }
.redeem input { flex: 1 1 200px; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 700 17px var(--body); letter-spacing: .12em; text-transform: uppercase; }
.redeem input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.redeem .msg { flex-basis: 100%; font-size: 14px; min-height: 1.4em; }
.redeem .msg.ok { color: var(--slime); }
.redeem .msg.err { color: #ff8f8f; }

.album-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.album-head h2 { font-size: 28px; }
.progress { flex: 1 1 220px; max-width: 360px; }
.progress-bar { height: 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; transition: width .8s var(--ease-out); }
.progress small { display: flex; justify-content: space-between; margin-top: 6px; color: var(--text-soft); font-weight: 700; }
.filters { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.filters .chip { cursor: pointer; }
.filters .chip[aria-pressed="true"] { background: var(--surface-2); color: var(--text); border-color: var(--purple); }

.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 16px; }
.slot { position: relative; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; border-radius: 12px; transition: transform .2s var(--ease-out); }
.slot:hover { transform: translateY(-4px); }
.slot .dots { display: flex; gap: 5px; justify-content: center; margin-top: 8px; }
.slot .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.slot .dots i.on.common { background: var(--r-common); border-color: var(--r-common); }
.slot .dots i.on.rare   { background: var(--r-rare); border-color: var(--r-rare); }
.slot .dots i.on.holo   { background: var(--r-holo); border-color: var(--r-holo); }
.slot .dots i.on.glitch { background: var(--r-glitch); border-color: var(--r-glitch); }
.slot.new::after { content: "NEW"; position: absolute; top: -8px; right: -6px; z-index: 5; background: var(--slime); color: #12300a; font: 700 11px var(--display); padding: 3px 8px; border-radius: 999px; }
@media (max-width: 520px) {
  .album { grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
  .slot .dots i { width: 7px; height: 7px; }
}

/* ---------- Fenêtres ----------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(10,6,18,.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.dialog { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px; text-align: center; position: relative; }
.dialog h2 { font-size: 26px; margin-bottom: 8px; }
.dialog .close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; font-size: 20px; }
.field { text-align: left; margin: 16px 0; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input[type=text] { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 600 17px var(--body); }
.check { display: flex; gap: 10px; align-items: flex-start; text-align: left; margin: 10px 0; font-size: 15px; color: var(--text-soft); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 2px; flex: none; }

/* Révélation d'une carte. */
.reveal { display: grid; justify-items: center; gap: 18px; text-align: center; }
.reveal-stage { position: relative; width: min(320px, 74vw, calc((100vh - 250px) / 1.464)); min-width: 180px; perspective: 1400px; }
.flipper { position: relative; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3,1.4,.4,1); }
.flipper.flipped { transform: rotateY(180deg); }
.flipper > .mbcard-back { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flipper > .mbcard { backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: rotateY(180deg); }
.burst { pointer-events: none; position: absolute; inset: -40%; z-index: -1; border-radius: 50%; opacity: 0; background: radial-gradient(circle, var(--glow, var(--r-common)) 0%, transparent 62%); transition: opacity .6s .5s; }
.flipper.flipped ~ .burst { opacity: .55; }
.rays { pointer-events: none; position: absolute; inset: -55%; z-index: -2; opacity: 0; background: repeating-conic-gradient(from 0deg, var(--glow) 0 6deg, transparent 6deg 18deg); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 62%); mask-image: radial-gradient(circle, #000 20%, transparent 62%); animation: spin 14s linear infinite; transition: opacity .6s .6s; }
.flipper.flipped ~ .rays.on { opacity: .35; }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal-text { opacity: 0; transform: translateY(10px); transition: opacity .4s 1s, transform .4s 1s; }
.reveal.done .reveal-text { opacity: 1; transform: none; }
.rarity-badge { display: inline-block; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .12em; padding: 5px 14px; border-radius: 999px; color: #160f22; background: var(--glow); }
.reveal-text h2 { font-size: 34px; margin: 10px 0 4px; }
.reveal-text .pts { font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--accent-2); }
.reveal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 110; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); } }

/* Détail d'une carte. */
.detail { width: min(760px, 100%); display: grid; grid-template-columns: 300px 1fr; gap: 28px; text-align: left; align-items: center; }
.detail .versions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.detail .versions button { background: none; border: 2px solid transparent; border-radius: 10px; padding: 3px; cursor: pointer; }
.detail .versions button[aria-pressed="true"] { border-color: var(--accent); }
.detail .versions small { display: block; text-align: center; font-size: 12px; font-weight: 700; color: var(--text-soft); margin-top: 4px; }
.tilt { transition: transform .2s ease-out; transform-style: preserve-3d; will-change: transform; }
@media (max-width: 640px) {
  .detail { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .detail .tilt { width: min(260px, 70vw); }
}

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 120; background: var(--text); color: var(--bg); font-weight: 700; padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow); animation: fadeIn .2s; }

/* ==========================================================================
   Classement
   ========================================================================== */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; margin: 26px 0 30px; }
.podium .p { padding: 22px 14px 18px; text-align: center; position: relative; }
.podium .p1 { padding-top: 34px; border-color: #e8b83a; }
.podium .medal { width: 92px; height: 92px; margin: 0 auto 10px; position: relative; }
.podium .p1 .medal { width: 116px; height: 116px; }
.medal img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 5px solid var(--m, #e8b83a); box-shadow: 0 0 0 3px var(--bg), 0 0 30px -4px var(--m, #e8b83a); }
.medal span { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: var(--m, #e8b83a); color: #1d1405; font: 700 14px var(--display); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.podium .p2 { --m: #c9d1dc; }
.podium .p3 { --m: #d58b52; }
.podium .name { font-family: var(--display); font-weight: 600; font-size: 19px; margin-top: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .score { font-weight: 800; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.podium .prize-note { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.lb { list-style: none; margin: 0; padding: 6px; }
.lb li { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; }
.lb li:nth-child(odd) { background: rgba(255,255,255,.025); }
.lb li.me { background: rgba(242,140,40,.14); outline: 1px solid rgba(242,140,40,.5); }
.lb .rk { font-family: var(--display); font-weight: 700; color: var(--text-faint); text-align: center; }
.lb .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .cards { font-size: 13px; color: var(--text-faint); }
.lb .sc { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent-2); min-width: 70px; text-align: right; }
@media (max-width: 560px) {
  .podium { gap: 8px; }
  .podium .medal { width: 64px; height: 64px; }
  .podium .p1 .medal { width: 82px; height: 82px; }
  .podium .name { font-size: 15px; }
  .lb li { grid-template-columns: 34px 1fr auto; }
  .lb .cards { display: none; }
}

/* Petits écrans : l'en-tête garde le nom de la marque, la puce joueur se
   réduit à l'initiale + les points. */
.btn-google .short { display: none; }
@media (max-width: 520px) {
  .header-inner { gap: 10px; }
  .brand img { width: 36px; height: 36px; }
  .brand span { font-size: 16px; }
  .user-chip .nm { display: none; }
  .user-chip { padding-right: 10px; font-size: 13px; }
  .btn-google .long { display: none; }
  .btn-google .short { display: inline; }
}

/* ==========================================================================
   Meatball Greetings : cartes de vœux interactives
   ========================================================================== */
.greet-builder { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; padding: 34px 0 20px; }
.greet-builder h1 { font-size: clamp(34px, 5vw, 52px); margin: 10px 0 10px; }
.occasions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0 6px; }
.occ { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 17px; text-align: left; }
.occ span { font-size: 24px; }
.occ[aria-pressed="true"] { border-color: var(--accent); background: rgba(242,140,40,.14); }
.greet-form .field input[type=text] { font-size: 19px; }
.share-box { margin-top: 18px; padding: 18px; }
.share-box .link { display: flex; gap: 8px; margin: 10px 0; }
.share-box input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text-soft); font: 600 14px var(--body); }

.paper {
  --paper: #f4e9da; --paper-ink: #4a3426;
  position: relative; border-radius: 24px; overflow: hidden;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.7), transparent 40%),
    radial-gradient(rgba(201,164,106,.25) 1.5px, transparent 2px) 0 0 / 22px 22px,
    var(--paper);
  color: var(--paper-ink);
}
.paper[data-o="birthday"] { --paper: #fde7c8; }
.paper[data-o="thanks"]   { --paper: #e3f1e4; }
.paper[data-o="love"]     { --paper: #fbdde3; }
.paper[data-o="hello"]    { --paper: #e2ecf8; }
.greet-preview { aspect-ratio: 4 / 5; display: grid; place-items: end center; padding: 20px; position: sticky; top: 90px; }
.greet-preview img { width: 78%; max-height: 62%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(74,52,38,.25)); }

.bubble {
  position: absolute; left: 50%; top: 9%; transform: translateX(-50%);
  max-width: 86%; padding: 14px 20px; border-radius: 22px;
  background: #fff; color: #3b2a20; border: 3px solid #4a3426;
  font: 400 clamp(22px, 4.6vw, 34px)/1.15 var(--hand); text-align: center;
  box-shadow: 0 6px 0 rgba(74,52,38,.18);
}
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -16px; margin-left: -10px; border: 13px solid transparent; border-top-color: #4a3426; border-bottom: 0; }
.bubble::before { content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -7px; z-index: 1; border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bubble b { color: #d96a12; font-weight: 400; }
.bubble.pop { animation: pop .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }

/* Le destinataire */
body.viewing .site-header, body.viewing .site-footer, body.viewing .tabbar, body.viewing .preview-bar, body.viewing .greet-builder { display: none; }
body.viewing { padding-bottom: 0; }
.viewer { min-height: 100svh; display: grid; place-items: center; padding: 16px; }
.stage { width: min(460px, 100%); aspect-ratio: 4 / 5.4; max-height: calc(100svh - 120px); display: grid; place-items: end center; padding: 22px; }
.stage .cat { width: 82%; max-height: 58%; object-fit: contain; transform-origin: 50% 100%; filter: drop-shadow(0 12px 16px rgba(74,52,38,.25)); opacity: 0; }
.stage .cat.in { animation: catIn .7s cubic-bezier(.3,1.5,.5,1) forwards; }
.stage .cat.bop { animation: bop .45s ease-in-out infinite alternate; opacity: 1; }
@keyframes catIn { from { opacity: 0; transform: translateY(40%) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes bop { from { transform: rotate(-3deg) translateY(0); } to { transform: rotate(3deg) translateY(-4%); } }
.viewer-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; opacity: 0; transition: opacity .6s; }
.viewer-actions.on { opacity: 1; }
.viewer-brand { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 12px; font-family: var(--display); font-weight: 600; text-decoration: none; }
.viewer-brand img { width: 30px; height: 30px; border-radius: 50%; }

.envelope { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; cursor: pointer; background: inherit; border: 0; padding: 0; font: inherit; color: inherit; }
.env { position: relative; width: 78%; aspect-ratio: 3 / 2; perspective: 900px; }
.env .body { position: absolute; inset: 0; border-radius: 10px; background: linear-gradient(160deg, #e9a25c, #d27f34); box-shadow: 0 18px 30px -12px rgba(74,52,38,.5); }
.env .body::before { content: ""; position: absolute; inset: 0; border-radius: 10px; background: linear-gradient(to top right, transparent 49.5%, rgba(0,0,0,.08) 50%) left / 50% 100% no-repeat, linear-gradient(to top left, transparent 49.5%, rgba(0,0,0,.08) 50%) right / 50% 100% no-repeat; }
.env .flap { position: absolute; left: 0; right: 0; top: 0; height: 62%; transform-origin: 50% 0; background: #c46f27; clip-path: polygon(0 0, 100% 0, 50% 100%); transition: transform .7s ease; z-index: 2; }
.env .seal { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); z-index: 3; width: 22%; aspect-ratio: 1; border-radius: 50%; background: url("../assets/brand/logo.webp") center / cover; border: 4px solid #8f3f0d; transition: opacity .3s; }
.env .to { position: absolute; left: 0; right: 0; bottom: 10%; text-align: center; z-index: 3; font: 400 clamp(22px, 5vw, 30px) var(--hand); color: #fff7ec; }
.envelope .hint { position: absolute; bottom: 9%; left: 0; right: 0; text-align: center; font-family: var(--display); font-weight: 600; color: #7a5a44; animation: breathe 1.4s ease-in-out infinite alternate; }
@keyframes breathe { to { opacity: .45; transform: translateY(-3px); } }
.envelope.open .flap { transform: rotateX(180deg); }
.envelope.open .seal { opacity: 0; }
.envelope.gone { animation: envOut .6s ease forwards; pointer-events: none; }
@keyframes envOut { to { opacity: 0; transform: translateY(30%) scale(.9); } }

@media (max-width: 860px) {
  .greet-builder { grid-template-columns: 1fr; }
  .greet-preview { position: relative; top: 0; max-width: 420px; width: 100%; margin: 0 auto; order: -1; }
}

/* Ticket doré et série complète */
.machine-top h2 { margin-right: auto; }
.ticket-chip { border-color: #e8b83a; color: #ffe39a; }
.btn-gold { background: linear-gradient(180deg, #ffe07a, #e8b83a); color: #3a2603; box-shadow: 0 6px 0 #a87b12, 0 14px 30px -10px rgba(232,184,58,.7); }
.btn-gold:hover { background: linear-gradient(180deg, #fff0a8, #f0c64e); }
.btn.nudge { animation: nudge .6s cubic-bezier(.3,1.6,.5,1) 2; }
@keyframes nudge { 50% { transform: scale(1.08); } }
.full-set { margin-top: 6px; font-family: var(--display); font-weight: 700; color: #ffd54a; text-shadow: 0 0 18px rgba(255,213,74,.6); }
.slot.full .mbcard { box-shadow: 0 0 0 3px #e8b83a, 0 0 22px -2px rgba(255,213,74,.8); }
.slot.full::before { content: "★ FULL SET"; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 5; white-space: nowrap; background: #e8b83a; color: #3a2603; font: 700 11px var(--display); padding: 3px 9px; border-radius: 999px; }

/* Progression par rareté */
.rows { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: -4px 0 20px; }
.row-meter { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.row-meter .row-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.row-meter .row-top b { font-family: var(--display); font-weight: 600; color: var(--c); }
.row-meter .row-top span { font-weight: 800; font-variant-numeric: tabular-nums; }
.row-meter .progress-bar { height: 8px; }
.row-meter .progress-bar i { background: var(--c); }
.row-meter small { display: block; margin-top: 6px; font-size: 12px; color: var(--text-faint); }
.row-meter.done { border-color: var(--c); box-shadow: 0 0 18px -6px var(--c); }
.row-meter.done small { color: var(--text); font-weight: 700; }
@media (max-width: 700px) { .rows { grid-template-columns: repeat(2, 1fr); } }

.dob { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.dob select { min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 600 16px var(--body); }

/* Compteurs de garanties */
.chip.pity { font-size: 13px; padding: 5px 10px; }
.chip.pity b { color: var(--accent-2); }
#pity-glitch b { color: var(--r-glitch); }
.btn-gold small { font-family: var(--body); font-weight: 700; font-size: 13px; opacity: .8; }
.full-set { display: block; }

/* Watch & Spin */
.watch-dialog { width: min(380px, 100%); }
.watch-frame { position: relative; width: min(300px, 100%, calc((100vh - 220px) * 9 / 16)); aspect-ratio: 9 / 16; margin: 14px auto 16px; border-radius: 16px; overflow: hidden; background: #000; display: grid; place-items: center; }
.watch-frame iframe, .watch-frame #yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watch-frame img { width: 80%; animation: bop .45s ease-in-out infinite alternate; }

/* Ouverture d'un paquet */
.reveal.pack { width: min(760px, 100%); }
.pack-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 2.4vw, 22px); width: 100%; max-width: min(640px, calc((100vh - 300px) / 1.464 * 3)); margin: 0 auto; perspective: 1400px; }
.pack-slot { position: relative; transition: transform .5s cubic-bezier(.3,1.5,.5,1); }
.pack-slot::after { content: ""; position: absolute; inset: -18%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, var(--glow) 0%, transparent 65%); opacity: 0; transition: opacity .6s .3s; pointer-events: none; }
.pack-slot.open { transform: translateY(-6px); }
.pack-slot.open::after { opacity: .45; }
.pack-slot.golden:not(.open) { animation: shake 1.4s ease-in-out infinite; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2.5deg); } 75% { transform: rotate(2.5deg); } }
.pack-list { list-style: none; margin: 4px 0 0; padding: 0; text-align: left; font-size: 15px; display: grid; gap: 6px; }
.pack-list li { padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.05); }
.pack-list .full-set { display: inline; margin-left: 6px; }

/* Pages Privacy / Terms */
.legal { max-width: 760px; padding: 40px 0 20px; }
.legal h1 { font-size: clamp(36px, 6vw, 52px); margin: 10px 0 12px; }
.legal .lede { font-size: 19px; color: var(--text-soft); margin-bottom: 18px; }
.legal h2 { font-size: 24px; margin: 30px 0 10px; }
.legal p, .legal li { color: var(--text-soft); }
.legal li { margin: 6px 0; }
.legal a { color: var(--accent-2); }

/* Junior Mode */
.linkish { display: block; margin: 14px auto 0; background: none; border: 0; padding: 6px; color: var(--accent-2); font: 700 14px var(--body); text-decoration: underline; cursor: pointer; }
.junior-list { list-style: none; padding: 0; margin: 14px 0 6px; text-align: left; display: grid; gap: 8px; font-size: 14px; color: var(--text-soft); }
.junior-list li { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.05); }
.user-chip.junior .av { background: var(--slime); color: #12300a; }
