/* Titi Boost Run — écrans du jeu (au-dessus du canvas).
   Univers de nuit unique, comme la page d'accueil : le jeu n'a pas de thème clair (choix assumé). */
:root {
  --night: #0a1033; --night-2: #101a4d; --night-3: #1b2766;
  --flame: #ff5a1f; --flame-2: #ff7a3d; --sun: #ffc62e; --like: #ff4d8d; --view: #4cc9ff; --grow: #22c55e; --alert: #ff3b3b;
  --ink: #f4f2ff; --ink-2: #c3c0e0; --ink-3: #8a87ad;
  --card: rgba(255, 255, 255, .07); --card-2: rgba(255, 255, 255, .11); --line: rgba(255, 255, 255, .13);
  --display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body.tbr {
  background: radial-gradient(120% 80% at 50% 0%, #1b2766 0%, var(--night) 60%) fixed, var(--night);
  color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; overflow: hidden;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; border-radius: 12px; }
[hidden] { display: none !important; }

/* Scène : plein écran sur téléphone, colonne de 430 px centrée sur ordinateur */
.tbr-wrap { height: 100%; display: flex; align-items: center; justify-content: center; }
.tbr-stage {
  --sat: env(safe-area-inset-top, 0px);
  position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--night-2);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
@media (min-width: 600px) {
  .tbr-wrap { padding: 16px; }
  .tbr-stage { width: 430px; height: min(900px, 100%); border-radius: 34px; box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 40px 90px rgba(0,0,0,.5), 0 0 120px rgba(255,90,31,.12); }
}
#tbrGame, #tbrFx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#tbrFx { pointer-events: none; z-index: 6; }

.tbr-screen {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 18px calc(18px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; touch-action: pan-y;
}
.tbr-screen::-webkit-scrollbar { display: none; }
.tbr-scrim { background: linear-gradient(180deg, rgba(10,16,51,.35) 0%, rgba(10,16,51,.86) 38%, rgba(10,16,51,.95) 100%); }
.tbr-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tbr-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(10,16,51,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 13px; font-weight: 700; text-decoration: none; transition: background .2s;
}
.tbr-chip:active { background: var(--card-2); }
.tbr-icon { width: 38px; padding: 0; justify-content: center; }
#tbrSound .w-on { display: none; }
#tbrSound.on { color: var(--sun); border-color: rgba(255,198,46,.45); }
#tbrSound.on .w-on { display: inline; } #tbrSound.on .w-off { display: none; }

/* ---------- Accueil ---------- */
.tbr-hero { text-align: center; margin-top: 2px; position: relative; }
.tbr-hero-art { position: relative; height: 170px; display: grid; place-items: center; }
.tbr-sun {
  position: absolute; width: 170px; height: 170px; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -46%);
  background: radial-gradient(circle, rgba(255,198,46,.55) 0%, rgba(255,122,61,.28) 42%, rgba(255,90,31,0) 70%);
  animation: tbr-breathe 3.2s ease-in-out infinite;
}
.tbr-hero img { position: relative; width: 210px; max-width: 62%; height: auto; filter: drop-shadow(0 18px 28px rgba(255,90,31,.38)); animation: tbr-hover 3.2s ease-in-out infinite; }
@keyframes tbr-hover { 0%, 100% { transform: translateY(0) rotate(-9deg); } 50% { transform: translateY(-12px) rotate(-4deg); } }
@keyframes tbr-breathe { 0%, 100% { opacity: .85; transform: translate(-50%, -46%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -46%) scale(1.08); } }
.tbr-hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 12vw, 50px); line-height: .9; letter-spacing: -.05em; margin: 2px 0 8px; }
.tbr-hero h1 span { background: linear-gradient(180deg, #ffe07a, var(--sun) 45%, var(--flame-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tbr-hero p { margin: 0 auto; max-width: 310px; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.tbr-first {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; height: 30px; padding: 0 13px; border-radius: 999px;
  background: rgba(34,197,94,.16); color: #6ff0a0; font-size: 12.5px; font-weight: 800; border: 1px solid rgba(34,197,94,.35);
  animation: tbr-pop .5s var(--ease-back) both .2s;
}
.tbr-first::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #6ff0a0; box-shadow: 0 0 10px #6ff0a0; animation: tbr-blink 1.4s infinite; }
@keyframes tbr-blink { 50% { opacity: .3; } }

.tbr-panel { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px 16px; display: grid; gap: 13px; }
.tbr-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.tbr-row b { color: var(--ink); font-family: var(--display); font-size: 17px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tbr-strong { color: var(--ink); font-weight: 800; }
.tbr-muted { color: var(--ink-3); font-size: 12px; }
.tbr-sm { font-size: 12.5px; }
.tbr-hint { display: block; color: var(--ink-3); font-size: 11.5px; font-weight: 600; margin-top: 6px; }
.tbr-label { display: block; color: var(--ink-3); font-size: 11.5px; font-weight: 700; margin-bottom: 7px; letter-spacing: .02em; }
.tbr-pips { display: flex; gap: 6px; align-items: center; }
.tbr-pips i { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe07a, var(--sun) 60%, #e8a800); box-shadow: 0 0 12px rgba(255,198,46,.65); animation: tbr-pop .4s var(--ease-back) both; }
.tbr-pips i:nth-child(2) { animation-delay: .06s; } .tbr-pips i:nth-child(3) { animation-delay: .12s; } .tbr-pips i:nth-child(4) { animation-delay: .18s; } .tbr-pips i:nth-child(5) { animation-delay: .24s; }
.tbr-pips i.off { background: rgba(255,255,255,.13); box-shadow: none; }
.tbr-pips .bank { font-size: 11px; font-weight: 800; color: var(--night); background: var(--grow); border-radius: 999px; padding: 2px 7px; }
.tbr-bar { display: block; height: 8px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 7px; }
.tbr-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--sun), var(--flame)); transition: width .9s var(--ease-out); }

.tbr-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tbr-duo > div { background: rgba(255,255,255,.05); border-radius: 16px; padding: 10px 12px; display: grid; gap: 1px; min-width: 0; }
.tbr-duo small { color: var(--ink-3); font-size: 11.5px; font-weight: 700; }
.tbr-duo b { font-family: var(--display); font-size: 22px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tbr-duo span { color: var(--ink-3); font-size: 11px; font-weight: 600; line-height: 1.3; }
.tbr-streak b::before { content: ''; display: inline-block; width: 14px; height: 18px; margin-right: 5px; vertical-align: -1px; background: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18'%3E%3Cpath d='M7 0c1 4 6 6 6 11a6 6 0 01-12 0c0-3 2-4 2-7 1 1 2 2 2 4 1-2 2-5 2-8z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18'%3E%3Cpath d='M7 0c1 4 6 6 6 11a6 6 0 01-12 0c0-3 2-4 2-7 1 1 2 2 2 4 1-2 2-5 2-8z'/%3E%3C/svg%3E") center/contain no-repeat; }
.tbr-streak.hot { background: linear-gradient(160deg, rgba(255,90,31,.22), rgba(255,198,46,.1)); }
.tbr-streak.hot b { color: #ffb38a; }
.tbr-streak.hot b::before { background: var(--flame); animation: tbr-flicker 1.1s ease-in-out infinite; }
.tbr-streak.hot span { color: #ffcf9e; }
@keyframes tbr-flicker { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.12) rotate(3deg); } }
.tbr-tiers { display: flex; flex-wrap: wrap; gap: 6px; }
.tbr-tiers span { font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--ink-3); border: 1px dashed rgba(255,255,255,.15); }
.tbr-tiers span.on { background: rgba(255,198,46,.15); color: var(--sun); border: 1px solid rgba(255,198,46,.4); }

.tbr-missions { display: grid; gap: 10px; }
.tbr-mi { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; align-items: center; font-size: 13px; font-weight: 600; }
.tbr-mi .tbr-bar { grid-column: 1 / -1; margin-top: 0; height: 6px; }
.tbr-mi em { font-style: normal; color: var(--sun); font-weight: 800; font-size: 12px; font-variant-numeric: tabular-nums; }
.tbr-mi.done span, .tbr-mi.done em { color: #5ee08f; }
.tbr-mi.done .tbr-bar i { background: var(--grow); }

.tbr-alert { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255,59,59,.14); border: 1px solid rgba(255,59,59,.35); font-size: 13px; font-weight: 600; line-height: 1.4; }
.tbr-alert.gold { background: linear-gradient(135deg, rgba(255,198,46,.2), rgba(255,90,31,.14)); border-color: rgba(255,198,46,.45); display: grid; gap: 4px; }
.tbr-alert.gold b { color: var(--sun); font-family: var(--display); font-size: 16px; }
.tbr-alert.gold a { font-weight: 800; color: #fff; }
.tbr-challenge { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(34,197,94,.2), rgba(76,201,255,.12)); border: 1px solid rgba(34,197,94,.4); display: grid; gap: 2px; animation: tbr-pop .5s var(--ease-back) both; }
.tbr-challenge b { font-family: var(--display); font-size: 17px; }
.tbr-challenge span { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.tbr-guest { margin-top: 12px; padding: 11px 14px; border-radius: 16px; background: rgba(76,201,255,.1); border: 1px solid rgba(76,201,255,.3); display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; }
.tbr-guest a { flex: none; font-weight: 800; color: var(--view); text-decoration: none; }

/* Bouton principal : même place sur l'accueil et sur les résultats (rejouer en un geste) */
.tbr-cta {
  margin: auto -18px 0; padding: 28px 18px 0; display: grid; gap: 10px; position: sticky; bottom: 0; z-index: 2;
  background: linear-gradient(180deg, rgba(10,16,51,0), rgba(10,16,51,.97) 26px); box-shadow: 0 40px 0 rgba(10,16,51,.97);
}
.tbr-play {
  position: relative; overflow: hidden; min-height: 62px; border: 0; border-radius: 20px; text-decoration: none;
  background: linear-gradient(180deg, var(--flame-2), var(--flame)); color: #fff;
  font-family: var(--display); font-size: 23px; font-weight: 800; letter-spacing: -.02em;
  box-shadow: 0 14px 30px rgba(255,90,31,.45), inset 0 -3px 0 rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform .12s, box-shadow .2s;
}
.tbr-play small { font-family: var(--body); font-size: 13px; font-weight: 700; opacity: .88; }
.tbr-play::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); animation: tbr-shine 3.4s ease-in-out infinite 1s; }
@keyframes tbr-shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.tbr-play:active { transform: scale(.97); box-shadow: 0 6px 16px rgba(255,90,31,.4), inset 0 -2px 0 rgba(0,0,0,.18); }
.tbr-play:disabled { background: rgba(255,255,255,.12); box-shadow: none; color: var(--ink-3); }
.tbr-play:disabled::after { display: none; }
.tbr-play.busy { pointer-events: none; }
.tbr-play.busy span::after { content: ''; display: inline-block; width: 16px; height: 16px; margin-left: 10px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; vertical-align: -1px; animation: tbr-spin .7s linear infinite; }
@keyframes tbr-spin { to { transform: rotate(360deg); } }
.tbr-play-sm { min-height: 50px; font-size: 18px; border-radius: 16px; width: 100%; }
.is-guest .tbr-streak, .is-guest #tbrTiers, .is-guest .tbr-label { display: none; }
.is-guest .tbr-duo { grid-template-columns: 1fr; }
.tbr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tbr-stack { display: grid; gap: 10px; }
.tbr-ghost {
  min-height: 48px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.06); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; padding: 0 12px; transition: background .2s, transform .12s;
}
.tbr-ghost:active { background: var(--card-2); transform: scale(.98); }
.tbr-gold { border-color: rgba(255,198,46,.45); color: var(--sun); }
.tbr-wa { border-color: rgba(37,211,102,.5); color: #4fe08a; }

/* ---------- Compte à rebours ---------- */
.tbr-count { align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.tbr-count b { font-family: var(--display); font-weight: 800; font-size: 150px; line-height: 1; color: var(--sun); text-shadow: 0 10px 50px rgba(255,198,46,.55); }
.tbr-count b.pop { animation: tbr-count .6s var(--ease-back); }
@keyframes tbr-count { 0% { transform: scale(1.8); opacity: 0; } 40% { opacity: 1; } 100% { transform: scale(1); } }
.tbr-count p { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; margin-top: 18px; background: rgba(10,16,51,.65); padding: 11px 16px; border-radius: 14px; }
.tbr-hand { width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px rgba(255,255,255,.2); animation: tbr-swipe 1.4s ease-in-out infinite; }
@keyframes tbr-swipe { 0%, 100% { transform: translateX(-14px); } 50% { transform: translateX(14px); } }
.tbr-pausebtn { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 4; width: 44px; height: 44px; border-radius: 14px; border: 0; background: rgba(10,16,51,.45); display: grid; place-items: center; }
.tbr-pausebtn svg { width: 18px; height: 18px; }

/* ---------- Résultats ---------- */
.tbr-res { background: linear-gradient(180deg, rgba(10,16,51,.82), rgba(10,16,51,.96) 36%); }
.tbr-res h2 { font-family: var(--display); font-size: 20px; letter-spacing: -.02em; margin: 8px 0 0; text-align: center; color: var(--ink-2); animation: tbr-rise .5s var(--ease-out) both; }
.tbr-big { text-align: center; margin-top: 4px; animation: tbr-pop .6s var(--ease-back) both .05s; }
.tbr-big b { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(64px, 20vw, 80px); line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; text-shadow: 0 8px 40px rgba(255,198,46,.25); }
.tbr-big span { color: var(--ink-2); font-weight: 700; }
.tbr-badges { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.tbr-badge { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800; background: rgba(255,255,255,.09); animation: tbr-pop .45s var(--ease-back) both; }
.tbr-badge.sun { background: rgba(255,198,46,.16); color: var(--sun); }
.tbr-badge.grow { background: rgba(34,197,94,.16); color: #5ee08f; }
.tbr-badge.view { background: rgba(76,201,255,.14); color: #8ddcff; }
.tbr-near { display: grid; gap: 7px; margin-top: 12px; }
.tbr-near-chip { text-align: center; font-size: 13.5px; font-weight: 800; color: #ffe2a8; background: rgba(255,198,46,.1); border: 1px dashed rgba(255,198,46,.45); border-radius: 14px; padding: 9px 12px; animation: tbr-rise .5s var(--ease-out) both; }
.tbr-gain { margin-top: 14px; border-radius: 22px; padding: 15px 16px; background: linear-gradient(135deg, rgba(255,198,46,.2), rgba(255,90,31,.14)); border: 1px solid rgba(255,198,46,.32); display: grid; gap: 8px; animation: tbr-rise .5s var(--ease-out) both .15s; }
.tbr-gain .tbr-row b { font-size: 28px; color: var(--sun); }
.tbr-gain p { margin: 0; font-size: 12.5px; color: var(--ink-2); font-weight: 600; line-height: 1.45; }
.tbr-gain.loading .tbr-row b { animation: tbr-blink 1s infinite; }
.tbr-gain.pending { background: linear-gradient(135deg, rgba(76,201,255,.16), rgba(255,198,46,.12)); border-color: rgba(76,201,255,.35); }
.tbr-gain.warn { background: rgba(255,255,255,.06); border-color: var(--line); }
.tbr-gain.warn .tbr-row, .tbr-gain.demo .tbr-row { flex-direction: column; align-items: flex-start; gap: 2px; }
.tbr-gain.warn .tbr-row b { font-size: 20px; color: var(--ink); }
.tbr-gain.demo { background: rgba(76,201,255,.1); border-color: rgba(76,201,255,.3); }
.tbr-gain.demo .tbr-row b { font-size: 16px; color: var(--view); }
.tbr-gold-link { font-weight: 800; font-size: 13.5px; color: #fff; text-align: center; background: rgba(255,198,46,.22); border-radius: 12px; padding: 10px; text-decoration: none; }
.tbr-signup { margin-top: 12px; display: grid; gap: 10px; text-align: center; }
.tbr-signup p { margin: 0; font-size: 13px; color: var(--ink-2); }
.tbr-rankrow { width: 100%; border: 0; background: none; padding: 0; text-align: left; }
.tbr-rankval { color: var(--sun) !important; }
.tbr-rankval::after { content: ' ›'; color: var(--ink-3); }

@keyframes tbr-pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes tbr-rise { 0% { transform: translateY(14px); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- Feuilles (classement, règles, partage, pause) ---------- */
.tbr-sheet { position: absolute; inset: 0; z-index: 8; background: rgba(5,8,26,.7); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: flex; align-items: flex-end; animation: tbr-fade .2s both; }
.tbr-sheet > div { width: 100%; max-height: 90%; overflow-y: auto; background: linear-gradient(180deg, #17205a, #111948); border-radius: 28px 28px 0 0; padding: 20px 20px calc(22px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); animation: tbr-up .32s var(--ease-out) both; overscroll-behavior: contain; touch-action: pan-y; }
.tbr-sheet > div::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.2); margin: -8px auto 12px; }
@keyframes tbr-fade { from { opacity: 0; } }
@keyframes tbr-up { from { transform: translateY(40%); } }
.tbr-sheet h3 { font-family: var(--display); font-size: 27px; letter-spacing: -.03em; margin: 0 0 4px; }
.tbr-sub { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; }
.tbr-money { background: rgba(255,198,46,.1); border-radius: 14px; padding: 10px 12px; color: #ffe2a8; font-weight: 600; }
.tbr-tabs { display: grid; grid-template-columns: 1fr 1fr; background: rgba(255,255,255,.07); border-radius: 14px; padding: 4px; margin-bottom: 12px; }
.tbr-tabs button { border: 0; background: none; height: 38px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--ink-2); transition: background .2s, color .2s; }
.tbr-tabs button.on { background: #fff; color: var(--night); }
.tbr-prizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.tbr-prizes div { background: rgba(255,198,46,.1); border-radius: 12px; padding: 8px 4px; text-align: center; font-size: 11px; color: var(--ink-2); font-weight: 700; }
.tbr-prizes b { display: block; color: var(--sun); font-family: var(--display); font-size: 15px; }
.tbr-lb { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; min-height: 120px; }
.tbr-lb.loading { background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)) 0 0/200% 100%; border-radius: 14px; animation: tbr-shimmer 1.2s linear infinite; }
@keyframes tbr-shimmer { to { background-position: -200% 0; } }
.tbr-lb li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.05); font-size: 13.5px; animation: tbr-rise .35s var(--ease-out) both; }
.tbr-lb li:nth-child(1) { background: linear-gradient(90deg, rgba(255,198,46,.22), rgba(255,255,255,.04)); }
.tbr-lb li:nth-child(2) { background: linear-gradient(90deg, rgba(200,210,235,.16), rgba(255,255,255,.04)); }
.tbr-lb li:nth-child(3) { background: linear-gradient(90deg, rgba(255,138,76,.18), rgba(255,255,255,.04)); }
.tbr-lb li.me { background: rgba(255,90,31,.22); outline: 1px solid rgba(255,90,31,.55); }
.tbr-lb li.gap, .tbr-lb li.empty { display: block; background: none; text-align: center; color: var(--ink-3); padding: 2px; }
.tbr-lb li.empty { padding: 20px 10px; font-weight: 600; }
.tbr-lb .rk { font-family: var(--display); font-weight: 800; color: var(--ink-3); text-align: center; }
.tbr-lb li:nth-child(-n+3) .rk { color: var(--sun); }
.tbr-lb .nm { min-width: 0; }
.tbr-lb .nm b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbr-lb .nm small { color: var(--ink-3); font-weight: 600; }
.tbr-lb .sc { font-family: var(--display); font-weight: 800; font-variant-numeric: tabular-nums; }
.tbr-legend { display: grid; gap: 7px; }
.tbr-lg { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.tbr-lg canvas { width: 40px; height: 40px; }
.tbr-lg b { color: var(--ink); display: block; }
.tbr-card { width: 100%; max-width: 260px; display: block; margin: 4px auto 14px; border-radius: 18px; box-shadow: 0 20px 40px rgba(0,0,0,.45); aspect-ratio: 3 / 4; background: var(--night-3); }
.tbr-msg { width: 100%; min-height: 84px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--ink); padding: 10px 12px; font: inherit; font-size: 13px; resize: none; margin-bottom: 10px; }
.tbr-toast { position: absolute; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: #fff; color: var(--night); font-weight: 800; font-size: 13px; padding: 11px 16px; border-radius: 14px; z-index: 9; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: tbr-rise .3s var(--ease-out) both; }
.tbr-closed { align-items: center; justify-content: center; text-align: center; gap: 10px; }
.tbr-closed img { width: 180px; height: auto; animation: tbr-hover 3.2s ease-in-out infinite; }
.tbr-closed h1 { font-family: var(--display); font-size: 40px; margin: 0; letter-spacing: -.04em; }
.tbr-closed p { color: var(--ink-2); max-width: 280px; }

@media (max-height: 680px) {
  .tbr-hero-art { height: 120px; } .tbr-hero img { width: 150px; } .tbr-sun { width: 120px; height: 120px; }
  .tbr-hero h1 { font-size: 38px; } .tbr-hero p { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* « Continuer » */
.tbr-revive-ring{position:relative;width:76px;height:76px;margin:0 auto 10px}
.tbr-revive-ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.tbr-revive-ring circle{fill:none;stroke:rgba(255,255,255,.14);stroke-width:4}
.tbr-revive-ring #tbrReviveArc{stroke:#ffc62e;stroke-linecap:round;transition:stroke-dashoffset .1s linear}
.tbr-revive-ring b{position:absolute;inset:0;display:grid;place-items:center;font:800 28px "Bricolage Grotesque",sans-serif;color:#fff}
#tbrReviveSheet h3,#tbrReviveSheet .tbr-sub{text-align:center}
.tbr-revive-err{color:#ffb4b4}
.tbr-revive-err a{color:#ffc62e;font-weight:800;text-decoration:underline}

/* ---------- Niveaux ---------- */
.tbr-lvpanel { gap: 10px; background: linear-gradient(160deg, rgba(255,198,46,.14), rgba(255,90,31,.08) 55%, rgba(255,255,255,.05)); border-color: rgba(255,198,46,.3); }
.tbr-lvpanel .tbr-row span:first-child { color: var(--sun); font-weight: 800; font-size: 14px; }
.tbr-lvtotal { color: var(--sun); font-family: var(--display); font-weight: 800; font-size: 16px; }
.tbr-lvdesc { margin: -4px 0 0; color: var(--ink-2); font-size: 13px; font-weight: 600; line-height: 1.4; }
.tbr-lvrow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.tbr-lvmapbtn { min-height: 42px; font-size: 14px; }
.tbr-runbtn { width: 100%; }
.tbr-node {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  aspect-ratio: 1 / 1.08; border-radius: 18px; border: 1.5px solid var(--line); background: rgba(10,16,51,.45);
  transition: transform .15s var(--ease-out);
}
.tbr-node b { font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1; }
.tbr-node:active { transform: scale(.94); }
.tbr-node.done { background: rgba(255,198,46,.12); border-color: rgba(255,198,46,.45); }
.tbr-node.cur { background: linear-gradient(160deg, var(--flame-2), var(--flame)); border-color: transparent; box-shadow: 0 8px 22px rgba(255,90,31,.45); animation: tbr-cur 1.8s ease-in-out infinite; }
.tbr-node.cur .tbr-st i { color: rgba(255,255,255,.45); }
.tbr-node.locked { opacity: .45; }
.tbr-node.locked b { font-size: 15px; }
@keyframes tbr-cur { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.tbr-st { display: inline-flex; gap: 1px; font-size: 11px; line-height: 1; }
.tbr-st i { font-style: normal; color: rgba(255,255,255,.22); }
.tbr-st i.on { color: var(--sun); text-shadow: 0 0 8px rgba(255,198,46,.6); }
/* fiche d'un niveau */
.tbr-lvkick { display: block; color: var(--sun); font-weight: 800; font-size: 12.5px; margin-bottom: 2px; }
.tbr-lvgoal { margin: 12px 0 10px; padding: 14px 16px; border-radius: 20px; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); display: grid; gap: 4px; }
.tbr-lvgoal small { color: #5ee08f; font-weight: 800; font-size: 12px; }
.tbr-lvgoal b { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; line-height: 1.15; }
.tbr-lvgoal span { color: var(--ink-2); font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.tbr-lvstars { display: grid; gap: 6px; margin-bottom: 4px; }
.tbr-lvst { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; background: var(--card); font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.tbr-lvst .tbr-st { font-size: 15px; min-width: 52px; }
.tbr-lvst.got { color: var(--ink); background: rgba(255,198,46,.12); }
.tbr-lvmine { display: flex; align-items: center; gap: 6px; }
.tbr-lvmine .tbr-st { font-size: 15px; }
/* carte des niveaux */
.tbr-mapsheet > div { max-height: 88%; display: flex; flex-direction: column; }
.tbr-map { overflow-y: auto; display: grid; gap: 14px; padding: 4px 2px 8px; margin: 0 -2px; scrollbar-width: none; touch-action: pan-y; }
.tbr-map::-webkit-scrollbar { display: none; }
.tbr-world { border-radius: 22px; padding: 12px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 10px; }
.tbr-world.locked { opacity: .6; }
.tbr-wh b { display: block; font-family: var(--display); font-weight: 800; font-size: 17px; }
.tbr-wh small { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.tbr-world .tbr-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.tbr-world.w1 { background: linear-gradient(160deg, rgba(76,201,255,.14), var(--card)); }
.tbr-world.w2 { background: linear-gradient(160deg, rgba(255,77,141,.14), var(--card)); }
.tbr-world.w3 { background: linear-gradient(160deg, rgba(255,90,31,.16), var(--card)); }
.tbr-world.w4 { background: linear-gradient(160deg, rgba(10,12,40,.9), var(--card)); }
.tbr-world.w5 { background: linear-gradient(160deg, rgba(34,197,94,.14), var(--card)); }
.tbr-world.w6 { background: linear-gradient(160deg, rgba(255,59,59,.16), var(--card)); }
.tbr-world.w7 { background: linear-gradient(160deg, rgba(255,198,46,.18), rgba(255,90,31,.12)); }
/* résultat d'un niveau */
.tbr-lvres { text-align: center; margin-top: 4px; }
.tbr-stars3 { display: flex; justify-content: center; gap: 10px; }
.tbr-stars3 i { font-style: normal; font-size: 46px; line-height: 1; color: rgba(255,255,255,.16); }
.tbr-stars3 i:nth-child(2) { font-size: 58px; transform: translateY(-8px); }
.tbr-stars3 i.on { color: var(--sun); text-shadow: 0 0 22px rgba(255,198,46,.7); animation: tbr-star .55s var(--ease-back) both; }
.tbr-stars3 i:nth-child(2).on { animation-name: tbr-star2; }
@keyframes tbr-star { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes tbr-star2 { 0% { transform: translateY(-8px) scale(0) rotate(-40deg); opacity: 0; } 100% { transform: translateY(-8px) scale(1) rotate(0); opacity: 1; } }
.tbr-lvres p { margin: 6px 0 0; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.tbr-nonext { color: var(--sun) !important; }
@media (prefers-reduced-motion: reduce) { .tbr-node.cur, .tbr-stars3 i.on { animation: none; } }
.tbr-lvfoes-h small { display: block; margin: 2px 0 6px; color: #ff9b9b; font-weight: 800; font-size: 12px; }
.tbr-lvfoes { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tbr-foe { display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; border-radius: 999px; background: rgba(255,59,59,.1); border: 1px solid rgba(255,59,59,.25); font-size: 12.5px; font-weight: 700; }
.tbr-foe canvas { width: 30px; height: 30px; }

#tbrLvGoT{white-space:nowrap}

/* ---------- TBC Social : village, défis entre membres ---------- */
.tbr-tabs { grid-auto-flow: column; grid-auto-columns: 1fr; grid-template-columns: none; }
.tbr-tabs button { padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbr-duel { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(255,90,31,.22), rgba(255,198,46,.12)); border: 1px solid rgba(255,138,76,.5); display: grid; gap: 4px; animation: tbr-pop .5s var(--ease-back) both; }
.tbr-duel b { font-family: var(--display); font-size: 17px; }
.tbr-duel span { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.tbr-duel .tbr-ghost { margin-top: 6px; min-height: 42px; border-color: rgba(255,198,46,.5); color: var(--sun); }
.tbr-village { background: linear-gradient(160deg, rgba(34,197,94,.12), rgba(255,255,255,.05) 60%); border-color: rgba(34,197,94,.3); }
.tbr-vh { display: inline-flex; align-items: center; gap: 7px; }
.tbr-vh i { font-style: normal; }
.tbr-vlink { color: #6ee7a0; font-size: 13px; font-weight: 800; text-decoration: none; }
.tbr-vquest { display: grid; gap: 2px; padding: 11px 12px; border-radius: 14px; background: rgba(10,16,51,.45); border: 1px solid var(--line); }
.tbr-vquest small, .tbr-vbonus small { color: var(--ink-3); font-size: 11.5px; font-weight: 700; }
.tbr-vquest b { font-size: 14px; line-height: 1.3; }
.tbr-vquest span { color: var(--ink-2); font-size: 12px; font-weight: 600; margin-top: 2px; }
.tbr-vquest .tbr-bar i { background: linear-gradient(90deg, #22c55e, #6ee7a0); }
.tbr-vquest.done { border-color: rgba(34,197,94,.55); }
.tbr-vquest.done span { color: #6ee7a0; }
.tbr-vbonus { display: grid; gap: 6px; }
.tbr-vb { font-size: 12.5px; font-weight: 700; color: var(--ink-2); padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px dashed var(--line); }
.tbr-vb.on { color: #6ee7a0; border-style: solid; border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.1); }
.tbr-resvil { display: grid; gap: 8px; margin-top: 10px; }
.tbr-rv { text-align: center; font-size: 13.5px; font-weight: 800; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid var(--line); animation: tbr-rise .5s var(--ease-out) both; }
.tbr-rv.won { color: #8ff0b6; background: rgba(34,197,94,.13); border-color: rgba(34,197,94,.45); }
.tbr-vshare { border-color: rgba(34,197,94,.5); color: #6ee7a0; }
.tbr-play-duel { background: linear-gradient(180deg, #ffd34d, #ff9d2e); color: #2a1300; }
.tbr-play-duel.sent, .tbr-ghost.sent, .tbr-play.sent { opacity: .7; }
.tbr-shvil { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.35); margin-bottom: 10px; }
.tbr-shvil small { color: #8ff0b6; font-weight: 800; font-size: 12.5px; }
.tbr-shvil .tbr-play-sm { min-height: 48px; font-size: 15px; }
.tbr-search { height: 46px; min-height: 0; resize: none; margin-bottom: 10px; }
.tbr-duellist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; }
.tbr-duellist li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.05); }
.tbr-duellist li.empty { display: block; text-align: center; color: var(--ink-3); font-size: 13px; padding: 14px; background: none; }
.tbr-duellist .nm { display: grid; min-width: 0; }
.tbr-duellist .nm b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbr-duellist .nm small { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.tbr-duellist .tbr-ghost { min-height: 38px; padding: 0 14px; }
.tbr-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--flame); overflow: hidden; }
.tbr-av img { width: 100%; height: 100%; object-fit: cover; }
.tbr-boardnote { margin: -4px 0 12px; font-size: 12.5px; }
.tbr-boardnote a { color: #6ee7a0; font-weight: 800; }
.tbr-play.tbr-play-duel { flex-direction: column; gap: 2px; min-height: 66px; }
.tbr-play.tbr-play-duel span { font-size: 18px; line-height: 1.15; }
.tbr-play.tbr-play-duel small { opacity: .8; }
/* ---------- Multijoueur sur un téléphone ---------- */
.tbr-partybtn { gap: 8px; border-color: rgba(76,201,255,.45); color: #9ee3ff; }
.tbr-pnames { display: grid; gap: 8px; margin: 4px 0 8px; }
.tbr-pnames label { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; }
.tbr-pnames label span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: rgba(76,201,255,.18); color: #9ee3ff; }
.tbr-pnames .tbr-msg { height: 46px; min-height: 0; resize: none; margin: 0; font-size: 15px; }
.tbr-pnote { font-size: 12px; margin-bottom: 12px; }
.tbr-turn { text-align: center; display: grid; gap: 10px; }
.tbr-turn > small { color: #9ee3ff; font-weight: 800; font-size: 13px; }
.tbr-turn h3 { font-family: var(--display); font-size: 30px; margin: 0; }
.tbr-turnic { font-size: 46px; line-height: 1; animation: tbr-pop .5s var(--ease-back) both; }
.tbr-plb { min-height: 0; margin: 2px 0 6px; text-align: left; }
/* ---------- Duel en direct ---------- */
.tbr-livebtn { gap: 8px; border-color: rgba(255,90,31,.55); color: #ffb08a; }
.tbr-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; font-weight: 700; margin: 12px 0; }
.tbr-or::before, .tbr-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.tbr-join { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.tbr-join .tbr-msg { height: 48px; min-height: 0; resize: none; margin: 0; text-transform: uppercase; letter-spacing: 3px; font-weight: 800; font-size: 17px; text-align: center; }
.tbr-code { font-size: 46px !important; letter-spacing: 8px; color: var(--sun); }
.tbr-vs { position: absolute; z-index: 6; top: calc(var(--sat) + 104px); left: 12px; display: grid; padding: 6px 12px; border-radius: 14px; background: rgba(10,16,51,.72); border: 1px solid rgba(255,90,31,.6); pointer-events: none; }
.tbr-vs small { font-size: 11px; font-weight: 800; color: #ffb08a; }
.tbr-vs b { font-family: var(--display); font-size: 20px; }
.tbr-vs.done { border-color: var(--line); opacity: .75; }
