/* Vista Predicciones — barras L/E/V, marcador estimado y análisis IA. */

.pred-view { display: flex; flex-direction: column; gap: 16px; }
.pred-header { display: flex; flex-direction: column; gap: 4px; }
.pred-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}
.pred-subtitle { color: var(--ink-3); font-size: 0.95rem; margin: 0; max-width: 62ch; }

.pred-list { display: flex; flex-direction: column; gap: 12px; }

.pred-card { padding: 14px 14px 12px; }
.pred-card__head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.pred-card__team { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.pred-card__name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink);
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.pred-card__mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pred-card__vs { font-family: var(--font-display); font-weight: 800; color: var(--ink-3); font-size: 0.8rem; }
.pred-card__when { font-size: 0.72rem; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.pred-card__toggle {
  margin-top: 12px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--hairline);
  background: var(--surface-soft);
  border-radius: var(--r-sm);
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.pred-card__toggle:hover { background: var(--surface-sunk); }

.pred-card__panel { display: none; margin-top: 12px; }
.pred-card__panel.is-open { display: block; }

/* ---- bloque de resultado ---- */
.pred-result { display: flex; flex-direction: column; gap: 12px; }

.pred-bar {
  display: flex;
  width: 100%;
  height: 30px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--surface-sunk);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.pred-bar__seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  transition: width var(--t-slow) var(--ease);
  min-width: 0;
  overflow: hidden;
}
.pred-bar__seg--home { background: linear-gradient(120deg, var(--blue), #2C7BE5); }
.pred-bar__seg--draw { background: var(--draw); }
.pred-bar__seg--away { background: linear-gradient(120deg, var(--green), #18A765); }

.pred-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.pred-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--ink-2); }
.pred-legend__item strong { font-variant-numeric: tabular-nums; color: var(--ink); }
.pred-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pred-dot--home { background: var(--blue); }
.pred-dot--draw { background: var(--draw); }
.pred-dot--away { background: var(--green); }

.pred-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.8rem; color: var(--ink-2); }
.pred-meta strong { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink); }
.pred-conf { padding: 1px 8px; border-radius: var(--r-pill); font-size: 0.72rem; font-weight: 700; }
.pred-conf--alta { background: #DCFCE7; color: #166534; }
.pred-conf--media { background: #FEF9C3; color: #854D0E; }
.pred-conf--baja { background: var(--surface-sunk); color: var(--ink-3); }

/* ---- análisis IA ---- */
.pred-ai { border-top: 1px solid var(--hairline); padding-top: 12px; }
.pred-ai__btn {
  padding: 8px 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.pred-ai__btn:disabled { opacity: 0.7; cursor: default; }
.pred-ai__text { font-size: 0.9rem; color: var(--ink-2); line-height: 1.5; }
.pred-ai__text p { margin: 0 0 8px; }
.pred-ai__text strong { color: var(--ink); }
.pred-ai__text ul { margin: 6px 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.pred-ai__off { color: var(--ink-3); font-style: italic; }
.pred-ai__date { font-size: .75rem; color: var(--ink-3); margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  .pred-bar__seg, .pred-card__toggle { transition: none !important; }
}

/* ===================== Toggle de modo ===================== */
.pred-modes { display: flex; gap: 6px; background: var(--surface-sunk); padding: 4px; border-radius: var(--r-pill); margin-bottom: 16px; }
.pred-mode { flex: 1; border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 0.85rem; color: var(--ink-3); padding: 9px; border-radius: var(--r-pill); cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.pred-mode.is-active { background: #fff; color: var(--brand-1); box-shadow: var(--shadow-sm); }

/* Sub-toggle dentro de "Predicción" (Por partido | Del torneo) */
.pred-submodes { display: inline-flex; gap: 4px; background: var(--surface-sunk); padding: 3px; border-radius: var(--r-pill); margin-bottom: 14px; }
.pred-submode { border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 0.8rem; color: var(--ink-3); padding: 6px 14px; border-radius: var(--r-pill); cursor: pointer; }
.pred-submode.is-active { background: #fff; color: var(--brand-1); box-shadow: var(--shadow-sm); }

/* Recibimiento en Mi quiniela (recién llegado sin picks) */
.q-welcome { background: linear-gradient(120deg, color-mix(in srgb, var(--brand-1) 8%, #fff), #fff); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 14px; }
.q-welcome__title { display: block; font-family: var(--font-display); font-weight: 800; font-size: .95rem; color: var(--ink); margin-bottom: 6px; }
.q-welcome__steps { margin: 0; padding-left: 18px; font-size: .84rem; color: var(--ink-2); line-height: 1.5; }

/* CTA al pie del sandbox de Predicción (pasar a competir) */
.q-sandbox-cta { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; background: var(--surface-soft); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 14px; margin-top: 16px; }
.q-sandbox-cta strong { font-size: .92rem; color: var(--ink); }
.q-sandbox-cta span { font-size: .82rem; color: var(--ink-2); margin-bottom: 8px; }

/* Sub-encabezado de quinielas públicas dentro de "Tus quinielas" */
.q-pools__sub { font-size: .9rem; font-weight: 800; color: var(--ink); margin: 16px 0 4px; }
.q-pools__public { margin-top: 8px; }

/* Intro por pestaña: explica el rol de cada modo (pronóstico vs quiniela vs pools) */
.pred-intro { display: flex; flex-direction: column; gap: 3px; background: var(--surface-soft); border: 1px solid var(--hairline); border-left: 3px solid var(--brand-1); border-radius: var(--r-md); padding: 11px 14px; margin-bottom: 16px; }
.pred-intro__title { font-family: var(--font-display); font-weight: 800; font-size: .92rem; color: var(--ink); }
.pred-intro__desc { font-size: .82rem; line-height: 1.45; color: var(--ink-2); }
.pred-intro__desc strong { color: var(--ink); }

/* ===================== Quiniela ===================== */
.q-note { background: var(--warn, #F59E0B); background: linear-gradient(120deg,#FFF7ED,#FEF3C7); border: 1px solid #FDE68A; color: #7C5710; border-radius: var(--r-md); padding: 12px 14px; font-size: 0.82rem; line-height: 1.45; margin-bottom: 14px; }
.q-note strong { color: #92400E; }
.q-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-bottom: 12px; }
.q-fill { border: 0; background: var(--grad-hero); color: #fff; border-radius: var(--r-pill); font: inherit; font-weight: 800; font-size: 0.8rem; padding: 8px 16px; cursor: pointer; box-shadow: var(--shadow-sm); }
.q-fill:hover { filter: brightness(1.05); }
.q-fill:disabled { opacity: .6; }
.q-surprise { border: 1px solid var(--brand-1); background: var(--surface); color: var(--brand-1); border-radius: var(--r-pill); font: inherit; font-weight: 800; font-size: 0.8rem; padding: 7px 14px; cursor: pointer; }
.q-surprise:hover { background: var(--surface-soft); }
.q-reset { border: 1px solid var(--hairline); background: var(--surface); border-radius: var(--r-pill); font: inherit; font-weight: 600; font-size: 0.8rem; color: var(--ink-2); padding: 7px 14px; cursor: pointer; }
.q-reset:hover { background: var(--surface-soft); }

.q-champion { display: flex; align-items: center; gap: 14px; background: var(--grad-trionda, var(--grad-brand)); color: #fff; border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-md); margin-bottom: 18px; }
.q-champion__label { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .92; }
.q-champion__name { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; line-height: 1.1; }

.q-section { margin-bottom: 22px; }
.q-section__title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--ink); margin: 0 0 12px; }

/* Bracket: columnas por ronda con scroll horizontal */
.q-bracket {
  --bgap: 26px;          /* separación entre columnas = ancho del conector */
  --line: var(--hairline);
  display: flex;
  align-items: stretch;  /* todas las columnas igual alto -> alinea el árbol */
  gap: var(--bgap);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.q-bcol { flex: 0 0 150px; width: 150px; display: flex; flex-direction: column; }
.q-bcol--champ { flex: 0 0 130px; width: 130px; }
.q-bcol__title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); text-align: center; margin-bottom: 8px; flex: 0 0 auto; }
.q-bcol__body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-around; }
.q-bslot { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; position: relative; }

/* conector ⊐ entrante: une los dos cruces de la ronda previa con este */
.q-bcol:not(:first-child) .q-bslot::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--bgap));
  width: var(--bgap);
  top: 25%;
  bottom: 25%;
  border: 2px solid var(--line);
  border-left: 0;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  pointer-events: none;
}
/* pequeño tramo que conecta este cruce a la línea vertical */
.q-bcol:not(:first-child) .q-bslot::after {
  content: '';
  position: absolute;
  left: calc(-1 * var(--bgap) / 2);
  width: calc(var(--bgap) / 2);
  top: 50%;
  height: 2px;
  background: var(--line);
  pointer-events: none;
}

.q-bmatch { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--shadow-sm); position: relative; z-index: 1; }
.q-bchamp { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: var(--grad-trionda, var(--grad-brand)); color: #fff; border-radius: var(--r-md); padding: 12px 8px; box-shadow: var(--shadow-md); position: relative; z-index: 1; }
.q-bchamp img { width: 26px; height: 26px; object-fit: contain; }
.q-bchamp__name { font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; line-height: 1.1; }
.q-bteam { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: transparent; font: inherit; padding: 7px 8px; cursor: pointer; color: var(--ink-2); border-bottom: 1px solid var(--hairline); }
.q-bteam:last-child { border-bottom: 0; }
.q-bteam img { width: 18px; height: 18px; object-fit: contain; flex: 0 0 auto; }
.q-bteam__name { flex: 1; min-width: 0; font-size: 0.74rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.q-bteam__prob { font-size: 0.66rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.q-bteam.is-win { background: rgba(79,70,229,.08); color: var(--ink); font-weight: 700; }
.q-bteam.is-win .q-bteam__name { font-weight: 800; }
.q-bteam:not(.is-win) { opacity: .72; }

/* Grupos editables */
.q-groups { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 760px) { .q-groups { grid-template-columns: 1fr 1fr; } }
.q-group { padding: 14px; }
.q-group__title { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; margin: 0 0 10px; }
.q-standings { overflow-x: auto; }
.q-st__head, .q-st__row { display: grid; grid-template-columns: 16px minmax(96px,1fr) repeat(8, 22px); align-items: center; gap: 2px; font-size: 0.68rem; min-width: 280px; }
.q-st__head { color: var(--ink-3); font-weight: 700; padding: 0 0 5px; border-bottom: 1px solid var(--hairline); text-align: center; }
.q-st__head span:nth-child(2) { text-align: left; }
.q-st__row { padding: 5px 0; border-bottom: 1px solid var(--surface-soft); text-align: center; font-variant-numeric: tabular-nums; }
.q-st__row span { color: var(--ink-2); }
.q-st__pos { color: var(--ink-3); font-weight: 700; }
.q-st__team { display: flex; align-items: center; gap: 6px; min-width: 0; }
.q-st__name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-st__pts { font-weight: 800; color: var(--ink); }
.q-st__row.is-adv { background: rgba(22,163,74,.08); }
.q-st__row.is-adv .q-st__pos { color: var(--win, #16A34A); }
.q-st__row.is-third .q-st__pos::after { content: '³'; }

.q-editor { margin-top: 10px; }
.q-editor summary { cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--brand-1); }
.q-edit { display: grid; grid-template-columns: 1fr 34px 12px 34px 1fr; align-items: center; gap: 4px; padding: 5px 0; }
.q-edit__name { font-size: 0.74rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-edit__name--h { text-align: right; }
.q-edit__score { width: 34px; text-align: center; border: 1px solid var(--hairline); border-radius: 6px; padding: 4px 0; font: inherit; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.q-edit__score:disabled { background: var(--surface-soft); color: var(--ink-3); }
.q-edit__sep { text-align: center; color: var(--ink-3); }
.q-edit.is-real .q-edit__name { color: var(--ink); font-weight: 600; }

/* Candado al kickoff: el pick se cierra cuando el partido arranca */
.q-edit.is-locked { opacity: 0.92; }
.q-edit__lock { grid-column: 1 / -1; text-align: center; font-size: 0.66rem; color: var(--ink-3); letter-spacing: 0.02em; }
.q-edit__pick { grid-column: 1 / -1; text-align: center; font-size: 0.7rem; font-weight: 600; color: var(--brand-1); }

/* Probabilidades */
.q-probs__hint { font-size: 0.74rem; color: var(--ink-3); margin: -6px 0 10px; }
.q-probs { display: flex; flex-direction: column; gap: 7px; }
.q-prob { display: grid; grid-template-columns: 20px minmax(90px,1.2fr) 1fr 42px; align-items: center; gap: 8px; }
.q-prob__name { font-size: 0.82rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-prob__bar { height: 9px; background: var(--surface-sunk); border-radius: var(--r-pill); overflow: hidden; }
.q-prob__fill { display: block; height: 100%; background: var(--grad-brand); border-radius: var(--r-pill); }
.q-prob__val { font-size: 0.78rem; font-weight: 800; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { .pred-mode, .q-reset { transition: none !important; } }

/* A1: top-3 marcadores + margen "gana por 2+" */
.pred-meta__scores em { font-style: normal; color: var(--ink-3); font-size: .72rem; font-variant-numeric: tabular-nums; }
.pred-meta__scores { font-variant-numeric: tabular-nums; }
.pred-margin {
  margin: 8px 0 0; font-size: .82rem; color: var(--ink-2);
  background: var(--surface-soft); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); padding: 7px 11px; display: inline-block;
}
.pred-margin strong { color: var(--green, #0A8754); font-variant-numeric: tabular-nums; }

/* ===================== Fase C: cuenta + tabla global ===================== */
.q-user {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  padding: 12px 14px; margin-bottom: 14px;
}
.q-user__avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--hairline); }
.q-user__avatar--ph { display: grid; place-items: center; background: var(--grad-hero); color: #fff; font-weight: 800; }
.q-user__body { flex: 1; min-width: 0; }
.q-user__name { font-weight: 700; font-size: .9rem; color: var(--ink); }
.q-user__score { font-size: .82rem; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: 1px; }
.q-user__score strong { color: var(--red); font-family: var(--font-display); }
.q-user__save { font-size: .72rem; color: var(--ink-3); flex: none; }
/* CTA invitado */
.q-user--out { background: var(--surface-soft); }
.q-user__cta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.q-user__cta strong { font-size: .92rem; color: var(--ink); }
.q-user__cta span { font-size: .8rem; color: var(--ink-2); line-height: 1.4; }
.q-user__login {
  flex: none; background: var(--grad-hero); color: #fff; border: 0; border-radius: var(--r-pill);
  font-weight: 800; font-size: .82rem; padding: 9px 18px; cursor: pointer; box-shadow: var(--shadow-sm);
}

.q-leaderboard { display: flex; flex-direction: column; gap: 4px; }
.q-lb__row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--r-sm); border: 1px solid transparent;
}
.q-lb__row:nth-child(odd) { background: var(--surface-soft); }
.q-lb__row.is-me { border-color: var(--red); background: var(--live-soft); }
.q-lb__rank { width: 22px; text-align: center; font-weight: 800; color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; }
.q-lb__avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--hairline); }
.q-lb__avatar--ph { display: grid; place-items: center; background: var(--surface-sunk); color: var(--ink-2); font-weight: 700; font-size: .8rem; }
.q-lb__id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.q-lb__name { min-width: 0; font-weight: 600; font-size: .88rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-lb__break { font-size: .72rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.q-lb__pts { font-size: .85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; flex: none; }
.q-lb__pts strong { color: var(--red); font-family: var(--font-display); }
.q-lb__legend { font-size: .74rem; color: var(--ink-3); margin: 0 0 8px; line-height: 1.4; }
.q-lb__legend strong { color: var(--ink-2); font-family: var(--font-display); }

/* ===================== Fase D: Quinielas (pools) ===================== */
.pools-tip { font-size: .82rem; color: var(--ink-2); background: var(--surface-soft); border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 8px 11px; margin: 0 0 14px; }
.pools-tip strong { color: var(--ink); }

.pool-join-card {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--hairline); border-left: 4px solid var(--accent, var(--green));
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.pool-join-card strong { color: var(--ink); font-size: .92rem; }
.pool-join-card span { color: var(--ink-2); font-size: .85rem; }
.pool-join-card__ok { color: var(--green); font-weight: 700; font-size: .9rem; flex: 1; }
.pool-join-card__btn { margin-left: auto; background: var(--accent, var(--green)); color: #fff; border: 0; border-radius: var(--r-pill); font-weight: 800; font-size: .82rem; padding: 9px 18px; cursor: pointer; }

.pool-actions { display: grid; gap: 10px; margin-bottom: 18px; }
@media (min-width: 600px) { .pool-actions { grid-template-columns: 1fr 1fr; } }
.pool-action { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 12px; box-shadow: var(--shadow-sm); }
.pool-action__label { width: 100%; font-weight: 700; font-size: .82rem; color: var(--ink); }
.pool-action__input { flex: 1; min-width: 0; border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 9px 11px; font: inherit; font-size: .88rem; }
.pool-action__input:focus { outline: 2px solid var(--brand-1); outline-offset: 1px; }
.pool-action__btn { flex: none; background: var(--grad-hero); color: #fff; border: 0; border-radius: var(--r-pill); font-weight: 800; font-size: .82rem; padding: 9px 16px; cursor: pointer; }
.pool-action__btn:disabled { opacity: .6; }
.pool-action__msg { width: 100%; font-size: .8rem; color: var(--ink-2); min-height: 1em; }
.pool-action__msg strong { color: var(--red); font-family: var(--font-display); letter-spacing: .04em; }

.pool-row { display: flex; align-items: center; gap: 8px; width: 100%; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 8px 10px 8px 14px; margin-bottom: 8px; transition: box-shadow var(--t-fast) var(--ease); }
.pool-row:hover { box-shadow: var(--shadow-md); }
.pool-row__open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.pool-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

/* Compartir quiniela: enlace de invitación + copiar */
.pool-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; width: 100%; }
.pool-share__url { flex: 1; min-width: 0; font-size: .76rem; color: var(--ink-2); background: var(--surface-sunk, #EEF1F4); border-radius: var(--r-sm); padding: 6px 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pool-share__btn { flex: none; background: var(--brand-1); color: #fff; border: 0; border-radius: var(--r-pill); font-weight: 800; font-size: .74rem; padding: 7px 12px; cursor: pointer; white-space: nowrap; }
.pool-share__btn:disabled { opacity: .5; cursor: default; }
.pool-share__btn.is-done { background: var(--green, #0A8754); }
.pool-join-banner { background: var(--surface-soft); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 10px 12px; font-size: .85rem; color: var(--ink-2); margin-bottom: 12px; }
.pool-join-banner.is-ok { background: color-mix(in srgb, var(--green, #0A8754) 10%, #fff); color: var(--green, #0A8754); border-color: transparent; }
.pool-join-banner.is-err { background: color-mix(in srgb, var(--red, #E4002B) 8%, #fff); color: var(--red, #E4002B); border-color: transparent; }

/* Panel de administración del pool (dueño) + salir (miembro) */
.pool-admin { margin-top: 16px; border-top: 1px solid var(--hairline); padding-top: 14px; }
.pool-admin__summary { cursor: pointer; font-weight: 800; font-size: .9rem; color: var(--ink); list-style: none; }
.pool-admin__summary::-webkit-details-marker { display: none; }
.pool-admin__row { display: flex; gap: 8px; margin-top: 12px; }
.pool-admin__row .pool-action__input { flex: 1; }
.pool-admin__label { font-weight: 700; font-size: .8rem; color: var(--ink-2); margin: 14px 0 6px; }
.pool-admin__members { display: flex; flex-direction: column; gap: 6px; }
.pool-admin__member { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface-soft); border-radius: var(--r-sm); padding: 7px 10px; font-size: .86rem; }
.pool-admin__kick { background: none; border: 1px solid var(--hairline); color: var(--loss, #DC2626); border-radius: var(--r-pill); font-weight: 700; font-size: .72rem; padding: 4px 10px; cursor: pointer; }
.pool-admin__empty { font-size: .8rem; color: var(--ink-3); margin: 0; }
.pool-admin__delete { width: 100%; margin-top: 16px; background: none; border: 1px solid var(--loss, #DC2626); color: var(--loss, #DC2626); border-radius: var(--r-pill); font-weight: 800; font-size: .82rem; padding: 9px; cursor: pointer; }
.pool-admin__delete:hover { background: var(--loss, #DC2626); color: #fff; }
.pool-admin__leave { width: 100%; background: none; border: 1px solid var(--hairline); color: var(--ink-2); border-radius: var(--r-pill); font-weight: 700; font-size: .82rem; padding: 9px; cursor: pointer; }
.pool-row__name { font-weight: 700; font-size: .92rem; color: var(--ink); }
.pool-row__meta { font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pool-row__tag { display: inline-block; margin-right: 6px; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: var(--r-pill); }
.pool-row__tag--tenant { background: var(--brand-1); color: #fff; }
.pool-row__tag--public { background: var(--green, #0A8754); color: #fff; }
.pool-row__tag--private { background: var(--surface-sunk, #EEF1F4); color: var(--ink-2); }
.pool-row__tag--owner { background: transparent; color: var(--ink-3); border: 1px solid var(--hairline); }
.pool-row__rank { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--red); flex: none; font-variant-numeric: tabular-nums; }

/* Selector de visibilidad al crear (privada vs pública) */
.pool-vis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.pool-vis__opt { display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.pool-vis__opt.is-active { border-color: var(--brand-1); background: color-mix(in srgb, var(--brand-1) 6%, #fff); }
.pool-vis__name { font-weight: 800; font-size: .82rem; color: var(--ink); }
.pool-vis__hint { font-size: .7rem; color: var(--ink-3); line-height: 1.2; }

/* Directorio público: botón de unirse en cada fila */
.pool-row--public { cursor: default; }
.pool-row--public:hover { transform: none; box-shadow: none; }
.pool-row__join { flex: none; background: var(--grad-hero); color: #fff; border: 0; border-radius: var(--r-pill); font-weight: 800; font-size: .76rem; padding: 7px 14px; cursor: pointer; }
.pool-row__join:disabled { opacity: .6; }
.pool-row__join.is-member { background: var(--surface-sunk, #EEF1F4); color: var(--ink-2); }

.pool-sheet { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(12,16,25,.45); backdrop-filter: blur(2px); }
@media (min-width: 600px) { .pool-sheet { align-items: center; } }
.pool-sheet__card { width: 100%; max-width: 520px; max-height: 82vh; overflow: auto; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-lg); }
@media (min-width: 600px) { .pool-sheet__card { border-radius: var(--r-lg); } }
.pool-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; position: sticky; top: 0; background: var(--surface); }
.pool-sheet__head h3 { font-family: var(--font-display); font-size: 1.1rem; }
.pool-sheet__close { width: 32px; height: 32px; border-radius: 50%; color: var(--ink-3); font-size: 15px; cursor: pointer; }
.pool-sheet__close:hover { background: var(--surface-soft); color: var(--ink); }
.pool-sheet__body { padding: 6px 14px 22px; }

/* ===== ¿Qué tan fino es el motor? (scorecard) ===== */
.pred-scorecard { padding: 14px 16px; margin-bottom: 14px; }
.pred-scorecard__head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 10px;
}
.pred-scorecard__head .gz-ico { color: var(--brand-1); }
.pred-scorecard__model { margin-left: auto; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pred-scorecard__cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.pred-scorecard__col h4 { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.pred-scorecard__col h4 em { font-style: normal; font-weight: 600; color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.pred-scorecard__stats { display: flex; flex-wrap: wrap; gap: 8px; }
.pred-scorecard__stat {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  min-width: 64px;
}
.pred-scorecard__stat b { font-family: var(--font-display); font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pred-scorecard__stat span { font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.pred-scorecard__empty { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.pred-scorecard__foot { margin: 10px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
@media (max-width: 640px) {
  .pred-scorecard__cols { grid-template-columns: 1fr; }
}
