/* Hub web de GC Coach: solo lo que cambia respecto a la app (app.css se copia tal cual). */
.hub-off { display: none !important; }

.hub-account { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2, #b3bbb7);
  padding: 0 4px; white-space: nowrap; max-width: 200px; }
.hub-account span { overflow: hidden; text-overflow: ellipsis; }
.hub-account img { border-radius: 50%; flex: none; }
.menu-pop a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  color: inherit; text-decoration: none; font-size: 13px; }
.menu-pop a:hover, .menu-pop a:focus-visible { background: var(--hover); }

body.hub-out { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.hub-login { max-width: 460px; text-align: center; }
.hub-login h1 { font-size: clamp(24px, 4vw, 32px); line-height: 1.15; margin: 8px 0 12px; text-wrap: balance; }
.hub-login p { color: var(--text-2, #b3bbb7); line-height: 1.55; margin: 0 auto 22px; }
.hub-kicker { margin: 18px 0 0 !important; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent, #8bd450) !important; font-weight: 600; }
.hub-steam { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  border-radius: 10px; background: var(--accent, #8bd450); color: var(--accent-ink); font-weight: 650; text-decoration: none;
  transition: transform 160ms cubic-bezier(.23, 1, .32, 1); }
.hub-steam:active { transform: scale(.97); }
.hub-back { display: block; margin-top: 16px; font-size: 13px; color: var(--text-2, #b3bbb7); }

/* Clasificación: el nombre del piloto junto al tiempo. */
.lap-row .lp { flex: 1 1 auto; min-width: 0; font-size: var(--t12); font-weight: 500; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lap-row .lt .flag.imp { display: none; }
.lap-row { grid-template-columns: 20px minmax(0, 1fr) 50px; }
.lap-row .lbar { display: none; }
/* Lo que cambia datos se hace en GC Coach, no en el hub. */
#btnCorners, #cdRename, .lap-row .more { display: none !important; }
.hub-login > img { display: block; margin: 0 auto; }
.hub-login > img.hub-wm { width: min(320px, 80vw); height: auto; }

/* Cara a cara: tú contra el piloto de referencia. */
.h2h { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px 16px;
  padding: 14px 16px; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius, 12px);
  background: linear-gradient(90deg, color-mix(in srgb, var(--lap) 10%, transparent), transparent 40%, transparent 60%, color-mix(in srgb, var(--ref) 10%, transparent)), var(--panel); }
.h2h-side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.h2h-side.b { flex-direction: row-reverse; text-align: right; }
.h2h-side img, .h2h-ini { width: 40px; height: 40px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--lap); }
.h2h-side.b img, .h2h-side.b .h2h-ini { box-shadow: 0 0 0 2px var(--ref); }
.h2h-ini { display: grid; place-items: center; background: var(--panel-2); font-weight: 700; color: var(--text); }
.h2h-side > div { min-width: 0; display: flex; flex-direction: column; }
.h2h-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2h-name i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--accent-ink); background: var(--accent);
  border-radius: 999px; padding: 1px 6px; margin-left: 4px; vertical-align: 2px; }
.h2h-meta { font-size: 13px; color: var(--text-2); }
.h2h-meta b { color: var(--text); }
.h2h-side.none .h2h-name { color: var(--text-2); font-weight: 500; }
.h2h-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.h2h-vs { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.h2h-gap { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.h2h-gap.loss { color: var(--loss); } .h2h-gap.gain { color: var(--gain); }
.h2h-foot { grid-column: 1 / -1; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
@media (max-width: 560px) {
  .h2h { gap: 10px; padding: 12px; }
  .h2h-side { flex-direction: column; text-align: center; gap: 6px; }
  .h2h-side.b { flex-direction: column; text-align: center; }
  .h2h-side > div { align-items: center; }
}
.hub-pos { color: var(--accent); font-weight: 700; }

/* Cargando y avisos. */
.hub-loading { margin: 6px 10px; font-size: 13px; color: var(--muted); }
.hub-notice { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius, 12px); font-size: 14px; line-height: 1.5;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); color: var(--text-2); }
.hub-notice b { color: var(--text); display: block; margin-bottom: 2px; }

/* Un solo piloto: sin diferencias a cero que no dicen nada. */
.hub-alone .fig:has(#sGap), .hub-alone section[aria-labelledby="barsTitle"] { display: none; }

/* Móvil: pestañas en una línea con scroll y listas más cortas para llegar antes al análisis. */
@media (max-width: 1000px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs [role="tab"] { flex: none; }
  .combo-list { max-height: 148px; overflow-y: auto; }
  .lap-list { max-height: 156px; overflow-y: auto; }
  .side-block.grow { padding-bottom: 6px; }
}
.ref-pick.hub-ref-out { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: var(--t12); color: var(--muted);
  border-bottom: 1px solid var(--line); }
.ref-pick.hub-ref-out .select { flex: 1; min-width: 0; }

/* Seguir a un compañero: botón en el cara a cara y estrella en la clasificación. */
.h2h-fol { margin-left: 8px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-2); background: transparent;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 9px; cursor: pointer;
  transition: transform 160ms cubic-bezier(.23, 1, .32, 1), background-color .15s ease, color .15s ease; }
.h2h-fol:hover { color: var(--text); background: var(--hover); }
.h2h-fol:active { transform: scale(.97); }
.h2h-fol[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.lap-row .fol { display: inline-flex; color: #e7b93e; margin-left: 4px; vertical-align: -1px; }

/* Columna de juegos (GC Coach 0.1.0.85). En el hub no hay /api/gameicon (los iconos salen del exe instalado en el PC),
   así que cada juego se ve con su sigla en una ficha con un filete de color propio. El nombre completo va en el título. */
.hub .gr-foot { display: none; } /* directo y ajustes: solo en la app */
.hub .gr-ico:not(.img) { position: relative; background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.hub .gr-ico:not(.img)::after { content: ''; position: absolute; left: 9px; right: 9px; bottom: 6px; height: 3px; border-radius: 2px;
  background: var(--gr-tint, var(--line-2)); opacity: .9; }
.hub .gr-fb { font-size: 12.5px; letter-spacing: 0; color: var(--text); margin-top: -3px; }
.hub .gr-game:not([aria-pressed="true"]) .gr-fb { color: var(--text-2); }
.hub .gr-game[data-g="AC"] { --gr-tint: #d8483b; }
.hub .gr-game[data-g="ACEVO"] { --gr-tint: #e08a2c; }
.hub .gr-game[data-g="ACC"] { --gr-tint: #3c8ce0; }
.hub .gr-game[data-g="iRacing"] { --gr-tint: #8a6ee0; }
.hub .gr-game[data-g="AMS2"] { --gr-tint: #2fb59a; }
.hub .gr-game[data-g="LMU"] { --gr-tint: #d6c34a; }
@media (min-width: 721px) {
  .hub .gr-ico:not(.img) + .gr-name { display: none; } /* la sigla ya es el nombre corto */
  .hub .gr-game { padding: 7px 0; }
}
@media (max-width: 720px) {
  /* En el móvil la píldora ya lleva el nombre: la ficha se queda en un punto de color. */
  .hub .gr-ico:not(.img) { width: 8px; height: 8px; border-radius: 50%; background: var(--gr-tint, var(--muted)); box-shadow: none; margin-left: 6px; }
  .hub .gr-ico:not(.img)::after, .hub .gr-ico:not(.img) .gr-fb { display: none; }
}


/* Hub dentro de la web (desde el 27-nov): arriba la cabecera de GrassCutters (#gch, en Shadow DOM) y el juego se elige
   en su menú «Coach Hub», así que la columna de juegos de la app no se muestra. */
/* Ordenador: la página no se desplaza (lo hace <main> dentro del hub), así que el hub ocupa lo que deja la cabecera.
   app.css pone el body en bloque y .app a height:100%: con la cabecera encima, el final quedaba cortado.
   Móvil (≤ 820 px): se desplaza la página entera, como en la app. */
@media (min-width: 821px) {
  body.hub-site:not(.hub-out) { display: flex; flex-direction: column; height: 100%; }
  body.hub-site > #gch { flex: none; }
  body.hub-site .app { flex: 1 1 0; min-height: 0; height: auto; }
}
body.hub-site .game-rail, body.hub-site #gameBar { display: none !important; }
body.hub-site.has-rail .app { margin-left: 0; }
body.hub-site.has-rail .laps-panel { left: 0; width: min(400px, 100vw); }
body.hub-site.has-rail .picker { left: 50%; }
body.hub-site .topbar .brand-wm { display: none; }
body.hub-site.has-rail .topbar .brand { display: flex; }
body.hub-site.hub-out { display: flex; padding: 0; place-items: initial; }
body.hub-site.hub-out .hub-login { margin: auto; padding: 32px 24px; }
