/* TopBar Epitech commune (shared/topbar.js), la même sur le launcher, Epi Parcours, l’administration
   et les pages des activités : maquette « Parcours joueur – TopBar unique » validée le 19 octobre
   2026. Couleurs Pop Show fixes et police propre, pour ne rien hériter de la page qui l’accueille.
   Les pages prennent la largeur de la fenêtre : --tb-gutter et --tb-content sont aussi les marges
   et la largeur maximale du contenu des pages qui suivent la TopBar. */

@font-face { font-family: LauncherPop; src: url('/shared/brand/nunito-sans.ttf') format('truetype'); font-weight: 200 1000; font-display: swap; }

:root { --tb-gutter: clamp(16px, 2.8vw, 40px); --tb-content: 1760px; --tb-height: 88px; }

/* !important : le décor Pop Show d’Epi Parcours place chaque enfant de #app en relative, z-index 1 ;
   la TopBar reste collée en haut et son menu passe au-dessus des cartes. */
header.tb.tb {
  position: sticky !important; top: 0; z-index: 60 !important; display: block; flex: none; width: 100%; margin: 0;
  background: #013afb radial-gradient(circle, #ffffff21 2px, transparent 2.5px) 0 0 / 26px 26px;
  border-bottom: 4px solid #0b1a4d; color: #ffffff;
  font: 900 16px/1.2 LauncherPop, Plex, sans-serif; letter-spacing: normal; text-align: left; text-transform: none;
  -webkit-font-smoothing: antialiased; font-synthesis: none;
}
header.tb.tb.tb--flow { position: relative !important; }
.tb.tb *, .tb.tb *::before, .tb.tb *::after { box-sizing: border-box; }
.tb.tb a { text-decoration: none; }
.tb.tb img, .tb.tb svg { display: block; }
.tb.tb .tb-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.tb.tb .tb__in {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 20px; width: 100%;
  max-width: calc(var(--tb-content) + 2 * var(--tb-gutter)); min-height: 84px; margin: 0 auto; padding: 12px var(--tb-gutter);
}
.tb.tb .tb__brand { display: inline-flex; flex: none; padding: 8px 12px; background: #ffffff; border: 3px solid #0b1a4d; border-radius: 12px; box-shadow: 3px 3px 0 #0b1a4d; }
.tb.tb .tb__brand img { width: auto; height: 26px; }
.tb.tb .tb__nav { display: flex; flex: 1 1 auto; flex-wrap: nowrap; justify-content: center; gap: 8px; min-width: 0; }
.tb.tb .tb__nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 7px 16px; border: 3px solid transparent; border-radius: 20px;
  color: #ffffff; font-weight: 900; font-size: 15px; white-space: nowrap; transition: background-color 120ms;
}
.tb.tb .tb__nav a:hover { background: #ffffff26; color: #ffffff; }
.tb.tb .tb__nav a[aria-current] { background: #0b1a4d; color: #ffffff; border-color: #0b1a4d; }
.tb.tb .tb__nav a:focus-visible, .tb.tb .tb__brand:focus-visible, .tb.tb .tb__wallet a:focus-visible { outline: 3px solid #ff9d73; outline-offset: 3px; }

/* ---------- Éclats et plumes d’un joueur */
.tb.tb .tb__wallet { display: flex; align-items: center; gap: 10px; flex: none; }
.tb.tb :is(.shard-pill, .plume-pill) {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 8px;
  background: #ffffff; color: #0b1a4d; border: 3px solid #0b1a4d; border-radius: 999px; box-shadow: 0 3px 0 #0b1a4d;
  font-weight: 1000; font-size: 17px; white-space: nowrap;
}
.tb.tb :is(.shard-pill, .plume-pill)[hidden] { display: none; }
.tb.tb :is(.shard-pill, .plume-pill):hover { background: #fff4cc; color: #0b1a4d; }
.tb.tb .plume-pill { gap: 4px; padding-left: 6px; }
.tb.tb .plume-pill__icon { width: 30px; height: 30px; }
.tb.tb .plume-pill__unit { margin-left: 4px; }
.tb.tb .shard-pill__body { fill: #00f5ab; stroke: #0b1a4d; stroke-width: 2; stroke-linejoin: round; }
.tb.tb .shard-pill__facet { fill: none; stroke: #0b1a4d; stroke-width: 1.4; stroke-linejoin: round; }

/* ---------- Menu du profil */
.tb.tb .tb-profile { position: relative; flex: none; }
.tb.tb .tb-profile__toggle {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; max-width: 300px; margin: 0; padding: 5px 12px 5px 5px;
  background: #ffffff; color: #0b1a4d; border: 3px solid #0b1a4d; border-radius: 18px; box-shadow: 3px 3px 0 #0b1a4d;
  font: inherit; font-weight: 900; text-align: left; cursor: pointer;
  transition: background-color 120ms, transform 120ms cubic-bezier(.23, 1, .32, 1), box-shadow 120ms cubic-bezier(.23, 1, .32, 1);
}
.tb.tb .tb-profile__toggle:hover { background: #e6edff; }
.tb.tb .tb-profile__toggle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #0b1a4d; }
.tb.tb .tb-profile__toggle[aria-expanded="true"] { background: #ffd84d; }
.tb.tb .tb-profile__toggle:focus-visible, .tb.tb .tb-profile__menu :is(a, button):focus-visible { outline: 3px solid #ff9d73; outline-offset: 3px; }
.tb.tb .tb-avatar { flex: none; display: grid; place-items: center; width: 38px; height: 38px; background: #00f5ab; border: 3px solid #0b1a4d; border-radius: 12px; color: #0b1a4d; font-size: 15px; font-weight: 1000; letter-spacing: -.02em; }
.tb.tb .tb-avatar--lg { width: 52px; height: 52px; border-radius: 16px; font-size: 20px; }
.tb.tb .tb-role-student { background: #00f5ab; } .tb-role-animator { background: #ffd84d; } .tb-role-creator { background: #f59bee; } .tb-role-admin { background: #ff7859; } .tb-role-screen { background: #b5efff; }
.tb.tb .tb-profile__who { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.tb.tb .tb-profile__who b { overflow: hidden; font-size: 15px; font-weight: 1000; white-space: nowrap; text-overflow: ellipsis; }
.tb.tb .tb-profile__who small { margin-top: 2px; overflow: hidden; color: #3b4f86; font-size: 12.5px; font-weight: 850; white-space: nowrap; text-overflow: ellipsis; }
.tb.tb .tb-profile__caret { flex: none; transition: transform 160ms cubic-bezier(.23, 1, .32, 1); }
.tb.tb .tb-profile__toggle[aria-expanded="true"] .tb-profile__caret { transform: rotate(180deg); }
.tb.tb .tb-profile__dot { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; background: #ff7859; border: 3px solid #0b1a4d; border-radius: 50%; }
.tb.tb .tb-profile__menu {
  position: absolute; z-index: 70; top: calc(100% + 12px); right: 0; display: grid; gap: 12px; width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 110px); overflow: auto; padding: 16px;
  background: #ffffff; color: #0b1a4d; border: 4px solid #0b1a4d; border-radius: 22px; box-shadow: 8px 8px 0 #0b1a4d; font-weight: 700;
}
.tb.tb .tb-profile__menu[hidden] { display: none; }
.tb.tb .tb-profile__card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.tb.tb .tb-profile__card .tb-avatar--lg { grid-row: span 2; }
.tb.tb .tb-profile__card-text { display: flex; flex-direction: column; min-width: 0; }
.tb.tb .tb-profile__card-text b { font-size: 18px; font-weight: 1000; overflow-wrap: anywhere; }
.tb.tb .tb-profile__card-text span { color: #3b4f86; font-size: 13.5px; font-weight: 750; overflow-wrap: anywhere; }
.tb.tb .tb-role-chip { justify-self: start; padding: 3px 10px; border: 2px solid #0b1a4d; border-radius: 12px; font-size: 12.5px; font-weight: 1000; }
.tb.tb .tb-profile__level { display: grid; gap: 6px; padding: 12px 14px; background: #e6edff; border: 3px solid #0b1a4d; border-radius: 16px; }
.tb.tb .tb-profile__level div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tb.tb .tb-profile__level b { font-size: 16px; font-weight: 1000; }
.tb.tb .tb-profile__level div span, .tb.tb .tb-profile__level small { color: #3b4f86; font-size: 13px; font-weight: 850; }
.tb.tb .tb-profile__bar { display: block; height: 12px; overflow: hidden; background: #ffffff; border: 2px solid #0b1a4d; border-radius: 8px; }
.tb.tb .tb-profile__bar span { display: block; width: var(--tb-progress, 0%); height: 100%; background: #00e6a0; border-right: 2px solid #0b1a4d; }
.tb.tb .tb-profile__alert { display: block; padding: 10px 12px; background: #fff4cc; border: 3px solid #0b1a4d; border-radius: 14px; color: #0b1a4d; font-weight: 850; font-size: 14px; line-height: 1.3; }
.tb.tb .tb-profile__alert:hover { background: #ffe27a; color: #0b1a4d; }
.tb.tb .tb-profile__links { display: grid; gap: 4px; }
.tb.tb .tb-profile__links a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; color: #0b1a4d; }
.tb.tb .tb-profile__links a:hover { background: #e6edff; color: #0b1a4d; }
.tb.tb .tb-profile__links b { font-size: 15px; font-weight: 1000; }
.tb.tb .tb-profile__links small { color: #3b4f86; font-size: 13px; font-weight: 750; }
.tb.tb .tb-profile__badge { display: inline-grid; place-items: center; min-width: 24px; height: 22px; margin-left: 6px; padding: 0 6px; background: #ff7859; border: 2px solid #0b1a4d; border-radius: 999px; font-size: 12px; font-weight: 1000; vertical-align: 1px; }
.tb.tb .tb-profile__preview { display: grid; gap: 8px; padding: 12px; background: #f4f7ff; border: 3px solid #0b1a4d; border-radius: 16px; }
.tb.tb .tb-profile__preview > span { font-size: 13px; font-weight: 1000; }
.tb.tb .tb-profile__preview-links { display: flex; flex-wrap: wrap; gap: 6px; }
.tb.tb .tb-profile__preview-links a { padding: 5px 10px; background: #ffffff; border: 2px solid #0b1a4d; border-radius: 12px; color: #0b1a4d; font-size: 13px; font-weight: 900; }
.tb.tb .tb-profile__preview-links a[aria-current] { background: #ffd84d; }
.tb.tb .tb-profile__logout { min-height: 46px; margin: 0; padding: 8px 14px; background: #ffd0c4; border: 3px solid #0b1a4d; border-radius: 14px; box-shadow: 0 3px 0 #0b1a4d; color: #0b1a4d; font: inherit; font-weight: 1000; cursor: pointer; }
.tb.tb .tb-profile__logout:disabled { cursor: progress; opacity: .7; }

/* ---------- Liens d’une page partagée réservés à l’équipe (consoles, guides) : cachés à un joueur */
html:not([data-audience="team"]) [data-audience-only="team"] { display: none !important; }
html[data-audience="team"] [data-audience-only="player"] { display: none !important; }
/* Une page d’activité sous la TopBar ne répète ni le logo Epitech ni le retour aux jeux. */
html.has-topbar [data-topbar-duplicate] { display: none !important; }

/* ---------- Écrans moyens, tablette, téléphone */
@media (max-width: 1560px) {
  .tb.tb :is(.plume-pill__unit, .shard-pill__unit) { display: none; }
}
@media (max-width: 1360px) {
  .tb.tb .tb__in { gap: 14px; }
  .tb.tb .tb__nav { gap: 2px; }
  .tb.tb .tb__nav a { padding: 7px 11px; }
  .tb.tb .tb-profile__who { display: none; }
}
@media (max-width: 1100px) {
  :root { --tb-height: 140px; }
  .tb.tb .tb__in { flex-wrap: wrap; }
  .tb.tb .tb__nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .tb.tb .tb__nav::-webkit-scrollbar { display: none; }
  .tb.tb .tb__wallet { margin-left: auto; }
  .tb.tb .tb__wallet + .tb-profile, .tb.tb .tb__nav + .tb-profile { margin-left: auto; }
  .tb.tb .tb__wallet:has(> :not([hidden])) + .tb-profile { margin-left: 0; }
}
@media (max-width: 640px) {
  :root { --tb-height: 112px; }
  .tb.tb .tb__in { min-height: 0; gap: 8px; padding-top: 10px; padding-bottom: 8px; }
  .tb.tb .tb__brand { padding: 6px 8px; }
  .tb.tb .tb__brand img { height: 22px; }
  .tb.tb .tb__wallet { gap: 6px; }
  .tb.tb :is(.plume-pill, .shard-pill) { min-height: 40px; font-size: 15px; padding-right: 10px; }
  .tb.tb .tb-profile__toggle { min-height: 44px; padding: 3px; }
  .tb.tb .tb-profile__caret { display: none; }
  .tb.tb .tb__nav { gap: 14px; }
  .tb.tb .tb__nav a { min-height: 34px; padding: 2px 0; border: 0; border-radius: 0; font-size: 14px; }
  .tb.tb .tb__nav a:hover { background: transparent; }
  .tb.tb .tb__nav a[aria-current] { background: transparent; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 3px; }
  .tb.tb .tb-profile__menu { position: fixed; top: auto; right: 16px; bottom: 16px; left: 16px; width: auto; max-height: calc(100vh - 32px); }
}
/* Téléphone en paysage : une seule ligne basse, pour laisser la hauteur à l’activité. */
@media (max-height: 500px) {
  :root { --tb-height: 60px; }
  .tb.tb .tb__in { flex-wrap: nowrap; min-height: 0; gap: 10px; padding-top: 6px; padding-bottom: 6px; }
  .tb.tb .tb__brand { padding: 5px 8px; }
  .tb.tb .tb__brand img { height: 20px; }
  .tb.tb .tb__nav { order: 0; width: auto; flex: 1 1 auto; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .tb.tb .tb__nav a { min-height: 34px; padding: 4px 10px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .tb.tb *, .tb.tb *::before, .tb.tb *::after { transition: none !important; }
}
