/* JeuxEnd Arcade - styles autonomes (prefixe .ja-), alignes sur la charte du site :
 * cartes blanches zinc, accent fuchsia #a21caf, police systeme, graisses 400-700.
 * Seul element "fort" : l'ecran de jeu sombre prune (#120d18). */
:root {
  --ja-ink: #18181b; --ja-text: #3f3f46; --ja-sub: #71717a; --ja-line: #e4e4e7; --ja-wash: #f4f4f5;
  --ja-brand: #a21caf; --ja-brand-ink: #86198f; --ja-brand-wash: #fdf4ff; --ja-glow: #f0abfc;
  --ja-screen: #120d18; --ja-screen-line: #2a2133; --ja-gold: #a16207; --ja-gold-wash: #fefce8;
}

/* ---------- Briques communes ---------- */
.ja-tile { display: inline-grid; width: 2.25rem; height: 2.25rem; flex-shrink: 0; place-items: center; border-radius: .625rem; background: var(--ja-screen); color: var(--ja-glow); }
.ja-tile--lg { width: 3rem; height: 3rem; border-radius: .8rem; }
.ja-glyph { display: block; }
.ja-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.ja-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.5rem; border: 1px solid transparent; border-radius: .75rem; background: var(--ja-ink); padding: .55rem 1rem; font: inherit; font-size: .875rem; font-weight: 600; color: #fff; text-decoration: none; cursor: pointer; transition: background-color .15s; }
.ja-btn:hover { background: var(--ja-brand); }
.ja-btn:focus-visible, .ja-link:focus-visible, .ja-row:focus-visible, .ja-seg button:focus-visible { outline: 2px solid var(--ja-brand); outline-offset: 2px; }
.ja-btn--brand { background: var(--ja-brand); }
.ja-btn--brand:hover { background: var(--ja-brand-ink); }
.ja-btn--quiet { border-color: rgba(255, 255, 255, .25); background: transparent; }
.ja-btn--quiet:hover { background: rgba(255, 255, 255, .1); }
.ja-link { font-size: .8125rem; font-weight: 600; color: var(--ja-brand); text-decoration: none; }
.ja-link:hover { text-decoration: underline; }
.ja-muted { color: var(--ja-sub); }
.ja-pill { display: inline-flex; align-items: center; border-radius: 999px; background: rgba(255, 255, 255, .12); padding: .25rem .65rem; font-size: .75rem; font-weight: 600; color: #fff; }
.ja-pill.is-gold { background: #fde68a; color: #422006; }
.ja-pill.is-brand { background: var(--ja-glow); color: #4a044e; }
.ja-pill.is-red { background: #fecdd3; color: #881337; }

/* ---------- Classements ---------- */
.ja-board { list-style: none; margin: 0; padding: 0; }
.ja-board li { display: grid; grid-template-columns: 1.25rem 1.75rem minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .4rem .35rem; border-radius: .6rem; font-size: .875rem; color: var(--ja-text); }
.ja-board li + li { border-top: 1px solid var(--ja-wash); }
.ja-board .ja-rank { text-align: right; font-size: .8125rem; color: var(--ja-sub); }
.ja-board li:first-child .ja-rank { color: var(--ja-gold); font-weight: 600; }
.ja-board li.is-me { background: var(--ja-brand-wash); }
.ja-board li.is-me + li { border-top-color: transparent; }
.ja-board a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ja-ink); text-decoration: none; }
.ja-board a:hover { text-decoration: underline; }
.ja-board .ja-score { font-weight: 600; color: var(--ja-ink); }
.ja-avatar { width: 1.75rem; height: 1.75rem; border-radius: 50%; object-fit: cover; }
.ja-avatar--txt { display: grid; place-items: center; background: #fae8ff; font-size: .625rem; font-weight: 600; color: var(--ja-brand-ink); }
.ja-empty { margin: 0; padding: .5rem .35rem; font-size: .8125rem; color: var(--ja-sub); }

/* ---------- /social : widgets compacts, meme ton que le bloc « Groupes » ---------- */
.ja-side, .ja-feed { margin-top: 1rem; border: 1px solid var(--ja-line); border-radius: 1rem; background: #fff; padding: .85rem .9rem .7rem; box-shadow: 0 1px 2px rgba(24, 24, 27, .05); }
.ja-feed { margin: 0 0 1rem; }
.ja-side__head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; }
.ja-side h3, .ja-feed h3 { margin: 0; font-size: .875rem; font-weight: 600; color: var(--ja-ink); }
.ja-feed h3 { margin-bottom: .35rem; }
.ja-side .ja-link { font-size: .75rem; font-weight: 500; }
.ja-side ul { list-style: none; margin: 0; padding: 0; }
.ja-row { display: flex; align-items: center; gap: .6rem; margin: 0 -.35rem; border-radius: .6rem; padding: .3rem .35rem; color: inherit; text-decoration: none; }
.ja-row:hover { background: var(--ja-wash); }
.ja-row__text { min-width: 0; flex: 1; line-height: 1.25; }
.ja-row__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; font-weight: 500; color: var(--ja-ink); }
.ja-row__meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; color: var(--ja-sub); }
.ja-row__meta strong { font-weight: 500; color: var(--ja-text); }
.ja-side .ja-tile, .ja-feed .ja-tile { width: 1.75rem; height: 1.75rem; border-radius: .5rem; }
.ja-feed .ja-score { font-size: .8125rem; font-weight: 500; color: var(--ja-ink); }

/* ---------- Pages Arcade ---------- */
.ja-page { background: #fafafa; color: var(--ja-text); }
.ja-wrap { margin: 0 auto; max-width: 72rem; padding: 1.25rem 1rem 4rem; }
@media (min-width: 640px) { .ja-wrap { padding: 1.75rem 1.5rem 5rem; } }
.ja-crumbs { margin: 0 0 1rem; font-size: .8125rem; color: var(--ja-sub); }
.ja-crumbs a { color: var(--ja-sub); text-decoration: none; }
.ja-crumbs a:hover { color: var(--ja-brand); }
.ja-crumbs span { margin: 0 .35rem; color: #d4d4d8; }

.ja-intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.75rem; }
.ja-intro h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.05; color: var(--ja-ink); }
.ja-intro p { max-width: 36rem; margin: .6rem 0 0; font-size: 1rem; line-height: 1.6; }
.ja-counter { text-align: right; font-size: .8125rem; line-height: 1.3; color: var(--ja-sub); }
.ja-counter strong { display: block; font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; color: var(--ja-ink); }

/* Une borne par jeu : ecran a gauche, fiche a droite */
.ja-cabinet { display: grid; gap: 1.25rem; margin-bottom: 1rem; border: 1px solid var(--ja-line); border-radius: 1.5rem; background: #fff; padding: 1rem; box-shadow: 0 1px 2px rgba(24, 24, 27, .05); }
@media (min-width: 768px) { .ja-cabinet { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); padding: 1.25rem; gap: 1.75rem; } }
.ja-screen { position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 1rem; background: var(--ja-screen); aspect-ratio: 16 / 10; text-decoration: none; }
.ja-screen canvas { position: absolute; inset: 0; display: block; height: 100%; width: auto; max-width: 100%; margin: auto; }
.ja-screen--wide canvas { width: 100%; height: auto; max-height: 100%; }
.ja-screen__play { position: absolute; left: .75rem; bottom: .75rem; border-radius: .6rem; background: rgba(18, 13, 24, .78); padding: .35rem .65rem; font-size: .75rem; font-weight: 600; color: #f5d0fe; opacity: 0; transition: opacity .15s; }
.ja-screen:hover .ja-screen__play, .ja-screen:focus-visible .ja-screen__play { opacity: 1; }
.ja-cabinet__info { display: flex; min-width: 0; flex-direction: column; }
.ja-cabinet__title { display: flex; align-items: center; gap: .75rem; }
.ja-cabinet h2 { margin: 0; font-size: 1.375rem; font-weight: 600; letter-spacing: -.015em; color: var(--ja-ink); }
.ja-cabinet__pitch { margin: .7rem 0 0; font-size: .9375rem; line-height: 1.55; }
.ja-facts { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin: .8rem 0 0; font-size: .8125rem; }
.ja-facts dt { color: var(--ja-sub); }
.ja-facts dd { margin: 0; font-weight: 600; color: var(--ja-ink); }
.ja-cabinet__board { margin-top: 1rem; border-top: 1px solid var(--ja-line); padding-top: .75rem; }
.ja-cabinet__board h3, .ja-panel h2 { margin: 0 0 .35rem; font-size: .8125rem; font-weight: 600; color: var(--ja-sub); }
.ja-cabinet__cta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: auto; padding-top: 1rem; }

.ja-split { display: grid; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 768px) { .ja-split { grid-template-columns: 1.2fr 1fr; } }
.ja-panel { border: 1px solid var(--ja-line); border-radius: 1.5rem; background: #fff; padding: 1.1rem 1.15rem; box-shadow: 0 1px 2px rgba(24, 24, 27, .05); }
.ja-panel + .ja-panel { margin-top: 1rem; }
.ja-panel p { margin: 0; font-size: .875rem; line-height: 1.6; }
.ja-panel p + p { margin-top: .6rem; }

/* ---------- Page de jeu ---------- */
.ja-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.ja-head h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 600; letter-spacing: -.02em; color: var(--ja-ink); }
.ja-head p { margin: .15rem 0 0; font-size: .875rem; color: var(--ja-sub); }
.ja-layout { display: grid; gap: 1.25rem; }
@media (min-width: 1024px) { .ja-layout { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; } }

.ja-stage { position: relative; overflow: hidden; border-radius: 1.25rem; background: var(--ja-screen); box-shadow: inset 0 0 0 1px var(--ja-screen-line); touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.ja-stage canvas { display: block; height: auto; margin: 0 auto; cursor: pointer; }
.ja-hud { position: absolute; inset: .85rem 1rem auto; display: flex; align-items: baseline; justify-content: space-between; color: #fff; pointer-events: none; opacity: 0; transition: opacity .2s; }
.ja-stage.is-playing .ja-hud, .ja-stage.is-over .ja-hud { opacity: 1; }
.ja-hud__score { font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; }
.ja-hud__info { font-size: .8125rem; color: #d4d4d8; }
.ja-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .65rem; padding: 1.5rem 1.25rem 1.75rem; text-align: center; color: #fff; background: linear-gradient(to top, rgba(18, 13, 24, .96) 0%, rgba(18, 13, 24, .82) 45%, rgba(18, 13, 24, .2) 100%); }
.ja-overlay[hidden] { display: none; }
.ja-overlay--center { justify-content: center; background: rgba(18, 13, 24, .9); }
.ja-overlay h2 { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -.015em; }
.ja-overlay p { max-width: 28rem; margin: 0; font-size: .9375rem; line-height: 1.55; color: #e4e4e7; }
.ja-overlay a { color: var(--ja-glow); }
.ja-overlay small { font-size: .75rem; color: #a1a1aa; }
.ja-final { font-size: clamp(2.75rem, 9vw, 4rem); font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.ja-final-label { font-size: .8125rem; color: #a1a1aa; }
.ja-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; min-height: 1.5rem; }
.ja-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .25rem; }

.ja-best { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.ja-best h2 { margin: 0; font-size: .9375rem; font-weight: 600; color: var(--ja-ink); }
.ja-best strong { font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; color: var(--ja-ink); }
.ja-best + p { margin-top: .35rem; font-size: .8125rem; color: var(--ja-sub); }
.ja-panel--challenge { border-color: #f5d0fe; background: var(--ja-brand-wash); }
.ja-panel--challenge h2 { color: var(--ja-brand-ink); font-size: .9375rem; font-weight: 600; }
.ja-panel--challenge strong { color: var(--ja-ink); }
.ja-board-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.ja-board-head h2 { margin: 0; font-size: .9375rem; font-weight: 600; color: var(--ja-ink); }
.ja-seg { display: inline-flex; border-radius: .65rem; background: var(--ja-wash); padding: .2rem; }
.ja-seg button { border: 0; border-radius: .5rem; background: transparent; padding: .3rem .7rem; font: inherit; font-size: .75rem; font-weight: 600; color: var(--ja-sub); cursor: pointer; }
.ja-seg button[aria-selected="true"] { background: #fff; color: var(--ja-ink); box-shadow: 0 1px 2px rgba(24, 24, 27, .12); }
.ja-note { margin-top: .6rem; font-size: .75rem; line-height: 1.5; color: var(--ja-sub); }
.ja-others { display: grid; gap: .5rem; margin-top: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.ja-others .ja-row { margin: 0; border: 1px solid var(--ja-line); background: #fff; padding: .6rem .75rem; }
.ja-toast { position: fixed; left: 50%; bottom: calc(var(--je-bottom-space, 0px) + 1rem); z-index: 60; transform: translateX(-50%); border-radius: .75rem; background: var(--ja-ink); padding: .6rem 1rem; font-size: .875rem; font-weight: 600; color: #fff; box-shadow: 0 8px 24px rgba(24, 24, 27, .25); }
.ja-toast[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { .ja-btn, .ja-hud, .ja-screen__play { transition: none; } }
