/* 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, .shot-casque, .shot-dessus { grid-column: span 3; } .shot-pluie button, .shot-chat button, .shot-casque button, .shot-dessus 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, .shot-casque, .shot-dessus { 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-vis { display: flex; flex-wrap: wrap; gap: 5px; }
.g-vis button { display: inline-flex; align-items: center; gap: 5px; border-radius: 11px; padding: 2px 8px 2px 3px; border: 2px solid rgba(255,255,255,.15); background: var(--bg); color: var(--tx); font: 700 .7rem var(--f-d); cursor: pointer; }
.g-vis button i { width: 22px; height: 12px; border-radius: 6px 6px 3px 3px; display: block; }
.g-vis button.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--y); }
.g-vis .vis-fumee i { background: linear-gradient(180deg, #2a2e36, #0c0e12); }
.g-vis .vis-claire i { background: linear-gradient(180deg, #c9dbe8, #7f97aa); }
.g-vis .vis-rouge i { background: linear-gradient(180deg, #ffb000, #ff3b1f 55%, #8a1206); }
.g-vis .vis-or i { background: linear-gradient(180deg, #fff1a8, #e8b32a 55%, #7a5208); }
.g-vis .vis-bleu i { background: linear-gradient(180deg, #5fe0ff, #1d5bff 55%, #2a0f8a); }
.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 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; background: radial-gradient(ellipse at 30% 70%, #2b3242, #0b0e14 75%); }
.p-stage { position: relative; aspect-ratio: 4 / 3; }
.p-stage #p-3d { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.p-stage #p-card { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-views { bottom: 10px; }
.p-hero .p-hero-info { position: static; width: 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 .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.pen-on .hud-bl { top: 150px; } .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; } .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: 480px) { .at-bar .lg { display: none; } }
@media (max-width: 430px) { .top .game-tag { display: none; } }
@media (max-width: 400px) { .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; }
}

.hud-redflag { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); z-index: 12; background: #c8102e; color: #fff; padding: 14px 26px; border-radius: 12px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: rf-blink 0.8s steps(2) infinite; }
.hud-redflag b { display: block; font: 800 1.8rem var(--f-d); letter-spacing: .08em; } .hud-redflag small { font: 600 .85rem var(--f-d); opacity: .9; }
.hud-redflag[hidden] { display: none; }
@keyframes rf-blink { 50% { background: #8a0a1f; } }
.g-race { flex-wrap: wrap; }
/* iPhone en portrait : le chrono ne recouvre plus la case « Tour » */
@media (max-width: 430px) and (orientation: portrait) { #hud .hud-time { font-size: 1.25rem; min-width: 0 !important; display: inline-block; padding: 4px 8px; } #hud .hud-sectors span { min-width: 36px; font-size: .6rem; } .hud-lap, .hud-posbox, .hud-pen { max-width: 118px; } .hud-pen { white-space: nowrap; overflow: hidden; } }

/* ---------------- atelier « Mon pilote » ---------------- */
.atelier { padding: 18px 0 110px; }
.at-head h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 .2em; }
.at-head p { margin: 0 0 14px; }
.at-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, 1fr); gap: 20px; align-items: start; }
.at-grid > * { min-width: 0; }
.top nav a.nav-me { white-space: nowrap; }
.at-stage { position: sticky; top: 72px; aspect-ratio: 16 / 11; border-radius: 16px; overflow: hidden; background: radial-gradient(ellipse at 50% 70%, #2b3242, #0b0e14 75%); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.at-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.at-stage canvas:active { cursor: grabbing; }
.at-load { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--mut); font: 600 .95rem var(--f-d); background: #0f131a; transition: opacity .4s; }
.at-load i { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--y); animation: atspin 0.9s linear infinite; }
.at-load.done { opacity: 0; pointer-events: none; }
@keyframes atspin { to { transform: rotate(360deg); } }
.at-id { position: absolute; left: 14px; top: 12px; font: 800 1.15rem var(--f-d); text-shadow: 0 2px 6px rgba(0,0,0,.6); pointer-events: none; }
.at-id .n { color: var(--y); } .at-id .f { font-size: 1.2rem; }
.at-views { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; border-radius: 22px; background: rgba(10,12,16,.72); backdrop-filter: blur(6px); }
.at-views button { border: 0; background: transparent; color: var(--tx); font: 700 .82rem var(--f-d); padding: 7px 13px; border-radius: 18px; cursor: pointer; }
.at-views button.on { background: var(--y); color: #111; }
.at-tools { position: absolute; right: 12px; top: 10px; display: flex; gap: 6px; }
.at-tools button { border: 1px solid rgba(255,255,255,.14); background: rgba(10,12,16,.65); color: var(--tx); font: 700 .8rem var(--f-d); padding: 6px 10px; border-radius: 16px; cursor: pointer; }
.at-tools button.on { border-color: var(--y); color: var(--y); }
.at-hint { position: absolute; right: 14px; bottom: 58px; margin: 0; font-size: .72rem; color: rgba(255,255,255,.5); pointer-events: none; }
.at-panel { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 6px 16px 14px; }
.at-tabs { display: flex; gap: 2px; overflow-x: auto; margin: 0 -10px 6px; padding: 6px 4px 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.at-tabs::-webkit-scrollbar { display: none; }
.at-tabs button { flex: 1 0 auto; border: 0; background: none; color: var(--mut); font: 700 .86rem var(--f-d); padding: 10px 7px 11px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.at-tabs button.on { color: var(--tx); border-bottom-color: var(--y); }
.at-row { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.at-row:last-child { border-bottom: 0; }
.at-row h3 { font-size: .9rem; margin: 0 0 9px; color: var(--mut); text-transform: uppercase; letter-spacing: .05em; }
.at-row h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.at-sw { display: flex; flex-wrap: wrap; gap: 8px; }
.at-sw button, .at-sw .custom { --c: #888; width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.16); background: var(--c); cursor: pointer; padding: 0; position: relative; }
.at-sw button.on, .at-sw .custom.on { box-shadow: 0 0 0 3px var(--bg2), 0 0 0 5px var(--y); }
.at-sw button.auto { width: auto; padding: 0 12px; border-radius: 17px; background: var(--bg3); color: var(--tx); font: 700 .78rem var(--f-d); }
.at-sw .custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); overflow: hidden; }
.at-sw .custom.on { background: var(--c); }
.at-sw .custom input { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); opacity: 0; cursor: pointer; }
.at-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.at-chips button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg3); color: var(--tx); font: 700 .82rem var(--f-d); padding: 7px 12px; border-radius: 18px; cursor: pointer; }
.at-chips button i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.3); }
.at-chips button.on { background: var(--y); border-color: var(--y); color: #111; }
.at-chips button.locked { opacity: .5; } .at-chips button small { font-weight: 500; }
.at-vis button { padding: 4px 12px 4px 5px; font-size: .8rem; } .at-vis button i { width: 30px; height: 16px; }
.at-num { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.at-num button { width: 44px; height: 46px; border: 0; background: var(--bg3); color: var(--tx); font: 700 1.3rem var(--f-d); cursor: pointer; }
.at-num input { width: 74px; height: 46px; border: 0; background: #ffd400; color: #111; text-align: center; font: 800 1.5rem var(--f-d); -moz-appearance: textfield; }
.at-num input::-webkit-inner-spin-button, .at-num input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.at-txt, .at-sel { width: 100%; max-width: 360px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); font: 700 1rem var(--f-d); }
.at-txt { text-transform: uppercase; letter-spacing: .04em; }
.at-ai.busy { opacity: .6; pointer-events: none; }
.at-guest p { margin: .4em 0; }
.at-misc { display: flex; align-items: center; gap: 12px; padding-top: 10px; }
.at-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(13,15,18,.92); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); }
.at-bar-in { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.at-saved { margin-right: auto; color: var(--g); font: 600 .9rem var(--f-d); }
.at-saved.busy { color: var(--mut); } .at-saved.bad { color: #ff8a7a; }
.at-saved.pop { animation: atpop .5s; }
@keyframes atpop { 0% { transform: scale(1.08); } 100% { transform: none; } }
.atelier-page .foot { padding-bottom: 80px; }
.flag { font-size: 1.05em; }
.g-me { display: flex; gap: 14px; align-items: center; padding: 10px 12px; margin-bottom: 14px; border-radius: 12px; background: var(--bg3); border: 1px solid var(--line); color: var(--tx); text-decoration: none !important; }
.g-me:hover { border-color: var(--y); }
.g-me b { display: block; font: 700 1.05rem var(--f-d); } .g-me small { color: var(--mut); }
.g-me .btn { margin-top: 8px; pointer-events: none; }
@media (max-width: 860px) {
  .p-hero { grid-template-columns: 1fr; } .p-stage { aspect-ratio: 5 / 4; }
  .at-grid { grid-template-columns: 1fr; gap: 12px; padding: 0; }
  .at-head { padding: 0 16px; }
  .at-stage { top: 56px; z-index: 5; aspect-ratio: auto; height: 46vh; min-height: 260px; border-radius: 0; border-left: 0; border-right: 0; }
  .at-panel { margin: 0 12px; }
  .at-hint { display: none; }
  .at-sw button, .at-sw .custom { width: 36px; height: 36px; }
  .at-bar .btn { padding: .6em 1em; font-size: .9rem; }
  .at-saved { font-size: .78rem; }
}

.g-me.pulse { animation: gpulse 1.4s ease-in-out 4; }
@keyframes gpulse { 50% { box-shadow: 0 0 0 4px var(--y); } }
.g-me canvas { width: 110px; height: 110px; flex: none; background: radial-gradient(circle, #2c3138, #15181d 70%); border-radius: 50%; }
.fb { margin: 16px 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--bg3); border: 1px solid var(--line); text-align: center; }
.fb-q { display: block; font: 700 1rem var(--f-d); margin-bottom: 8px; }
.fb-rate { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.fb-rate button { display: grid; justify-items: center; gap: 2px; min-width: 70px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--tx); cursor: pointer; }
.fb-rate button span { font-size: 1.6rem; line-height: 1; } .fb-rate button small { font: 600 .72rem var(--f-d); color: var(--mut); }
.fb-rate button.on { border-color: var(--y); background: rgba(247,197,30,.14); }
.fb-more { display: grid; gap: 8px; margin-top: 10px; text-align: left; }
.fb-more textarea { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); font: 400 .95rem var(--f-t); resize: vertical; }
.fb-more .btn { justify-self: end; }
.fb-ok { margin: 8px 0 0; color: var(--g); font: 600 .9rem var(--f-d); }
.fb .link { margin-top: 6px; }

/* HUD moins envahissant : en course, les messages restent petits et hors de la trajectoire */
body.racing .hud-toast { top: 92px; padding: 6px 14px; border-radius: 10px; font-size: 1.05rem; line-height: 1.25; background: rgba(10,12,15,.7); white-space: normal; width: max-content; max-width: min(560px, 60vw); pointer-events: none; }
body.racing .hud-toast.gold { background: rgba(247,197,30,.9); font-size: 1.1rem; }
body.racing .hud-toast.bad, body.racing .hud-toast.meh, body.racing .hud-toast.info { font-size: .95rem; }
body.racing .xp-pop { top: 18%; font-size: 1.15rem; }
@media (max-width: 760px) and (orientation: portrait) {
  body.racing .hud-toast { top: auto; bottom: calc(132px + env(safe-area-inset-bottom)); font-size: .82rem; padding: 5px 10px; max-width: 86vw; }
  body.racing .hud-toast.gold { font-size: .88rem; }
  .hud-pause { right: auto; left: 8px; top: 150px; transform: none; }
  #hud.pen-on .hud-pause { top: 200px; }
  .hud-sectors { display: none; }
  .hud-delta { font-size: 1rem; min-height: 1.2em; }
}
@media (max-height: 520px) and (orientation: landscape) {
  body.racing .hud-toast { top: 56px; font-size: .8rem; padding: 4px 10px; max-width: 44vw; }
  body.racing .hud-toast.gold { font-size: .85rem; }
  .hud-sectors { display: none; }
  .hud-delta { font-size: .95rem; min-height: 1.1em; }
  .hud-tr div:nth-child(2) { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) { .hud-pause { left: auto; right: calc(170px + env(safe-area-inset-right)); top: 10px; transform: none; } }

.diff { display: inline-block; vertical-align: 3px; margin-left: 6px; padding: 2px 8px; border-radius: 10px; font: 700 .68rem var(--f-d); text-transform: uppercase; letter-spacing: .04em; }
.diff.d1 { background: #1f3a5c; color: #9cc8ff; } .diff.d2 { background: #2f4a2a; color: #a8e39a; } .diff.d3 { background: #5a3a10; color: #ffc46b; } .diff.d4 { background: #6b1c1c; color: #ff9c9c; }

/* ---------------- logo KART GP (damier) + langues ---------------- */
.kgp { display: inline-flex; align-items: stretch; transform: skewX(-10deg); font: 400 1.45rem/1 'Russo One', 'Chakra Petch', system-ui, sans-serif; letter-spacing: .01em; }
.kgp-k { color: #fff; padding: 3px 7px 2px 0; }
.kgp-gp { position: relative; display: inline-flex; align-items: center; background: #f7c51e; color: #0d0f12; border-radius: 4px; padding: 3px 15px 2px 7px; }
.kgp-gp i { position: absolute; right: 3px; top: 3px; bottom: 3px; width: 8px; background: conic-gradient(#0d0f12 25%, transparent 0 50%, #0d0f12 0 75%, transparent 0) 0 0 / 8px 8px; }
.kgp.small { font-size: 1.15rem; }
.logo:hover .kgp-gp { background: #ffd84a; }
.lang-sw { display: inline-flex; gap: 4px; margin-top: 10px; }
.lang-sw a { font: 700 .78rem var(--f-d); padding: 4px 9px; border-radius: 14px; border: 1px solid var(--line); color: var(--tx); text-decoration: none !important; }
.lang-sw a.on { background: var(--y); border-color: var(--y); color: #111; }
@media (max-width: 440px) { .kgp { font-size: 1.15rem; } .kgp-gp { padding-right: 12px; } .kgp-gp i { width: 6px; background-size: 6px 6px; } }

/* ---------------- courses en direct ---------------- */
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--r); box-shadow: 0 0 0 0 rgba(225,6,0,.7); animation: livePulse 1.6s infinite; vertical-align: middle; margin-right: 6px; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(225,6,0,.7); } 70% { box-shadow: 0 0 0 8px rgba(225,6,0,0); } 100% { box-shadow: 0 0 0 0 rgba(225,6,0,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.top nav a.nav-live { white-space: nowrap; font-weight: 700; }
.live-strip { background: linear-gradient(90deg, rgba(225,6,0,.2), rgba(225,6,0,.04)); border-color: rgba(225,6,0,.55); }
.live-strip:hover { border-color: var(--r); }
.live-strip [data-live-cd] { font-variant-numeric: tabular-nums; color: var(--y); }
.live-hero { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 18px 0 8px; }
.live-hero > * { min-width: 0; }
.live-hero h2 { margin: 6px 0 2px; }
.live-hero .thumb { width: 100%; height: auto; border-radius: 10px; }
.live-when { margin: 0; font-family: var(--f-d); font-size: 1.05rem; }
.live-cd { font-family: var(--f-d); font-variant-numeric: tabular-nums; }
.live-when .live-cd { font-size: 2.4rem; color: var(--y); display: block; line-height: 1.1; }
.live-count { font-weight: 600; }
.live-ps { display: block; margin: 10px 0 4px; font-size: .9rem; color: var(--mut); }
.live-ps input { display: block; margin-top: 4px; width: 100%; max-width: 260px; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); font: inherit; }
.live-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.live-list li { background: var(--bg3); border-radius: 999px; padding: 3px 10px 3px 8px; font-size: .85rem; white-space: nowrap; }
.live-how li { margin: 4px 0; }
.btn.busy { opacity: .6; pointer-events: none; }
/* panneau du garage */
.live-box { background: rgba(225,6,0,.12); border: 1px solid rgba(225,6,0,.5); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.live-box .live-head { font-family: var(--f-d); }
.live-box .live-cd { font-size: 1.5rem; margin: 6px 0; }
.live-box .live-cd b { color: var(--y); font-variant-numeric: tabular-nums; }
.live-box .live-ok { margin: 4px 0; }
.live-next { margin-top: 14px; }
@media (max-width: 760px) { .live-hero { grid-template-columns: 1fr; } .live-hero .thumb { order: -1; max-width: 420px; } }
.danger-box { border-color: rgba(225,6,0,.45); }
.btn-danger { background: #b40500; color: #fff; }
.btn-danger:hover { background: var(--r); }
/* dans l'appli installée (Google Play / écran d'accueil) on ne propose pas l'appli */
@media (display-mode: fullscreen), (display-mode: standalone) { .play-badge { display: none !important; } }

/* ---------------- circuits des joueurs */
.ucards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin: 14px 0 6px; }
.ucard { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.ucard:hover { border-color: #3d4450; transform: translateY(-2px); }
.ucard-art { position: relative; display: block; background: #2f5a24; aspect-ratio: 16 / 10; }
.ucard-art .thumb { width: 100%; height: 100%; display: block; }
.ucard-art .theme-tag { position: absolute; left: 8px; bottom: 8px; background: rgba(15,17,22,.78); color: #fff; font: 700 .7rem var(--f-d); padding: 3px 8px; border-radius: 999px; }
.ucard-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ucard-body h3 { margin: 0; font-size: 1.1rem; } .ucard-body h3 a { color: var(--tx); }
.ucard-body p { margin: 0; }
.ucard-body .card-cta { margin-top: auto; padding-top: 6px; }
.ustats { display: flex; gap: 14px; font-size: .92rem; color: var(--mut); } .ustats b { color: var(--tx); font-family: var(--f-d); }
.ugc-sec { margin-top: 46px; }
.ugc-sec .ugc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ugc-sec .ugc-head p { margin: 4px 0 0; }
.ugc-sec .ugc-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.ulist-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 0 6px; }
.tabs-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs-inline a { padding: 7px 14px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); color: var(--tx); font: 600 .9rem var(--f-d); }
.tabs-inline a.on { background: var(--y); color: #111; border-color: var(--y); } .tabs-inline a:hover { text-decoration: none; border-color: var(--y); }
.ulist-search { display: flex; gap: 6px; } .ulist-search input { min-width: 220px; }
.danger { color: #ff7b7b !important; }

/* ---------------- créateur de circuits */
.cr-page input:not([type=checkbox]):not([type=file]), .cr-page select, .ulist-search input { background: var(--bg); color: var(--tx); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: .95rem; }
.cr-links { margin: 0 0 6px; }
.cr-note { background: #1b2230; border: 1px solid #2c3a52; border-radius: 10px; padding: 10px 14px; color: #cfd8e6; }
.cr-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 12px; }
.cr-tabs button { background: var(--bg2); color: var(--tx); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font: 600 .95rem var(--f-d); cursor: pointer; }
.cr-tabs button.on { background: var(--y); color: #111; border-color: var(--y); }
.cr-howto { background: var(--bg2); border-left: 3px solid var(--y); border-radius: 8px; padding: 10px 14px 10px 34px; margin: 0 0 12px; color: #cfd4da; font-size: .95rem; }
.cr-howto li { margin: 3px 0; } .cr-howto b { color: #fff; }
.cr-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.cr-tools label.btn { cursor: pointer; }
.cr-msg { color: var(--mut); font-size: .9rem; }
.cr-search { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; } .cr-search input { flex: 1; min-width: 200px; }
.cr-osm { display: flex; flex-direction: column; gap: 6px; width: 100%; max-height: 220px; overflow: auto; } .cr-osm .btn { justify-content: flex-start; text-transform: none; letter-spacing: 0; }
.cr-stage { position: relative; background: #0b0d10; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
#ed-canvas { display: block; width: 100%; height: 560px; touch-action: none; cursor: crosshair; }
#map { height: 560px; }
.cr-gen { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 16px; }
.cr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .cr-row3 { grid-template-columns: 1fr 1fr 1fr; align-items: end; }
.cr-gen label { display: block; font-size: .85rem; color: var(--mut); margin: 0 0 10px; }
.cr-gen label input:not([type=checkbox]), .cr-gen label select { display: block; width: 100%; margin-top: 4px; }
.cr-gen .chk { display: flex; align-items: center; gap: 8px; }
#pv { width: 100%; height: auto; border-radius: 10px; background: #2f5a24; display: block; }
.cr-out { font-size: .95rem; line-height: 1.6; }
.cr-page .bad { color: #ff8080; } .cr-page .warn { color: #ffb86b; } .cr-page .good { color: #5be38f; }
.cr-mine { margin-top: 40px; } .cr-total { font-size: 1.05rem; }
.pt-icon { width: 16px !important; height: 16px !important; margin: -8px 0 0 -8px !important; border-radius: 50%; background: #ffd400; border: 2px solid #111; box-shadow: 0 0 0 1px #fff; }
.pt-icon.first { background: #ff3b3b; }
@media (max-width: 800px) { .cr-gen { grid-template-columns: 1fr; } .cr-row3 { grid-template-columns: 1fr 1fr; } #ed-canvas, #map { height: 62vh; min-height: 340px; } }

/* ---------------- menu du haut : sous-menu « Circuits » (ordinateur) et menu burger (mobile, tablette) */
.top { gap: 14px; }
.top .nav-main { display: flex; align-items: center; gap: 18px; font: 600 .95rem var(--f-d); margin-left: auto; }
.top .nav-main > a, .nav-dd-btn { color: var(--tx); white-space: nowrap; }
.top .nav-main > a:hover, .nav-dd-btn:hover { color: var(--y); text-decoration: none; }
.top-act { display: flex; align-items: center; gap: 12px; }
.top-act .me { display: flex; align-items: center; color: var(--tx); font: 600 .95rem var(--f-d); white-space: nowrap; max-width: 150px; }
.top-act .me span { overflow: hidden; text-overflow: ellipsis; }
.top .live-m, .top .burger, .top .nav-acct, .top .nav-play { display: none; }
.nav-dd { position: relative; }
.nav-dd-btn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.nav-dd-btn .caret { font-size: .7em; transition: transform .15s; }
.nav-dd-menu { position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%); min-width: 290px; background: #161a20; border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 18px 40px rgba(0,0,0,.5); display: none; z-index: 30; }
.nav-dd-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.nav-dd-menu a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; color: var(--tx); text-decoration: none !important; }
.nav-dd-menu a:hover { background: #222831; }
.nav-dd-menu .ico { font-size: 1.25rem; width: 1.5em; text-align: center; }
.nav-dd-menu b { display: block; font: 700 .95rem var(--f-d); } .nav-dd-menu small { display: block; color: var(--mut); font: 400 .82rem var(--f-t); }
.nav-dd-menu .new { font-style: normal; background: var(--y); color: #111; font: 700 .62rem var(--f-d); padding: 2px 6px; border-radius: 999px; vertical-align: 2px; margin-left: 4px; text-transform: uppercase; }
@media (hover: hover) { .nav-dd:hover .nav-dd-menu { display: block; } .nav-dd:hover .caret { transform: rotate(180deg); } }
.nav-dd.open .nav-dd-menu { display: block; } .nav-dd.open .caret { transform: rotate(180deg); }
.top .badge { background: var(--r); color: #fff; font: 700 .7rem var(--f-d); padding: 1px 6px; border-radius: 999px; vertical-align: 1px; }

@media (max-width: 1080px) {
  .top { padding: 8px 14px; }
  .top .live-m { display: inline-flex; align-items: center; color: var(--tx); font: 700 .85rem var(--f-d); white-space: nowrap; text-decoration: none !important; }
  .top .burger { display: inline-flex; flex-direction: column; justify-content: center; gap: 4px; width: 40px; height: 38px; padding: 0 9px; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; position: relative; }
  .top .burger span { display: block; height: 2px; background: var(--tx); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .top .burger .dotbadge { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--r); }
  .top.menu-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .top.menu-open .burger span:nth-child(2) { opacity: 0; }
  .top.menu-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .top .nav-main { display: none; position: absolute; left: 0; right: 0; top: 100%; height: calc(100vh - var(--top-h, 56px)); height: calc(100dvh - var(--top-h, 56px)); margin: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 10px 16px 30px; background: var(--bg); overflow-y: auto; font-size: 1.05rem; border-top: 1px solid var(--line); }
  .top.menu-open .nav-main { display: flex; }
  .top .nav-main > a { padding: 14px 6px; border-bottom: 1px solid var(--line); }
  .top .nav-main .nav-live { color: var(--tx); }
  .top .nav-acct { display: block; }
  .top .nav-main > a.nav-play { display: flex; justify-content: center; margin: 6px 0 10px; padding: 14px; border: 0; border-radius: 10px; background: var(--y); color: #111; font: 700 1.05rem var(--f-d); text-transform: uppercase; letter-spacing: .04em; }
  .nav-dd { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .nav-dd-btn { display: none; }
  .nav-dd-menu { display: block; position: static; transform: none; min-width: 0; background: none; border: 0; box-shadow: none; padding: 0; }
  .nav-dd-menu::before { display: none; }
  .nav-dd-menu a { padding: 10px 6px; }
  body.menu-lock { overflow: hidden; }
}
@media (max-width: 440px) {
  .top-act { gap: 8px; }
  .top .live-m { font-size: 0; } .top .live-m .live-dot { margin: 0; width: 11px; height: 11px; }
  .top-act .me { max-width: 96px; font-size: .85rem; }
}
.essai-bar { margin: 6px 0 0; padding: 8px 12px; border-radius: 8px; background: #1d2a1d; border: 1px solid #2f5a2f; color: #cfe8cf; font-size: .9rem; }
