/* Jocus V41
   1. Pendant une partie : l'écran est verrouillé sur la zone vraiment visible (barres du navigateur comprises), rien à faire défiler.
   2. Puissance 4 et Quiz plus compacts sur les petits écrans (le titre et le statut doublaient la barre « À vous de jouer »).
   3. Fin de Tier list et de Classement à l'aveugle : l'image du classement, sans tableau à lire.
   4. Menus : quelques touches de couleur utiles, dans le thème. */

/* ---------- 1. verrouillage de l'écran pendant une partie (téléphone, tablette) ---------- */
@media (max-width:1099px){
  html.jx-playing,html.jx-playing body{overflow:hidden;overscroll-behavior:none;height:var(--app-vh,100dvh)}
  html.jx-playing body{position:fixed;inset:0;width:100%}
  html.jx-playing #app{height:var(--app-vh,100dvh)!important;min-height:0!important}
  html.jx-playing #app .gv.full{height:var(--app-vh,100dvh)!important;max-height:var(--app-vh,100dvh);min-height:0!important}
  html.jx-playing #app #v-play[data-fit]{height:var(--app-vh,var(--view-h,100dvh))!important}
}

/* ---------- 2. Puissance 4 et Quiz sur petit écran ---------- */
@media (max-width:699px){
  html #app #v-game:has(.jx-turnbar.in-head) #gTitle{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important}
  html #app #v-game:not(.over):has(.jx-turnbar.in-head) #gStatus{display:none}
  html #app #v-game .ghead{min-height:56px}
  html #app #v-game .stagew{padding:10px 14px 8px;gap:10px}
  html #app #v-game .board{width:min(100%,470px,calc((var(--app-vh,100dvh) - 250px)*1.15))!important;margin-inline:auto}
  html #app #v-game .legend{margin:0}
  html #app #v-quiz:not(.over):has(.jx-turnbar.in-head) #qStatus{display:none}
  html #app #v-quiz .stagew{padding:10px 14px 8px;gap:8px}
  html #app #v-quiz .vs{padding:6px 8px;border-radius:16px}
  html #app #v-quiz .vs .vchip{padding:4px 6px}
  html #app #v-quiz .vs .avatar{width:30px;height:30px}
  html #app #v-quiz .qbox{padding:14px 16px}
}
@media (max-width:699px) and (max-height:700px){
  html #app #v-quiz .prog{margin:0}
  html #app #v-quiz .qbox{border-radius:18px}
  html #app #v-quiz .qbox .qtext{font-size:20px;line-height:1.2;margin-block:6px 10px}
  html #app #v-quiz .qbox .qopts{gap:6px}
  html #app #v-quiz .qbox .qopt{min-height:44px;padding-block:7px}
}

/* ---------- 3a. Tier list : l'image du classement ---------- */
html #app #v-play .wy.tr.tf-end{gap:8px}
html #app #v-play .wy.tr.tf-end>.wy-meta{display:none}
html #app #v-play .wy.tr.tf-end .tr-theme{font:400 22px/1.15 Georgia,serif;text-align:center;margin:0}
.tf-board{display:flex;flex-direction:column;gap:3px;width:100%;padding:3px;border-radius:14px;background:#1d1611;border:1px solid #c7a774;box-shadow:0 12px 30px #0006}
.tf-row{display:flex;align-items:stretch;gap:4px;min-height:58px}
.tf-lab{flex:0 0 46px;display:grid;place-items:center;border-radius:10px;font:700 24px/1 Georgia,serif;color:#2a1c10}
.tf-S .tf-lab{background:#f08c7c}.tf-A .tf-lab{background:#f5b56f}.tf-B .tf-lab{background:#f3d77c}.tf-C .tf-lab{background:#b9d98a}.tf-D .tf-lab{background:#8fc2dd}
.tf-zone{flex:1;min-width:0;display:flex;flex-wrap:wrap;gap:4px;align-content:center;padding:3px;border-radius:10px;background:#2e251ccc}
.tf-tile{position:relative;width:54px;height:54px;border-radius:8px;overflow:hidden;background:#5a6657;flex:none}
.tf-tile img{width:100%;height:100%;object-fit:cover;display:block}
.tf-cap{position:absolute;inset:auto 0 0;padding:2px 2px 3px;font:600 9px/1.1 Figtree,system-ui,sans-serif;color:#fff;text-align:center;background:linear-gradient(transparent,#16110bf0 35%);overflow-wrap:anywhere}
.tf-tile.text-only .tf-cap{inset:0;display:grid;place-items:center;font-size:10px;background:none;padding:3px}
@media (max-height:640px){.tf-row{min-height:48px}.tf-tile{width:44px;height:44px}.tf-lab{flex-basis:38px;font-size:20px}}

/* ---------- 3b. Classement à l'aveugle : 10 photos numérotées ---------- */
html #app #v-play .wy.bl-duo.bf-end{gap:8px}
html #app #v-play .wy.bl-duo.bf-end>.wy-meta{display:none}
html #app #v-play .wy.bl-duo.bf-end .tr-theme{font:400 22px/1.15 Georgia,serif;text-align:center;margin:0}
.bf-grid{list-style:none;margin:0;padding:0;width:100%;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
@media (max-width:520px){.bf-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.bf-card{position:relative;aspect-ratio:1.6;border-radius:12px;overflow:hidden;background:#5a6657;border:1px solid #c7a77466;box-shadow:0 6px 16px #0005}
@media (max-width:520px){.bf-card{aspect-ratio:auto;height:clamp(52px,calc((var(--play-h,520px) - 120px)/5 - 6px),110px)}}
.bf-card img{width:100%;height:100%;object-fit:cover;display:block}
.bf-n{position:absolute;top:5px;left:5px;min-width:24px;height:24px;padding:0 6px;border-radius:12px;display:grid;place-items:center;background:#1d1611e6;color:#ffe9c2;font:700 13px/1 Figtree,system-ui,sans-serif;border:1px solid #c7a774}
.bf-top1 .bf-n{background:#e9b949;color:#2a1c10;border-color:#fff1c4}
.bf-top2 .bf-n{background:#d9dde2;color:#2a2a2a;border-color:#fff}
.bf-top3 .bf-n{background:#d08a52;color:#2a1c10;border-color:#ffd9b5}
.bf-cap{position:absolute;inset:auto 0 0;padding:10px 6px 5px;font:700 12px/1.15 Figtree,system-ui,sans-serif;color:#fff;text-shadow:0 1px 2px #000;background:linear-gradient(transparent,#120d08e8 45%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bf-card.text-only .bf-cap{inset:0;display:grid;place-items:center;white-space:normal;text-align:center;background:none;font-size:14px}
.bf-legend{display:flex;justify-content:space-between;width:100%;margin:0;font-size:11px;opacity:.75}

/* ---------- 2b. petits écrans (iPhone SE et équivalents, barres du navigateur visibles) ---------- */
@media (max-width:699px) and (max-height:620px){
  html #app #v-game .board{width:min(100%,calc((var(--app-vh,100dvh) - 285px)*1.15))!important;padding:8px;gap:4px;border-width:8px}
  html #app #v-game .col{gap:4px}
  html #app #v-game .vs{padding:4px 8px}
  html #app #v-game .legend{display:none}
  html #app #v-quiz .vs{display:none}
  html #app #v-play .vs{padding-block:2px!important;min-height:0}
  html #app #v-play .vs .avatar{width:22px!important;height:22px!important}
  html #app #v-play .pbody .sub{font-size:11px!important;line-height:1.25!important}
  html #app #v-play[data-game=tier] .tr-co-lead{display:none}
  html #app #v-play[data-game=tier] .tr-co .rank-tray{min-height:0!important}
  html #app #v-play[data-game=tier] .tr-co .rank-tray .rank-tile{height:44px!important;width:52px!important;flex-basis:52px!important}
  html #app #v-play[data-game=tier] .tr-co .rank-level{height:36px!important}
  html #app #v-play[data-game=tier] .tr-co .rank-zone .rank-tile{height:32px!important}
  html #app #v-play[data-game=tier] .tr-co .g7-go{min-height:40px}
  html #app #v-play[data-game=blind] .bl-duo>.sub{display:none}
  html #app #v-play[data-game=blind] .bl-slot{min-height:24px!important;height:24px!important;padding-block:1px!important}
  html #app #v-play[data-game=wmyst] .wm-grid{max-width:calc((var(--play-h,480px) - 235px)/6*var(--wm-len,5) + 20px)!important}
  html #app #v-play[data-game=wmyst] .wm-k{min-height:32px!important}
  html #app #v-play[data-game=tl] .tl-form{gap:5px}
  html #app #v-play[data-game=tl] .tl-field{padding:5px 12px}
  html #app #v-play[data-game=tl] .tl-field input{font-size:16px;padding-top:2px}
  html #app #v-play .qg-deep textarea,html #app #v-play .qg textarea{min-height:56px!important;height:56px!important}
  html #app #v-play .pbody>.wy{padding:8px 10px!important;gap:5px!important}
  html #app :is(#v-quiz,#v-game):has(.jx-turnbar.in-head) .ghead>:is(#qAvatar,#gAvatar){display:none}
  html #app #v-play[data-game=tl] .tl-fine{display:none}
  html #app #v-play[data-game=wyr] .wy>.sub{display:none}
  html #app #v-play .pbody .wy-title{font-size:24px!important;margin-block:2px!important}
  html #app #v-play .pbody .qg-prompt span{font-size:19px!important}
}
@media (max-width:699px) and (max-height:720px){
  html #app #v-play[data-game=wmyst] .wm-grid{max-width:calc((var(--play-h,480px) - 245px)/6*var(--wm-len,5) + 20px)}
}

/* ---------- 4. Menus : couleur utile, dans le thème « bougie » ----------
   Une couleur = un sens, toujours la même : rose = matchs / amour, or = « qui m'aime », sauge = contacts / proches,
   bleu nuit = demandes. Le pêche reste la couleur des actions. Rien ne change dans les jeux. */
html[data-theme="bougie"] #v-main .jx-kicker{color:var(--acc);opacity:.9}
html[data-theme="bougie"] .cx-entry[data-cx]>.cx-ic{border:1px solid transparent}
html[data-theme="bougie"] .cx-entry[data-cx=matches]>.cx-ic{background:#e98a7f26;color:#f2a093;border-color:#e98a7f40}
html[data-theme="bougie"] .cx-entry[data-cx=likes]>.cx-ic{background:#e9b94924;color:#f1c766;border-color:#e9b94940}
html[data-theme="bougie"] .cx-entry[data-cx=contacts]>.cx-ic{background:#9cc59a22;color:#b3d6a8;border-color:#9cc59a40}
html[data-theme="bougie"] .cx-entry[data-cx=requests]>.cx-ic{background:#8fc2dd22;color:#a9d2e8;border-color:#8fc2dd40}
html[data-theme="bougie"] .cx-entry[data-cx=matches] .cx-count:not(.is-zero){background:#e98a7f;color:#2a1410;font-weight:700}
html[data-theme="bougie"] .cx-entry[data-cx=likes] .cx-count:not(.is-zero){background:#e9b949;color:#2a1c08;font-weight:700}
html[data-theme="bougie"] .cx-entry[data-cx=contacts] .cx-count:not(.is-zero){background:#9cc59a;color:#14231a;font-weight:700}
html[data-theme="bougie"] .cx-entry[data-cx=requests] .cx-count:not(.is-zero){background:#8fc2dd;color:#0f2029;font-weight:700}
html[data-theme="bougie"] .cx-entry[data-cx]{transition:border-color .2s,background .2s}
html[data-theme="bougie"] .cx-entry[data-cx=matches]:hover{border-color:#e98a7f66}
html[data-theme="bougie"] .cx-entry[data-cx=likes]:hover{border-color:#e9b94966}
html[data-theme="bougie"] .cx-entry[data-cx=contacts]:hover{border-color:#9cc59a66}
html[data-theme="bougie"] .cx-entry[data-cx=requests]:hover{border-color:#8fc2dd66}
/* barre du bas : chaque onglet garde sa couleur (discrète au repos, pleine quand il est ouvert) */
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab] .jx-nav-icon{transition:color .2s}
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=discover] svg,html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=discover] svg *{stroke:#f2a093!important;color:#f2a093!important}
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=games] svg,html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=games] svg *{stroke:#f3c38f!important;color:#f3c38f!important}
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=date] svg,html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=date] svg *{stroke:#f1c766!important;color:#f1c766!important}
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=friends] svg,html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=friends] svg *{stroke:#b3d6a8!important;color:#b3d6a8!important}
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=me] svg,html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=me] svg *{stroke:#a9d2e8!important;color:#a9d2e8!important}
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab]:not([aria-current="page"]) svg{opacity:.78}
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab][aria-current="page"] svg,html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab][aria-current="page"] svg *{opacity:1}
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=discover][aria-current="page"]{box-shadow:inset 0 -2px #f2a093}
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=games][aria-current="page"]{box-shadow:inset 0 -2px #f3c38f}
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=date][aria-current="page"]{box-shadow:inset 0 -2px #f1c766}
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=friends][aria-current="page"]{box-shadow:inset 0 -2px #b3d6a8}
html[data-theme="bougie"] #v-main nav.tabs .tab[data-tab=me][aria-current="page"]{box-shadow:inset 0 -2px #a9d2e8}
/* filtres « Tous / Non lus » et autres puces actives : pêche plein, lisible d'un coup d'œil */
html[data-theme="bougie"] #v-main .seg button[aria-pressed="true"],html[data-theme="bougie"] #v-main #convAll[aria-pressed="true"],html[data-theme="bougie"] #v-main #convUnread[aria-pressed="true"]{background:var(--acc);color:#2b170e;border-color:var(--acc)}
/* conversation non lue : un liseré pêche à gauche */
html[data-theme="bougie"] #v-main .conv.unread{box-shadow:inset 3px 0 var(--acc)}
html[data-theme="bougie"] #v-main .conv.unread .t b{color:var(--acc)}
