/* Jeu de karting Pilote Amateur — styles */
:root {
  --bg: #0d0f12; --bg2: #14171c; --bg3: #1c2027; --line: #2a2f38;
  --tx: #eef0f3; --mut: #9aa3ae; --y: #f7c51e; --r: #e10600; --g: #22c55e; --b: #3b82f6;
  --pl: #b9e8ff; --or: #ffcc33; --ar: #cfd6de; --br: #d08a4c;
  --f-d: 'Chakra Petch', system-ui, sans-serif; --f-t: 'Barlow', system-ui, sans-serif;
  --rad: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 400 17px/1.55 var(--f-t); }
a { color: var(--y); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--f-d); line-height: 1.15; letter-spacing: .01em; }
h2 { font-size: 1.6rem; margin: 0 0 .8em; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; margin: 0 2px; border: 1px solid #3a404b; border-bottom-width: 3px; border-radius: 5px; background: #20242b; font: 600 .78em var(--f-d); text-align: center; color: var(--tx); }
.muted { color: var(--mut); } .small { font-size: .9rem; } .tiny { font-size: .8rem; }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .45em; vertical-align: -.02em; box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.dot.big { width: .8em; height: .8em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 26px; padding-bottom: 50px; min-height: 60vh; }
.prose { max-width: 760px; }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .7em 1.3em; border: 0; border-radius: 8px; background: var(--y); color: #111; font: 700 1rem var(--f-d); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; transition: transform .1s, filter .15s; text-decoration: none !important; }
.btn:hover { filter: brightness(1.08); } .btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--tx); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--y); color: var(--y); }
.btn-xl { font-size: 1.2rem; padding: .85em 1.8em; }
.btn-sm, .btn.btn-sm { padding: .4em .8em; font-size: .82rem; }
button.link { background: none; border: 0; color: var(--y); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.icon-btn { background: var(--bg3); border: 1px solid var(--line); color: var(--tx); width: 42px; height: 42px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; }

/* en-tête */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: rgba(13,15,18,.86); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top nav { display: flex; align-items: center; gap: 18px; font: 600 .95rem var(--f-d); }
.top nav a { color: var(--tx); } .top nav a:hover { color: var(--y); text-decoration: none; }
.top .btn-sm { background: var(--y); color: #111; border: 0; border-radius: 6px; font: 700 .85rem var(--f-d); padding: .45em .9em; cursor: pointer; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--tx) !important; text-decoration: none !important; }
.logo img { width: 34px; height: 34px; }
.logo-txt { font: 700 1.3rem/1 "Chakra Petch", var(--f-d); letter-spacing: -.01em; white-space: nowrap; color: #fff; }
.logo-txt b { font-weight: 700; background: var(--y); color: #14181d; padding: 3px 6px 2px; margin-left: 2px; border-radius: 3px; }
.logo-txt.small { font-size: 1.05rem; }
.game-tag { white-space: nowrap; font: 700 .78rem var(--f-d); text-transform: uppercase; letter-spacing: .08em; color: #14181d !important; background: #fff; border-radius: 20px; padding: 4px 10px; text-decoration: none !important; }
.game-tag:hover { background: var(--y); }
.real-tag { display: inline-block; vertical-align: middle; margin-left: 6px; font: 700 .62rem var(--f-d); text-transform: uppercase; letter-spacing: .06em; color: #14181d; background: var(--y); border-radius: 3px; padding: 2px 6px; }

/* héro */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 20px; max-width: 1180px; margin: 0 auto; padding: 44px 20px 30px; }
.kicker { font: 600 .85rem var(--f-d); color: var(--y); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0 0 16px; }
.hero h1 em { font-style: normal; color: var(--y); }
.lead { font-size: 1.15rem; color: #cfd4da; max-width: 36em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 26px; list-style: none; padding: 0; margin: 0; color: var(--mut); }
.hero-stats b { display: block; font: 700 1.6rem var(--f-d); color: var(--tx); }
.hero-art { position: relative; padding: 0 0 40px 0; }
.hero-art .screen { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid #2a303a; box-shadow: 0 24px 60px rgba(0,0,0,.55); transform: perspective(1400px) rotateY(-6deg) rotateX(2deg); }
.hero-art .screen img { display: block; width: 100%; height: auto; }
.hero-pod { position: absolute; left: -22px; bottom: -6px; width: 30%; height: auto; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 16px 40px rgba(0,0,0,.55); transform: rotate(-5deg); }
.hero-mini { color: var(--mut); font-size: .92rem; margin: 0; }
.shots .shot-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.shot { margin: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.shot button { padding: 0; border: 0; background: #0b0d12; cursor: zoom-in; display: block; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.shot:hover img { transform: scale(1.03); }
.shot figcaption { padding: 10px 12px 12px; font-size: .88rem; color: #c6ccd3; }
.shot figcaption b { display: block; color: var(--tx); font-family: var(--f-d); font-size: 1rem; margin-bottom: 2px; }
.shot-pluie, .shot-chat { grid-column: span 3; } .shot-pluie button, .shot-chat button { aspect-ratio: 16 / 10; }
.shot-mobile { grid-column: span 4; } .shot-mobile button { aspect-ratio: 1200 / 555; }
.shot-carte { grid-column: span 2; } .shot-carte button { flex: 1; min-height: 0; } .shot-carte img { object-position: top; position: absolute; inset: 0; } .shot-carte button { position: relative; }
.zoom-dlg { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
.zoom-dlg::backdrop { background: rgba(4,6,10,.85); }
.zoom-dlg img { display: block; max-width: 96vw; max-height: 92vh; border-radius: 10px; }
.zoom-x { position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 1.5rem; cursor: pointer; }
.mode-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-list li { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: #c6ccd3; font-size: .92rem; }
.mode-list b { display: block; color: var(--tx); font-family: var(--f-d); font-size: 1.05rem; margin-bottom: 2px; }
.howto { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.howto summary { cursor: pointer; font: 700 1.1rem var(--f-d); }
.howto .twocol { margin-top: 10px; }
@media (max-width: 900px) { .shots .shot-grid { grid-template-columns: 1fr 1fr; } .shot-pluie, .shot-chat, .shot-mobile, .shot-carte { grid-column: span 1; } .shot-mobile { grid-column: span 2; } .shot-carte { grid-column: span 2; } .shot-carte button { aspect-ratio: 16 / 10; flex: none; } .mode-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .shots .shot-grid { grid-template-columns: 1fr; } .shot-mobile, .shot-carte { grid-column: span 1; } .mode-list { grid-template-columns: 1fr; } .hero-pod { left: auto; right: -6px; width: 34%; } .hero-art .screen { transform: none; } }

/* cartes circuits */
#circuits { padding-top: 20px; padding-bottom: 30px; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.card:hover { border-color: #3d4450; transform: translateY(-2px); }
.card-art { background: radial-gradient(ellipse at 50% 35%, #1f3a29, #0f1d15 75%); display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.card-art canvas, .card-art .shot { width: 100%; height: 100%; display: block; object-fit: cover; }
.cards.v-photo .card-art:not(.no-shot) canvas { display: none; }
.cards.v-trace .card-art .shot { display: none; }
.cards.v-photo .card-art .shot { transition: transform .4s; } .card:hover .card-art .shot { transform: scale(1.04); }
.cards-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.view-toggle { display: inline-flex; background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.view-toggle button { border: 0; background: none; color: var(--mut); font: 700 .8rem var(--f-d); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.view-toggle button.on { background: var(--y); color: #141820; }
.card-body { padding: 16px 18px; }
.card h3 { margin: 0 0 2px; font-size: 1.35rem; } .card h3 a { color: var(--tx); }
.card .desc { font-size: .95rem; color: #c6ccd3; margin: 8px 0; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.kv dt { font: 600 .7rem var(--f-d); text-transform: uppercase; letter-spacing: .06em; color: var(--mut); }
.kv dd { margin: 0; font: 600 1rem var(--f-d); }
.kv small { color: var(--mut); font-weight: 500; }
.card-cta { display: flex; gap: 10px; flex-wrap: wrap; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.box { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.box h3 { margin: 0 0 6px; }
.modes, .twocol, .faq { padding-top: 34px; padding-bottom: 10px; }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.keys { border-collapse: collapse; } .keys td { padding: 6px 12px 6px 0; vertical-align: middle; }
.setup-doc dt { font: 700 1rem var(--f-d); color: var(--y); margin-top: 10px; } .setup-doc dd { margin: 2px 0 0; color: #c6ccd3; }
.toplist, .feed { list-style: none; padding: 0; margin: 0; }
.toplist li, .feed li { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.toplist .r { width: 2em; font: 700 1rem var(--f-d); color: var(--mut); } .toplist b { margin-left: auto; font-family: var(--f-d); }
.feed li { display: block; }
.faq details { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font: 600 1.05rem var(--f-d); }
.faq p { margin: 10px 0 0; color: #c6ccd3; }

/* médailles */
.medal-badge { display: inline-block; padding: 1px 8px; border-radius: 20px; font: 700 .72rem var(--f-d); text-transform: uppercase; letter-spacing: .05em; color: #111; vertical-align: middle; }
.medal-badge.platine, .medal-dot.platine { background: var(--pl); } .medal-badge.or, .medal-dot.or { background: var(--or); }
.medal-badge.argent, .medal-dot.argent { background: var(--ar); } .medal-badge.bronze, .medal-dot.bronze { background: var(--br); }
.medal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-left: 4px; }

/* classements */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.tabs a { padding: 6px 14px; border-radius: 20px; background: var(--bg2); border: 1px solid var(--line); color: var(--tx); font: 600 .9rem var(--f-d); }
.tabs a.on { background: var(--y); color: #111; border-color: var(--y); } .tabs a:hover { text-decoration: none; border-color: var(--y); }
.board { width: 100%; border-collapse: collapse; margin: 14px 0 24px; }
.board tr { scroll-margin-top: 110px; } .board tr:target td { background: rgba(255,212,0,.22); }
.rank-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 0 0 6px; }
.rank-me { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); flex: 1 1 320px; }
.rank-me b { font-family: var(--f-d); } .rank-me sup { font-size: .6em; }
.rank-search { display: flex; gap: 6px; }
.rank-search input { width: 190px; padding: .45em .7em; border-radius: 6px; border: 1px solid var(--line); background: var(--bg2); color: var(--tx); font: inherit; }
.pager { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.pager a, .pager span { min-width: 34px; text-align: center; padding: 5px 9px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line); color: var(--tx); font: 600 .85rem var(--f-d); }
.pager span { background: none; border-color: transparent; color: var(--mut); }
.pager a.on { background: var(--y); color: #111; border-color: var(--y); } .pager a:hover { text-decoration: none; border-color: var(--y); }
.board th { text-align: left; font: 600 .75rem var(--f-d); text-transform: uppercase; letter-spacing: .06em; color: var(--mut); padding: 8px; border-bottom: 1px solid var(--line); }
.board td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.board tr.me td { background: rgba(255,212,0,.08); }
.board td b { font-family: var(--f-d); }
.pro { font: 700 .62rem var(--f-d); color: var(--y); border: 1px solid var(--y); border-radius: 3px; padding: 0 3px; }
.pstats { display: flex; flex-wrap: wrap; gap: 26px; list-style: none; padding: 0; color: var(--mut); }
.pstats b { display: block; color: var(--tx); font: 700 1.5rem var(--f-d); }

/* pied */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 20px; background: #0a0c0e; }
.foot-in { max-width: 1180px; margin: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.foot-in p { max-width: 36em; font-size: .9rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: .95rem; }
.foot-links a { color: var(--mut); }

/* modale compte */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: 100%; max-width: 400px; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal-box h2 { margin: 0 0 6px; font-size: 1.4rem; }
.modal-box p { font-size: .9rem; }
.modal-box label { display: block; font: 600 .85rem var(--f-d); margin: 12px 0; }
.modal-box input { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); font: 500 1rem var(--f-t); }
.modal-box input:focus { outline: 2px solid var(--y); border-color: transparent; }
.modal-box .btn { width: 100%; margin-top: 6px; }
.err { color: #ff6b6b; font-weight: 600; }
.x { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--mut); font-size: 1.6rem; cursor: pointer; line-height: 1; }

/* ============================ page de jeu ============================ */
body.play { overflow: hidden; height: 100vh; height: 100dvh; background: #3f6f2a; touch-action: none; user-select: none; -webkit-user-select: none; }
/* iPhone / Android : pas de loupe, pas de menu, pas de sélection ni de zoom en restant appuyé sur une commande */
body.play, body.play .touch, body.play .touch * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
body.play .touch, body.play .touch * { touch-action: none; }
.touch button { pointer-events: auto; } .touch button > * { pointer-events: none; }
#jk-app { position: fixed; inset: 0; }
#jk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.panel { position: absolute; z-index: 10; background: rgba(13,15,18,.94); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 70px rgba(0,0,0,.55); }
.panel[hidden] { display: none; }
.garage { inset: 24px; max-width: 1060px; margin: auto; padding: 18px 24px; overflow: auto; display: flex; flex-direction: column; backdrop-filter: blur(4px); }
.g-head { display: flex; align-items: center; gap: 14px; }
.g-head > div { flex: 1; } .g-head h1 { margin: 0; font-size: 1.8rem; } .g-head p { margin: 2px 0 0; }
.g-back { font: 700 1.5rem var(--f-d); color: var(--tx); width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--bg3); }
.g-back:hover { text-decoration: none; background: var(--y); color: #111; }
.g-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: 14px; flex: 1; } .g-col { min-width: 0; }
.g-col h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); margin: 4px 0 10px; display: flex; justify-content: space-between; align-items: center; }
.g-modes { display: flex; gap: 8px; }
.g-modes button { flex: 1; padding: 12px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg3); color: var(--tx); font: 700 1rem var(--f-d); cursor: pointer; }
.g-modes button.on { background: var(--y); color: #111; border-color: var(--y); }
.defi-box { background: rgba(225,6,0,.15); border: 1px solid rgba(225,6,0,.5); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; }
.g-race { display: flex; gap: 14px; margin-top: 12px; }
.g-race label { font: 600 .85rem var(--f-d); color: var(--mut); display: flex; flex-direction: column; gap: 4px; flex: 1; }
select, input[type=number] { background: var(--bg3); color: var(--tx); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: 600 .95rem var(--f-t); }
.g-ghosts { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: .95rem; cursor: pointer; margin: 6px 0; }
.chk input { width: 18px; height: 18px; accent-color: var(--y); }
.g-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 10px; }
.g-info div { background: var(--bg3); border-radius: 10px; padding: 10px 12px; }
.g-info small { display: block; font: 600 .7rem var(--f-d); text-transform: uppercase; letter-spacing: .06em; color: var(--mut); }
.g-info b { font: 700 1.15rem var(--f-d); } .g-info b small { display: inline; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--mut); }
.g-medals { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.g-medals li { border-radius: 10px; padding: 8px 10px; background: var(--bg3); border: 1px solid var(--line); opacity: .65; }
.g-medals li span { display: block; font: 700 .7rem var(--f-d); text-transform: uppercase; letter-spacing: .06em; }
.g-medals li b { font: 600 .95rem var(--f-d); }
.g-medals li.got { opacity: 1; color: #111; } .g-medals li.platine.got { background: var(--pl); } .g-medals li.or.got { background: var(--or); } .g-medals li.argent.got { background: var(--ar); } .g-medals li.bronze.got { background: var(--br); }
.g-medals li.platine span { color: var(--pl); } .g-medals li.or span { color: var(--or); } .g-medals li.argent span { color: var(--ar); } .g-medals li.bronze span { color: var(--br); }
.g-medals li.got span { color: #111; }
.g-who { font-size: .92rem; color: var(--mut); }
.g-kart-row { display: flex; gap: 14px; align-items: center; }
#g-kart { width: 160px; height: 160px; background: radial-gradient(circle, #2c3138, #15181d 70%); border-radius: 50%; flex: none; }
.g-colors { display: grid; grid-template-columns: repeat(7, 30px); gap: 7px; }
.g-colors button, .g-colors .custom { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); cursor: pointer; padding: 0; }
.g-colors button.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--y); }
.g-colors .custom { display: grid; place-items: center; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); color: #fff; font-weight: 700; position: relative; overflow: hidden; }
.g-colors .custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.g-num { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font: 600 .9rem var(--f-d); }
.g-num input { width: 70px; }
.setup label { display: block; font: 600 .95rem var(--f-d); margin-bottom: 8px; }
.setup label span { float: right; color: var(--y); }
.setup input[type=range] { width: 100%; accent-color: var(--y); margin: 6px 0 0; }
.bars { display: grid; gap: 5px; margin-top: 6px; }
.bars div { display: grid; grid-template-columns: 140px 1fr; align-items: center; font-size: .82rem; color: var(--mut); }
.bars i { height: 7px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.bars b { display: block; height: 100%; background: linear-gradient(90deg, var(--y), #ff9d00); border-radius: 4px; transition: width .2s; }
.g-go { text-align: center; margin-top: 16px; } .g-go .btn { min-width: 280px; } .g-go p { margin: 8px 0 0; }

.small-panel { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.small-panel h2 { margin: 0 0 6px; text-align: center; font-size: 1.6rem; }
.small-panel h3 { margin: 10px 0 0; font-size: 1rem; }
.small-panel .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#results { width: min(620px, calc(100% - 24px)); }
.r-cta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.res { width: 100%; border-collapse: collapse; font-size: .95rem; }
.res th { text-align: left; color: var(--mut); font: 600 .72rem var(--f-d); text-transform: uppercase; padding: 6px; }
.res td { padding: 6px; border-top: 1px solid var(--line); }
.res tr.me td { background: rgba(255,212,0,.12); font-weight: 700; } .res tr.inv td { color: var(--mut); text-decoration: line-through; }
.sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.sum div { background: var(--bg3); border-radius: 10px; padding: 10px; text-align: center; }
.sum small { display: block; color: var(--mut); font: 600 .7rem var(--f-d); text-transform: uppercase; }
.sum b { font: 700 1.2rem var(--f-d); }
.medal.platine { color: var(--pl); } .medal.or { color: var(--or); } .medal.argent { color: var(--ar); } .medal.bronze { color: var(--br); }

/* HUD */
#hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--f-d); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
#hud[hidden] { display: none; }
.hud-tl { position: absolute; left: 14px; top: 12px; display: flex; gap: 10px; }
.hud-lap, .hud-posbox { background: rgba(10,12,15,.72); border-radius: 8px; padding: 6px 12px; font-size: 1.05rem; }
.hud-lap b, .hud-posbox b { font-size: 1.5rem; } .hud-lap small { color: var(--y); }
.hud-posbox[hidden] { display: none; }
.hud-tc { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); text-align: center; }
.hud-time { font: 700 2.4rem/1 var(--f-d); background: rgba(10,12,15,.72); padding: 6px 18px; border-radius: 10px; font-variant-numeric: tabular-nums; min-width: 230px; }
.hud-delta { margin-top: 4px; font: 700 1.3rem var(--f-d); font-variant-numeric: tabular-nums; min-height: 1.4em; }
.hud-delta.neg { color: #36e27a; } .hud-delta.pos { color: #ff5a5a; }
.hud-sectors { display: flex; gap: 4px; justify-content: center; }
.hud-sectors span { min-width: 74px; font-size: .8rem; padding: 2px 6px; border-radius: 4px; background: rgba(10,12,15,.5); }
.hud-sectors span:empty { visibility: hidden; }
.hud-sectors .better { background: #13a34a; } .hud-sectors .worse { background: #c99a00; } .hud-sectors .neutral { background: #444b55; }
.hud-invalid { margin-top: 4px; background: var(--r); padding: 2px 10px; border-radius: 4px; font-size: .85rem; display: inline-block; }
.hud-invalid[hidden] { display: none; }
.hud-tr { position: absolute; right: 14px; top: 12px; display: grid; gap: 4px; text-align: right; }
.hud-tr div { background: rgba(10,12,15,.66); border-radius: 7px; padding: 3px 10px; min-width: 150px; }
.hud-tr small { display: block; font-size: .65rem; color: var(--y); letter-spacing: .08em; }
.hud-tr b { font-size: 1.05rem; font-variant-numeric: tabular-nums; } .hud-tr b.invalid { color: #ff7a7a; text-decoration: line-through; }
.hud-bl { position: absolute; left: 14px; bottom: 14px; background: rgba(10,12,15,.72); border-radius: 10px; padding: 8px 14px; min-width: 160px; }
.hud-speed b { font-size: 2.2rem; font-variant-numeric: tabular-nums; } .hud-speed small { margin-left: 4px; color: var(--mut); }
.hud-rpm { height: 6px; background: #2a2f38; border-radius: 3px; overflow: hidden; margin: 4px 0 6px; }
.hud-rpm i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--g), var(--y) 70%, var(--r)); }
.hud-temp { font-size: .78rem; color: var(--mut); } .hud-temp b { font-size: .95rem; }
.hud-temp b.cold { color: #6cb6ff; } .hud-temp b.ok { color: #36e27a; } .hud-temp b.hot { color: #ff5a5a; }
.hud-map { position: absolute; right: 14px; bottom: 14px; width: 200px; height: 144px; background: rgba(10,12,15,.55); border-radius: 10px; }
.hud-pause { pointer-events: auto; position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(10,12,15,.6); color: #fff; border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: .9rem; cursor: pointer; }
.hud-toast { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -10px); background: rgba(10,12,15,.85); border-radius: 12px; padding: 12px 22px; font: 700 1.5rem var(--f-d); opacity: 0; transition: opacity .25s, transform .25s; white-space: nowrap; text-align: center; }
.hud-toast.show { opacity: 1; transform: translate(-50%, 0); }
.hud-toast small { font-size: .7em; opacity: .85; }
.hud-toast.good { color: #36e27a; } .hud-toast.bad { color: #ff7a7a; font-size: 1.2rem; } .hud-toast.meh { color: #e8e8e8; font-size: 1.2rem; } .hud-toast.info { font-size: 1.15rem; }
.hud-toast.gold { color: #111; background: var(--y); font-size: 1.7rem; }
.hud-toast.medal-platine { color: #111; background: var(--pl); } .hud-toast.medal-or { color: #111; background: var(--or); } .hud-toast.medal-argent { color: #111; background: var(--ar); } .hud-toast.medal-bronze { color: #111; background: var(--br); }
.hud-lights { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); display: flex; gap: 12px; background: #111; padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.hud-lights[hidden] { display: none; }
.hud-lights i { width: 38px; height: 38px; border-radius: 50%; background: #3a0d0d; box-shadow: inset 0 -4px 8px rgba(0,0,0,.5); }
.hud-lights i.on { background: #ff2a2a; box-shadow: 0 0 22px #ff2a2a; } .hud-lights i.go { background: #22d36b; box-shadow: 0 0 22px #22d36b; }
.guest-bar { pointer-events: auto; position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: rgba(10,12,15,.9); border: 1px solid var(--y); border-radius: 12px; padding: 8px 40px 8px 14px; font: 500 .95rem var(--f-t); text-shadow: none; white-space: nowrap; }
.guest-bar[hidden] { display: none; }
.guest-bar .x { top: 50%; transform: translateY(-50%); }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; animation: conf linear forwards; }
@keyframes conf { to { transform: translateY(110vh) rotate(720deg); } }

.hud-pen { background: #c81414; color: #fff; font: 700 .8rem var(--f-d); letter-spacing: .05em; padding: 6px 10px; border-radius: 8px; align-self: flex-start; animation: penb 1s ease-in-out 3; }
.hud-pen b { font-size: 1rem; }
@keyframes penb { 50% { transform: scale(1.12); } }
.hud-draft { margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: #1e63ff; color: #fff !important; font: 700 .68rem var(--f-d) !important; letter-spacing: .06em; vertical-align: middle; }
.res .pen { display: block; color: #ff6b6b; font-size: .75em; }
/* comptes, groupes, chat */
.narrow { max-width: 760px; }
.auth-tabs { display: flex; gap: 6px; margin: 0 26px 10px 0; }
.auth-tabs button { flex: 1; padding: 9px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--mut); font: 700 .9rem var(--f-d); cursor: pointer; }
.auth-tabs button.on { background: var(--y); color: #111; border-color: var(--y); }
.okmsg { color: #4ade80; font-weight: 600; }
.warn { color: #fbbf24; font-weight: 600; }
.mail-banner { background: #3a2f07; color: #fde68a; text-align: center; padding: 8px 14px; font-size: .9rem; }
.mail-banner a { color: var(--y); font-weight: 700; }
.badge { display: inline-block; min-width: 1.5em; padding: 1px 6px; border-radius: 10px; background: #e10600; color: #fff !important; font: 700 .72rem var(--f-d); font-style: normal; text-align: center; text-decoration: none !important; vertical-align: middle; }
.top nav a.nav-grp { white-space: nowrap; }
.share-box { background: var(--bg2); border: 1px solid var(--y); border-radius: 12px; padding: 14px 16px; margin: 16px 0; }
.share-box > b { display: block; font-family: var(--f-d); margin-bottom: 8px; }
.share-link { display: flex; gap: 6px; }
.share-link input { flex: 1; min-width: 0; padding: .45em .7em; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); font: 500 .9rem var(--f-t); }
.share-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.share-btns .sh-wa { background: #25d366; color: #fff; }
.grp-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; margin-bottom: 22px; }
.grp-top .share-box { margin: 0; }
.inline-form { display: flex; gap: 6px; margin-top: 8px; }
.inline-form input, .form-box input:not([type=checkbox]), .create-box input:not([type=checkbox]) { flex: 1; min-width: 0; width: 100%; padding: .5em .7em; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); font: 500 .95rem var(--f-t); }
.form-box, .create-box { margin: 14px 0; }
.form-box h2 { margin: 0 0 8px; font-size: 1.15rem; }
.form-box label, .create-box label:not(.chk) { display: block; font: 600 .85rem var(--f-d); margin: 10px 0; }
.form-box label input, .create-box label input { margin-top: 5px; }
.create-box summary { cursor: pointer; }
.cta-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.cta-box p { margin: 0; flex-basis: 100%; }
.join-cta { margin: 18px 0 26px; }
.grp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.grp-card { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); color: var(--tx); }
.grp-card:hover { border-color: var(--y); text-decoration: none; }
.grp-card .badge { position: absolute; top: 10px; right: 10px; }
.grp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.grp-chat { position: sticky; top: 14px; }
.grp-chat h2 { margin-top: 0; }
.chat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; height: min(70vh, 560px); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { position: relative; background: var(--bg3); border-radius: 10px; padding: 6px 10px; max-width: 92%; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: #2b2a14; }
.msg.event { align-self: center; background: transparent; border: 1px dashed var(--line); font-size: .9rem; }
.msg b { font: 700 .82rem var(--f-d); } .msg time { color: var(--mut); font-size: .72rem; }
.msg p { margin: 2px 0 0; word-wrap: break-word; overflow-wrap: anywhere; }
.msg .del { position: absolute; top: 2px; right: 6px; background: none; border: 0; color: var(--mut); cursor: pointer; font-size: 1rem; opacity: 0; }
.msg:hover .del { opacity: 1; }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; padding: .55em .7em; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); font: 500 .95rem var(--f-t); }
#chat-err { padding: 0 10px 8px; margin: 0; }
.members { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.members li { display: flex; align-items: center; gap: 4px; }
.g-friends { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--bg3); }
.g-friends .gf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.g-friends ol { list-style: none; margin: 6px 0 4px; padding: 0; font-size: .9rem; }
.g-friends li { display: flex; gap: 6px; padding: 2px 0; } .g-friends li b { margin-left: auto; font-family: var(--f-d); } .g-friends li.me { color: var(--y); }
.g-friends li a { text-decoration: none; }
.gf-group + .gf-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.gf-act { display: flex; gap: 6px; margin-top: 10px; }
@media (max-width: 860px) { .grp-layout, .grp-top { grid-template-columns: minmax(0, 1fr); } .grp-chat { position: static; } .chat { height: 60vh; } }
.tilt-test { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg3); }
.tt-bar { position: relative; height: 14px; border-radius: 7px; background: linear-gradient(90deg, #3b4250, #1d2129 50%, #3b4250); }
.tt-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: rgba(255,255,255,.4); }
.tt-bar i { position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--y); box-shadow: 0 0 10px rgba(247,197,30,.6); }
.tt-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.tt-range { display: flex; flex-direction: column; font: 600 .78rem var(--f-d); gap: 2px; } .tt-range input { accent-color: var(--y); }
.touch .t-center { width: auto; height: 34px; padding: 0 12px; border-radius: 17px; font-size: .75rem; position: absolute; bottom: 112px; left: 0; white-space: nowrap; }
.touch:not(.ctl-tilt) .t-center { display: none; }
.g-level { display: flex; align-items: center; gap: 8px; margin-right: 6px; }
.g-level > b { width: 38px; height: 38px; border-radius: 50%; background: var(--y); color: #111; display: grid; place-items: center; font: 800 1.05rem var(--f-d); flex: none; }
.g-level small { display: block; font: 600 .72rem var(--f-d); color: var(--mut); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.g-level i { display: block; width: 120px; height: 6px; border-radius: 3px; background: var(--bg3); margin-top: 4px; overflow: hidden; }
.g-level i b { display: block; height: 100%; background: linear-gradient(90deg, #f7c51e, #ff7a00); border-radius: 3px; }
.xp-pop { position: absolute; left: 50%; top: 46%; transform: translate(-50%, 0); font: 800 1.6rem var(--f-d); color: var(--y); text-shadow: 0 2px 8px rgba(0,0,0,.6); opacity: 0; pointer-events: none; }
.xp-pop.show { animation: xpup 1.6s ease-out forwards; }
@keyframes xpup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60px); } }
.g-liveries { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.g-liveries button { padding: 4px 9px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg3); color: var(--tx); font: 600 .75rem var(--f-d); cursor: pointer; }
.g-liveries button.on { background: var(--y); color: #111; border-color: var(--y); }
.g-liveries button.locked { opacity: .5; } .g-liveries button small { font-weight: 500; }
.g-top5 { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--bg3); }
.g-top5 ol { list-style: none; margin: 6px 0 0; padding: 0; font-size: .9rem; }
.g-top5 li { display: flex; gap: 6px; align-items: center; padding: 2px 0; } .g-top5 li b { margin-left: auto; font-family: var(--f-d); } .g-top5 li.me { color: var(--y); } .g-top5 li a { text-decoration: none; }
.daily-box { margin: 8px 0 0; background: rgba(247,197,30,.1); border-color: rgba(247,197,30,.5); font-size: .9rem; } .champ-box { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg3); font-size: .9rem; }
.setup-locked .setup { opacity: .55; }
.champ-h { margin: 14px 0 6px; font-size: 1.05rem; } .champ-final { font-size: 1.2rem; text-align: center; }
.g-modes button { padding: 10px 4px; font-size: .9rem; }
.daily-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: center; margin: 10px 0 22px; }
.daily-hero canvas { width: 100%; height: auto; }
@media (max-width: 760px) { .daily-hero { grid-template-columns: 1fr; } .daily-hero canvas { max-width: 320px; } }
.p-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.p-head canvas { width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, #2c3138, #15181d 70%); }
.p-head h1 { margin: 0 0 8px; }
.p-level { display: flex; align-items: center; gap: 10px; }
.p-level > b { width: 44px; height: 44px; border-radius: 50%; background: var(--y); color: #111; display: grid; place-items: center; font: 800 1.2rem var(--f-d); flex: none; }
.p-level span { font: 600 .85rem var(--f-d); }
.p-level i { display: block; width: min(260px, 60vw); height: 8px; border-radius: 4px; background: var(--bg3); margin: 4px 0 2px; overflow: hidden; }
.p-level i b { display: block; height: 100%; background: linear-gradient(90deg, #f7c51e, #ff7a00); border-radius: 4px; }
.ach { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 10px 0 24px; }
.ach li { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); opacity: .45; filter: grayscale(1); }
.ach li.got { opacity: 1; filter: none; border-color: rgba(247,197,30,.5); }
.ach .ic { grid-row: 1 / 3; font-size: 1.5rem; text-align: center; } .ach b { font: 700 .9rem var(--f-d); } .ach small { color: var(--mut); font-size: .78rem; } .ach em { grid-column: 2; font-size: .7rem; color: var(--y); font-style: normal; }
.daily-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; border-radius: 12px; background: linear-gradient(90deg, rgba(247,197,30,.16), rgba(247,197,30,.04)); border: 1px solid rgba(247,197,30,.5); color: var(--tx); margin-top: 18px; }
.daily-strip:hover { text-decoration: none; border-color: var(--y); }
.daily-strip b { font-family: var(--f-d); } .daily-strip .btn { margin-left: auto; }
.ds-tag { font: 700 .75rem var(--f-d); text-transform: uppercase; letter-spacing: .08em; color: var(--y); }
.card-top3 { list-style: none; margin: 10px 0 0; padding: 8px 10px; background: var(--bg3); border-radius: 8px; font-size: .9rem; }
.card-top3 li { display: flex; align-items: center; gap: 6px; padding: 2px 0; } .card-top3 .r { width: 1.4em; } .card-top3 b { margin-left: auto; font-family: var(--f-d); } .card-top3 .defy { text-decoration: none; }
.tabs-meteo { margin-top: -8px; } .tabs-meteo a { padding: 4px 12px; font-size: .82rem; }
.g-weather-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; }
.g-weather-row label { font: 600 .85rem var(--f-d); color: var(--mut); display: flex; align-items: center; gap: 6px; }
.g-weather-row select { padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg3); color: var(--tx); font: 600 .9rem var(--f-d); }
.card-art { position: relative; }
.card-art .theme-tag { position: absolute; left: 10px; bottom: 10px; background: rgba(15,17,22,.78); color: #fff; font: 700 .72rem var(--f-d); padding: 4px 8px; border-radius: 999px; letter-spacing: .02em; }
.g-style { margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg3); display: grid; gap: 8px; }
.g-style-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 8px; font: 600 .82rem var(--f-d); color: var(--mut); }
.g-style-row input[type=text] { width: 100%; max-width: 220px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); font: 700 .85rem var(--f-d); text-transform: uppercase; }
.g-mini { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.g-mini button, .g-mini .custom { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); cursor: pointer; padding: 0; }
.g-mini button.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--y); }
.g-mini button.auto { width: auto; border-radius: 11px; padding: 0 8px; font: 700 .7rem var(--f-d); background: var(--bg); color: var(--tx); }
.g-mini .custom { display: grid; place-items: center; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); position: relative; overflow: hidden; }
.g-mini .custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.g-ai { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 6px; border-top: 1px dashed var(--line); }
.g-ai.busy label { opacity: .5; pointer-events: none; }
@media (max-width: 560px) { .g-style-row { grid-template-columns: 1fr; gap: 4px; } }
.g-preview { width: 100%; height: auto; display: block; border-radius: 10px; background: #0e1118; }
.podium-photo { margin: 6px 0 14px; }
.podium-photo canvas { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.45); }
.podium-photo .pod-cta { text-align: center; margin-top: 8px; }
.reveal canvas { display: block; width: auto; max-width: 100%; height: min(58vh, 520px); margin: 6px auto; border-radius: 12px; }
.p-hero { position: relative; margin: 0 0 18px; border-radius: 16px; overflow: hidden; background: #0e1118; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.p-hero canvas { display: block; width: 100%; height: auto; }
.p-hero-info { position: absolute; right: 0; top: 0; width: 42%; padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.p-hero-info h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6); word-break: break-word; }
.p-hero-info h1 small { color: #f7c51e; font-size: .55em; }
.p-hero-info .p-level { background: rgba(8,10,16,.6); border-radius: 10px; padding: 8px 10px; }
.p-hero-cta { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) { .p-hero-info { position: static; width: auto; padding: 14px 14px 16px; } }
#hud-pen small { display: block; font-size: .62em; opacity: .85; font-weight: 600; }
.hud-pause { z-index: 20; touch-action: manipulation; }
.is-touch .hud-pause { width: 46px !important; height: 46px !important; background: rgba(10,12,15,.82); border: 2px solid var(--y); color: var(--y); font-size: 1rem; box-shadow: 0 2px 10px rgba(0,0,0,.5); }
.seg-cam { display: grid; grid-template-columns: repeat(2, 1fr); }
.cam-prev { margin: 8px 0 0; }
.cam-prev img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: #0e1118; }
.cam-prev figcaption { font-size: .78rem; color: var(--mut); margin-top: 4px; }
/* tactile */
.touch { position: absolute; inset: auto 0 0 0; height: 48%; pointer-events: none; z-index: 5; }
.touch[hidden] { display: none; }
.touch > div { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 12px; pointer-events: auto; }
.touch .t-left, .touch .t-tiltbrake { left: calc(14px + env(safe-area-inset-left)); }
.touch .t-right { right: calc(14px + env(safe-area-inset-right)); }
.touch button { width: 84px; height: 84px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: rgba(10,12,15,.42); color: #fff; font: 700 1.3rem var(--f-d); touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; }
.touch button.on { background: rgba(255,212,0,.7); color: #111; border-color: #ffd400; }
.touch .t-gas { width: 106px; height: 106px; font-size: 1.15rem; background: rgba(22,120,60,.5); }
.touch .t-brake { width: 78px; height: 78px; font-size: .8rem; background: rgba(160,20,20,.45); }
/* joystick : toute la moitié gauche de l'écran, le pouce se pose où il veut */
.touch .t-steer { left: 0; top: 0; bottom: 0; width: 52%; display: block; touch-action: none; }
.t-stick { position: absolute; left: 110px; top: 62%; width: 128px; height: 128px; margin: -64px 0 0 -64px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: radial-gradient(circle, rgba(10,12,15,.15), rgba(10,12,15,.4)); opacity: .45; pointer-events: none; transition: opacity .15s; }
.t-stick::before, .t-stick::after { content: ""; position: absolute; top: 50%; margin-top: -9px; border: 9px solid transparent; }
.t-stick::before { left: 6px; border-right-color: rgba(255,255,255,.55); }
.t-stick::after { right: 6px; border-left-color: rgba(255,255,255,.55); }
.t-stick.on { opacity: 1; transition: none; }
.t-stick i { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; border-radius: 50%; background: rgba(255,212,0,.85); border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.45); transform: translate(-50%,-50%); }
.t-hint { position: absolute; left: 110px; top: calc(62% - 96px); transform: translateX(-50%); white-space: nowrap; font: 600 .78rem var(--f-d); color: #fff; background: rgba(10,12,15,.55); padding: 3px 9px; border-radius: 12px; pointer-events: none; }
.t-steer.used .t-hint { display: none; }
/* « direction » : le même joystick, mais à 360° (anneau sans flèches) */
.touch.ctl-dir .t-stick::before, .touch.ctl-dir .t-stick::after { display: none; }
.touch.ctl-dir .t-stick { background: radial-gradient(circle, rgba(10,12,15,.1) 40%, rgba(10,12,15,.45)); }
.touch.ctl-dir .t-stick i { background: rgba(255,212,0,.9); }
.touch.ctl-dir .t-left, .touch.ctl-dir .t-tiltbrake { display: none; }
.hud-assist { background: #a16207; }
.seg-4 button { padding: 8px 3px; font-size: .82rem; } .seg-4 button small { font-size: .62rem; }
.tuto .tuto-steps { display: grid; gap: 10px; margin: 10px 0 16px; text-align: left; }
.tuto .tuto-steps > div { background: var(--bg3); border-radius: 10px; padding: 10px 12px; }
.tuto .tuto-steps b { font-family: var(--f-d); } .tuto .tuto-steps p { margin: 4px 0 0; font-size: .95rem; }
.tuto .btn-xl { width: 100%; }
/* un seul schéma visible à la fois */
.touch.ctl-stick .t-left, .touch.ctl-stick .t-tiltbrake { display: none; }
.touch.ctl-buttons .t-steer, .touch.ctl-buttons .t-tiltbrake { display: none; }
.touch.ctl-tilt .t-steer, .touch.ctl-tilt .t-left, .touch.ctl-tilt .t-right .t-brake { display: none; }
.touch.ctl-tilt .t-tiltbrake .t-brake { width: 96px; height: 96px; font-size: .95rem; }
.touch.ctl-tilt .t-gas { width: 112px; height: 112px; }
/* sélecteurs segmentés (commandes, caméra) */
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg3); color: var(--tx); cursor: pointer; font: 700 .95rem var(--f-d); line-height: 1.15; }
.seg button small { font: 500 .72rem var(--f-t); color: var(--mut); }
.seg button.on { background: var(--y); border-color: var(--y); color: #111; }
.seg button.on small { color: #3b3000; }
.seg-sm button { padding: 7px 4px; font-size: .85rem; }
.g-ctl { margin-top: 14px; }
.g-ctl h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); margin: 4px 0 8px; }
html:not(.is-touch) .only-touch { display: none !important; }
html.is-touch .only-desk { display: none !important; }

/* responsive */
@media (max-width: 980px) {
  .cards { grid-template-columns: 1fr; }
  .twocol { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .top { padding: 8px 14px; } .top nav { gap: 12px; font-size: .85rem; } .top nav a.nav-circ, .top nav a.nav-day { display: none; } .top .btn-sm { white-space: nowrap; } .brand { gap: 8px; } .game-tag { white-space: nowrap; }
  .logo-txt { font-size: 1.05rem; } .logo img { width: 28px; height: 28px; } .game-tag { font-size: .68rem; padding: 3px 8px; }
  .hero { grid-template-columns: 1fr; padding-top: 24px; } .hero-art { order: 2; }

  .grid3 { grid-template-columns: 1fr; }
  .hide-m { display: none; }
  .garage { inset: 0; border-radius: 0; padding: 14px; }
  .g-grid { grid-template-columns: 1fr; gap: 14px; }
  .g-head h1 { font-size: 1.4rem; }
  .garage { overflow-x: hidden; }
  .g-head { flex-wrap: wrap; gap: 8px 12px; } .g-head > div:not(.g-level) { flex: 1 1 0; min-width: 0; }
  .g-head .icon-btn { order: 2; } .g-head > .g-level { order: 3; flex: 1 1 100%; margin: 2px 0 0; min-width: 0; }
  .g-level > div { flex: 1; min-width: 0; } .g-level small { white-space: normal; } .g-level i { width: 100%; }
  .g-kart-row { flex-wrap: wrap; } .g-kart-row > * { min-width: 0; }
  .g-medals { grid-template-columns: repeat(2, 1fr); }
  .g-colors { grid-template-columns: repeat(auto-fill, 28px); gap: 6px; max-width: 100%; } .g-colors button, .g-colors .custom { width: 28px; height: 28px; }
  .g-grid { grid-template-columns: minmax(0, 1fr); } .g-col { min-width: 0; } #g-kart { width: 112px; height: 112px; }
  .bars div { grid-template-columns: 120px 1fr; }
  .g-go { position: sticky; bottom: -14px; margin: 14px -14px -14px; padding: 12px 14px; background: linear-gradient(transparent, rgba(13,15,18,.97) 30%); }
  .g-go .btn { min-width: 0; width: 100%; }
  .hud-time { font-size: 1.6rem; min-width: 150px; padding: 4px 10px; }
  .hud-tr div { min-width: 0; padding: 2px 8px; } .hud-tr b { font-size: .9rem; } .hud-tr div:nth-child(3) { display: none; }
  .hud-sectors span { min-width: 54px; font-size: .7rem; }
  .hud-lap, .hud-posbox { font-size: .85rem; padding: 4px 8px; } .hud-lap b, .hud-posbox b { font-size: 1.15rem; }
  .hud-tl { flex-direction: column; gap: 4px; left: 8px; top: 8px; } .hud-tr { right: 8px; top: 8px; }
  .hud-bl { left: 8px; bottom: auto; top: 100px; min-width: 0; padding: 4px 10px; } .hud-speed b { font-size: 1.4rem; } .hud-temp { display: none; } .hud-rpm { margin: 2px 0 0; }
  .hud-map { width: 120px; height: 86px; right: 8px; top: 140px; bottom: auto; }
  .hud-pause { bottom: auto; top: 8px; left: auto; right: 50%; transform: translateX(50%) translateY(84px); width: 38px; height: 38px; }
  .hud-toast { font-size: 1.1rem; top: 26%; white-space: normal; width: max-content; max-width: 92vw; }
  .hud-lights i { width: 26px; height: 26px; }
  .guest-bar { bottom: auto; top: 150px; white-space: normal; width: 92vw; font-size: .85rem; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .touch { height: 72%; } .touch > div { bottom: calc(10px + env(safe-area-inset-bottom)); } .touch button { width: 70px; height: 70px; } .touch .t-gas { width: 94px; height: 94px; } .touch .t-brake { width: 68px; height: 68px; }
  .t-stick, .t-hint { left: 120px; } .t-stick { top: 66%; } .t-hint { top: calc(66% - 92px); }
  .hud-bl { display: none; }
  .hud-map { top: 62px; left: 8px; right: auto; bottom: auto; width: 130px; height: 94px; }
  .hud-pause { top: 8px; bottom: auto; left: auto; right: 50%; transform: translateX(170px); width: 38px; height: 38px; }
  .hud-tl { flex-direction: row; }
  .hud-pen { font-size: .6rem; padding: 4px 6px; } .hud-pen b { font-size: .8rem; }
}

@media (max-width: 440px) { .top { padding: 8px 10px; } .top nav { gap: 9px; } .logo-txt { font-size: .92rem; } .logo img { width: 24px; height: 24px; } .brand { gap: 6px; } .game-tag { padding: 3px 6px; font-size: .62rem; } .top .btn-sm { padding: .4em .6em; font-size: .78rem; } }
@media (max-width: 400px) { .top nav a.nav-rank { display: none; } .board td, .board th { padding: 8px 5px; } .board .btn-sm { padding: .35em .5em; font-size: .72rem; } }
.seg-cam .cam-hd b::after { content: 'HD'; margin-left: 6px; font-size: 10px; letter-spacing: .04em; background: #ffd400; color: #111; border-radius: 4px; padding: 1px 4px; vertical-align: 2px; }
/* Tablette tactile (iPad…) : boutons plus gros, vitesse et plan du circuit remontés au-dessus des commandes */
@media (min-width: 700px) and (min-height: 600px) {
  .is-touch .touch button { width: 108px; height: 108px; font-size: 1.5rem; }
  .is-touch .touch .t-gas { width: 128px; height: 128px; font-size: 1.3rem; }
  .is-touch .touch .t-brake { width: 96px; height: 96px; font-size: .95rem; }
  .is-touch .touch > div { gap: 16px; bottom: calc(22px + env(safe-area-inset-bottom)); }
  .is-touch .touch .t-left { left: calc(22px + env(safe-area-inset-left)); } .is-touch .touch .t-right { right: calc(22px + env(safe-area-inset-right)); }
  .is-touch .hud-bl { bottom: auto; top: 96px; left: 14px; }
  .is-touch .hud-map { bottom: auto; top: 214px; right: 14px; }
}
/* Téléphone en portrait : les 4 boutons tiennent sur la largeur sans se chevaucher */
@media (max-width: 480px) and (orientation: portrait) {
  .touch > div { gap: 8px; } .touch .t-left { left: calc(10px + env(safe-area-inset-left)); } .touch .t-right { right: calc(10px + env(safe-area-inset-right)); }
  .touch button { width: 76px; height: 76px; } .touch .t-gas { width: 92px; height: 92px; } .touch .t-brake { width: 66px; height: 66px; font-size: .75rem; }
}
@media (max-width: 360px) and (orientation: portrait) {
  .touch > div { gap: 6px; } .touch button { width: 66px; height: 66px; } .touch .t-gas { width: 82px; height: 82px; } .touch .t-brake { width: 58px; height: 58px; font-size: .7rem; }
}

/* Tablette en portrait (iPad…) : garage sur une seule colonne, rien ne dépasse à droite */
@media (max-width: 960px) and (orientation: portrait) {
  .g-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .garage { overflow-x: hidden; }
}
