/* ATTRAPE-LES — game.css — hub 3 modes (sélection + EASY duel + arcade canvas). Isolé du site. */
*{ box-sizing:border-box; }
html,body{ margin:0; min-height:100%; background:#20261f; color:#f9e8c4;
  font-family:"Inter",system-ui,-apple-system,sans-serif; -webkit-text-size-adjust:100%; }
button,a{ -webkit-tap-highlight-color:transparent; }
[hidden]{ display:none!important; }

/* ====================== ÉCRAN DE SÉLECTION DES MODES ====================== */
#modeSelect{ position:fixed; inset:0; overflow:auto; display:flex; align-items:center; justify-content:center;
  background-color:#1a1109;
  background-image:
    radial-gradient(135% 95% at 50% 38%, transparent 52%, rgba(16,10,5,.58) 100%),
    linear-gradient(rgba(24,15,8,.52) 0%, rgba(24,15,8,.05) 28%, rgba(20,13,7,.28) 62%, rgba(14,9,4,.84) 100%),
    url('assets/game/menu-bg.jpg');
  background-size:cover; background-position:center 42%; background-repeat:no-repeat; }
.ms-in{ max-width:1040px; width:100%; padding:64px 22px 40px; text-align:center; }
.ms-title{ font-family:"Anton",sans-serif; font-size:clamp(44px,9.5vw,82px); margin:0; letter-spacing:.03em; color:#f6ecd4;
  text-shadow:0 2px 0 rgba(0,0,0,.45), 0 7px 28px rgba(0,0,0,.6); }
.ms-sub{ font-family:"Special Elite",monospace; color:#ead9b4; margin:8px 0 34px; font-size:15px;
  text-shadow:0 1px 8px rgba(0,0,0,.75); }
.ms-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.ms-card{ cursor:pointer; text-align:left; background:#efe4c8; color:#1c1712; border:3px solid #1c1712;
  border-radius:6px; padding:20px 18px 18px; box-shadow:6px 9px 0 rgba(0,0,0,.6); transition:transform .14s, box-shadow .14s;
  display:flex; flex-direction:column; gap:10px; min-height:188px; }
.ms-card:hover{ transform:translate(-2px,-5px); box-shadow:10px 14px 0 rgba(0,0,0,.6); background:#f6efd8; }
.ms-card:focus-visible{ outline:3px solid #fff; outline-offset:3px; }
.ms-badge{ align-self:flex-start; font-family:"Anton",sans-serif; letter-spacing:.06em; font-size:14px;
  color:#f4ecd8; padding:4px 12px; border-radius:3px; }
.ms-badge--easy{ background:#2f7d54; } .ms-badge--standard{ background:#b8892f; } .ms-badge--hard{ background:#c0302a; }
.ms-name{ font-family:"Anton",sans-serif; font-size:24px; letter-spacing:.01em; line-height:1; }
.ms-name small{ font-size:15px; color:#8a6f3c; }
.ms-desc{ font-family:"Special Elite",monospace; font-size:13.5px; line-height:1.45; color:#4a4031; }
.ms-foot{ font-family:"Special Elite",monospace; font-size:13px; color:#e7cfa0; margin-top:30px;
  text-shadow:0 1px 8px rgba(0,0,0,.8); }

/* ====================== ARCADE (canvas V1/V3) ====================== */
#arcade{ position:fixed; inset:0; }
#jeu{ width:100%; height:100%; display:block; touch-action:none; cursor:crosshair;
  background:#d99a52; user-select:none; -webkit-user-select:none; }
.jeu-back{ position:fixed; bottom:10px; left:12px; z-index:5; cursor:pointer;
  font-family:"Special Elite",monospace; font-size:13px; letter-spacing:.04em;
  color:#1c1712; background:rgba(239,228,200,.82); text-decoration:none;
  padding:6px 12px; border:1.5px solid #1c1712; border-radius:4px; }
.jeu-back:hover{ background:#efe4c8; }
.modeback{ top:12px; bottom:auto; }
.jeu-hint{ position:fixed; bottom:10px; left:50%; transform:translateX(-50%); z-index:5;
  font-family:"Special Elite",monospace; font-size:12px; color:rgba(28,23,18,.6);
  background:rgba(239,228,200,.6); padding:4px 10px; border-radius:20px; pointer-events:none; }
@media (hover:hover) and (pointer:fine){ .jeu-hint{ display:none; } }

/* ====================== MODE EASY — LE DUEL (porté de Vitto, scopé #duel) ====================== */
#duel{ color:#f9e8c4; }
#duel button{ font:inherit; cursor:pointer; border:1px solid #b78848; background:#e5b45d; color:#2f211a;
  padding:12px 18px; border-radius:4px; font-weight:700; }
#duel button:hover{ background:#f5cc80; }
#duel button:focus-visible, #duel a:focus-visible{ outline:3px solid #fff; outline-offset:4px; }
.dhd{ max-width:1160px; margin:auto; display:flex; justify-content:space-between; align-items:center; padding:20px 24px; gap:12px; }
.dhd #dbrand{ color:#f9e8c4; text-decoration:none; font-family:Georgia,serif; font-weight:900; font-size:22px; letter-spacing:1px; }
.dhd #dbrand span{ display:block; color:#e5b45d; font:12px system-ui; letter-spacing:4px; margin-top:6px; }
.dhd button{ font-size:14px; background:transparent; color:#f9e8c4; padding:9px 12px; border:1px solid #6b573a; }
.dhd .dlink{ border:none; }
.dmain{ max-width:1160px; margin:auto; padding:8px 24px 30px; }
#duel .intro{ text-align:center; margin:8px 0 28px; }
#duel .eyebrow{ letter-spacing:3px; font-size:13px; color:#e5b45d; }
#duel h1{ font:700 clamp(30px,5vw,52px)/1.06 Georgia,serif; margin:16px 0; }
#duel p{ line-height:1.5; }
#cards{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; }
.dcard{ background:#f3d49a; color:#34241b; border:3px solid #b68547; padding:15px 12px 12px; text-align:center;
  box-shadow:4px 5px 0 #17110d; transition:transform .15s; }
.dcard:hover{ transform:translateY(-4px); background:#f8dda6; }
.dcard .wanted{ display:block; font:900 24px Georgia,serif; letter-spacing:3px; }
.dcard img{ display:block; width:100%; height:140px; object-fit:cover; object-position:center 30%; filter:sepia(.5); margin:10px 0; border:2px solid #674530; }
.dcard strong{ font:700 21px Georgia,serif; display:block; }
.dcard .reward{ display:block; font:900 27px Georgia,serif; margin:8px 0 2px; }
.dcard small{ font-size:13px; font-weight:500; }
.footnote{ text-align:center; font-size:14px; color:#ccae87; margin:25px 0; }
.hud{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin:8px 0 14px; }
.hud button{ background:transparent; color:#f9e8c4; font-size:14px; border:1px solid #6b573a; }
.hud div{ text-align:center; }
.hud strong{ font:700 24px Georgia,serif; display:block; }
.hud span{ display:block; font-size:14px; color:#e5b45d; }
#dtimer{ font-size:23px; min-width:65px; }
#arena{ height:min(62vh,600px); min-height:330px; position:relative; overflow:hidden; border:4px solid #b68547;
  border-radius:6px; background:#e5b45d center/cover; touch-action:none; cursor:crosshair; user-select:none; }
#target{ position:absolute; width:82px; height:132px; transform:translate(-50%,-50%); will-change:left,top,transform;
  pointer-events:none; display:flex; align-items:center; flex-direction:column; }
#face{ height:78px; width:72px; object-fit:cover; border-radius:45%; border:3px solid #493224; z-index:1; }
#duel .hat{ font-size:47px; height:28px; z-index:2; transform:translateY(-7px); }
#duel .boots{ font-size:29px; letter-spacing:-10px; margin-left:-8px; }
#rope{ position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
#announcement{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font:900 clamp(30px,6vw,60px) Georgia,serif; color:#fff4d9; text-shadow:3px 3px #42291c; pointer-events:none; }
#dinstruction{ text-align:center; font-size:16px; }
#gesture{ position:absolute; font-size:52px; transform:translate(-50%,-50%); pointer-events:none; }
#result{ position:absolute; bottom:18px; left:50%; transform:translateX(-50%); width:min(92%,520px);
  background:#2f211aef; color:#f9e8c4; padding:18px; text-align:center; border:1px solid #bc8b48; border-radius:5px; }
#result p{ margin:4px 0 10px; }
#resultKicker{ font-size:12px; letter-spacing:3px; color:#e5b45d; }
#duel h2{ font:700 clamp(26px,4vw,38px) Georgia; margin:5px 0 10px; }
#result button{ margin:4px; }
#saloonScene{ position:absolute; inset:0; }
#saloonScene:not([hidden]){ display:flex; justify-content:center; gap:45px; padding-top:6vh; }
.drinker{ position:relative; display:flex; flex-direction:column; align-items:center; }
.drinker>span{ font-size:90px; height:110px; }
.drinker img{ height:110px; width:95px; object-fit:cover; border-radius:40%; border:3px solid #d6a15a; }
.drinker b{ background:#352319cc; padding:4px 10px; border-radius:3px; margin-top:6px; }
.drinker i{ font-style:normal; font-size:60px; position:absolute; top:110px; }
.player i{ right:-35px; animation:cheersLeft 1.5s infinite; }
.friend i{ left:-35px; animation:cheersRight 1.5s infinite; }
@keyframes cheersLeft{ 50%{ transform:translateX(25px) rotate(16deg); } }
@keyframes cheersRight{ 50%{ transform:translateX(-25px) rotate(-16deg); } }

/* ====================== responsive ====================== */
@media (max-width:760px){
  .ms-grid{ grid-template-columns:1fr; gap:14px; }
  .ms-card{ min-height:0; }
  .ms-in{ padding:44px 16px 30px; }
}
@media (max-width:650px){
  .dhd{ padding:16px 14px; } .dhd #dbrand{ font-size:17px; }
  .dmain{ padding:0 12px 20px; }
  #cards{ grid-template-columns:repeat(2,1fr); gap:12px; }
  .dcard{ padding:10px; } .dcard img{ height:110px; } .dcard .wanted{ font-size:20px; }
  .dcard strong{ font-size:18px; } .dcard .reward{ font-size:23px; }
  #duel .intro{ margin:8px 0 20px; }
  .hud button{ max-width:120px; padding:8px; font-size:12px; } .hud strong{ font-size:19px; }
  #arena{ height:60vh; min-height:360px; }
  #saloonScene:not([hidden]){ gap:35px; padding-top:25px; }
  #result{ padding:12px; bottom:12px; } #resultText{ font-size:14px; }
}
@media (prefers-reduced-motion:reduce){ .player i,.friend i{ animation:none; } }

/* ====================== bouton "classement" sur l'écran des modes ====================== */
.ms-leader{ cursor:pointer; margin-top:22px; font-family:"Anton",sans-serif; letter-spacing:.03em; font-size:17px;
  color:#1c1712; background:#b8892f; border:2px solid #1c1712; border-radius:4px; padding:10px 22px;
  box-shadow:4px 5px 0 rgba(0,0,0,.5); transition:transform .14s, box-shadow .14s; }
.ms-leader:hover{ transform:translate(-1px,-3px); box-shadow:6px 8px 0 rgba(0,0,0,.5); background:#caa14e; }
.ms-leader:focus-visible{ outline:3px solid #fff; outline-offset:3px; }

/* ====================== PANNEAU CLASSEMENT (leaderboard) ====================== */
#lb{ position:fixed; inset:0; z-index:40; display:flex; align-items:center; justify-content:center;
  background:rgba(16,10,5,.78); padding:18px; overflow:auto; }
.lb__box{ position:relative; width:min(460px,100%); max-height:92vh; overflow:auto; background:#efe4c8; color:#1c1712;
  border:3px solid #1c1712; border-radius:6px; box-shadow:0 18px 50px rgba(0,0,0,.6); padding:22px 20px 20px; }
.lb__x{ position:absolute; top:8px; right:10px; cursor:pointer; background:none; border:none; font-size:28px; line-height:1; color:#1c1712; }
.lb__head{ text-align:center; margin-bottom:12px; }
.lb__head h2{ font-family:"Anton",sans-serif; font-size:34px; letter-spacing:.03em; color:#c0302a; margin:0; }
.lb__sub{ font-family:"Special Elite",monospace; font-size:13px; color:#6a4a22; letter-spacing:.06em; margin-top:2px; }
.lb__tabs{ display:flex; gap:6px; margin-bottom:12px; }
.lb__tabs button{ flex:1; cursor:pointer; font-family:"Special Elite",monospace; font-size:12.5px; padding:8px 4px;
  background:#e0d2ad; color:#4a3115; border:2px solid #9a7a44; border-radius:3px; }
.lb__tabs button[aria-current="true"]{ background:#1c1712; color:#f4ecd8; border-color:#1c1712; }
.lb__list{ list-style:none; margin:0; padding:0; }
.lb__row{ display:flex; align-items:center; gap:10px; padding:9px 8px; border-bottom:1px dashed rgba(28,23,18,.22); }
.lb__row:last-child{ border-bottom:none; }
.lb__pos{ width:30px; text-align:center; font-size:19px; }
.lb__rank{ font-family:"Anton",sans-serif; font-size:17px; color:#8a6f3c; }
.lb__name{ flex:1; font-family:"Special Elite",monospace; font-size:15px; letter-spacing:.02em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lb__val{ font-family:"Anton",sans-serif; font-size:19px; color:#c0302a; letter-spacing:.01em; }
.lb__row--me{ background:#f6e7bd; border-radius:4px; box-shadow:inset 0 0 0 2px #b8892f; }
.lb__loading,.lb__empty{ list-style:none; text-align:center; font-family:"Special Elite",monospace; font-size:13px; color:#6a4a22; padding:18px 0; }
.lb__status{ text-align:center; font-family:"Special Elite",monospace; font-size:13px; color:#1c1712; min-height:18px; margin:10px 0 0; }
.lb__form{ display:flex; gap:8px; margin-top:12px; }
.lb__input{ flex:1; font-family:"Special Elite",monospace; font-size:15px; padding:10px 12px; border:2px solid #1c1712;
  border-radius:3px; background:#fff; color:#1c1712; }
.lb__btn{ cursor:pointer; font-family:"Anton",sans-serif; letter-spacing:.03em; font-size:15px; color:#f4ecd8;
  background:#c0302a; border:2px solid #1c1712; border-radius:3px; padding:9px 16px; box-shadow:3px 3px 0 rgba(0,0,0,.35); }
.lb__btn:hover{ background:#d13a33; }
.lb__btn--ghost{ background:#e0d2ad; color:#1c1712; }
.lb__btn--ghost:hover{ background:#ecdcb2; }
.lb__actions{ display:flex; gap:8px; justify-content:center; margin-top:14px; }
@media (max-width:480px){ .lb__head h2{ font-size:28px; } .lb__name{ font-size:14px; } .lb__val{ font-size:17px; } }
