  :root{
    --void:#0a0e14;
    --void-2:#0f1620;
    --cyan:#5fe3e0;
    --purple:#8b6fd9;
    --paper:#eaf3f3;
    --paper-dim:#7e93a0;
    --danger:#e07a5f;
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  /* Un élément masqué (attribut hidden) l'est toujours, même si sa classe lui
     donne un display:flex/grid. Sans ça, une fenêtre « fermée » mais
     transparente restait posée sur la page et bloquait tous les clics. */
  [hidden]{ display:none !important; }
  body{
    min-height:100vh;
    background:var(--void);
    color:var(--paper);
    font-family:'Rajdhani', sans-serif;
    font-weight:500;
    display:flex; flex-direction:column; align-items:center;
    padding:8vh 6vw 6vh;
    overflow-x:hidden;
  }
  ::selection{ background:var(--cyan); color:var(--void); }

  @keyframes riseIn{ from{ opacity:0; transform:translateY(26px); } to{ opacity:1; transform:translateY(0); } }
  @keyframes fadeIn{ from{ opacity:0; } to{ opacity:1; } }
  @keyframes popIn{
    0%{ opacity:0; transform:scale(.94) translateY(18px); }
    70%{ opacity:1; transform:scale(1.012) translateY(-2px); }
    100%{ opacity:1; transform:scale(1) translateY(0); }
  }
  @keyframes letterIn{ from{ opacity:0; transform:translateY(.6em) rotateX(40deg); } to{ opacity:1; transform:translateY(0) rotateX(0); } }
  @keyframes hudSweep{ from{ transform:translateX(-120%); } to{ transform:translateX(220%); } }
  @keyframes floatIdle{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-6px); } }
  @keyframes rippleOut{ from{ transform:scale(0); opacity:.4; } to{ transform:scale(2.6); opacity:0; } }
  @keyframes glowPulse{ 0%,100%{ box-shadow:0 0 0 0 rgba(95,227,224,0); } 50%{ box-shadow:0 0 22px 1px rgba(95,227,224,.14); } }
  @keyframes scanMove{ from{ background-position:0 0; } to{ background-position:0 40px; } }

  .fire-wrap{ position:fixed; inset:0; pointer-events:none; z-index:0; }
  #fireCanvas{ position:absolute; inset:0; width:100%; height:100%; display:block; }
  .scan-overlay{
    position:fixed; inset:0; pointer-events:none; z-index:1; opacity:.35;
    background:repeating-linear-gradient(0deg, rgba(95,227,224,.05) 0 1px, transparent 1px 3px);
    animation:scanMove 6s linear infinite;
  }
  .vignette{
    position:fixed; inset:0; pointer-events:none; z-index:1;
    background:radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.55) 100%);
  }

  h1{
    font-family:'Orbitron', sans-serif;
    font-weight:700;
    font-size:clamp(2.3rem, 7.5vw, 4.4rem);
    letter-spacing:.06em;
    text-align:center;
    perspective:600px;
  }
  h1 .letter{
    display:inline-block;
    animation:letterIn .7s cubic-bezier(.16,1,.3,1) both;
    color:var(--cyan);
    text-shadow:0 0 18px rgba(95,227,224,.55), 0 0 46px rgba(95,227,224,.18);
  }
  h1 .line2 .letter{
    color:var(--purple);
    text-shadow:0 0 18px rgba(139,111,217,.55), 0 0 46px rgba(139,111,217,.18);
  }
  .hero-sub{
    margin-top:16px; text-align:center; font-family:'Share Tech Mono', monospace;
    font-size:.78rem; letter-spacing:.14em; text-transform:uppercase; color:var(--paper-dim);
    animation:fadeIn 1s ease .6s both;
  }
  .hero-sub .dot{
    display:inline-block; width:6px; height:6px; border-radius:50%;
    background:var(--cyan); margin-right:8px;
    box-shadow:0 0 8px 2px rgba(95,227,224,.7);
    animation:glowPulse 2s ease-in-out infinite;
  }

  .card{
    margin-top:48px;
    width:100%; max-width:420px;
    background:linear-gradient(180deg, rgba(15,22,32,.9), rgba(10,14,20,.94));
    backdrop-filter:blur(6px);
    border:1px solid rgba(95,227,224,.25);
    border-radius:4px;
    padding:0 0 30px;
    position:relative;
    animation:popIn .8s cubic-bezier(.16,1,.3,1) .25s both, glowPulse 4s ease-in-out 1.2s infinite;
    transition:border-color .3s, transform .12s ease-out;
    transform-style:preserve-3d;
    will-change:transform;
  }
  .card::before, .card::after{
    content:""; position:absolute; width:16px; height:16px;
    border:2px solid var(--cyan); opacity:.7;
  }
  .card::before{ top:-1px; left:-1px; border-right:none; border-bottom:none; }
  .card::after{ bottom:-1px; right:-1px; border-left:none; border-top:none; }
  .corner-tr, .corner-bl{ position:absolute; width:16px; height:16px; border:2px solid var(--purple); opacity:.7; }
  .corner-tr{ top:-1px; right:-1px; border-left:none; border-bottom:none; }
  .corner-bl{ bottom:-1px; left:-1px; border-right:none; border-top:none; }

  .card-header{
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 22px;
    border-bottom:1px solid rgba(95,227,224,.18);
    font-family:'Share Tech Mono', monospace;
    font-size:.68rem; letter-spacing:.1em; text-transform:uppercase; color:var(--paper-dim);
    margin-bottom:26px;
  }
  .card-header .rec{ display:flex; align-items:center; gap:6px; color:var(--cyan); }
  .card-header .rec .dot{
    width:6px; height:6px; border-radius:50%; background:var(--cyan);
    box-shadow:0 0 6px 2px rgba(95,227,224,.6);
    animation:glowPulse 1.6s ease-in-out infinite;
  }

  .card-body{ padding:0 26px; }

  .tabs{
    display:flex; position:relative;
    background:rgba(95,227,224,.05);
    border:1px solid rgba(95,227,224,.25);
    border-radius:4px; padding:4px; margin-bottom:26px;
  }
  .tabs::before{
    content:""; position:absolute; top:4px; left:4px;
    width:calc(50% - 4px); height:calc(100% - 8px);
    background:rgba(95,227,224,.16);
    border:1px solid var(--cyan);
    border-radius:3px;
    transition:transform .35s cubic-bezier(.65,0,.35,1);
    z-index:0;
  }
  .tabs.signup-active::before{ transform:translateX(100%); border-color:var(--purple); background:rgba(139,111,217,.16); }
  .tab{
    flex:1; text-align:center; padding:10px 4px;
    font-family:'Share Tech Mono', monospace;
    font-size:.66rem; letter-spacing:.08em; text-transform:uppercase;
    color:var(--paper-dim); border:none; background:transparent; cursor:pointer;
    transition:color .25s; position:relative; z-index:1;
  }
  .tab.active{ color:var(--cyan); }
  .tabs.signup-active .tab.active{ color:var(--purple); }

  .card form{ display:none; flex-direction:column; gap:17px; }
  .card form.active{ display:flex; animation:riseIn .45s cubic-bezier(.16,1,.3,1) both; }

  .field{ position:relative; }
  .field label{
    display:block; font-family:'Share Tech Mono', monospace;
    font-size:.66rem; letter-spacing:.1em; text-transform:uppercase;
    color:var(--cyan); margin-bottom:8px; transition:color .2s;
  }
  .field input{
    width:100%;
    background:rgba(95,227,224,.03);
    border:1px solid rgba(95,227,224,.25);
    color:var(--paper);
    padding:12px 14px; border-radius:3px;
    font-size:.95rem; font-family:'Rajdhani', sans-serif; font-weight:500;
    transition:border-color .25s, box-shadow .25s, background .25s;
  }
  .field input::placeholder{ color:#4c5e68; }
  .field input:focus{
    outline:none; border-color:var(--cyan);
    box-shadow:0 0 0 3px rgba(95,227,224,.1);
    background:rgba(95,227,224,.06);
  }
  .field:focus-within label{ color:var(--purple); }

  .pwd-wrap{ position:relative; }
  .pwd-wrap input{ padding-right:42px; }
  .pwd-toggle{
    position:absolute; top:50%; right:10px; transform:translateY(-50%);
    width:26px; height:26px; padding:0; border:none; background:transparent;
    color:var(--paper-dim); cursor:pointer; display:flex; align-items:center; justify-content:center;
    transition:color .2s;
  }
  .pwd-toggle:hover{ color:var(--cyan); }
  .pwd-toggle svg{ width:18px; height:18px; }

  .pseudo-status{
    display:block; margin-top:7px; font-family:'Share Tech Mono', monospace;
    font-size:.7rem; min-height:1em; letter-spacing:.03em;
  }
  .pseudo-status.ok, .pseudo-status.taken{ animation:riseIn .3s ease both; }
  .pseudo-status.ok{ color:var(--cyan); }
  .pseudo-status.taken{ color:var(--danger); }
  .pseudo-status.checking{ color:var(--paper-dim); }

  .submit-btn{
    margin-top:8px;
    background:linear-gradient(90deg, var(--cyan), var(--purple));
    color:var(--void); font-weight:700;
    padding:13px; border:none; border-radius:3px;
    font-family:'Share Tech Mono', monospace; font-size:.82rem; letter-spacing:.1em; text-transform:uppercase;
    cursor:pointer; position:relative; overflow:hidden;
    transition:filter .2s, transform .15s, box-shadow .25s;
  }
  .submit-btn:hover{ filter:brightness(1.1); transform:translateY(-2px); box-shadow:0 10px 26px -12px rgba(95,227,224,.5); }
  .submit-btn:active{ transform:translateY(0) scale(.98); }
  .submit-btn .ripple{
    position:absolute; width:16px; height:16px; border-radius:50%;
    background:rgba(10,14,20,.35); transform:scale(0); pointer-events:none;
    animation:rippleOut .55s ease-out forwards;
  }
  .submit-btn.loading{ color:transparent; pointer-events:none; }
  .submit-btn.loading::after{
    content:""; position:absolute; top:50%; left:50%;
    width:18px; height:18px; margin:-9px 0 0 -9px;
    border:2.5px solid rgba(10,14,20,.3); border-top-color:var(--void);
    border-radius:50%; animation:spin .7s linear infinite;
  }
  @keyframes spin{ to{ transform:rotate(360deg); } }

  .status-msg{
    display:none; margin-top:16px; padding:12px 14px;
    border:1px solid rgba(95,227,224,.35); background:rgba(95,227,224,.06);
    border-radius:3px; font-family:'Share Tech Mono', monospace; font-size:.78rem; color:var(--cyan);
  }
  .status-msg.show{ display:block; animation:riseIn .4s cubic-bezier(.16,1,.3,1) both; }

  footer{
    margin-top:50px; font-family:'Share Tech Mono', monospace;
    font-size:.72rem; letter-spacing:.08em; color:var(--paper-dim);
    animation:fadeIn 1s ease .5s both;
  }

  h1, .card, footer, .hero-sub{ position:relative; z-index:2; }

  #landing{
    display:flex; flex-direction:column; align-items:center;
    transition:opacity .4s ease, transform .4s ease;
  }
  #landing.leaving{ opacity:0; transform:translateY(-16px) scale(.98); pointer-events:none; }

  #dashboard{ display:none; position:relative; z-index:2; width:100%; min-height:100vh; flex-direction:column; }
  #dashboard.active{ display:flex; }

  .topbar{
    display:flex; align-items:center; justify-content:space-between;
    padding:18px 4vw; border-bottom:1px solid rgba(95,227,224,.2);
    opacity:0; position:relative;
    animation:riseIn .6s cubic-bezier(.16,1,.3,1) .05s forwards;
    background:rgba(95,227,224,.03);
  }
  .topbar::after{
    content:""; position:absolute; top:0; bottom:0; left:0; width:30%;
    background:linear-gradient(90deg, transparent, rgba(95,227,224,.16), transparent);
    animation:hudSweep 1.1s ease-out .5s both;
    pointer-events:none;
  }
  .topbar-brand{
    font-family:'Orbitron', sans-serif; font-weight:700; font-size:1.05rem; letter-spacing:.05em;
    color:var(--cyan); text-shadow:0 0 14px rgba(95,227,224,.4);
  }
  .topbar-brand span{ color:var(--purple); text-shadow:0 0 14px rgba(139,111,217,.4); }
  .topbar-nav{ display:flex; align-items:center; gap:16px; }
  .boutique-btn{
    display:flex; align-items:center; gap:8px;
    background:transparent; color:var(--purple);
    border:1px solid var(--purple);
    font-family:'Share Tech Mono', monospace; font-size:.72rem; letter-spacing:.08em; text-transform:uppercase;
    padding:9px 16px; border-radius:3px; cursor:pointer;
    transition:background .2s, transform .15s, box-shadow .25s, color .2s;
  }
  .boutique-btn:hover{
    background:rgba(139,111,217,.14); color:#c9bdf2;
    box-shadow:0 10px 22px -10px rgba(139,111,217,.5);
  }
  .boutique-btn:active{ transform:scale(.97); }
  .boutique-btn .icon{ display:inline-block; width:15px; height:15px; transition:transform .25s; }
  .boutique-btn:hover .icon{ transform:translateY(-1px) rotate(-8deg) scale(1.1); }

  .capacites-btn{
    position:relative;
    display:flex; align-items:center; justify-content:center;
    width:32px; height:32px;
    background:transparent; color:var(--cyan);
    border:1px solid var(--cyan);
    border-radius:3px; cursor:pointer;
    transition:background .2s, transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .25s, color .2s;
  }
  .capacites-btn:hover{
    background:rgba(95,227,224,.14); color:#bdf3f2;
    box-shadow:0 10px 22px -10px rgba(95,227,224,.5);
  }
  .capacites-btn:active{ transform:scale(.9); }
  .capacites-btn.active{
    background:rgba(95,227,224,.18); color:#bdf3f2;
    animation:capacitesGlow 2.4s ease-in-out infinite;
  }
  @keyframes capacitesGlow{
    0%,100%{ box-shadow:0 0 0 1px var(--cyan), 0 0 8px rgba(95,227,224,.25); }
    50%{ box-shadow:0 0 0 1px var(--cyan), 0 0 18px rgba(95,227,224,.6); }
  }

  .capacites-btn .icon{ transition:transform .3s cubic-bezier(.34,1.56,.64,1); }
  .capacites-btn:hover .icon{ transform:rotate(8deg); }
  .capacites-btn .icon rect{
    transform-box:fill-box; transform-origin:center;
    transition:transform .3s cubic-bezier(.34,1.56,.64,1);
  }
  .capacites-btn:hover .icon rect:nth-child(1){ transform:scale(1.22); transition-delay:0s; }
  .capacites-btn:hover .icon rect:nth-child(2){ transform:scale(1.22); transition-delay:.05s; }
  .capacites-btn:hover .icon rect:nth-child(3){ transform:scale(1.22); transition-delay:.1s; }
  .capacites-btn:hover .icon rect:nth-child(4){ transform:scale(1.22); transition-delay:.15s; }

  .btn-tooltip{
    position:absolute; top:calc(100% + 12px); right:0;
    width:230px; max-width:calc(100vw - 24px); padding:10px 12px; border-radius:8px;
    background:linear-gradient(180deg, #131a24, #0c1119);
    border:1.5px solid var(--cyan);
    color:var(--paper); font-family:'Rajdhani', sans-serif; font-weight:500;
    font-size:.78rem; line-height:1.35; text-align:left;
    letter-spacing:normal; text-transform:none;
    box-shadow:0 14px 28px -14px rgba(0,0,0,.65);
    opacity:0; pointer-events:none;
    transform-origin:top right;
    transform:translateY(-8px) scale(.9);
    transition:opacity .2s cubic-bezier(.16,1,.3,1), transform .3s cubic-bezier(.34,1.56,.64,1);
    z-index:20;
  }
  .btn-tooltip strong{ color:var(--cyan); font-family:'Share Tech Mono', monospace; font-size:.72rem; letter-spacing:.04em; text-transform:uppercase; }
  .btn-tooltip::before{
    content:''; position:absolute; bottom:100%; right:10px;
    border:6px solid transparent; border-bottom-color:var(--cyan);
  }
  .capacites-btn:hover .btn-tooltip, .capacites-btn:focus-visible .btn-tooltip{
    opacity:1; transform:translateY(0) scale(1); pointer-events:auto;
  }
  .capacites-btn .icon{ width:14px; height:14px; }

  .user-chip{
    display:flex; align-items:center; gap:10px; font-family:'Share Tech Mono', monospace; font-size:.76rem; color:var(--paper-dim);
    text-decoration:none; cursor:pointer; transition:opacity .2s;
  }
  .user-chip:hover{ opacity:.85; }
  .user-chip-info{ display:flex; flex-direction:column; gap:3px; }
  .user-level{ display:flex; align-items:center; gap:6px; font-size:.62rem; color:#f2c46d; letter-spacing:.03em; }
  .user-level-bar{ width:48px; height:4px; border-radius:2px; background:rgba(255,255,255,.12); overflow:hidden; }
  .user-level-bar span{ display:block; height:100%; background:linear-gradient(90deg, #f2c46d, #e0a83f); }
  .avatar{
    --avatar-color: var(--cyan);
    width:30px; height:30px; border-radius:50%;
    background:color-mix(in srgb, var(--avatar-color) 12%, transparent); border:1px solid var(--avatar-color);
    display:flex; align-items:center; justify-content:center;
    font-family:'Orbitron', serif; font-weight:700; color:var(--avatar-color); font-size:.8rem;
    animation:avatarPulse 2.6s ease-in-out infinite;
  }
  @keyframes avatarPulse{
    0%,100%{ box-shadow:0 0 0 0 color-mix(in srgb, var(--avatar-color) 35%, transparent); }
    50%{ box-shadow:0 0 0 5px color-mix(in srgb, var(--avatar-color) 0%, transparent); }
  }
  .avatar-swatch{
    --swatch-color: var(--cyan);
    width:34px; height:34px; border-radius:50%; cursor:pointer;
    background:var(--swatch-color); border:2px solid transparent;
    transition:transform .15s ease, border-color .15s ease;
  }
  .avatar-swatch:hover{ transform:scale(1.1); }
  .avatar-swatch--active{ border-color:#fff; box-shadow:0 0 0 2px var(--swatch-color); }
  .avatar-icon-swatch{
    width:38px; height:38px; border-radius:50%; cursor:pointer;
    background:#10161e; border:2px solid rgba(255,255,255,.15);
    display:flex; align-items:center; justify-content:center;
    font-size:1.1rem; font-family:'Orbitron', serif; font-weight:700; color:var(--paper-dim);
    transition:transform .15s ease, border-color .15s ease;
  }
  .avatar-icon-swatch:hover{ transform:scale(1.1); border-color:var(--cyan); }
  .avatar-icon-swatch--active{ border-color:var(--cyan); box-shadow:0 0 0 2px rgba(95,227,224,.5); }
  .avatar-icon-swatch--admin{ border-color:#f2c46d; }
  .avatar-icon-swatch--admin.avatar-icon-swatch--active{ border-color:#f2c46d; box-shadow:0 0 0 2px rgba(242,196,109,.5); }
  .logout-link{
    font-family:'Share Tech Mono', monospace; font-size:.72rem; letter-spacing:.05em; text-transform:uppercase;
    color:var(--paper-dim); border-bottom:1px dotted var(--paper-dim); transition:color .2s, border-color .2s;
  }
  .logout-link:hover{ color:var(--danger); border-color:var(--danger); }

  .dash-body{ flex:1; display:flex; justify-content:center; align-items:center; padding:6vh 4vw; }

  /* ---------- CARTES DE CAPACITÉ (façon roster de brawlers) ---------- */
  .bs-panel-sub{
    font-family:'Share Tech Mono', monospace; font-size:.68rem; color:var(--paper-dim); letter-spacing:.03em;
  }

  .game-card{
    position:relative; overflow:hidden;
    background:
      radial-gradient(120% 140% at 30% 15%, color-mix(in srgb, var(--card-color) 45%, transparent), transparent 60%),
      linear-gradient(160deg, #1c2733, #10161e 75%);
    border:2.5px solid var(--card-color);
    border-radius:14px;
    padding:12px 10px;
    display:flex; flex-direction:column; align-items:center; gap:8px;
    box-shadow:
      0 8px 0 -2px rgba(0,0,0,.35), 0 10px 20px -10px rgba(0,0,0,.6),
      inset 0 0 18px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.12),
      0 0 0 1px color-mix(in srgb, var(--card-color) 35%, transparent);
    transition:transform .2s ease, box-shadow .25s ease, border-color .25s ease;
    opacity:0; transform:translateY(14px) scale(.92);
    animation:cardIn .5s cubic-bezier(.16,1,.3,1) forwards;
  }
  .game-card::before{
    content:''; position:absolute; inset:0; pointer-events:none; z-index:1;
    background:linear-gradient(115deg, transparent 40%, rgba(255,255,255,.12) 48%, transparent 56%);
    transform:translateX(-140%);
    transition:transform .6s ease;
  }
  .game-card:hover::before{ transform:translateX(140%); }
  .game-card:hover{
    transform:translateY(-5px) scale(1.03);
    box-shadow:
      0 10px 0 -2px rgba(0,0,0,.35), 0 20px 30px -14px rgba(0,0,0,.65),
      inset 0 0 18px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.16),
      0 0 22px -2px color-mix(in srgb, var(--card-color) 65%, transparent);
  }
  @keyframes cardIn{
    from{ opacity:0; transform:translateY(14px) scale(.92); }
    to{ opacity:1; transform:translateY(0) scale(1); }
  }
  .game-card--special{ border-style:dashed; }
  .game-card--special::after{
    content:''; position:absolute; top:10px; right:10px; width:16px; height:16px; z-index:1;
    background:var(--card-color);
    clip-path:polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    filter:drop-shadow(0 0 4px var(--card-color));
  }

  .game-card-img{
    position:relative;
    width:100%; aspect-ratio:1; border-radius:10px; overflow:hidden;
    background:radial-gradient(120% 120% at 50% 30%, color-mix(in srgb, var(--card-color) 30%, transparent), rgba(255,255,255,.06) 70%);
    box-shadow:inset 0 0 0 2px rgba(255,255,255,.14), inset 0 0 0 4px rgba(0,0,0,.25);
    display:flex; align-items:center; justify-content:center;
  }
  .game-card-img img{
    width:100%; height:100%; object-fit:cover; display:block;
    filter:drop-shadow(0 4px 8px rgba(0,0,0,.35));
    transition:transform .3s cubic-bezier(.34,1.56,.64,1);
  }
  .game-card:hover .game-card-img img{ transform:scale(1.08); }
  .game-card-name{
    font-family:'Lilita One', sans-serif; font-size:.86rem; letter-spacing:.03em; text-transform:uppercase;
    color:#fff; text-align:center; text-shadow:0 2px 0 rgba(0,0,0,.5); line-height:1.15;
    position:relative; z-index:1;
  }
  .game-card-stats{
    display:flex; gap:12px; font-family:'Share Tech Mono', monospace; font-size:.72rem; color:var(--paper-dim);
    position:relative; z-index:1;
  }
  .game-card-stats span{ display:flex; align-items:center; gap:3px; }
  .game-card-stats svg{ width:13px; height:13px; color:var(--card-color); filter:drop-shadow(0 0 3px color-mix(in srgb, var(--card-color) 60%, transparent)); }
  .game-card-desc{
    font-size:.72rem; line-height:1.4; color:var(--paper-dim); text-align:center;
    position:relative; z-index:1;
  }
  /* ---------- PAGE "TOUTES LES CARTES" ---------- */
  .cartes-body{ width:100%; max-width:960px; display:flex; flex-direction:column; gap:36px; padding:6vh 4vw; }
  .cartes-head{ display:flex; flex-direction:column; gap:6px; opacity:0; animation:riseIn .7s cubic-bezier(.16,1,.3,1) .1s forwards; }
  .cartes-head h1{ text-align:left; font-size:clamp(1.8rem, 3.6vw, 2.7rem); }
  .cartes-section{ display:flex; flex-direction:column; gap:14px; opacity:0; animation:riseIn .7s cubic-bezier(.16,1,.3,1) .2s forwards; }
  .cartes-section[hidden]{ display:none; }
  .cartes-tabs{
    display:inline-flex; gap:4px;
    background:rgba(95,227,224,.05);
    border:1px solid rgba(95,227,224,.25);
    border-radius:4px; padding:4px;
    opacity:0; animation:riseIn .7s cubic-bezier(.16,1,.3,1) .15s forwards;
  }
  .cartes-tab{
    padding:9px 22px;
    font-family:'Share Tech Mono', monospace; font-size:.72rem; letter-spacing:.08em; text-transform:uppercase;
    color:var(--paper-dim); border:none; border-radius:3px; background:transparent; cursor:pointer;
    transition:color .2s, background .2s;
  }
  .cartes-tab:hover{ color:var(--paper); }
  .cartes-tab.active{ color:var(--void); background:var(--cyan); }

  .mode-tabs{
    display:inline-flex; gap:4px;
    background:rgba(139,111,217,.06);
    border:1px solid rgba(139,111,217,.3);
    border-radius:4px; padding:4px;
    opacity:0; animation:riseIn .7s cubic-bezier(.16,1,.3,1) .1s forwards;
  }
  .mode-tab{
    padding:9px 22px;
    font-family:'Share Tech Mono', monospace; font-size:.72rem; letter-spacing:.08em; text-transform:uppercase;
    color:var(--paper-dim); border:none; border-radius:3px; background:transparent; cursor:pointer;
    transition:color .2s, background .2s;
  }
  .mode-tab:hover{ color:var(--paper); }
  .mode-tab.active{ color:#fff; background:var(--purple); }
  #mode-horsligne, #mode-enligne{ display:flex; flex-direction:column; gap:36px; margin-top:22px; }
  #mode-horsligne[hidden], #mode-enligne[hidden]{ display:none; }

  .cartes-section-head{ display:flex; align-items:baseline; justify-content:space-between; }
  .cartes-grid{
    display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:16px;
  }

  /* ---------- PAGE "CARRIÈRE" (statistiques) ---------- */
  .stats-grid{
    display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:16px;
  }
  .stat-card{
    display:flex; flex-direction:column; gap:6px;
    background:linear-gradient(160deg, #1c2733, #10161e 75%);
    border:1.5px solid var(--cyan); border-radius:12px;
    padding:18px 20px;
    box-shadow:0 14px 28px -18px rgba(95,227,224,.35), inset 0 0 18px rgba(0,0,0,.35);
  }
  .stat-value{
    font-family:'Lilita One', sans-serif; font-size:1.8rem; color:#fff; -webkit-text-stroke:.6px #1a2230;
  }
  .stat-label{
    font-family:'Share Tech Mono', monospace; font-size:.7rem; letter-spacing:.06em; text-transform:uppercase; color:var(--paper-dim);
  }

  /* ---------- PAGE "ÉVÉNEMENTS" (maps) ---------- */
  .maps-grid{
    display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:20px;
  }
  .map-card{
    position:relative; overflow:hidden; cursor:pointer;
    display:flex; flex-direction:column; gap:10px;
    background:linear-gradient(160deg, #1c2733, #10161e 75%);
    border:2px solid color-mix(in srgb, var(--map-color) 45%, rgba(255,255,255,.12));
    border-radius:14px;
    padding:14px;
    box-shadow:
      0 10px 20px -12px rgba(0,0,0,.6), inset 0 0 18px rgba(0,0,0,.3),
      inset 0 1px 0 rgba(255,255,255,.1);
    transition:transform .2s ease, box-shadow .25s ease, border-color .25s ease;
    opacity:0; transform:translateY(14px) scale(.96);
    animation:cardIn .5s cubic-bezier(.16,1,.3,1) forwards;
  }
  .map-card::before{
    content:''; position:absolute; inset:0; pointer-events:none; z-index:1;
    background:linear-gradient(115deg, transparent 40%, rgba(255,255,255,.1) 48%, transparent 56%);
    transform:translateX(-140%);
    transition:transform .6s ease;
  }
  .map-card:hover::before{ transform:translateX(140%); }
  .map-card:hover{
    transform:translateY(-5px);
    border-color:var(--map-color);
    box-shadow:
      0 16px 26px -14px rgba(0,0,0,.65), inset 0 0 18px rgba(0,0,0,.3),
      inset 0 1px 0 rgba(255,255,255,.14),
      0 0 22px -4px color-mix(in srgb, var(--map-color) 65%, transparent);
  }
  .map-grid{
    position:relative; z-index:1;
    display:grid; grid-template-columns:repeat(var(--map-size), 1fr);
    gap:1.5px; background:#000; border-radius:10px; overflow:hidden;
    aspect-ratio:1; width:100%;
    box-shadow:inset 0 0 0 2px rgba(255,255,255,.1), 0 8px 16px -10px rgba(0,0,0,.7);
  }
  .map-grid .cell{
    position:relative; z-index:1; display:block; width:100%; height:100%;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.18), inset 0 -1px 0 rgba(0,0,0,.3);
  }
  .map-grid .cell--spawn::after{
    content:''; position:absolute; inset:28%; border-radius:50%;
    background:#fff;
    box-shadow:0 0 5px 1px rgba(255,255,255,.85);
  }
  .map-grid .cell--feature{ box-shadow:inset 0 0 0 1px rgba(255,255,255,.35); }
  .map-card-name{
    position:relative; z-index:1;
    font-family:'Lilita One', sans-serif; font-size:.95rem; letter-spacing:.02em; text-transform:uppercase;
    color:#fff; text-shadow:0 2px 0 rgba(0,0,0,.5);
  }
  .map-card-desc{ position:relative; z-index:1; font-size:.78rem; color:var(--paper-dim); line-height:1.4; }
  .map-card:focus-visible{ outline:2px solid var(--cyan); outline-offset:3px; }
  .map-card--locked{ cursor:not-allowed; border-color:rgba(255,255,255,.12); }
  .map-card--locked:hover{ transform:none; border-color:rgba(255,255,255,.12); box-shadow:0 10px 20px -12px rgba(0,0,0,.6), inset 0 0 18px rgba(0,0,0,.3); }
  .map-card--locked:hover::before{ transform:translateX(-140%); }
  .map-card--locked .map-grid{ filter:grayscale(.85) brightness(.45); }
  .map-card--locked .map-card-name{ color:var(--paper-dim); }
  .map-card-lock{
    position:absolute; z-index:2; top:14px; left:14px; right:14px; aspect-ratio:1;
    display:flex; align-items:center; justify-content:center;
    font-family:'Lilita One', sans-serif; font-size:1rem; letter-spacing:.04em; text-transform:uppercase;
    color:#fff; text-shadow:0 2px 6px rgba(0,0,0,.9);
  }

  .map-modal-overlay{
    position:fixed; inset:0; z-index:60;
    display:flex; align-items:center; justify-content:center;
    background:rgba(5,7,11,.75); backdrop-filter:blur(4px);
    padding:20px;
    opacity:0; pointer-events:none; transition:opacity .2s ease;
  }
  .map-modal-overlay[hidden]{ display:none; }
  .map-modal-overlay.show{ opacity:1; pointer-events:auto; }
  .map-modal{
    position:relative; width:100%; max-width:420px;
    background:linear-gradient(160deg, #1c2733, #10161e 75%);
    border:2px solid rgba(95,227,224,.35); border-radius:16px;
    padding:28px 24px 24px;
    box-shadow:0 30px 60px -20px rgba(0,0,0,.7);
    transform:translateY(16px) scale(.96);
    transition:transform .25s cubic-bezier(.16,1,.3,1);
  }
  .map-modal-overlay.show .map-modal{ transform:translateY(0) scale(1); }
  .map-modal-close{
    position:absolute; top:12px; right:12px; width:28px; height:28px;
    display:flex; align-items:center; justify-content:center;
    background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.15); border-radius:6px;
    color:var(--paper-dim); font-size:1.1rem; line-height:1; cursor:pointer;
    transition:color .2s, border-color .2s;
  }
  .map-modal-close:hover{ color:#fff; border-color:var(--cyan); }
  .map-modal h2{ text-align:left; font-size:1.5rem; margin:4px 0 2px; animation:none; }
  .map-modal-sub{ font-size:.82rem; color:var(--paper-dim); margin-bottom:16px; }
  .map-modal-players{ display:flex; flex-wrap:wrap; gap:10px; }
  .map-modal-player-btn{
    flex:1; min-width:80px;
    background:transparent; color:var(--cyan); border:1.5px solid var(--cyan); border-radius:8px;
    padding:12px 10px; font-family:'Share Tech Mono', monospace; font-size:.8rem; letter-spacing:.04em;
    cursor:pointer; transition:background .2s, color .2s, transform .15s;
  }
  .map-modal-player-btn:hover{ background:rgba(95,227,224,.14); color:#bdf3f2; }
  .map-modal-player-btn:active{ transform:scale(.96); }
  .map-modal-confirm{
    font-size:.85rem; line-height:1.5; color:#bdf3f2;
    padding:14px; border:1px dashed rgba(95,227,224,.4); border-radius:10px;
  }
  .map-modal-names{ display:flex; flex-direction:column; gap:10px; margin-bottom:16px; }
  .map-modal-name-input{
    background:rgba(95,227,224,.05); border:1px solid rgba(95,227,224,.3); border-radius:6px;
    padding:10px 12px; color:var(--paper); font-family:'Rajdhani', sans-serif; font-size:.9rem; font-weight:500;
    transition:border-color .2s, background .2s;
  }
  .map-modal-name-input:focus{ outline:none; border-color:var(--cyan); background:rgba(95,227,224,.08); }
  .map-modal-launch{
    width:100%;
    background:linear-gradient(90deg, var(--cyan), var(--purple)); color:var(--void); font-weight:700;
    border:none; border-radius:8px;
    padding:12px; font-family:'Share Tech Mono', monospace; font-size:.8rem; letter-spacing:.06em; text-transform:uppercase;
    cursor:pointer; transition:transform .15s, box-shadow .2s;
  }
  .map-modal-launch:hover:not(:disabled){ transform:translateY(-2px); box-shadow:0 10px 20px -12px rgba(95,227,224,.5); }
  .map-modal-launch:disabled{ opacity:.6; cursor:wait; }

  /* ---------- PAGE "BOUTIQUE" ---------- */
  .boutique-body{ width:100%; max-width:960px; display:flex; flex-direction:column; gap:28px; padding:6vh 4vw; }
  .boutique-head{ display:flex; flex-direction:column; align-items:flex-start; gap:14px; opacity:0; animation:riseIn .7s cubic-bezier(.16,1,.3,1) .1s forwards; }
  .boutique-head h1{ text-align:left; font-size:clamp(1.8rem, 3.6vw, 2.7rem); }
  .coin-balance{
    display:inline-flex; align-items:center; gap:8px;
    background:linear-gradient(180deg, #1c2733, #10161e 75%);
    border:2px solid #f2c46d; border-radius:999px;
    padding:8px 18px 8px 10px;
    font-family:'Share Tech Mono', monospace; font-size:.82rem; letter-spacing:.04em; color:#f2c46d;
    box-shadow:0 8px 20px -12px rgba(242,196,109,.5), inset 0 0 12px rgba(242,196,109,.08);
  }
  .coin-balance .coin-icon{ width:22px; height:22px; filter:drop-shadow(0 0 5px rgba(242,196,109,.6)); }
  .coin-balance strong{
    font-family:'Lilita One', sans-serif; font-size:1.1rem; color:#fff; -webkit-text-stroke:.6px #1a2230;
    display:inline-block;
  }
  .coin-balance strong.bump{ animation:coinBump .4s cubic-bezier(.34,1.56,.64,1); }
  @keyframes coinBump{
    0%{ transform:scale(1); }
    40%{ transform:scale(1.35); color:#fff9e6; }
    100%{ transform:scale(1); }
  }

  .ad-offer{
    display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
    opacity:0; animation:riseIn .7s cubic-bezier(.16,1,.3,1) .18s forwards;
    background:linear-gradient(160deg, #1c2733, #10161e 75%);
    border:2px solid #f2c46d; border-radius:14px;
    padding:18px 22px;
    box-shadow:0 14px 28px -18px rgba(242,196,109,.35), inset 0 0 18px rgba(0,0,0,.35);
  }
  .ad-offer-info{ display:flex; flex-direction:column; gap:4px; }
  .ad-offer-title{
    font-family:'Lilita One', sans-serif; font-size:1.1rem; color:#fff; -webkit-text-stroke:.6px #1a2230;
  }
  .ad-offer-desc{ font-size:.85rem; color:var(--paper-dim); }
  .ad-offer-progress{ font-family:'Share Tech Mono', monospace; font-size:.7rem; color:var(--paper-dim); letter-spacing:.02em; }
  .ad-offer-progress span{ color:#f2c46d; font-weight:700; }

  .music-toggle{
    position:fixed; bottom:18px; left:18px; z-index:80;
    width:38px; height:38px; border-radius:50%; cursor:pointer;
    background:linear-gradient(160deg, #1c2733, #10161e 75%);
    border:1.5px solid rgba(255,255,255,.15); color:var(--paper-dim);
    display:flex; align-items:center; justify-content:center; font-size:1rem;
    box-shadow:0 10px 22px -12px rgba(0,0,0,.6);
    transition:border-color .2s, transform .15s, box-shadow .2s;
  }
  .music-toggle:hover{ transform:scale(1.08); }
  .music-toggle--on{ border-color:var(--cyan); color:var(--cyan); box-shadow:0 0 16px -4px rgba(95,227,224,.6); }

  .card-win-toast{
    position:fixed; bottom:28px; right:28px; z-index:50;
    display:flex; align-items:center; gap:12px;
    background:linear-gradient(160deg, #1c2733, #10161e 75%);
    border:2px solid #f2c46d; border-radius:12px; padding:12px 18px;
    box-shadow:0 20px 40px -18px rgba(0,0,0,.7), 0 0 30px -6px rgba(242,196,109,.5);
    opacity:0; transform:translateY(20px) scale(.9);
    transition:opacity .3s cubic-bezier(.16,1,.3,1), transform .3s cubic-bezier(.16,1,.3,1);
  }
  .card-win-toast.show{ opacity:1; transform:translateY(0) scale(1); }
  .card-win-toast-img{
    width:54px; height:54px; border-radius:8px; overflow:hidden; flex-shrink:0;
    border:2px solid var(--card-color, #f2c46d); background:#fff;
  }
  .card-win-toast-img img{ width:100%; height:100%; object-fit:cover; display:block; }
  .card-win-toast-text{ display:flex; flex-direction:column; gap:2px; }
  .card-win-toast-title{
    font-family:'Share Tech Mono', monospace; font-size:.68rem; letter-spacing:.06em; text-transform:uppercase;
    color:#f2c46d;
  }
  #cardWinName{ font-family:'Lilita One', sans-serif; font-size:.95rem; color:#fff; }

  .level-up-overlay{
    position:fixed; inset:0; z-index:70;
    display:flex; align-items:center; justify-content:center;
    background:rgba(6,9,14,0); pointer-events:none;
    opacity:0; transition:opacity .3s ease, background .3s ease;
  }
  .level-up-overlay.show{ opacity:1; background:rgba(6,9,14,.6); pointer-events:auto; cursor:pointer; }
  .level-up-burst{
    position:relative;
    display:flex; flex-direction:column; align-items:center; gap:6px;
    transform:scale(.5); opacity:0;
    transition:transform .5s cubic-bezier(.34,1.56,.64,1), opacity .4s ease;
  }
  .level-up-overlay.show .level-up-burst{ transform:scale(1); opacity:1; }
  .level-up-burst::before{
    content:''; position:absolute; inset:-70px; z-index:-1;
    background:radial-gradient(circle, rgba(95,227,224,.45), transparent 70%);
    filter:blur(6px);
    animation:levelUpPulse 1.8s ease-in-out infinite;
  }
  @keyframes levelUpPulse{
    0%,100%{ transform:scale(1); opacity:.7; }
    50%{ transform:scale(1.25); opacity:1; }
  }
  .level-up-label{
    font-family:'Share Tech Mono', monospace; font-size:.85rem; letter-spacing:.16em; text-transform:uppercase;
    color:var(--cyan); text-shadow:0 0 14px rgba(95,227,224,.6);
  }
  .level-up-number{
    font-family:'Lilita One', sans-serif; font-size:4.5rem; line-height:1; color:#fff;
    -webkit-text-stroke:2px #1a2230;
    text-shadow:0 0 30px rgba(95,227,224,.8), 0 0 60px rgba(95,227,224,.4);
    animation:levelUpNumberPop .6s cubic-bezier(.34,1.56,.64,1) .1s both;
  }
  @keyframes levelUpNumberPop{
    0%{ transform:scale(0) rotate(-8deg); }
    60%{ transform:scale(1.2) rotate(4deg); }
    100%{ transform:scale(1) rotate(0); }
  }

  .booster-overlay{
    position:fixed; inset:0; z-index:71;
    display:flex; align-items:center; justify-content:center;
    background:rgba(6,9,14,0); pointer-events:none;
    opacity:0; transition:opacity .3s ease, background .3s ease;
  }
  .booster-overlay.show{ opacity:1; background:rgba(6,9,14,.72); pointer-events:auto; }

  .booster-pack{
    position:relative; cursor:pointer;
    display:flex; flex-direction:column; align-items:center; gap:8px;
    transform:scale(.4); opacity:0;
    transition:transform .5s cubic-bezier(.34,1.56,.64,1), opacity .4s ease;
    animation:boosterShake 1.6s ease-in-out .6s infinite;
  }
  .booster-overlay.show .booster-pack{ transform:scale(1); opacity:1; }
  .booster-pack[hidden]{ display:none; }
  @keyframes boosterShake{
    0%, 100%{ transform:rotate(0deg) scale(1); }
    20%{ transform:rotate(-6deg) scale(1.03); }
    40%{ transform:rotate(5deg) scale(1.03); }
    60%{ transform:rotate(-3deg) scale(1); }
    80%{ transform:rotate(2deg) scale(1); }
  }
  .booster-pack-glow{
    position:absolute; inset:-50px; z-index:-1;
    background:radial-gradient(circle, rgba(242,196,109,.5), transparent 70%);
    filter:blur(8px);
    animation:levelUpPulse 1.6s ease-in-out infinite;
  }
  .booster-pack-icon{ font-size:5rem; filter:drop-shadow(0 10px 20px rgba(0,0,0,.5)); }
  .booster-pack-label{
    font-family:'Lilita One', sans-serif; font-size:1.1rem; color:#fff; -webkit-text-stroke:.6px #1a2230;
  }
  .booster-pack-hint{
    font-family:'Share Tech Mono', monospace; font-size:.7rem; letter-spacing:.06em; text-transform:uppercase;
    color:#f2c46d;
  }
  .booster-pack--burst{ animation:boosterBurst .45s ease-in forwards !important; }
  @keyframes boosterBurst{
    0%{ transform:scale(1); opacity:1; filter:brightness(1); }
    60%{ transform:scale(1.5); opacity:1; filter:brightness(2.2); }
    100%{ transform:scale(2); opacity:0; filter:brightness(3); }
  }

  .booster-reveal{
    display:flex; flex-direction:column; align-items:center; gap:16px;
    transform:scale(.7); opacity:0;
    transition:transform .45s cubic-bezier(.34,1.56,.64,1), opacity .35s ease;
  }
  .booster-reveal.show{ transform:scale(1); opacity:1; }
  .booster-reveal[hidden]{ display:none; }
  .booster-reveal-title{
    font-family:'Share Tech Mono', monospace; font-size:.85rem; letter-spacing:.16em; text-transform:uppercase;
    color:#f2c46d; text-shadow:0 0 14px rgba(242,196,109,.6);
  }
  .booster-reveal-coins{
    display:flex; align-items:center; gap:8px;
    font-family:'Lilita One', sans-serif; font-size:1.6rem; color:#fff; -webkit-text-stroke:.6px #1a2230;
  }
  .booster-reveal-coins .coin-icon{ width:28px; height:28px; color:#f2c46d; filter:drop-shadow(0 0 6px rgba(242,196,109,.6)); }
  .booster-reveal-card{
    position:relative; overflow:hidden;
    display:flex; flex-direction:column; align-items:center; gap:8px;
    width:180px; padding:18px 14px;
    background:
      radial-gradient(120% 140% at 30% 15%, color-mix(in srgb, var(--card-color) 45%, transparent), transparent 60%),
      linear-gradient(160deg, #1c2733, #10161e 75%);
    border:2px solid var(--card-color); border-radius:14px;
    box-shadow:0 20px 40px -18px rgba(0,0,0,.7), 0 0 30px -8px var(--card-color);
    animation:boosterCardIn .5s cubic-bezier(.34,1.56,.64,1) .1s both;
  }
  @keyframes boosterCardIn{
    0%{ transform:rotateY(90deg); opacity:0; }
    100%{ transform:rotateY(0deg); opacity:1; }
  }
  .booster-reveal-card::after{
    content:''; position:absolute; top:0; left:-60%; width:40%; height:100%;
    background:linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
    animation:boosterShine 1.6s ease-in-out .5s;
  }
  @keyframes boosterShine{
    0%{ left:-60%; }
    100%{ left:140%; }
  }
  .booster-reveal-card img{ width:80px; height:80px; object-fit:cover; border-radius:10px; }
  .booster-reveal-card-badge{
    background:#f2c46d; color:#1a2230; font-weight:700;
    font-family:'Share Tech Mono', monospace; font-size:.62rem; letter-spacing:.04em;
    padding:3px 8px; border-radius:999px;
  }
  .booster-reveal-card-name{
    font-family:'Lilita One', sans-serif; font-size:.9rem; color:#fff; text-align:center;
  }

  .global-toast{
    position:fixed; top:28px; left:50%; z-index:60;
    display:flex; flex-direction:column; gap:2px; align-items:center; text-align:center;
    background:linear-gradient(160deg, #1c2733, #10161e 75%);
    border:2px solid #f2c46d; border-radius:12px; padding:14px 24px;
    box-shadow:0 20px 40px -18px rgba(0,0,0,.7), 0 0 30px -6px rgba(242,196,109,.5);
    opacity:0; transform:translate(-50%, -20px) scale(.9);
    transition:opacity .3s cubic-bezier(.16,1,.3,1), transform .3s cubic-bezier(.16,1,.3,1);
  }
  .global-toast.show{ opacity:1; transform:translate(-50%, 0) scale(1); }
  .global-toast-title{ font-family:'Lilita One', sans-serif; font-size:1rem; color:#f2c46d; }
  .ad-offer-btn{
    display:flex; align-items:center; gap:8px;
    background:linear-gradient(90deg, #f2c46d, #e0a83f); color:#1a1408; font-weight:700;
    border:none; border-radius:3px; cursor:pointer;
    padding:12px 20px; font-family:'Share Tech Mono', monospace; font-size:.8rem; letter-spacing:.06em; text-transform:uppercase;
    transition:box-shadow .25s, opacity .2s;
  }
  .ad-offer-btn svg{ width:16px; height:16px; }
  .ad-offer-btn:hover{ box-shadow:0 12px 26px -14px rgba(242,196,109,.7); }
  .ad-offer-btn:active{ transform:scale(.97); }
  .ad-offer-btn.loading{ opacity:.6; cursor:wait; }
  .ad-offer-btn:disabled{ cursor:not-allowed; }

  .shop-buy-btn{
    position:relative; z-index:1;
    display:flex; align-items:center; justify-content:center; gap:6px;
    width:100%;
    background:linear-gradient(90deg, #f2c46d, #e0a83f); color:#1a1408; font-weight:700;
    border:none; border-radius:4px; cursor:pointer;
    padding:9px 10px; font-family:'Share Tech Mono', monospace; font-size:.8rem; letter-spacing:.04em;
    transition:box-shadow .25s, opacity .2s;
  }
  .shop-buy-btn svg{ width:14px; height:14px; }
  .shop-buy-btn:hover:not(:disabled){ box-shadow:0 10px 20px -12px rgba(242,196,109,.7); }
  .shop-buy-btn:active:not(:disabled){ transform:scale(.97); }
  .shop-buy-btn.loading{ opacity:.6; cursor:wait; }
  .shop-buy-btn:disabled{ opacity:.4; cursor:not-allowed; }
  .shop-owned{
    position:relative; z-index:1;
    display:flex; align-items:center; justify-content:center;
    width:100%; padding:9px 10px; border-radius:4px;
    border:1.5px dashed rgba(255,255,255,.25);
    font-family:'Share Tech Mono', monospace; font-size:.72rem; letter-spacing:.06em; text-transform:uppercase;
    color:var(--paper-dim);
  }

  .game-card--promo{ border-color:#c65cff; }
  .game-card-promo-badge{
    position:absolute; top:10px; left:10px; z-index:2;
    background:#c65cff; color:#fff; font-weight:700;
    font-family:'Share Tech Mono', monospace; font-size:.66rem; letter-spacing:.04em;
    padding:3px 7px; border-radius:999px;
    box-shadow:0 4px 10px -4px rgba(198,92,255,.7);
  }
  .shop-price-old{ text-decoration:line-through; opacity:.6; font-size:.9em; }

  .game-card-owned-badge{
    position:absolute; top:10px; left:10px; z-index:2;
    background:var(--cyan); color:#0c1119; font-weight:700;
    font-family:'Share Tech Mono', monospace; font-size:.66rem; letter-spacing:.04em;
    padding:3px 7px; border-radius:999px;
    box-shadow:0 4px 10px -4px rgba(95,227,224,.7);
  }

  .game-card--locked{ filter:grayscale(.85); opacity:.55; }
  .shop-locked{
    position:relative; z-index:1;
    display:flex; align-items:center; justify-content:center; text-align:center;
    width:100%; padding:9px 10px; border-radius:4px;
    border:1.5px dashed rgba(255,255,255,.25);
    font-family:'Share Tech Mono', monospace; font-size:.68rem; letter-spacing:.03em;
    color:var(--paper-dim);
  }

  .admin-table{
    width:100%; border-collapse:collapse; min-width:980px;
    font-family:'Share Tech Mono', monospace; font-size:.78rem;
  }
  .admin-table th{
    text-align:left; padding:10px 12px; color:#f2c46d; letter-spacing:.04em; text-transform:uppercase; font-size:.68rem;
    border-bottom:2px solid rgba(242,196,109,.4);
  }
  .admin-table td{ padding:10px 12px; border-bottom:1px solid rgba(255,255,255,.08); color:var(--paper-dim); }
  .admin-tag{
    display:inline-block; margin-left:6px; padding:2px 7px; border-radius:999px;
    background:rgba(95,227,224,.15); border:1px solid var(--cyan); color:var(--cyan); font-size:.62rem;
  }
  .admin-banned{ color:var(--danger); font-weight:700; }
  .admin-action-btn{
    background:linear-gradient(90deg, #ff6b6b, #d64545); color:#fff; font-weight:700;
    border:none; border-radius:4px; cursor:pointer; padding:7px 14px;
    font-family:'Share Tech Mono', monospace; font-size:.72rem; letter-spacing:.03em; text-transform:uppercase;
    transition:box-shadow .2s;
  }
  .admin-action-btn:hover{ box-shadow:0 8px 16px -8px rgba(214,69,69,.7); }
  .admin-action-btn--unban{ background:linear-gradient(90deg, #5fe3e0, #2fb3b0); color:#0c2323; }
  .admin-action-btn--protect{ background:transparent; color:var(--cyan); border:1px solid var(--cyan); }
  .admin-action-btn--protect:hover{ background:rgba(95,227,224,.14); box-shadow:none; }
  .admin-action-btn--give{ background:linear-gradient(90deg, #f2c46d, #e0a83f); color:#2a1b00; }
  .admin-action-btn--give:hover{ box-shadow:0 8px 16px -8px rgba(242,196,109,.7); }
  .admin-action-btn:disabled{ opacity:.35; cursor:not-allowed; box-shadow:none; }
  .admin-table .admin-action-btn{ white-space:nowrap; }
  .admin-tag--protege{ background:rgba(242,196,109,.15); border-color:#f2c46d; color:#f2c46d; }
  .admin-actions{ display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
  .admin-give{ display:flex; gap:6px; }
  .admin-give input{
    width:110px; background:#10161e; color:#fff; border:1px solid rgba(242,196,109,.5); border-radius:4px;
    padding:6px 8px; font-family:'Share Tech Mono', monospace; font-size:.72rem;
  }
  .admin-give input:focus{ outline:none; border-color:#f2c46d; }
  .admin-tous{ display:flex; flex-wrap:wrap; gap:14px; }

  /* ---------- GEMMES (vertes, façon Brawl Stars) ---------- */
  .gem{ width:1.15em; height:1.15em; vertical-align:-.2em; flex-shrink:0; filter:drop-shadow(0 0 4px rgba(74,222,128,.55)); }
  .gem-chip{
    display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px;
    font-family:'Lilita One', sans-serif; font-size:.95rem; letter-spacing:.03em; color:#bbf7d0;
    background:linear-gradient(135deg, rgba(34,197,94,.22), rgba(21,128,61,.18));
    border:1px solid rgba(74,222,128,.6); box-shadow:0 0 14px -4px rgba(74,222,128,.7);
    vertical-align:middle;
  }
  a.gem-chip:hover{ filter:brightness(1.2); }
  .gem-chip--big{ font-size:1.15rem; padding:9px 18px; }
  .gem-chip--big strong{ color:#fff; }
  .gem-solde.bump{ display:inline-block; animation:coinBump .4s cubic-bezier(.34,1.56,.64,1); }
  .gem-offer-link{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; color:#86efac; font-weight:600; }
  .gem-offer-link:hover{ color:#bbf7d0; }

  /* Onglets de la boutique, façon Brawl Stars */
  .shop-soldes{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
  .shop-tabs{
    display:flex; gap:8px; overflow-x:auto; padding:6px 2px 10px; margin-top:6px;
    scrollbar-width:thin;
  }
  .shop-tab{
    position:relative; flex-shrink:0; display:flex; flex-direction:column; align-items:center; gap:2px;
    min-width:96px; padding:10px 14px 8px; border:0; border-radius:12px; cursor:pointer;
    font-family:'Lilita One', sans-serif; letter-spacing:.03em; color:var(--paper-dim);
    background:linear-gradient(180deg, #1c2733, #10161e); box-shadow:0 4px 0 #070a0f, inset 0 0 0 1px rgba(255,255,255,.08);
    transition:transform .15s, color .15s;
  }
  .shop-tab:hover{ transform:translateY(-2px); color:#fff; }
  .shop-tab-icone{ font-size:1.4rem; line-height:1; }
  .shop-tab-nom{ font-size:.85rem; white-space:nowrap; }
  .shop-tab.active{
    color:#2a1a00; transform:translateY(-2px);
    background:linear-gradient(180deg, #ffd166, #e0a83f); box-shadow:0 4px 0 #7a5410, 0 10px 20px -10px rgba(242,196,109,.8);
  }
  .shop-tab-nb{
    position:absolute; top:-6px; right:-4px; min-width:20px; height:20px; padding:0 5px; border-radius:999px;
    display:flex; align-items:center; justify-content:center;
    font-family:'Share Tech Mono', monospace; font-size:.68rem; color:#fff;
    background:#e5383b; box-shadow:0 0 0 2px var(--void);
  }
  .shop-panel{ display:flex; flex-direction:column; gap:18px; animation:riseIn .35s cubic-bezier(.16,1,.3,1); }
  .shop-panel[hidden]{ display:none; }
  .shop-vide{ padding:28px; text-align:center; color:var(--paper-dim); border:1px dashed rgba(255,255,255,.15); border-radius:14px; }
  .shop-vide a{ color:var(--cyan); text-decoration:underline; }
  .gem-item--parti{ transition:opacity .35s, transform .35s; opacity:0; transform:scale(.6); }

  /* Page profil : réglages à gauche, aperçu en direct à droite */
  .profil-body{ max-width:1400px; }
  .profil-layout{ display:grid; grid-template-columns:minmax(0, 1fr) 440px; grid-template-areas:"reglages apercu"; gap:28px; align-items:start; }
  .profil-reglages{ grid-area:reglages; display:flex; flex-direction:column; gap:28px; min-width:0; }
  .apercu{
    grid-area:apercu; position:sticky; top:20px;
    display:flex; flex-direction:column; align-items:center; gap:14px; padding:22px; border-radius:18px;
    background:rgba(12,17,24,.75); border:1px solid rgba(95,227,224,.3);
  }
  .apercu-label{ align-self:flex-start; display:flex; align-items:center; gap:8px; font-family:'Orbitron', sans-serif; font-size:.95rem; letter-spacing:.08em; text-transform:uppercase; color:var(--cyan); }
  .apercu-etat{ padding:2px 9px; border-radius:6px; font-family:'Share Tech Mono', monospace; font-size:.72rem; letter-spacing:0; text-transform:none; color:#2a1a00; background:#f2c46d; }
  .apercu-carte{
    width:100%; display:flex; flex-direction:column; align-items:center; gap:14px; padding:40px 24px 30px; border-radius:20px;
    background:linear-gradient(160deg, #1c2733, #0c1118); border:3px solid rgba(255,255,255,.25);
    box-shadow:0 20px 40px -18px rgba(0,0,0,.9), inset 0 0 30px rgba(0,0,0,.45);
  }
  .apercu-carte--pop{ animation:apercuPop .4s cubic-bezier(.34,1.56,.64,1); }
  .apercu-carte.banniere--anime.apercu-carte--pop{ animation:apercuPop .4s cubic-bezier(.34,1.56,.64,1), banniereDefile 6s ease-in-out infinite; }
  @keyframes apercuPop{ 40%{ transform:scale(1.05); } }
  .apercu-avatar{
    width:150px; height:150px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    font-family:'Orbitron', sans-serif; font-weight:700; font-size:4.2rem; color:var(--avatar-color);
    background:rgba(10,14,20,.7); border:4px solid var(--avatar-color); box-shadow:0 0 40px -4px var(--avatar-color);
    transition:border-color .25s, box-shadow .25s, color .25s;
  }
  .apercu-pseudo{ font-family:'Lilita One', sans-serif; font-size:2.3rem; color:#fff; letter-spacing:.03em; text-shadow:0 2px 6px rgba(0,0,0,.9); max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .apercu-titre:empty{ display:none; }
  .apercu-titre .profil-titre{ font-size:1.15rem; padding:5px 16px; border-radius:8px; }
  .apercu-niveau{ font-family:'Share Tech Mono', monospace; font-size:1rem; color:#f2c46d; text-shadow:0 1px 4px rgba(0,0,0,.9); }
  .apercu-carte .lobby-xp-bar{ height:10px; border-radius:5px; }
  .apercu-info{ font-size:.92rem; text-align:center; color:var(--paper-dim); }
  @media (max-width:1100px){
    .profil-layout{ grid-template-columns:minmax(0, 1fr) 340px; }
    .apercu-avatar{ width:120px; height:120px; font-size:3.3rem; }
    .apercu-pseudo{ font-size:1.9rem; }
  }
  @media (max-width:900px){
    .profil-layout{ grid-template-columns:minmax(0, 1fr); grid-template-areas:"apercu" "reglages"; }
    .apercu{ position:static; }
  }

  /* Collection sur le profil */
  .ad-offer.collection{ display:grid; grid-template-columns:minmax(0, 1fr); }
  .collection-item{
    padding:6px; border-radius:12px; cursor:pointer; background:transparent; color:inherit;
    border:2px solid rgba(255,255,255,.12); transition:border-color .2s, transform .2s;
  }
  .collection-item:hover{ transform:translateY(-2px); border-color:rgba(95,227,224,.6); }
  .collection-item--equipe{ border-color:var(--cyan); box-shadow:0 0 0 2px rgba(95,227,224,.35); cursor:default; position:relative; }
  .collection-item--equipe::after{
    content:"Équipé"; position:absolute; top:-9px; right:8px; padding:1px 8px; border-radius:6px;
    font-family:'Share Tech Mono', monospace; font-size:.62rem; color:var(--void); background:var(--cyan);
  }
  .collection-item{ position:relative; }
  .collection-item--choix{ border-color:#f2c46d; }
  .collection-item--choix::after{
    content:"Équiper ?"; position:absolute; inset:0; border-radius:10px;
    display:flex; align-items:center; justify-content:center;
    font-family:'Lilita One', sans-serif; font-size:1rem; letter-spacing:.04em; color:#2a1a00;
    background:rgba(242,196,109,.88); animation:popIn .25s cubic-bezier(.34,1.56,.64,1);
  }
  .collection-item--exclusif::before{
    content:"🎁 Exclusif"; position:absolute; top:-9px; left:8px; z-index:1; padding:1px 7px; border-radius:6px;
    font-family:'Share Tech Mono', monospace; font-size:.6rem; color:#fff; background:#c026d3;
  }
  .collection-titres{ display:flex; flex-wrap:wrap; gap:12px; padding-top:8px; }

  /* Exclusivités du coffre mystère (aperçu dans l'onglet Échanges) */
  .profil-carte--mini{ height:46px; padding:0; }
  .exclu-item{ position:relative; }
  .exclu-item:not(.exclu-item--obtenu) > :not(.exclu-etat){ filter:grayscale(.75) brightness(.6); }
  .exclu-etat{ margin-top:auto; font-family:'Share Tech Mono', monospace; font-size:.7rem; color:var(--paper-dim); }
  .exclu-item--obtenu .exclu-etat{ color:#86efac; }

  /* Popup « Débloqué ! » */
  .unlock-modal{
    position:fixed; inset:0; z-index:55; display:flex; align-items:center; justify-content:center; padding:16px;
    background:rgba(5,8,12,.75); backdrop-filter:blur(4px); opacity:0; transition:opacity .25s;
  }
  .unlock-modal[hidden]{ display:none; }
  .unlock-modal.show{ opacity:1; }
  .unlock-box{
    display:flex; flex-direction:column; align-items:center; gap:14px; width:min(360px, 100%); padding:28px 22px; border-radius:18px; text-align:center;
    border:2px solid #4ade80; background:radial-gradient(circle at 50% 0%, rgba(74,222,128,.25), transparent 60%), linear-gradient(160deg, #13261a, #0c1118);
    box-shadow:0 0 60px -10px rgba(74,222,128,.6);
    transform:scale(.7); transition:transform .4s cubic-bezier(.34,1.56,.64,1);
  }
  .unlock-modal.show .unlock-box{ transform:scale(1); }
  .unlock-titre{ font-family:'Lilita One', sans-serif; font-size:1.7rem; color:#86efac; }
  .unlock-apercu{ width:100%; display:flex; justify-content:center; }
  .unlock-apercu .profil-carte{ height:90px; }
  .unlock-apercu .profil-titre{ font-size:1.1rem; padding:6px 16px; }
  .unlock-apercu .gem-item-visuel{ font-size:3.6rem; }
  .unlock-apercu > *{ filter:none !important; animation:gemDebloque .9s cubic-bezier(.34,1.56,.64,1); }
  .unlock-nom{ font-weight:700; color:#fff; }
  .unlock-actions{ display:flex; gap:10px; align-items:center; }
  .unlock-plus-tard{ background:none; border:0; cursor:pointer; color:var(--paper-dim); font-family:'Share Tech Mono', monospace; text-decoration:underline; }
  .unlock-info{ font-size:.8rem; color:var(--paper-dim); }

  .dev-afk{ border-color:rgba(74,222,128,.45) !important; background:linear-gradient(90deg, rgba(34,197,94,.12), transparent 70%) !important; }
  .collection-titres .collection-item{ padding:8px 10px; }
  .avatar-icon-swatch--premium{ border-color:#4ade80; }

  .gem-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(118px, 1fr)); gap:12px; }
  .gem-grid--large{ grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); }
  .gem-item{
    --rarete:#7e93a0;
    display:flex; flex-direction:column; align-items:center; gap:8px; padding:14px 10px; border-radius:14px; text-align:center;
    background:linear-gradient(180deg, color-mix(in srgb, var(--rarete) 16%, #10161e), #0c1118);
    border:2px solid color-mix(in srgb, var(--rarete) 55%, transparent);
    transition:transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  }
  .gem-item:hover{ transform:translateY(-4px); box-shadow:0 12px 24px -12px var(--rarete); }
  .gem-item--rare{ --rarete:#3b9dff; }
  .gem-item--epique{ --rarete:#c65cff; }
  .gem-item--legendaire{ --rarete:#f2c46d; }
  .gem-item-visuel{ font-size:2.4rem; line-height:1.1; }
  .gem-item-nom{ font-weight:700; color:#fff; font-size:.95rem; }
  .gem-item-desc{ font-family:'Share Tech Mono', monospace; font-size:.7rem; color:var(--paper-dim); }
  .gem-item--debloque{ animation:gemDebloque .9s cubic-bezier(.34,1.56,.64,1); }
  @keyframes gemDebloque{ 0%{ transform:scale(1); } 35%{ transform:scale(1.12) rotate(-3deg); box-shadow:0 0 40px 6px rgba(74,222,128,.75); } 100%{ transform:scale(1); } }
  .gem-item--refus{ animation:gemRefus .4s; }
  @keyframes gemRefus{ 0%,100%{ transform:translateX(0); } 25%{ transform:translateX(-6px); } 75%{ transform:translateX(6px); } }

  .gem-buy-btn{
    display:inline-flex; align-items:center; justify-content:center; gap:6px; min-width:90px; margin-top:auto;
    padding:8px 14px; border:0; border-radius:999px; cursor:pointer;
    font-family:'Lilita One', sans-serif; font-size:.95rem; letter-spacing:.04em; color:#052e16;
    background:linear-gradient(180deg, #4ade80, #16a34a); box-shadow:0 4px 0 #14532d, 0 8px 16px -8px rgba(74,222,128,.8);
    transition:transform .15s, filter .15s;
  }
  .gem-buy-btn .gem{ filter:none; }
  .gem-buy-btn:hover{ filter:brightness(1.1); transform:translateY(-1px); }
  .gem-buy-btn:active{ transform:translateY(3px); box-shadow:0 1px 0 #14532d; }
  .gem-buy-btn[data-etat="confirm"]{ background:linear-gradient(180deg, #ffd166, #e0a83f); box-shadow:0 4px 0 #7a5410; animation:gemConfirm .8s ease-in-out infinite; }
  @keyframes gemConfirm{ 50%{ transform:scale(1.07); } }
  .gem-buy-btn[data-etat="possede"]{ background:rgba(95,227,224,.14); color:var(--cyan); box-shadow:inset 0 0 0 1px rgba(95,227,224,.5); }
  .gem-buy-btn[data-etat="equipe"]{ background:transparent; color:#86efac; box-shadow:inset 0 0 0 1px rgba(74,222,128,.6); }
  .gem-buy-btn.loading{ opacity:.6; pointer-events:none; }

  /* Carte de profil (bannière) : aperçu en boutique et carte joueur du lobby */
  .profil-carte{
    width:100%; height:86px; border-radius:10px; display:flex; align-items:center; gap:10px; padding:0 14px;
    background:linear-gradient(160deg, #1c2733, #10161e); border:1px solid rgba(255,255,255,.15);
    box-shadow:inset 0 0 24px rgba(0,0,0,.45);
  }
  .profil-carte .avatar{ width:42px; height:42px; font-size:1.1rem; background-color:rgba(10,14,20,.55); }
  .profil-carte-pseudo{ font-family:'Orbitron', sans-serif; font-weight:700; color:#fff; font-size:.85rem; text-shadow:0 1px 4px rgba(0,0,0,.8); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .banniere--anime{ animation:banniereDefile 6s ease-in-out infinite; }
  @keyframes banniereDefile{ 0%,100%{ background-position:0% 50%; } 50%{ background-position:100% 50%; } }
  .lobby-profile.banniere{ border-color:rgba(255,255,255,.3); box-shadow:inset 0 0 40px rgba(0,0,0,.45); }
  .lobby-profile.banniere .lobby-level, .lobby-profile.banniere .lobby-xp-label{ text-shadow:0 1px 4px rgba(0,0,0,.9); }
  .lobby-profile.banniere .lobby-xp-label{ color:#fff; }

  /* Titre affiché sous l'avatar, coloré selon sa rareté */
  .profil-titre{
    display:inline-block; padding:3px 12px; border-radius:6px;
    font-family:'Lilita One', sans-serif; font-size:.85rem; letter-spacing:.04em;
    color:#d6dee3; background:rgba(10,14,20,.7); border:1px solid rgba(255,255,255,.25);
  }
  .profil-titre--rare{ color:#8cc8ff; border-color:#3b9dff; }
  .profil-titre--epique{ color:#e2a8ff; border-color:#c65cff; text-shadow:0 0 8px rgba(198,92,255,.6); }
  .profil-titre--legendaire{
    color:#fff3c4; border-color:#f2c46d; text-shadow:0 0 10px rgba(242,196,109,.8);
    background:linear-gradient(90deg, rgba(90,61,0,.8), rgba(242,196,109,.35), rgba(90,61,0,.8)); background-size:200% 100%;
    animation:banniereDefile 3s linear infinite;
  }

  /* Booster : gemmes (rares) et code secret (jackpot très rare) */
  .booster-reveal-gemmes{
    display:inline-flex; align-items:center; gap:8px; padding:6px 16px; border-radius:999px;
    font-family:'Lilita One', sans-serif; font-size:1.25rem; color:#bbf7d0;
    background:rgba(34,197,94,.18); border:1px solid #4ade80; box-shadow:0 0 22px -4px rgba(74,222,128,.8);
    animation:gemDebloque .9s cubic-bezier(.34,1.56,.64,1);
  }
  .booster-reveal-code{
    display:flex; flex-direction:column; align-items:center; gap:6px; padding:14px 20px; border-radius:14px; text-align:center;
    background:linear-gradient(135deg, rgba(90,61,0,.9), rgba(242,196,109,.25)); border:2px solid #f2c46d;
    box-shadow:0 0 40px -6px rgba(242,196,109,.9); animation:gemDebloque 1s cubic-bezier(.34,1.56,.64,1);
  }
  .booster-reveal-code-titre{ font-family:'Lilita One', sans-serif; font-size:1.2rem; color:#fff3c4; }
  .booster-reveal-code-valeur{
    font-family:'Share Tech Mono', monospace; font-size:2rem; letter-spacing:.3em; color:#fff;
    padding:4px 14px; border-radius:8px; background:rgba(0,0,0,.45); user-select:all;
  }
  .booster-reveal-code-info{ font-size:.85rem; color:#f2e6c4; max-width:280px; }

  /* Option « Chrono » dans la fenêtre de lancement d'une partie */
  .map-modal-option{
    display:flex; align-items:center; gap:10px; margin-top:4px; padding:10px 12px; border-radius:10px; cursor:pointer;
    background:rgba(95,227,224,.08); border:1px solid rgba(95,227,224,.3); color:var(--paper); font-size:.95rem;
  }
  .map-modal-option input{ width:18px; height:18px; accent-color:var(--cyan); cursor:pointer; }
  .map-modal-option strong{ color:var(--cyan); }

  /* Chrono du tour (tour-timer.js) */
  .tour-chrono{
    display:inline-flex; align-items:center; gap:6px; padding:5px 12px; border-radius:999px;
    font-family:'Lilita One', sans-serif; font-size:1.05rem; letter-spacing:.03em; color:#fff;
    background:rgba(95,227,224,.12); border:1px solid rgba(95,227,224,.5);
    font-variant-numeric:tabular-nums; transition:background .2s, border-color .2s, color .2s;
  }
  .tour-chrono svg{ width:18px; height:18px; color:var(--cyan); }
  button.tour-chrono{ cursor:pointer; }
  button.tour-chrono:hover{ filter:brightness(1.2); }
  /* Chrono désactivé (option) : grisé, « off » à la place du temps. */
  .tour-chrono--off{ color:var(--paper-dim); background:rgba(255,255,255,.05); border-color:rgba(255,255,255,.2); }
  .tour-chrono--off svg{ color:var(--paper-dim); }
  .tour-chrono--off #tourChronoSec{ font-size:0; }
  .tour-chrono--off #tourChronoSec::after{ content:"off"; font-size:1.05rem; }
  .tour-chrono--off .tour-chrono-unite{ display:none; }

  /* Rechargement dans le même tour (après une action) : pas d'animation
     d'entrée, la partie ne doit pas sembler redémarrer à chaque coup. */
  .game-page--suite .game-head{ animation:none; opacity:1; }
  .game-page--suite .game-hand-card--flash:not(.game-hand-card--new){ animation:none; }
  .tour-chrono--urgent{
    color:#fff; background:rgba(229,56,59,.35); border-color:#e5383b;
    animation:chronoUrgent .5s ease-in-out infinite alternate;
  }
  .tour-chrono--urgent svg, .tour-chrono--fini svg{ color:#ff6b6b; }
  .tour-chrono--fini{ color:#ff6b6b; background:rgba(229,56,59,.2); border-color:#e5383b; }
  @keyframes chronoUrgent{ from{ transform:scale(1); box-shadow:0 0 0 0 rgba(229,56,59,.6); } to{ transform:scale(1.12); box-shadow:0 0 16px 2px rgba(229,56,59,.6); } }
  .tour-auto-msg{
    position:fixed; left:50%; top:22%; z-index:70; transform:translateX(-50%);
    padding:14px 26px; border-radius:14px; pointer-events:none;
    font-family:'Lilita One', sans-serif; font-size:1.4rem; letter-spacing:.03em; color:#fff;
    background:rgba(10,14,20,.92); border:2px solid #f2c46d; box-shadow:0 0 30px -6px rgba(242,196,109,.7);
    animation:popIn .3s cubic-bezier(.34,1.56,.64,1);
  }
  @media (prefers-reduced-motion:reduce){ .tour-chrono--urgent{ animation:none; } }

  /* Écran d'intro de partie (VS) */
  .vs-intro{
    position:fixed; inset:0; z-index:60; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:28px; padding:16px;
    background:radial-gradient(circle at 50% 50%, #2a2147, #05080c 70%);
    opacity:1; transition:opacity .35s; cursor:pointer; overflow:hidden;
  }
  .vs-intro[hidden]{ display:none; }
  .vs-intro::before{
    content:""; position:absolute; inset:-50%;
    background:repeating-conic-gradient(from 0deg, rgba(255,255,255,.04) 0 6deg, transparent 6deg 12deg);
    animation:vsRayons 18s linear infinite;
  }
  @keyframes vsRayons{ to{ transform:rotate(360deg); } }
  .vs-intro--on{ opacity:1; }
  .vs-intro--off{ opacity:0; }
  .vs-intro-map{ position:relative; display:flex; flex-direction:column; align-items:center; gap:4px; animation:riseIn .5s cubic-bezier(.16,1,.3,1); }
  .vs-intro-map span{ font-family:'Orbitron', sans-serif; font-weight:800; font-size:clamp(1.3rem, 3vw, 2rem); color:#fff; text-transform:uppercase; letter-spacing:.06em; }
  .vs-intro-map small{ font-family:'Share Tech Mono', monospace; color:#f2c46d; letter-spacing:.1em; text-transform:uppercase; }
  .vs-intro-joueurs{ position:relative; display:flex; align-items:center; justify-content:center; gap:14px; flex-wrap:wrap; max-width:1100px; }
  .vs-carte{
    position:relative; display:flex; flex-direction:column; align-items:center; gap:8px;
    width:190px; padding:22px 14px 16px; border-radius:16px;
    background:linear-gradient(160deg, #1c2733, #0c1118); border:2px solid rgba(255,255,255,.25);
    box-shadow:0 20px 40px -18px rgba(0,0,0,.9), inset 0 0 30px rgba(0,0,0,.45);
    opacity:0; animation:vsArrivee .55s cubic-bezier(.34,1.56,.64,1) forwards; animation-delay:calc(.25s + var(--i) * .35s);
  }
  .vs-carte.banniere--anime{ animation:vsArrivee .55s cubic-bezier(.34,1.56,.64,1) forwards, banniereDefile 6s ease-in-out infinite; animation-delay:calc(.25s + var(--i) * .35s), 0s; }
  .vs-carte:nth-child(4n+1){ --dx:-60px; }
  .vs-carte:nth-child(4n+3){ --dx:60px; }
  @keyframes vsArrivee{
    from{ opacity:0; transform:translateX(var(--dx, 0)) scale(.6) rotate(-4deg); }
    to{ opacity:1; transform:none; }
  }
  .vs-carte-avatar{
    width:78px; height:78px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    font-family:'Orbitron', sans-serif; font-weight:700; font-size:2.1rem; color:var(--avatar-color);
    background:rgba(10,14,20,.7); border:3px solid var(--avatar-color); box-shadow:0 0 26px -4px var(--avatar-color);
  }
  .vs-carte-nom{ font-family:'Lilita One', sans-serif; font-size:1.35rem; color:#fff; letter-spacing:.03em; text-shadow:0 2px 6px rgba(0,0,0,.9); max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .vs-carte-niveau{ font-family:'Share Tech Mono', monospace; font-size:.75rem; color:#f2c46d; text-shadow:0 1px 4px rgba(0,0,0,.9); }
  .vs-carte--boss{ border-color:#ff4d4d; background:linear-gradient(160deg, #4a0a0a, #120303); box-shadow:0 0 40px -8px rgba(255,77,77,.8); }
  .vs-carte--bot{ border-color:#5fe3e0; }
  .vs-intro-vs{
    position:relative; font-family:'Lilita One', sans-serif; font-size:2.6rem; color:#ffd166;
    -webkit-text-stroke:2px #7a5410; text-shadow:0 4px 0 #7a5410, 0 0 24px rgba(255,209,102,.7);
    opacity:0; animation:vsPop .45s cubic-bezier(.34,1.56,.64,1) forwards; animation-delay:calc(.1s + var(--i) * .35s);
  }
  @keyframes vsPop{ from{ opacity:0; transform:scale(3) rotate(-15deg); } to{ opacity:1; transform:none; } }
  .vs-intro-commence{
    position:relative; font-family:'Lilita One', sans-serif; font-size:1.3rem; letter-spacing:.04em; color:var(--cyan);
    opacity:0; animation:riseIn .5s cubic-bezier(.16,1,.3,1) 1.6s forwards;
  }
  .vs-intro-skip{ position:relative; font-family:'Share Tech Mono', monospace; font-size:.7rem; color:var(--paper-dim); animation:fadeBlink 1.6s ease-in-out infinite; }
  @keyframes fadeBlink{ 50%{ opacity:.35; } }
  @media (max-width:640px){
    .vs-carte{ width:140px; padding:16px 10px 12px; }
    .vs-carte-avatar{ width:56px; height:56px; font-size:1.5rem; }
    .vs-intro-vs{ font-size:1.8rem; }
  }
  @media (prefers-reduced-motion:reduce){
    .vs-intro::before, .vs-carte, .vs-intro-vs, .vs-intro-skip, .vs-intro-commence{ animation:none; opacity:1; }
  }

  .user-chip-titre{ align-self:flex-start; padding:1px 7px; border-radius:4px; font-size:.62rem; line-height:1.4; white-space:nowrap; }

  @media (prefers-reduced-motion:reduce){
    .banniere--anime, .profil-titre--legendaire, .gem-buy-btn[data-etat="confirm"]{ animation:none; }
  }
  .admin-message{
    padding:12px 16px; border-radius:6px; border:1px solid var(--cyan);
    background:rgba(95,227,224,.08); color:var(--paper);
    font-family:'Share Tech Mono', monospace; font-size:.8rem;
  }

  .boutique-empty{
    opacity:0; animation:riseIn .7s cubic-bezier(.16,1,.3,1) .25s forwards;
    border:2px dashed rgba(255,255,255,.15); border-radius:14px;
    padding:40px 24px; text-align:center; color:var(--paper-dim);
    font-size:.95rem; line-height:1.5;
  }

  .dash-welcome{ display:flex; flex-direction:column; gap:16px; max-width:520px; opacity:0; animation:riseIn .7s cubic-bezier(.16,1,.3,1) .35s forwards; }
  .dash-eyebrow{ font-family:'Share Tech Mono', monospace; font-size:.72rem; letter-spacing:.14em; text-transform:uppercase; color:var(--purple); }
  .dash-welcome h1{ font-size:clamp(1.8rem, 3.6vw, 2.7rem); text-align:left; margin:0; animation:none; }
  .dash-welcome h1 .letter{ animation:none; text-shadow:none; color:var(--paper); }
  .dash-welcome p{ color:var(--paper-dim); font-size:1rem; }
  .dash-cta{
    margin-top:10px; display:inline-flex; align-self:flex-start;
    background:linear-gradient(90deg, var(--cyan), var(--purple)); color:var(--void); font-weight:700;
    padding:13px 22px; border-radius:3px; font-family:'Share Tech Mono', monospace; font-size:.78rem; letter-spacing:.08em; text-transform:uppercase;
    transition:transform .2s, box-shadow .25s;
    animation:floatIdle 3.4s ease-in-out 1.5s infinite;
  }
  .dash-cta:hover{ transform:translateY(-4px); box-shadow:0 12px 26px -14px rgba(95,227,224,.55); animation-play-state:paused; }
  .dash-cta:active{ transform:translateY(0) scale(.98); }

  /* ---------- LOBBY (tableau de bord) ---------- */
  .lobby{ width:100%; max-width:1080px; margin:0 auto; padding:5vh 4vw 8vh; flex:1; display:flex; flex-direction:column; justify-content:center; }
  .lobby-hero{
    position:relative; overflow:hidden;
    display:flex; align-items:center; justify-content:space-between; gap:32px; flex-wrap:wrap;
    padding:36px; border-radius:18px;
    border:1px solid rgba(95,227,224,.35);
    background:
      radial-gradient(60% 120% at 100% 0%, rgba(139,111,217,.28), transparent 60%),
      radial-gradient(50% 120% at 0% 100%, rgba(95,227,224,.18), transparent 60%),
      linear-gradient(160deg, rgba(28,39,51,.9), rgba(12,17,25,.9));
    box-shadow:0 30px 60px -40px rgba(95,227,224,.5), inset 0 0 40px rgba(0,0,0,.35);
    opacity:0; animation:popIn .7s cubic-bezier(.16,1,.3,1) .15s forwards;
  }
  .lobby-hero::before{
    content:""; position:absolute; inset:0; pointer-events:none;
    background:linear-gradient(100deg, transparent 35%, rgba(255,255,255,.07) 50%, transparent 65%);
    transform:translateX(-100%); animation:lobbyShine 6s ease-in-out 1.2s infinite;
  }
  @keyframes lobbyShine{ 0%{ transform:translateX(-100%); } 35%,100%{ transform:translateX(100%); } }
  .lobby-hero-text{ position:relative; display:flex; flex-direction:column; gap:14px; max-width:540px; }
  .lobby-hero-text p{ color:var(--paper-dim); font-size:1.02rem; line-height:1.45; }
  .lobby-title{
    margin:0; text-align:left; animation:none; opacity:1;
    font-family:'Orbitron', sans-serif; font-weight:800; font-size:clamp(1.6rem, 3.6vw, 2.6rem); line-height:1.15; color:#fff;
  }
  .lobby-title span{
    background:linear-gradient(90deg, var(--cyan), var(--purple)); -webkit-background-clip:text; background-clip:text; color:transparent;
  }
  .lobby-play{
    align-self:flex-start; margin-top:6px;
    display:inline-flex; align-items:center; gap:12px;
    padding:16px 38px; border-radius:999px;
    background:linear-gradient(90deg, var(--cyan), var(--purple)); color:var(--void);
    font-family:'Lilita One', sans-serif; font-size:1.35rem; letter-spacing:.06em; text-transform:uppercase;
    box-shadow:0 0 0 0 rgba(95,227,224,.5), 0 18px 34px -16px rgba(139,111,217,.8);
    transition:transform .2s cubic-bezier(.34,1.56,.64,1), filter .2s;
    animation:lobbyPlayPulse 2.4s ease-in-out infinite;
  }
  .lobby-play svg{ width:20px; height:20px; }
  .lobby-play:hover{ transform:translateY(-3px) scale(1.04); filter:brightness(1.1); }
  .lobby-play:active{ transform:scale(.97); }
  @keyframes lobbyPlayPulse{
    0%,100%{ box-shadow:0 0 0 0 rgba(95,227,224,.45), 0 18px 34px -16px rgba(139,111,217,.8); }
    50%{ box-shadow:0 0 0 12px rgba(95,227,224,0), 0 18px 34px -16px rgba(139,111,217,.8); }
  }
  .lobby-profile{
    position:relative; display:flex; flex-direction:column; align-items:center; gap:8px;
    min-width:190px; padding:22px 26px; border-radius:14px;
    background:rgba(10,14,20,.55); border:1px solid rgba(255,255,255,.1);
    transition:border-color .2s, transform .2s;
  }
  .lobby-profile:hover{ border-color:var(--cyan); transform:translateY(-3px); }
  .lobby-avatar{
    --avatar-color:var(--cyan);
    width:84px; height:84px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-family:'Orbitron', sans-serif; font-weight:700; font-size:2.2rem; color:var(--avatar-color);
    background:color-mix(in srgb, var(--avatar-color) 14%, transparent);
    border:2px solid var(--avatar-color);
    box-shadow:0 0 28px -6px var(--avatar-color);
  }
  .lobby-level{ font-family:'Lilita One', sans-serif; font-size:1.15rem; color:#f2c46d; letter-spacing:.03em; }
  .lobby-xp-bar{ width:100%; height:8px; border-radius:4px; background:rgba(255,255,255,.1); overflow:hidden; }
  .lobby-xp-bar span{ display:block; height:100%; border-radius:4px; background:linear-gradient(90deg, #f2c46d, #e0a83f); }
  .lobby-xp-label{ font-family:'Share Tech Mono', monospace; font-size:.68rem; color:var(--paper-dim); }

  @media (max-width:640px){
    .lobby-hero{ padding:24px; }
    .lobby-profile{ width:100%; }
  }
  @media (prefers-reduced-motion:reduce){
    .lobby-hero::before, .lobby-play{ animation:none; }
  }

  /* ---------- QUOTIDIEN (bonus de connexion + missions) ---------- */
  .daily{
    display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:22px;
    opacity:0; animation:popIn .7s cubic-bezier(.16,1,.3,1) .35s forwards;
  }
  .daily-panel{
    display:flex; flex-direction:column; gap:16px; padding:22px; border-radius:16px;
    border:1px solid rgba(255,255,255,.1);
    background:linear-gradient(160deg, rgba(28,39,51,.85), rgba(12,17,25,.85));
  }
  .daily-head h2{ margin:0; font-family:'Orbitron', sans-serif; font-size:1.05rem; color:#fff; letter-spacing:.04em; }
  .daily-sub{ font-family:'Share Tech Mono', monospace; font-size:.72rem; color:var(--paper-dim); }

  .daily-days{ display:grid; grid-template-columns:repeat(7, 1fr); gap:6px; }
  .daily-day{
    display:flex; flex-direction:column; align-items:center; gap:4px; padding:10px 2px; border-radius:10px;
    background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08);
    text-align:center; transition:transform .2s;
  }
  .daily-day-label{ font-family:'Share Tech Mono', monospace; font-size:.62rem; color:var(--paper-dim); }
  .daily-day-icon{ font-size:1.3rem; }
  .daily-day-value{ font-family:'Lilita One', sans-serif; font-size:.72rem; color:#f2c46d; line-height:1.1; }
  .daily-day-gem{ font-family:'Share Tech Mono', monospace; font-size:.62rem; color:#b8f3ff; }
  .daily-day--done{ opacity:.45; }
  .daily-day--done .daily-day-icon{ filter:grayscale(1); }
  .daily-day--done::after{ content:"✓"; font-weight:700; color:var(--cyan); font-size:.8rem; }
  .daily-day--locked{ opacity:.7; }
  .daily-day--today{
    border-color:#f2c46d; background:rgba(242,196,109,.12);
    animation:dailyGlow 1.6s ease-in-out infinite;
  }
  .daily-day--big{ border-color:rgba(198,92,255,.5); background:rgba(198,92,255,.1); }
  @keyframes dailyGlow{
    0%,100%{ box-shadow:0 0 0 0 rgba(242,196,109,.5); transform:translateY(0); }
    50%{ box-shadow:0 0 18px 2px rgba(242,196,109,.35); transform:translateY(-3px); }
  }

  .daily-claim, .daily-mission-btn, .daily-toast-close{
    border:0; cursor:pointer; border-radius:999px;
    font-family:'Lilita One', sans-serif; letter-spacing:.05em; text-transform:uppercase;
    background:linear-gradient(90deg, #f2c46d, #e0a83f); color:var(--void);
    transition:transform .2s cubic-bezier(.34,1.56,.64,1), filter .2s;
  }
  .daily-claim{ padding:13px; font-size:1.05rem; animation:lobbyPlayPulse 2.4s ease-in-out infinite; }
  .daily-claim:hover:not(:disabled), .daily-mission-btn:hover, .daily-toast-close:hover{ transform:scale(1.04); filter:brightness(1.1); }
  .daily-claim:disabled{ cursor:default; animation:none; background:rgba(255,255,255,.08); color:var(--paper-dim); font-size:.9rem; }

  .daily-missions{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
  .daily-mission{
    display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:12px;
    background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08);
  }
  .daily-mission-info{ flex:1; display:flex; flex-direction:column; gap:6px; min-width:0; }
  .daily-mission-text{ font-weight:700; color:#fff; }
  .daily-mission-bar{ height:7px; border-radius:4px; background:rgba(255,255,255,.1); overflow:hidden; }
  .daily-mission-bar span{ display:block; height:100%; border-radius:4px; background:linear-gradient(90deg, var(--cyan), var(--purple)); transition:width .6s; }
  .daily-mission-progress{ font-family:'Share Tech Mono', monospace; font-size:.7rem; color:var(--paper-dim); }
  .daily-mission-btn{ padding:8px 16px; font-size:.85rem; flex-shrink:0; }
  .daily-mission-btn--go{ background:rgba(95,227,224,.14); color:var(--cyan); border:1px solid rgba(95,227,224,.4); }
  .daily-mission--ready{ border-color:#f2c46d; animation:dailyGlow 1.6s ease-in-out infinite; }
  .daily-mission--done{ opacity:.5; }
  .daily-mission-check{ color:var(--cyan); font-size:1.3rem; font-weight:700; padding:0 8px; }

  .daily-chest{
    display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:12px;
    border:1px dashed rgba(198,92,255,.5); background:rgba(198,92,255,.08);
  }
  .daily-chest-icon{ font-size:1.8rem; }
  .daily-chest-info{ flex:1; display:flex; flex-direction:column; gap:2px; }
  .daily-chest-info strong{ color:#fff; }
  .daily-chest-info span{ font-size:.85rem; color:var(--paper-dim); }
  .daily-chest--ready{ border-style:solid; border-color:#c65cff; animation:dailyGlow 1.6s ease-in-out infinite; }
  .daily-chest--ready .daily-chest-icon{ animation:dailyShake 1.2s ease-in-out infinite; }
  .daily-chest--open{ opacity:.55; }
  @keyframes dailyShake{
    0%,60%,100%{ transform:rotate(0); } 70%{ transform:rotate(-12deg); } 80%{ transform:rotate(12deg); } 90%{ transform:rotate(-6deg); }
  }

  .daily-toast{
    position:fixed; inset:0; z-index:50; display:flex; align-items:center; justify-content:center; padding:16px;
    background:rgba(5,8,12,.7); backdrop-filter:blur(4px); opacity:0; transition:opacity .25s;
  }
  .daily-toast[hidden]{ display:none; }
  .daily-toast.show{ opacity:1; }
  .daily-toast-box{
    display:flex; flex-direction:column; align-items:center; gap:14px; max-width:360px; padding:28px; border-radius:18px; text-align:center;
    border:1px solid #f2c46d; background:linear-gradient(160deg, rgba(40,34,20,.95), rgba(12,17,25,.95));
    box-shadow:0 0 60px -10px rgba(242,196,109,.6);
    transform:scale(.7); transition:transform .4s cubic-bezier(.34,1.56,.64,1);
  }
  .daily-toast.show .daily-toast-box{ transform:scale(1); }
  .daily-toast-title{ font-family:'Lilita One', sans-serif; font-size:1.6rem; color:#f2c46d; }
  .daily-toast-card{ width:150px; border-radius:12px; box-shadow:0 0 30px -4px var(--card-color, #f2c46d); }
  .daily-toast-text{ color:var(--paper); }
  .daily-toast-close{ padding:11px 28px; font-size:1rem; }

  @media (max-width:820px){
    .daily{ grid-template-columns:1fr; }
  }
  @media (max-width:480px){
    .daily-days{ grid-template-columns:repeat(4, 1fr); }
    .daily-day--big{ grid-column:span 2; }
  }
  @media (prefers-reduced-motion:reduce){
    .daily, .daily-day--today, .daily-claim, .daily-mission--ready, .daily-chest--ready, .daily-chest--ready .daily-chest-icon{ animation:none; }
    .daily{ opacity:1; }
  }

  .evenements-btn{
    position:fixed; left:50%; bottom:28px; transform:translateX(-50%);
    display:inline-flex; align-items:center; gap:8px;
    background:rgba(10,14,20,.75); backdrop-filter:blur(6px);
    color:var(--paper); border:1px solid rgba(139,111,217,.5);
    padding:12px 26px; border-radius:999px;
    font-family:'Share Tech Mono', monospace; font-size:.78rem; letter-spacing:.08em; text-transform:uppercase;
    box-shadow:0 14px 30px -16px rgba(139,111,217,.5);
    opacity:0; animation:riseIn .7s cubic-bezier(.16,1,.3,1) .5s forwards;
    transition:background .2s, box-shadow .25s, color .2s;
    z-index:5;
  }
  .evenements-btn:hover{
    background:rgba(139,111,217,.18); color:#fff; border-color:var(--purple);
    box-shadow:0 16px 34px -14px rgba(139,111,217,.7);
  }
  .evenements-btn:active{ transform:translateX(-50%) scale(.96); }

  /* ---------- PAGE "PARTIE EN COURS" (jeu) ---------- */
  .game-body{ width:100%; max-width:1100px; display:flex; flex-direction:column; gap:22px; padding:5vh 4vw; }
  .game-head{ display:flex; flex-direction:column; gap:4px; opacity:0; animation:riseIn .6s cubic-bezier(.16,1,.3,1) .05s forwards; }
  .game-head h1{ text-align:left; font-size:clamp(1.5rem, 3vw, 2.1rem); animation:none; }
  .game-turn-status{ display:flex; gap:14px; }
  .game-turn-status span{
    font-family:'Share Tech Mono', monospace; font-size:.66rem; letter-spacing:.03em; text-transform:uppercase;
    color:var(--paper-dim); padding:4px 10px; border:1px solid rgba(255,255,255,.15); border-radius:999px;
  }
  .game-turn-status span.done{ color:var(--void); background:var(--cyan); border-color:var(--cyan); text-decoration:line-through; }
  .turn-announce{ animation:turnPop .4s cubic-bezier(.34,1.56,.64,1) both; }
  .turn-announce--change{
    animation:turnChangePop .6s cubic-bezier(.34,1.56,.64,1) both;
    text-shadow:0 0 18px rgba(95,227,224,.6);
  }
  @keyframes turnPop{
    0%{ opacity:0; transform:translateY(-6px) scale(.96); }
    100%{ opacity:1; transform:translateY(0) scale(1); }
  }
  @keyframes turnChangePop{
    0%{ opacity:0; transform:scale(.7); }
    55%{ opacity:1; transform:scale(1.08); }
    100%{ opacity:1; transform:scale(1); }
  }
  .game-layout{ display:grid; grid-template-columns:1fr 300px; gap:24px; align-items:start; }

  .game-board{
    position:relative; isolation:isolate; container-type:inline-size;
    /* Rangées et colonnes à parts égales, quel que soit le contenu des cases
       (sans ça, une rangée avec une icône de joueur devenait plus haute). */
    display:grid; grid-template-columns:repeat(var(--map-size), minmax(0, 1fr)); grid-template-rows:repeat(var(--map-size), minmax(0, 1fr));
    gap:2px; background:#000; border-radius:12px; overflow:hidden;
    border:2px solid rgba(255,255,255,.18);
    aspect-ratio:1; width:100%;
    box-shadow:0 20px 40px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.6), 0 0 40px -12px rgba(95,227,224,.35);
  }
  .game-board > .game-cell, .game-board > .game-cell-form{ position:relative; z-index:2; }
  .game-cell-form .game-cell{ z-index:auto; }

  /* Décor de la map, dessiné sous la grille (SVG généré par map_decor_svg). */
  .map-decor{ position:absolute; inset:0; width:100%; height:100%; z-index:0; pointer-events:none; }
  .game-board .map-decor{ animation:decorRespire 14s ease-in-out infinite alternate; }
  @keyframes decorRespire{ from{ transform:scale(1); } to{ transform:scale(1.04); } }

  /* Logo Mission Mars posé au sol, visible à travers les cases. */
  .game-board-logo{
    position:absolute; inset:0; z-index:1; pointer-events:none;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4%;
    opacity:.55;
  }
  .game-board-logo-planete{
    position:relative; width:30%; aspect-ratio:1; border-radius:50%;
    background:
      radial-gradient(circle at 32% 30%, #ffb38a 0 8%, transparent 9%),
      radial-gradient(circle at 60% 62%, rgba(90,20,10,.55) 0 10%, transparent 11%),
      radial-gradient(circle at 35% 35%, #ff8a50, #c1391b 55%, #4a0f05);
    box-shadow:0 0 40px 6px rgba(255,110,60,.45), inset -10px -12px 24px rgba(0,0,0,.55);
  }
  .game-board-logo-planete::after{
    content:""; position:absolute; left:-32%; right:-32%; top:42%; height:16%;
    border:3px solid rgba(95,227,224,.85); border-radius:50%;
    transform:rotate(-16deg);
    box-shadow:0 0 12px rgba(95,227,224,.6);
  }
  .game-board-logo-texte{
    font-family:'Orbitron', sans-serif; font-weight:800; letter-spacing:.18em;
    font-size:6.4cqw; white-space:nowrap; color:#fff;
    text-shadow:0 0 18px rgba(95,227,224,.8), 0 2px 0 rgba(0,0,0,.6);
  }
  .game-board-logo-texte b{ color:#ff8a50; text-shadow:0 0 18px rgba(255,110,60,.8), 0 2px 0 rgba(0,0,0,.6); }
  @media (prefers-reduced-motion:reduce){ .game-board .map-decor{ animation:none; } }
  .game-cell-form{ display:contents; }
  .game-cell{
    position:relative; width:100%; height:100%; min-height:0; border:none; padding:0; margin:0;
    display:flex; align-items:center; justify-content:center;
    font-family:'Lilita One', sans-serif; font-size:.85rem;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.07);
  }
  .game-cell--movable{
    cursor:pointer;
    box-shadow:inset 0 0 0 2px rgba(95,227,224,.55);
    transition:box-shadow .15s, filter .15s;
  }
  .game-cell--jumpable{
    cursor:pointer;
    box-shadow:inset 0 0 0 3px var(--danger), 0 0 12px -2px var(--danger);
    animation:targetPulse 1s ease-in-out infinite;
  }
  .game-cell--jumpable:hover{ filter:brightness(1.25); }
  .game-cell--movable:hover{ box-shadow:inset 0 0 0 2px var(--cyan); filter:brightness(1.35); }
  .game-cell--player{
    font-size:1.6rem; line-height:1; /* l'icône d'avatar du joueur (ou son initiale) */
    background:var(--player-color); color:#0a0e14; text-shadow:none;
    box-shadow:inset 0 0 0 2px rgba(0,0,0,.35);
    transition:box-shadow .15s, transform .15s;
  }
  .game-cell--current{ box-shadow:inset 0 0 0 3px #fff; animation:glowPulse 1.4s ease-in-out infinite; }
  .game-cell--boss{
    background:linear-gradient(160deg, var(--danger), #7a1f0f) !important;
    color:#fff; font-size:1.6rem;
    box-shadow:inset 0 0 0 2px #000, 0 0 14px -2px var(--danger);
    z-index:1;
  }
  .game-player--boss{ border-color:var(--danger) !important; }
  .game-player--boss .game-player-name{ color:var(--danger); }
  .game-player--boss .game-player-hp span{ background:var(--danger) !important; }
  .game-cell--bot{
    background:linear-gradient(160deg, var(--purple), #2f2260) !important;
    color:#fff; font-size:1.6rem;
    box-shadow:inset 0 0 0 2px #000, 0 0 14px -2px var(--purple);
    z-index:1;
  }
  .game-player--bot{ border-color:var(--purple) !important; }
  .game-player--bot .game-player-name{ color:var(--purple); }
  .game-player--bot .game-player-hp span{ background:var(--purple) !important; }
  .game-cell--targetable{
    cursor:pointer;
    box-shadow:inset 0 0 0 3px var(--danger), 0 0 14px -2px var(--danger);
    animation:targetPulse 1s ease-in-out infinite;
  }
  @keyframes targetPulse{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.08); } }
  .game-cell--teleport-target{
    cursor:pointer;
    box-shadow:inset 0 0 0 2px var(--purple);
    transition:box-shadow .15s, filter .15s;
  }
  .game-cell--teleport-target:hover{ box-shadow:inset 0 0 0 2px #fff; filter:brightness(1.4); }
  .game-cell--zone-target{
    cursor:pointer;
    box-shadow:inset 0 0 0 2px #f2c46d;
    transition:box-shadow .15s, filter .15s;
  }
  .game-cell--zone-target:hover{ box-shadow:inset 0 0 0 3px #f2c46d, 0 0 14px -2px #f2c46d; filter:brightness(1.3); }
  .game-cell--tank{
    background:var(--player-color); color:#0a0e14; text-shadow:none;
    box-shadow:inset 0 0 0 2px rgba(0,0,0,.35);
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px;
    font-size:1rem;
  }
  /* Icône du tank : silhouette noire sur fond blanc ; en « multiply », le
     blanc prend la couleur du joueur propriétaire et le tank reste noir. */
  .game-cell-tank-icone{
    width:62%; height:62%; object-fit:contain; pointer-events:none;
    mix-blend-mode:multiply;
  }
  /* Joueur qui partage la case d'un autre : petit pion dans le coin, qu'on
     peut viser comme n'importe quel adversaire. */
  .game-cell-empile{
    position:absolute; top:-6%; right:-6%; z-index:3;
    width:52%; height:52%; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-size:.8rem; line-height:1; color:#0a0e14;
    background:var(--player-color); border:2px solid #0a0e14; box-shadow:0 0 6px rgba(0,0,0,.6);
  }
  .game-cell-empile.game-cell--targetable{
    cursor:crosshair; animation:empileCible .8s ease-in-out infinite alternate;
    box-shadow:0 0 0 2px #ff4d4d, 0 0 12px 2px rgba(255,77,77,.8);
  }
  @keyframes empileCible{ to{ transform:scale(1.15); } }

  /* PV du Tank, en cœurs sous l'icône */
  .game-cell-tank-pv{
    font-size:.55rem; line-height:1; letter-spacing:1px; color:#b3001b; pointer-events:none;
  }

  .game-side{ display:flex; flex-direction:column; gap:18px; }
  .game-players{ display:flex; flex-direction:column; gap:10px; }
  .game-player{
    position:relative;
    display:flex; flex-direction:column; gap:5px;
    background:linear-gradient(160deg, #1c2733, #10161e 75%);
    border:2px solid color-mix(in srgb, var(--player-color) 40%, rgba(255,255,255,.12));
    border-radius:10px; padding:10px 12px;
    opacity:.55; transition:opacity .2s, border-color .2s;
  }
  .game-player--active{ opacity:1; border-color:var(--player-color); box-shadow:0 0 16px -6px var(--player-color); }
  .game-player--dead{ opacity:.3; filter:grayscale(1); }
  .game-player-name{ font-family:'Lilita One', sans-serif; font-size:.85rem; color:#fff; }
  .game-player-hp{ height:6px; border-radius:3px; background:rgba(0,0,0,.4); overflow:hidden; }
  .game-player-hp span{ display:block; height:100%; background:var(--player-color); transition:width .3s cubic-bezier(.16,1,.3,1); }
  .game-player-pv{ font-family:'Share Tech Mono', monospace; font-size:.66rem; color:var(--paper-dim); }

  .game-player--hit{ animation:playerHit .5s cubic-bezier(.36,.07,.19,.97) both; }
  .game-player--hit .game-player-hp{ animation:playerHpFlash .5s ease both; }
  @keyframes playerHit{
    0%, 100%{ transform:translateX(0); }
    15%{ transform:translateX(-6px); }
    30%{ transform:translateX(5px); }
    45%{ transform:translateX(-4px); }
    60%{ transform:translateX(3px); }
    75%{ transform:translateX(-2px); }
  }
  @keyframes playerHpFlash{
    0%, 100%{ box-shadow:none; }
    40%{ box-shadow:0 0 0 3px var(--danger); }
  }
  .game-damage-popup{
    position:absolute; top:-6px; right:10px;
    font-family:'Lilita One', sans-serif; font-size:1.3rem; color:var(--danger);
    text-shadow:0 2px 4px rgba(0,0,0,.6);
    animation:damagePopup .9s cubic-bezier(.16,1,.3,1) forwards;
    pointer-events:none;
  }
  @keyframes damagePopup{
    0%{ opacity:0; transform:translateY(0) scale(.7); }
    20%{ opacity:1; transform:translateY(-10px) scale(1.15); }
    70%{ opacity:1; transform:translateY(-22px) scale(1); }
    100%{ opacity:0; transform:translateY(-34px) scale(.95); }
  }

  /* Animations d'attaque : projectile qui traverse le plateau, puis impact. */
  .attack-fx{
    position:fixed; left:0; top:0; z-index:55; pointer-events:none;
    display:flex; align-items:center; justify-content:center;
    width:var(--fx-size); height:var(--fx-size);
    margin:calc(var(--fx-size) / -2) 0 0 calc(var(--fx-size) / -2);
    font-size:calc(var(--fx-size) * .75); line-height:1;
    filter:drop-shadow(0 0 6px var(--fx-color)) drop-shadow(0 0 14px var(--fx-color));
    will-change:transform, opacity;
  }
  .attack-fx--orb{
    border-radius:50%;
    width:calc(var(--fx-size) * .45); height:calc(var(--fx-size) * .45);
    margin:calc(var(--fx-size) * -.225) 0 0 calc(var(--fx-size) * -.225);
    background:radial-gradient(circle at 35% 35%, #fff, var(--fx-color) 55%, transparent 75%);
  }
  .attack-fx--beam{
    height:calc(var(--fx-size) * .22); margin:calc(var(--fx-size) * -.11) 0 0 0;
    transform-origin:0 50%; border-radius:999px;
    background:linear-gradient(90deg, transparent, var(--fx-color) 15%, #fff 50%, var(--fx-color) 85%, transparent);
  }
  .attack-trail{
    position:fixed; left:0; top:0; z-index:54; pointer-events:none;
    width:calc(var(--fx-size) * .3); height:calc(var(--fx-size) * .3);
    margin:calc(var(--fx-size) * -.15) 0 0 calc(var(--fx-size) * -.15);
    border-radius:50%; background:var(--fx-color);
    animation:attackTrail .4s ease-out forwards;
  }
  @keyframes attackTrail{
    from{ opacity:.7; scale:1; }
    to{ opacity:0; scale:.15; }
  }
  .attack-impact{
    position:fixed; left:0; top:0; z-index:56; pointer-events:none;
    width:var(--fx-size); height:var(--fx-size);
    margin:calc(var(--fx-size) / -2) 0 0 calc(var(--fx-size) / -2);
    border-radius:50%;
    border:3px solid var(--fx-color);
    background:radial-gradient(circle, #fff 0%, var(--fx-color) 35%, transparent 70%);
    animation:attackImpact .45s ease-out forwards;
  }
  @keyframes attackImpact{
    0%{ opacity:1; scale:.3; }
    60%{ opacity:.8; scale:1.5; }
    100%{ opacity:0; scale:2.1; }
  }
  .attack-damage{
    position:fixed; left:0; top:0; z-index:57; pointer-events:none;
    translate:-50% -50%;
    font-family:'Lilita One', sans-serif; font-size:1.6rem; color:#fff;
    text-shadow:0 0 8px var(--danger), 0 2px 0 rgba(0,0,0,.7);
    animation:damagePopup .9s cubic-bezier(.16,1,.3,1) forwards;
  }
  .game-cell--struck{ animation:cellStruck .4s cubic-bezier(.36,.07,.19,.97) both; z-index:2; }
  @keyframes cellStruck{
    0%, 100%{ transform:translate(0,0); filter:none; }
    20%{ transform:translate(-3px,2px); filter:brightness(2.2); }
    40%{ transform:translate(3px,-2px); filter:brightness(1.6); }
    60%{ transform:translate(-2px,-1px); }
    80%{ transform:translate(2px,1px); }
  }

  .game-hand{ display:flex; flex-direction:column; gap:6px; }
  .game-hand-hint{
    font-family:'Share Tech Mono', monospace; font-size:.62rem; letter-spacing:.03em;
    color:var(--paper-dim); margin-top:-4px;
  }
  /* Les cartes ont une vraie forme de carte (5:7) ; leur hauteur --card-h est
     recalculée par jouer.js pour que toute la main tienne sans défilement, et
     tout l'intérieur est dimensionné en em à partir de cette hauteur. */
  .game-hand-cards{
    --card-h:210px;
    flex:1; min-height:0;
    display:flex; flex-wrap:wrap; gap:8px; justify-content:center; align-content:center;
  }
  /* Grand écran : grille fixe de 2 rangées, --cols colonnes (3 pour les 6
     cartes de départ, 4 dès qu'une carte orange s'ajoute), posé par jouer.js. */
  @media (min-width:901px){
    .game-hand-cards{
      display:grid; grid-template-columns:repeat(var(--cols, 3), max-content); grid-auto-rows:var(--card-h);
      justify-content:center; align-content:center;
    }
  }
  /* Un clic sur une carte (classe --open posée par jouer.js) voile son image
     et y affiche sa légende. Une carte qui vient d'être piochée (--pioche)
     montre son dos et se retourne au clic. */
  .game-hand-card{
    position:relative; flex:none; height:var(--card-h); aspect-ratio:5/7;
    font-size:max(8px, calc(var(--card-h) * .085));
    cursor:pointer; border-radius:.9em; perspective:60em;
    transition:transform .15s ease, box-shadow .2s ease;
  }
  .game-hand-card:hover{ transform:translateY(-2px); }

  /* Carte spéciale déjà jouée : elle reste à sa place, sous un voile noir,
     avec un tampon « JOUÉ » rouge en diagonale. */
  .game-hand-card--jouee{ cursor:default; }
  .game-hand-card--jouee:hover{ transform:none; }
  .game-hand-card--jouee::after{
    content:""; position:absolute; inset:0; z-index:2; border-radius:.9em;
    background:rgba(0,0,0,.62); pointer-events:none;
  }
  .game-hand-card--jouee .game-hand-card-face{ filter:grayscale(.6); }
  .game-hand-jouee-tampon{
    position:absolute; top:50%; left:50%; z-index:3; pointer-events:none;
    transform:translate(-50%, -50%) rotate(-30deg);
    padding:.05em .35em; border:.14em solid #ff2d2d; border-radius:.2em;
    font-family:'Black Ops One', 'Lilita One', sans-serif; font-size:1.95em; line-height:1.1;
    letter-spacing:.08em; text-transform:uppercase; color:#ff2d2d;
    text-shadow:0 0 .35em rgba(255,45,45,.65);
    box-shadow:0 0 .5em rgba(255,45,45,.45), inset 0 0 .4em rgba(255,45,45,.3);
  }
  /* Seule la carte jouée à l'instant reçoit le coup de tampon animé. */
  .game-hand-card--jouee-recente .game-hand-jouee-tampon{ animation:tamponJoue .45s cubic-bezier(.34,1.56,.64,1) .15s both; }
  @keyframes tamponJoue{
    from{ opacity:0; transform:translate(-50%, -50%) rotate(-30deg) scale(2.2); }
    to{ opacity:1; transform:translate(-50%, -50%) rotate(-30deg) scale(1); }
  }
  @media (prefers-reduced-motion:reduce){ .game-hand-jouee-tampon{ animation:none; } }
  .game-hand-card:focus-visible{ outline:2px solid var(--cyan); outline-offset:3px; }
  .game-hand-card--playable:hover{ box-shadow:0 10px 20px -12px color-mix(in srgb, var(--card-color) 60%, transparent); }
  .game-hand-card-inner{
    position:absolute; inset:0; transform-style:preserve-3d;
    transition:transform .5s cubic-bezier(.3,1.3,.5,1);
  }
  .game-hand-card--pioche .game-hand-card-inner{ transform:rotateY(180deg); }
  .game-hand-card-face{
    position:absolute; inset:0;
    -webkit-backface-visibility:hidden; backface-visibility:hidden;
    background:linear-gradient(170deg, color-mix(in srgb, var(--card-color) 24%, #1c2733), #10161e 80%);
    border:2px solid var(--card-color); border-radius:.9em; padding:.5em;
    display:flex; flex-direction:column; gap:.35em;
    overflow:hidden; box-sizing:border-box;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.08), 0 8px 16px -10px rgba(0,0,0,.7);
  }
  /* Dos de la pioche : une pile de cartes face cachée. */
  .game-hand-card-dos{
    transform:rotateY(180deg);
    align-items:center; justify-content:center; gap:.6em;
    border-color:var(--cyan);
    background:
      repeating-linear-gradient(45deg, rgba(95,227,224,.07) 0 .3em, transparent .3em .9em),
      radial-gradient(circle at 50% 42%, rgba(255,110,60,.35), transparent 45%),
      linear-gradient(160deg, #1a2a3a, #0b1118 80%);
    box-shadow:inset 0 0 0 .3em rgba(10,14,20,.6), inset 0 0 0 .38em rgba(95,227,224,.35), 0 8px 16px -10px rgba(0,0,0,.7);
  }
  .game-hand-card--pioche{
    box-shadow:.25em .25em 0 -.05em #13202b, .25em .25em 0 0 rgba(95,227,224,.4),
               .5em .5em 0 -.05em #101a24, .5em .5em 0 0 rgba(95,227,224,.25);
    animation:piocheAttente 1.6s ease-in-out infinite;
  }
  @keyframes piocheAttente{ 50%{ transform:translateY(-3px); } }
  .game-hand-dos-logo{
    font-family:'Orbitron', sans-serif; font-weight:800; font-size:.8em; letter-spacing:.14em; text-align:center; line-height:1.3;
    color:#fff; text-shadow:0 0 .6em rgba(95,227,224,.8);
  }
  .game-hand-dos-logo b{ display:block; color:#ff8a50; text-shadow:0 0 .6em rgba(255,110,60,.8); }
  .game-hand-dos-hint{
    font-family:'Share Tech Mono', monospace; font-size:.48em; letter-spacing:.1em; text-transform:uppercase;
    color:var(--cyan); background:rgba(10,14,20,.7); padding:.3em .7em; border-radius:999px;
  }

  /* Légende posée sur l'image, sous un voile gris, à l'ouverture de la carte. */
  .game-hand-card-img{ position:relative; }
  .game-hand-card-legende{
    position:absolute; inset:0; z-index:1;
    display:flex; flex-direction:column; gap:.35em; padding:.45em .5em;
    background:rgba(28,34,42,.84);
    -webkit-backdrop-filter:grayscale(1) blur(2px); backdrop-filter:grayscale(1) blur(2px);
    opacity:0; visibility:hidden; transition:opacity .2s ease, visibility .2s;
  }
  .game-hand-card--open .game-hand-card-legende{ opacity:1; visibility:visible; }
  .game-hand-legende-type{
    flex:none; font-family:'Share Tech Mono', monospace; font-size:.45em; letter-spacing:.1em; text-transform:uppercase;
    color:var(--card-color);
  }
  .game-hand-legende-desc{ flex:1; min-height:0; overflow-y:auto; margin:0; font-size:.55em; line-height:1.35; color:var(--paper); }
  .game-hand-legende-statut{ flex:none; font-size:.5em; font-style:italic; color:#f2c46d; }
  .game-hand-card-legende .game-hand-charges{ text-align:left; font-size:.48em; }
  .game-hand-card-legende .game-hand-confirm{ flex:none; align-self:stretch; font-size:.55em; }
  .game-hand-card-legende .game-hand-directions{ flex:none; align-self:center; width:8em; max-width:none; gap:.3em; font-size:.55em; }
  .game-hand-card-legende .game-hand-direction-btn{ padding:.25em 0; font-size:1em; border-radius:.35em; }
  .game-hand-card--selected{
    box-shadow:0 0 0 2px #fff, 0 0 18px -4px var(--card-color);
    transform:translateY(-2px);
  }
  .game-hand-card-img{
    flex:1; min-height:0; border-radius:.6em; overflow:hidden;
    background:radial-gradient(120% 120% at 50% 30%, color-mix(in srgb, var(--card-color) 30%, transparent), rgba(255,255,255,.06) 70%);
    box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.14);
  }
  .game-hand-card-img img{ width:100%; height:100%; object-fit:cover; display:block; }
  .game-hand-card-name{
    flex:none; text-align:center;
    font-family:'Lilita One', sans-serif; font-size:1.05em; line-height:1.15; color:#fff;
    text-shadow:0 1px 0 rgba(0,0,0,.6);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .game-hand-card-foot{ flex:none; display:flex; align-items:center; justify-content:center; gap:.4em; }
  .game-hand-card-type{
    font-family:'Share Tech Mono', monospace; font-size:.72em; letter-spacing:.04em; text-transform:uppercase;
    color:var(--card-color); font-weight:normal;
  }
  .game-hand-card-stats{ display:flex; gap:.35em; align-items:center; font-family:'Share Tech Mono', monospace; font-size:.95em; color:#fff; }
  .game-hand-card-stats svg{ width:1em; height:1em; color:var(--card-color); }
  .game-hand-card--flash{ animation:handCardFlash .5s cubic-bezier(.16,1,.3,1) both; }
  @keyframes handCardFlash{
    0%{ opacity:0; transform:translateY(10px) scale(.94); box-shadow:0 0 0 0 transparent; }
    55%{ opacity:1; transform:translateY(0) scale(1.03); box-shadow:0 0 20px -2px var(--card-color); }
    100%{ opacity:1; transform:translateY(0) scale(1); box-shadow:none; }
  }
  .game-hand-card--new{
    position:relative;
    animation:handCardNew .7s cubic-bezier(.34,1.56,.64,1) both;
  }
  .game-hand-card--new::before{
    content:'Nouvelle !'; position:absolute; top:22%; left:50%; transform:translateX(-50%); z-index:2;
    background:#f2c46d; color:#1a2230; font-weight:700;
    font-family:'Share Tech Mono', monospace; font-size:.58rem; letter-spacing:.03em;
    padding:2px 8px; border-radius:999px; white-space:nowrap;
    box-shadow:0 4px 10px -4px rgba(242,196,109,.7);
    animation:handCardNewBadge .7s cubic-bezier(.34,1.56,.64,1) both;
  }
  @keyframes handCardNew{
    0%{ opacity:0; transform:translateY(14px) scale(.85) rotate(-4deg); box-shadow:0 0 0 0 transparent; }
    55%{ opacity:1; transform:translateY(0) scale(1.06) rotate(1deg); box-shadow:0 0 26px -2px #f2c46d; }
    100%{ opacity:1; transform:translateY(0) scale(1) rotate(0); box-shadow:0 0 14px -6px #f2c46d; }
  }
  @keyframes handCardNewBadge{
    0%{ opacity:0; transform:translateX(-50%) scale(.5); }
    60%{ opacity:1; transform:translateX(-50%) scale(1.15); }
    100%{ opacity:1; transform:translateX(-50%) scale(1); }
  }

  .game-intro-overlay{
    position:fixed; inset:0; z-index:65;
    display:flex; align-items:center; justify-content:center;
    background:rgba(6,9,14,0); pointer-events:none;
    opacity:0; transition:opacity .4s ease, background .4s ease;
  }
  .game-intro-overlay.show{ opacity:1; background:rgba(6,9,14,.7); }
  .game-intro-content{
    display:flex; flex-direction:column; align-items:center; gap:6px;
    transform:scale(.85); opacity:0;
    transition:transform .5s cubic-bezier(.34,1.56,.64,1), opacity .4s ease;
  }
  .game-intro-overlay.show .game-intro-content{ transform:scale(1); opacity:1; }
  .game-intro-eyebrow{
    font-family:'Share Tech Mono', monospace; font-size:.75rem; letter-spacing:.2em; text-transform:uppercase;
    color:var(--cyan);
  }
  .game-intro-title{
    font-family:'Lilita One', sans-serif; font-size:clamp(2rem, 5vw, 3.2rem); color:#fff;
    -webkit-text-stroke:1.5px #1a2230; text-shadow:0 0 30px rgba(95,227,224,.5);
    animation:none;
  }
  .game-intro-sub{
    font-family:'Rajdhani', sans-serif; font-size:1rem; font-weight:600; color:var(--paper-dim);
  }
  .game-hand-target-btn{
    flex:none;
    background:linear-gradient(90deg, var(--danger), #a33); color:#fff; border:none; border-radius:.5em;
    padding:.45em .5em; font-family:'Share Tech Mono', monospace; font-size:.72em; cursor:pointer;
    transition:transform .15s, box-shadow .2s;
  }
  .game-hand-target-btn[hidden]{ display:none; }
  .game-hand-target-btn--utility{ background:linear-gradient(90deg, var(--cyan), var(--purple)); color:var(--void); font-weight:700; }
  .game-hand-target-btn:hover{ transform:translateY(-2px); box-shadow:0 8px 16px -10px rgba(224,122,95,.7); }
  .game-hand-no-target{ flex:none; text-align:center; font-size:.7em; line-height:1.15; color:var(--paper-dim); font-style:italic; }
  .game-hand-select-hint{ flex:none; text-align:center; font-size:.7em; line-height:1.15; color:var(--danger); font-style:italic; }
  .game-hand-charges{ flex:none; text-align:center; font-size:.68em; color:#f2c46d; font-family:'Share Tech Mono', monospace; }

  .game-hand-card--pickable{
    opacity:1; filter:none; cursor:pointer;
    box-shadow:0 0 0 2px #f2c46d, 0 0 14px -4px #f2c46d;
    animation:targetPulse 1s ease-in-out infinite;
  }

  .game-tourelle-cible-btn{
    background:linear-gradient(90deg, var(--danger), #a33); color:#fff; border:none; border-radius:6px;
    padding:8px 14px; font-family:'Share Tech Mono', monospace; font-size:.68rem; cursor:pointer;
    transition:transform .15s, box-shadow .2s;
  }
  .game-tourelle-cible-btn:hover{ transform:translateY(-2px); box-shadow:0 8px 16px -10px rgba(224,122,95,.7); }

  .game-log{
    display:flex; flex-direction:column; gap:4px;
    font-family:'Share Tech Mono', monospace; font-size:.7rem; color:var(--paper-dim);
    border-top:1px dashed rgba(255,255,255,.15); padding-top:10px;
  }
  .game-endturn-btn{
    width:100%;
    background:linear-gradient(90deg, var(--cyan), var(--purple)); color:var(--void); font-weight:700;
    border:none; border-radius:6px;
    padding:11px; font-family:'Share Tech Mono', monospace; font-size:.75rem; letter-spacing:.06em; text-transform:uppercase;
    cursor:pointer; transition:transform .15s, box-shadow .2s;
  }
  .game-endturn-btn:hover{ transform:translateY(-2px); box-shadow:0 10px 20px -12px rgba(95,227,224,.5); }
  .game-endturn-btn:active{ transform:translateY(0) scale(.98); }

  .game-hand-directions{ display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; max-width:150px; }
  .game-hand-directions[hidden]{ display:none; }
  .game-hand-direction-btn{
    background:linear-gradient(90deg, var(--danger), #a33); color:#fff; border:none; border-radius:6px;
    padding:8px; font-size:.9rem; cursor:pointer; transition:transform .15s;
  }
  .game-hand-direction-btn:hover{ transform:scale(1.08); }
  .game-hand-direction-btn[data-direction="haut"]{ grid-column:2; }
  .game-hand-direction-btn[data-direction="gauche"]{ grid-column:1; grid-row:2; }
  .game-hand-direction-btn[data-direction="bas"]{ grid-column:2; grid-row:2; }
  .game-hand-direction-btn[data-direction="droite"]{ grid-column:3; grid-row:2; }

  .game-quit-btn{
    width:100%;
    background:transparent; color:var(--danger); border:1px solid var(--danger); border-radius:6px;
    padding:10px; font-family:'Share Tech Mono', monospace; font-size:.72rem; letter-spacing:.06em; text-transform:uppercase;
    cursor:pointer; transition:background .2s, color .2s;
  }
  .game-quit-btn:hover{ background:rgba(224,122,95,.14); color:#fff; }

  /* ---------- Salon réseau ---------- */

  .reseau-body{ width:100%; max-width:1000px; margin:0 auto; padding:4vh 0 6vh; display:flex; flex-direction:column; gap:22px; }
  .reseau-head{ display:flex; flex-direction:column; gap:6px; }
  .reseau-head h1{ font-family:'Orbitron', sans-serif; font-size:1.9rem; letter-spacing:.04em; }
  .reseau-sub{ color:var(--paper-dim); max-width:60ch; }

  .reseau-grid{ display:grid; grid-template-columns:1fr 1fr; gap:18px; align-items:start; }

  .reseau-panel{
    display:flex; flex-direction:column; gap:12px;
    padding:18px; border-radius:14px;
    background:linear-gradient(160deg, rgba(15,22,32,.92), rgba(10,14,20,.92));
    border:1px solid rgba(95,227,224,.16);
  }
  .reseau-panel-hint{ font-size:.86rem; color:var(--paper-dim); }

  .reseau-liste{ display:flex; flex-direction:column; gap:8px; }

  .reseau-ligne{
    display:flex; align-items:center; gap:10px;
    padding:9px 11px; border-radius:10px;
    background:rgba(255,255,255,.035);
    border:1px solid rgba(255,255,255,.06);
  }
  .reseau-ligne--vide{
    justify-content:center; color:var(--paper-dim);
    font-family:'Share Tech Mono', monospace; font-size:.74rem;
    border-style:dashed; background:none;
  }
  .reseau-ligne-infos{ display:flex; flex-direction:column; gap:1px; min-width:0; flex:1; }
  .reseau-ligne-nom{ font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .reseau-ligne-sous{ font-family:'Share Tech Mono', monospace; font-size:.68rem; color:var(--paper-dim); }

  .reseau-avatar{
    width:32px; height:32px; flex:0 0 32px;
    display:grid; place-items:center; border-radius:50%;
    background:color-mix(in srgb, var(--avatar-color) 22%, transparent);
    border:1px solid var(--avatar-color);
    font-size:.86rem;
  }

  .reseau-btn{
    padding:7px 13px; border:none; border-radius:8px; cursor:pointer;
    font-family:'Rajdhani', sans-serif; font-weight:600; font-size:.82rem;
    background:linear-gradient(90deg, var(--cyan), var(--purple)); color:var(--void);
    transition:transform .18s, box-shadow .18s, opacity .18s;
  }
  .reseau-btn:hover:not(:disabled){ transform:translateY(-2px); box-shadow:0 8px 18px -10px rgba(95,227,224,.6); }
  .reseau-btn:disabled{ opacity:.45; cursor:not-allowed; }
  .reseau-btn--danger{ background:linear-gradient(90deg, var(--danger), #b4553c); color:var(--paper); }

  .reseau-cta{ align-self:stretch; text-align:center; }
  .reseau-cta:disabled{ opacity:.45; cursor:not-allowed; transform:none; }

  .reseau-champ{ display:flex; flex-direction:column; gap:4px; }
  .reseau-champ span{ font-family:'Share Tech Mono', monospace; font-size:.7rem; color:var(--paper-dim); text-transform:uppercase; letter-spacing:.1em; }
  .reseau-champ input, .reseau-champ select, .reseau-code-form input{
    padding:9px 11px; border-radius:9px;
    background:rgba(255,255,255,.05); color:var(--paper);
    border:1px solid rgba(95,227,224,.22);
    font-family:'Rajdhani', sans-serif; font-size:.92rem;
  }
  .reseau-champ input:focus, .reseau-champ select:focus, .reseau-code-form input:focus{
    outline:none; border-color:var(--cyan);
  }

  .reseau-separateur{ display:flex; align-items:center; gap:10px; color:var(--paper-dim); font-size:.72rem; }
  .reseau-separateur::before, .reseau-separateur::after{ content:''; flex:1; height:1px; background:rgba(255,255,255,.1); }

  .reseau-code-form{ display:flex; gap:8px; }
  .reseau-code-form input{ flex:1; text-transform:uppercase; letter-spacing:.2em; font-family:'Share Tech Mono', monospace; }

  .reseau-code-affiche{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:10px 13px; border-radius:10px;
    background:rgba(95,227,224,.07); border:1px dashed rgba(95,227,224,.35);
  }
  .reseau-code-label{ font-family:'Share Tech Mono', monospace; font-size:.68rem; color:var(--paper-dim); text-transform:uppercase; letter-spacing:.1em; }
  .reseau-code-affiche strong{ font-family:'Share Tech Mono', monospace; font-size:1.2rem; letter-spacing:.28em; color:var(--cyan); }

  .reseau-invitations{ display:flex; flex-direction:column; gap:8px; }
  .reseau-invitation{
    display:flex; align-items:center; gap:10px; flex-wrap:wrap;
    padding:12px 14px; border-radius:11px;
    background:linear-gradient(90deg, rgba(139,111,217,.18), rgba(95,227,224,.1));
    border:1px solid rgba(139,111,217,.4);
    animation:popIn .4s cubic-bezier(.16,1,.3,1) both;
  }
  .reseau-invitation span{ flex:1; min-width:180px; }

  .reseau-erreur{
    padding:10px 13px; border-radius:9px;
    background:rgba(224,122,95,.14); border:1px solid rgba(224,122,95,.45);
    color:var(--danger); font-size:.86rem;
  }

  .game-hand--attente{ opacity:.72; }

  /* ---------- Amis ---------- */
  .amis{ margin-top:20px; opacity:0; animation:popIn .7s cubic-bezier(.16,1,.3,1) .5s forwards; }
  .amis-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; }
  .amis-jouer{ flex-shrink:0; text-decoration:none; }
  .amis-form{ display:flex; gap:8px; }
  .amis-form input{
    flex:1; min-width:0; padding:10px 12px; border-radius:9px;
    background:rgba(255,255,255,.05); color:var(--paper);
    border:1px solid rgba(95,227,224,.22);
    font-family:'Rajdhani', sans-serif; font-size:.95rem;
  }
  .amis-form input:focus{ outline:none; border-color:var(--cyan); }
  .amis-message{ font-size:.86rem; color:var(--danger); margin-top:-6px; }
  .amis-message--ok{ color:#86efac; }
  .amis-bloc{ display:flex; flex-direction:column; gap:8px; }
  .amis-bloc[hidden]{ display:none; }
  .amis-titre{
    font-family:'Share Tech Mono', monospace; font-size:.7rem; letter-spacing:.1em; text-transform:uppercase;
    color:var(--paper-dim);
  }
  .amis-gerer{ font-size:.86rem; color:var(--cyan); text-decoration:underline; text-underline-offset:3px; }
  .reseau-avatar{ position:relative; }
  .reseau-avatar--en-ligne::after{
    content:""; position:absolute; right:-2px; bottom:-2px; width:11px; height:11px; border-radius:50%;
    background:#4ade80; border:2px solid #0f1620; box-shadow:0 0 6px rgba(74,222,128,.8);
  }
  .reseau-ligne--horsligne{ opacity:.5; }
  .reseau-btn--discret{ background:transparent; color:var(--paper-dim); border:1px solid rgba(255,255,255,.18); }
  .reseau-btn--discret:hover:not(:disabled){ color:var(--paper); border-color:var(--cyan); box-shadow:none; }
  @media (prefers-reduced-motion:reduce){ .amis{ animation:none; opacity:1; } }

  /* Colonne de gauche : les joueurs, la grille, puis les boutons du tour. */
  .game-main{ display:flex; flex-direction:column; gap:12px; min-width:0; }
  .game-actions{ display:flex; gap:8px; }
  .game-actions > form{ flex:1; min-width:0; }
  .game-actions > .game-actions-end{ flex:2; }

  /* Coups adverses depuis ton dernier tour : calque posé sur le plateau
     (flèches, cartes épinglées, effets), dessiné par jouer.js. */
  .game-board-wrap{ position:relative; container-type:inline-size; }
  .game-traces{ position:absolute; inset:2px; z-index:5; pointer-events:none; }
  .game-traces[hidden]{ display:none; }
  .game-traces-svg{ position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
  .game-trace-ombre{ fill:none; stroke:rgba(6,9,14,.75); stroke-width:1.4; stroke-linecap:round; }
  .game-trace-trait{
    fill:none; stroke-width:.7; stroke-linecap:round; stroke-dasharray:2 1.2;
    animation:traceDash 1.2s linear infinite;
  }
  @keyframes traceDash{ to{ stroke-dashoffset:-3.2; } }
  .game-trace-anneau{ fill:none; stroke-width:.5; }
  .game-trace-effet{
    position:absolute; z-index:2; transform:translate(-50%, -100%);
    font-family:'Lilita One', sans-serif; font-size:max(11px, 2.4cqw); line-height:1.2; white-space:nowrap;
    padding:.1em .55em; border-radius:999px; color:#fff;
    box-shadow:0 4px 10px -4px rgba(0,0,0,.8);
    animation:traceApparait .4s cubic-bezier(.34,1.56,.64,1) both;
  }
  .game-trace-effet--degats{ background:var(--danger); }
  .game-trace-effet--soin{ background:#3fae6a; }
  .game-trace-effet--statut{ background:var(--purple); font-family:'Share Tech Mono', monospace; font-size:max(10px, 1.9cqw); }
  @keyframes traceApparait{ from{ opacity:0; scale:.6; } }
  .game-trace-carte{
    position:absolute; z-index:3; pointer-events:auto; cursor:zoom-in;
    width:9cqw; aspect-ratio:5/7; transform:translate(-50%, -50%);
    font-size:1.07cqw; color:#fff; text-align:center;
    display:flex; flex-direction:column; gap:.3em; padding:.45em;
    background:linear-gradient(170deg, color-mix(in srgb, var(--card-color) 24%, #1c2733), #10161e 80%);
    border:2px solid var(--card-color); border-radius:.8em; box-sizing:border-box;
    box-shadow:0 0 0 2px rgba(6,9,14,.8), 0 6px 14px -6px rgba(0,0,0,.9);
    transition:transform .2s ease;
    animation:traceApparait .4s cubic-bezier(.34,1.56,.64,1) both;
  }
  .game-trace-carte:hover{ z-index:4; transform:translate(-50%, -50%) scale(1.15); }
  .game-trace-carte--grande, .game-trace-carte--grande:hover{ z-index:4; cursor:zoom-out; transform:translate(-50%, -50%) scale(2.6); }
  .game-trace-carte:focus-visible{ outline:2px solid var(--cyan); outline-offset:2px; }
  .game-trace-num{
    position:absolute; left:-1.4cqw; top:-1.4cqw;
    width:3.2cqw; height:3.2cqw; display:grid; place-items:center; border-radius:50%;
    font-family:'Lilita One', sans-serif; font-size:2cqw; color:var(--void); background:var(--card-color);
    box-shadow:0 0 0 2px rgba(6,9,14,.9);
  }
  .game-trace-nom{
    flex:none; font-family:'Lilita One', sans-serif; font-size:1.05em; line-height:1.15;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-shadow:0 1px 0 rgba(0,0,0,.6);
  }
  .game-trace-img{ flex:1; min-height:0; border-radius:.5em; overflow:hidden; background:rgba(255,255,255,.06); }
  .game-trace-img img{ width:100%; height:100%; object-fit:cover; display:block; }
  .game-trace-stats{ flex:none; font-family:'Share Tech Mono', monospace; font-size:.7em; color:var(--paper-dim); white-space:nowrap; }
  .game-traces-masquer{
    position:absolute; top:6px; right:6px; z-index:6; pointer-events:auto; cursor:pointer;
    font-family:'Share Tech Mono', monospace; font-size:.62rem; letter-spacing:.06em; text-transform:uppercase;
    color:var(--paper); background:rgba(10,14,20,.82); border:1px solid rgba(255,255,255,.2); border-radius:6px; padding:4px 8px;
  }
  .game-traces-masquer:hover{ border-color:var(--cyan); color:var(--cyan); }
  .game-player-coup{
    position:absolute; top:-9px; right:8px; z-index:2; max-width:85%;
    font-family:'Share Tech Mono', monospace; font-size:.62rem; line-height:1.4; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
    padding:0 7px; border-radius:999px; background:var(--danger); color:#fff;
    box-shadow:0 3px 8px -3px rgba(0,0,0,.8);
  }

  /* Panneau de droite : la main, qui prend toute la place disponible. */
  .game-hand--cartes .game-hand-hint{ margin-top:0; }

  /* ---------- Plateau de jeu : tout tient dans l'écran, sans défilement ---------- */
  body.game-page{ padding:0; }
  @media (min-width: 901px){
    body.game-page{ height:100vh; min-height:0; overflow:hidden; }
    .game-page #dashboard{ height:100vh; min-height:0; }
    .game-page .topbar{ box-sizing:border-box; height:52px; padding:0 2vw; flex:none; }
    .game-page .game-body{
      /* 52 (barre) + 20 (marges) + 34 (en-tête) + 8 (espace) + 2 de marge de
         sécurité, plus les deux espaces de 8 autour du plateau, les joueurs
         au-dessus et les boutons en dessous. */
      --players-h:44px;
      --actions-h:36px;
      --board:min(calc(100vh - 132px - var(--players-h) - var(--actions-h)), 50vw);
      box-sizing:border-box; flex:1; min-height:0; max-width:none; padding:10px 2vw; gap:8px;
    }
    .game-page .game-head{ flex:none; flex-direction:row; align-items:center; gap:16px; height:34px; overflow:hidden; white-space:nowrap; }
    .game-page .game-head h1{ font-size:1.25rem; margin:0; }
    .game-page .game-layout{ grid-template-columns:var(--board) minmax(0, 1fr); gap:16px; }
    .game-page .game-main{ width:var(--board); gap:8px; }
    .game-page .game-board-wrap{ flex:none; width:var(--board); height:var(--board); }
    .game-page .game-board{ box-sizing:border-box; width:var(--board); height:var(--board); flex:none; }
    .game-page .game-side{ height:calc(var(--board) + 16px + var(--players-h) + var(--actions-h)); min-height:0; gap:8px; }
    /* Joueurs sur une ligne : nom et PV en haut, barre de vie dessous. */
    .game-page .game-players{ flex:none; height:var(--players-h); flex-direction:row; gap:6px; }
    .game-page .game-player{
      flex:1; min-width:0; box-sizing:border-box; padding:0 10px;
      display:grid; grid-template-columns:minmax(0, 1fr) auto; align-content:center; align-items:baseline; gap:4px 8px;
    }
    .game-page .game-player-name{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .game-page .game-player-pv{ grid-row:1; grid-column:2; }
    .game-page .game-player-hp{ grid-row:2; grid-column:1 / -1; }
    .game-page .game-actions{ flex:none; height:var(--actions-h); }
    .game-page .game-endturn-btn, .game-page .game-quit-btn{ height:100%; padding:0 8px; }
    .game-page .game-hand--cartes{ flex:1; min-height:0; }
    .game-page .game-hand-hint{ margin-top:0; }
    .game-page #tourellePanel{ flex:none; }
    .game-page .game-log{ flex:none; gap:2px; padding-top:6px; font-size:.66rem; }
    .game-page .game-log p{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .game-page .game-log p:nth-last-child(n+4){ display:none; }
  }

  @media (max-width: 820px){
    .reseau-grid{ grid-template-columns:1fr; }
  }

  @media (max-width: 900px){
    .game-layout{ grid-template-columns:1fr; }
  }

  @media (max-width: 820px){
    .topbar{ flex-wrap:wrap; gap:12px; }
    .btn-tooltip{ display:none; }
  }
  /* ---------- TÉLÉPHONE ---------- */
  /* Les bandeaux à onglets défilent horizontalement au lieu d'élargir la page. */
  .shop-tabs, .cartes-tabs, .mode-tabs{ max-width:100%; overflow-x:auto; scrollbar-width:none; }
  .cartes-tabs > *, .mode-tabs > *{ flex-shrink:0; }
  .global-toast{ max-width:calc(100vw - 24px); }
  a, button{ -webkit-tap-highlight-color:transparent; }

  @media (max-width:900px){
    /* Pages avec barre du haut : pas de marge autour, chaque page gère la sienne. */
    body:has(#dashboard){ padding:0; }
    .topbar-nav{ flex-wrap:wrap; justify-content:flex-end; gap:10px; }
  }

  @media (max-width:640px){
    body{ padding:5vh 16px 4vh; }

    /* iOS zoome sur les champs en dessous de 16px. */
    input:not([type=checkbox]):not([type=radio]), select, textarea{ font-size:16px !important; }

    /* Barre du haut : ligne 1 = logo + déconnexion, ligne 2 = boutons. */
    .topbar{ flex-wrap:wrap; justify-content:flex-start; row-gap:10px; column-gap:7px; padding:10px 12px; }
    .topbar::before{ content:""; order:1; flex-basis:100%; height:0; }
    .topbar-nav{ display:contents; }
    .topbar-nav > *{ order:2; }
    .topbar-brand{ order:0; flex:1; font-size:.95rem; }
    .topbar .logout-link{ order:0; padding:8px 0; border-bottom:0; text-decoration:underline dotted; text-underline-offset:3px; }
    .topbar .boutique-btn{ height:38px; padding:0 11px; font-size:0; gap:0; }
    .topbar .boutique-btn .icon{ width:18px; height:18px; }
    .topbar form{ display:flex; }
    .capacites-btn{ width:38px; height:38px; }
    .capacites-btn .icon{ width:17px; height:17px; }
    .topbar .gem-chip{ height:38px; padding:0 10px; }
    .topbar .user-chip{ margin-left:auto; min-height:38px; }
    .user-chip-info > span:first-child, .user-chip-titre, .user-level-bar{ display:none; }
    .user-level{ font-size:.75rem; }

    /* Corps des pages */
    .lobby, .cartes-body, .boutique-body, .game-body{ padding:20px 14px 70px; }
    .reseau-body{ padding:20px 14px 70px; }
    .cartes-body, .boutique-body{ gap:22px; }
    .cartes-tab, .mode-tab{ padding:11px 16px; }
    .cartes-grid{ grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:12px; }
    .maps-grid{ grid-template-columns:1fr 1fr; gap:12px; }
    .map-card{ padding:10px; gap:8px; }
    .map-card-lock{ top:10px; left:10px; right:10px; }
    .map-card-desc{ font-size:.74rem; }
    .stats-grid{ grid-template-columns:1fr 1fr; gap:12px; }
    .stat-card{ padding:14px; }
    .gem-grid{ grid-template-columns:repeat(auto-fill, minmax(100px, 1fr)); gap:10px; }
    .gem-grid--large{ grid-template-columns:1fr; }
    .ad-offer{ padding:16px; }
    .ad-offer-btn{ width:100%; justify-content:center; }

    /* Lobby */
    .lobby-hero{ padding:22px 18px; gap:22px; }
    .lobby-play{ align-self:stretch; justify-content:center; }
    .daily-panel{ padding:16px; }
    .daily-mission{ padding:10px 12px; gap:10px; }

    /* Profil */
    .apercu{ padding:14px; }
    .apercu-carte{ padding:26px 16px 20px; }
    .apercu-avatar{ width:96px; height:96px; font-size:2.6rem; }
    .apercu-pseudo{ font-size:1.6rem; }

    /* Connexion */
    .card{ margin-top:30px; }
    .card-body{ padding:0 18px; }
    .card-header{ padding:12px 16px; }
    .pwd-toggle{ width:40px; height:40px; right:2px; }

    /* Fenêtres et notifications */
    .map-modal{ padding:24px 16px 18px; max-height:calc(100dvh - 32px); overflow-y:auto; }
    .map-modal-overlay{ padding:16px; }
    .map-modal-close{ width:36px; height:36px; top:8px; right:8px; }
    .card-win-toast{ left:12px; right:12px; bottom:16px; }
    .music-toggle{ bottom:12px; left:12px; }
    .reseau-code-form{ flex-wrap:wrap; }
    .reseau-code-form input{ min-width:0; }

    /* Partie : 3 cartes par ligne, hauteur calculée sur la largeur d'écran. */
    .game-body{ gap:14px; }
    .game-turn-status{ flex-wrap:wrap; gap:6px; }
    .game-hand-cards{ --card-h:calc((100vw - 28px - 16px) / 3 * 1.4); }
    /* Légende d'une carte ouverte : sur toute la carte, en plus gros. */
    .game-hand-card-img{ position:static; }
    .game-hand-card-legende{ padding:.6em; }
    .game-hand-legende-type{ font-size:.55em; }
    .game-hand-legende-desc{ font-size:.72em; }
    .game-hand-legende-statut, .game-hand-card-legende .game-hand-charges{ font-size:.62em; }
    .game-hand-card-legende .game-hand-confirm{ font-size:.7em; padding:.6em .4em; }
    .game-hand-card-legende .game-hand-directions{ font-size:.7em; }
    /* Joueurs sur une seule ligne, comme sur grand écran. */
    .game-players{ flex-direction:row; gap:6px; }
    .game-player{ flex:1; min-width:0; padding:7px 8px; gap:4px; }
    .game-player-name{ font-size:.78rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .game-player-pv{ font-size:.6rem; }
    .game-player-coup{ max-width:90%; font-size:.55rem; }
    .music-toggle{ opacity:.75; }
  }

  /* Écran tactile : pas d'effet de survol « collé » après un tap. */
  @media (hover:none){
    .game-card:hover, .map-card:hover, .gem-item:hover, .lobby-profile:hover, .collection-item:hover,
    .shop-tab:hover, .submit-btn:hover, .lobby-play:hover{ transform:none; }
    .game-card:hover::before, .map-card:hover::before{ transform:translateX(-140%); }
  }

  @media (prefers-reduced-motion: reduce){
    *{ animation-duration:.001s !important; animation-iteration-count:1 !important; transition-duration:.001s !important; }
  }

/* Carte « Invisibilité » : le joueur invisible se voit en fantôme. */
.game-cell--invisible{ opacity:.45; filter:saturate(.4) drop-shadow(0 0 6px #c084fc); }

/* Soldes de la barre du haut : style d'origine (pièces dorées de la boutique, gemmes vertes). */
.soldes{ display:inline-flex; align-items:center; gap:8px; }
.coin-balance--topbar{ padding:5px 14px 5px 8px; text-decoration:none; }
.coin-balance--topbar .coin-icon{ width:20px; height:20px; }
.coin-balance--topbar strong{ font-size:1rem; }

/* ==========================================================================
   VERSION TÉLÉPHONE (v2) : barre de navigation en bas, barre du haut
   allégée, plateau de jeu pleine largeur et bouton « Fin du tour » sous le pouce.
   ========================================================================== */
.nav-mobile{ display:none; }

@media (max-width:640px){
  /* Barre du bas : 5 gros boutons, au-dessus de la barre système (encoche). */
  .nav-mobile{
    display:grid; grid-template-columns:repeat(5, 1fr); align-items:end;
    position:fixed; left:0; right:0; bottom:0; z-index:50;
    padding:6px 6px calc(6px + env(safe-area-inset-bottom));
    background:linear-gradient(180deg, rgba(15,22,32,.92), rgba(8,11,16,.98));
    border-top:1px solid rgba(95,227,224,.25);
    box-shadow:0 -10px 30px -10px rgba(0,0,0,.8);
    backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
  }
  .nav-mobile-lien{
    display:flex; flex-direction:column; align-items:center; gap:3px; min-height:52px; justify-content:center;
    border-radius:12px; color:var(--paper-dim); text-decoration:none;
    font-family:'Rajdhani', sans-serif; font-weight:700; font-size:.74rem; letter-spacing:.02em;
    transition:color .15s, background .15s;
  }
  .nav-mobile-lien svg{ width:24px; height:24px; }
  .nav-mobile-lien--actif{ color:var(--cyan); background:rgba(95,227,224,.1); }
  .nav-mobile-lien--actif svg{ filter:drop-shadow(0 0 6px rgba(95,227,224,.7)); }
  .nav-mobile-lien--jouer{
    min-height:62px; margin-top:-16px; color:#0a0e14; border-radius:18px;
    background:linear-gradient(180deg, #ffd166, #ff8a3d);
    box-shadow:0 4px 0 #9a4a10, 0 10px 22px -8px rgba(255,138,61,.9);
  }
  .nav-mobile-lien--jouer svg{ width:28px; height:28px; fill:currentColor; }
  .nav-mobile-lien--jouer.nav-mobile-lien--actif{ background:linear-gradient(180deg, #ffe08a, #ffa05a); color:#0a0e14; }
  body:has(.nav-mobile){ padding-bottom:calc(84px + env(safe-area-inset-bottom)); }
  body:has(.nav-mobile) .music-toggle{ bottom:calc(92px + env(safe-area-inset-bottom)); }

  /* Barre du haut : logo, soldes, avatar. Les pages sont dans la barre du bas. */
  body:has(.nav-mobile) .topbar .boutique-btn,
  body:has(.nav-mobile) .topbar .capacites-btn{ display:none; }
  .topbar{ position:sticky; top:0; z-index:40; background:rgba(10,14,20,.9); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); }
  .soldes{ order:2; gap:6px; }
  .coin-balance--topbar{ padding:4px 10px 4px 6px; }
  .topbar .gem-chip{ height:34px; padding:0 10px; }

  /* Zones tactiles d'au moins 44 px. */
  .encyclo-filtre, .shop-tab, .cartes-tab, .mode-tab{ min-height:44px; }

  /* ---------- Partie ---------- */
  .game-page .topbar{ padding:8px 10px; }
  .game-page .user-chip-info{ display:none; }
  .game-page .game-body{ padding:10px 8px calc(84px + env(safe-area-inset-bottom)); gap:10px; }
  .game-page .game-head{ gap:6px; }
  .game-page .game-head h1{ font-size:1.15rem; }
  .game-page .game-turn-status span{ font-size:.66rem; padding:4px 8px; }
  .game-page .game-board{ border-radius:10px; gap:1px; }
  /* « Fin du tour » et « Quitter » fixés en bas, sous le pouce. */
  .game-page .game-actions{
    position:fixed; left:0; right:0; bottom:0; z-index:45; display:flex; gap:8px;
    padding:8px 10px calc(8px + env(safe-area-inset-bottom));
    background:linear-gradient(180deg, rgba(15,22,32,.9), rgba(8,11,16,.98));
    border-top:1px solid rgba(95,227,224,.25); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
  }
  .game-page .game-actions form{ display:flex; }
  .game-page .game-actions-end{ flex:2; }
  .game-page .game-actions-quit{ flex:1; }
  .game-page .game-endturn-btn, .game-page .game-quit-btn{ width:100%; min-height:52px; font-size:.95rem; }
  .game-page .game-log{ font-size:.75rem; }
  .game-page .game-log p:nth-last-child(n+4){ display:none; }
  .game-page .music-toggle{ bottom:calc(80px + env(safe-area-inset-bottom)); }
  /* Grande carte jouée : un peu plus petite sur téléphone. */
  .cfx-carte{ width:min(200px, 56vw); }
}

/* Salon en ligne : recherche d'un joueur au hasard */
.reseau-rapide{ display:flex; flex-direction:column; gap:10px; }
.reseau-rapide-boutons{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.reseau-rapide-boutons .reseau-cta{ margin:0; text-align:center; justify-content:center; }
.reseau-aleatoire--boss{ background:linear-gradient(90deg, #e11d48, #7f1d1d); color:#fff; }
.reseau-champ[hidden]{ display:none; }
@media (max-width:640px){ .reseau-rapide-boutons{ grid-template-columns:1fr; } }

/* Passage de niveau : ce qui vient d'être débloqué */
.level-up-debloque{
  display:flex; flex-direction:column; gap:6px; margin-top:14px; max-width:min(520px, 90vw); text-align:center;
  font-family:'Rajdhani', sans-serif; font-weight:700; font-size:1.05rem; color:#fff;
}
.level-up-debloque span{ padding:6px 12px; border-radius:10px; background:rgba(0,0,0,.45); border:1px solid rgba(242,196,109,.6); }

/* Bouton « Signaler » sur la fiche d'un joueur en partie en ligne */
.game-player{ position:relative; }
.game-player-signaler{ position:absolute; bottom:4px; right:4px; min-height:24px; padding:0 6px; font-size:.75rem; opacity:.7; }
.game-player-signaler:hover{ opacity:1; }

/* ---------- Booster de fin de partie qui monte de rareté (comme un Starr Drop) ---------- */
.booster-cadeau{ --c:#4ade80; }
.booster-cadeau[data-rarete="super_rare"]{ --c:#3b9dff; }
.booster-cadeau[data-rarete="epique"]{ --c:#c65cff; }
.booster-cadeau[data-rarete="mythique"]{ --c:#ff3b5c; }
.booster-cadeau[data-rarete="legendaire"]{ --c:#f2c46d; }
.booster-pack.booster-cadeau{ animation:none; display:flex; flex-direction:column; align-items:center; gap:10px; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.booster-cadeau-boite{ pointer-events:none; padding:10px; }
.booster-cadeau-boite .noel-cadeau-boite{ width:min(170px, 44vw); }
.booster-cadeau-rarete{
  font-family:'Lilita One', sans-serif; font-size:clamp(1.8rem, 6vw, 2.6rem); color:var(--c);
  -webkit-text-stroke:1.5px rgba(0,0,0,.6); text-shadow:0 4px 0 rgba(0,0,0,.5), 0 0 30px var(--c);
}
.booster-cadeau-rarete--flash{ animation:noelFlash .6s cubic-bezier(.2,1.6,.4,1); }
.booster-reveal.booster-cadeau{ border-color:var(--c); box-shadow:0 0 50px -10px var(--c); }
.booster-reveal-rarete{ color:var(--c); text-shadow:0 0 18px var(--c); }
.booster-reveal-objet{ font-weight:800; color:#fff3c4; padding:8px 12px; border-radius:10px; background:rgba(242,196,109,.15); border:1px solid #f2c46d; }

/* Combat d'équipe : pastille de couleur de l'équipe devant le nom */
.game-player-equipe{ display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:6px; vertical-align:middle; background:var(--equipe); box-shadow:0 0 8px var(--equipe); }
/* Mode Noël : cadeau posé sur une case du plateau */
.game-cell--cadeau{ display:grid; place-items:center; }
.game-cell-cadeau{
  font-size:clamp(14px, 5.5cqw, 30px); line-height:1; pointer-events:none;
  filter:drop-shadow(0 0 6px rgba(242,196,109,.9)); animation:cadeauSautille 1.4s ease-in-out infinite;
}
@keyframes cadeauSautille{ 0%,100%{ transform:translateY(0) rotate(-6deg); } 50%{ transform:translateY(-12%) rotate(6deg); } }
.game-cell--cadeau.game-cell--movable{ box-shadow:inset 0 0 0 2px #f2c46d, 0 0 14px -2px #f2c46d; }
@media (prefers-reduced-motion:reduce){ .game-cell-cadeau{ animation:none; } }