/* ============================================================
   FEROCIA PLAYER PORTAL — el marco de la app
   Hitos 3 y 4 (14 de octubre)

   Lo que se repite en las pantallas de dentro: la cabecera, la barra
   de abajo en el teléfono, el pie, los paneles blancos, las pastillas,
   las opciones (género, nivel, temas) y las tablas.
   ============================================================ */

/* ── La cabecera (ya unido a su ficha) ── */
.pj-appbar, .pj-simplebar { background: var(--pj-night); border-bottom: 3px solid var(--pj-lime); position: relative; z-index: 5; }
.pj-appbar-in {
  max-width: 1200px; margin: 0 auto; padding: 0 24px; min-height: 76px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 36px;
}
.pj-appbar-logo, .pj-appbar-img { display: block; }
.pj-appbar-logo img, .pj-appbar-img { width: 132px; height: auto; display: block; }
.pj-me {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
  color: #fff; font-size: 14px; font-weight: 700; text-decoration: none;
  padding: 4px 6px 4px 4px; border-radius: 999px;
}
.pj-me:hover, .pj-me[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .08); }
.pj-me[aria-current="page"] .pj-avatar { box-shadow: 0 0 0 3px rgba(198, 242, 33, .35); }
.pj-simplebar-links { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.pj-simplebar-back { color: rgba(255, 255, 255, .8); font-size: 14px; font-weight: 700; text-decoration: none; }
.pj-simplebar-back:hover { color: #fff; }

/* Botón claro sobre fondo oscuro ("Sign out" en las franjas). */
.pj-band-btn {
  min-height: 40px; padding: 0 16px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px;
  background: transparent; color: rgba(255, 255, 255, .85); font: 700 13px 'Inter', sans-serif; cursor: pointer;
}
.pj-band-btn:hover { border-color: rgba(255, 255, 255, .5); color: #fff; }
.pj-band-btn:focus-visible { outline: 3px solid rgba(198, 242, 33, .5); outline-offset: 2px; }

/* Pantallas de dentro: el alto lo pone su contenido (hay cabecera y pie). */
.pj-screen[data-chrome="app"] { min-height: calc(100vh - 160px); }

/* ── La barra de abajo, sólo en el teléfono ── */
.pj-tabbar { display: none; }

/* ── El pie ── */
.pj-footer { border-top: 1px solid var(--pj-line); background: #fff; }
.pj-footer-in {
  max-width: 1200px; margin: 0 auto; padding: 22px 24px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--pj-muted);
}
.pj-footer-links { display: flex; gap: 18px; }
.pj-footer-links a { text-decoration: none; font-weight: 700; }

/* ── El contenido ── */
.pj-wrap { max-width: 1200px; margin: 0 auto; padding: 36px 24px 64px; display: flex; flex-direction: column; gap: 26px; }
.pj-wrap-md { max-width: 1000px; }
.pj-wrap-sm { max-width: 820px; gap: 20px; }
.pj-page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.pj-page-head-col { flex-direction: column; align-items: flex-start; gap: 6px; }
.pj-back { font-size: 13px; font-weight: 800; text-decoration: none; }
.pj-section-label { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--pj-muted); }
.pj-self-start { align-self: flex-start; }
.pj-center { justify-content: center; }
.pj-break { overflow-wrap: anywhere; }
.pj-empty { margin: 8px 0 14px; font-size: 14px; line-height: 1.55; font-weight: 500; color: var(--pj-muted); }
.pj-small { margin: 0; font-size: 13px; line-height: 1.55; font-weight: 500; color: var(--pj-muted); }
.pj-small-dark { color: #374151; }
.pj-lead-dark { color: var(--pj-soft); }

/* Paneles blancos. */
.pj-panel {
  background: #fff; border: 1px solid var(--pj-line); border-radius: 18px; padding: 24px 26px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.pj-panel-tight { padding: 24px; }
.pj-panel-tint { background: rgba(23, 76, 204, .05); border-color: rgba(23, 76, 204, .15); padding: 20px 22px; gap: 8px; }
.pj-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pj-panel-title { margin: 0; font-size: 18px; font-weight: 900; color: var(--pj-navy); }
.pj-panel-title-sm { font-size: 15px; }
.pj-panel-link { font-size: 13px; font-weight: 800; text-decoration: none; }

/* Botón mediano. */
.pj-btn-md { min-height: 48px; padding: 0 22px; font-size: 13px; }
.pj-btn-lime { background: var(--pj-lime); color: var(--pj-night); font-weight: 900; }
.pj-btn-lime:hover:not([disabled]) { background: #d4f752; color: var(--pj-night); }
.pj-form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ── Pastillas y etiquetas ── */
.pj-pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.pj-pill:empty { display: none; }
.pj-pill-ok { background: var(--pj-green-bg); color: var(--pj-green-tx); }
.pj-pill-gray { background: #EFEFEF; color: var(--pj-soft); }
.pj-pill-warn { background: #fde8d8; color: #9A3412; }
.pj-pill-live { background: rgba(36, 188, 150, .2); color: #5EE0BC; }
.pj-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-chips-center { justify-content: center; }
.pj-chip { padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .85); font-size: 12px; font-weight: 700; }
.pj-chip-lime { background: var(--pj-lime); color: var(--pj-night); font-size: 11px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase; }
.pj-lime { color: var(--pj-lime); }
.pj-orange { color: #F26024; }
.pj-green { color: var(--pj-green-tx); }
.pj-blue { color: var(--pj-blue); }
.pj-gold { color: #92400E; }

/* ── Campos que faltaban ── */
.pj-fieldset { border: none; margin: 0; padding: 0; min-width: 0; }
.pj-fieldset > legend { padding: 0; margin-bottom: 10px; }
.pj-fieldset[aria-invalid="true"] > legend { color: var(--pj-red); }
.pj-field-narrow { max-width: 360px; }
.pj-textarea {
  width: 100%; min-height: 160px; border: 1px solid var(--pj-field); border-radius: var(--pj-radius);
  padding: 14px 16px; background: #fff; resize: vertical;
  font: 500 15px/1.6 'Inter', sans-serif; color: var(--pj-ink);
}
.pj-textarea::placeholder { color: #9CA3AF; }
.pj-textarea:focus { outline: none; border-color: var(--pj-blue); box-shadow: 0 0 0 4px rgba(23, 76, 204, .12); }
.pj-textarea[aria-invalid="true"] { border-color: var(--pj-red); }

/* Teléfono con el +1 delante. */
.pj-phone {
  display: flex; height: 52px; border: 1px solid var(--pj-field); border-radius: var(--pj-radius);
  background: #fff; overflow: hidden;
}
.pj-phone:focus-within { border-color: var(--pj-blue); box-shadow: 0 0 0 4px rgba(23, 76, 204, .12); }
.pj-phone:has(input[aria-invalid="true"]) { border-color: var(--pj-red); }
.pj-phone-cc {
  display: flex; align-items: center; padding: 0 14px; border-right: 1px solid var(--pj-line);
  font-size: 16px; font-weight: 700; color: #374151; background: var(--pj-bg);
}
.pj-phone-in { flex: 1; min-width: 0; border: none; padding: 0 14px; font: 600 16px 'Inter', sans-serif; background: transparent; color: var(--pj-ink); }
.pj-phone-in:focus { outline: none; }

/* Opciones: género (dos botones) … */
.pj-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pj-choices-narrow { grid-template-columns: repeat(2, minmax(0, 180px)); }
.pj-choice {
  min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--pj-field); border-radius: var(--pj-radius); background: #fff;
  font-size: 15px; font-weight: 700; color: #374151; cursor: pointer;
}
.pj-choice input { accent-color: var(--pj-blue); margin: 0; width: 18px; height: 18px; }
.pj-choice:has(input:checked) { border: 1.5px solid var(--pj-blue); background: rgba(23, 76, 204, .06); color: var(--pj-blue); }
.pj-choice:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(23, 76, 204, .18); }
/* … el nivel (tarjetas) … */
.pj-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.pj-level {
  position: relative; padding: 16px; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--pj-field); border-radius: var(--pj-radius); background: #fff; cursor: pointer;
}
.pj-level-name { font-size: 15px; font-weight: 800; color: var(--pj-ink); }
.pj-level-desc { font-size: 12.5px; line-height: 1.45; font-weight: 500; color: var(--pj-muted); }
.pj-level:has(input:checked) { border: 1.5px solid var(--pj-blue); background: rgba(23, 76, 204, .06); }
.pj-level:has(input:checked) .pj-level-name { color: var(--pj-blue); }
.pj-level:has(input:checked) .pj-level-desc { color: #374151; }
.pj-level:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(23, 76, 204, .18); }
/* … y los temas de Help (cápsulas). */
.pj-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-topic {
  min-height: 44px; display: flex; align-items: center; padding: 0 16px;
  border: 1px solid var(--pj-field); border-radius: 999px; background: #fff;
  font-size: 14px; font-weight: 700; color: #374151; cursor: pointer;
}
.pj-topic:has(input:checked) { border: 1.5px solid var(--pj-blue); background: rgba(23, 76, 204, .06); color: var(--pj-blue); }
.pj-topic:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(23, 76, 204, .18); }

/* ── Filas de lista (escaleras, torneos) ── */
.pj-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid #F1F2F4; color: var(--pj-ink); text-decoration: none; }
a.pj-row:hover .pj-row-name { color: var(--pj-blue); }
.pj-row-badge {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; background: #F3F4F6; color: var(--pj-soft);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900;
}
.pj-row-badge.is-blue { background: rgba(23, 76, 204, .08); color: var(--pj-blue); }
.pj-row-trophy {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; background: #F3F4F6; color: var(--pj-soft);
  display: flex; align-items: center; justify-content: center;
}
.pj-row-trophy.is-gold { background: #FFB70B; color: #fff; }
.pj-ico { display: inline-flex; }
.pj-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pj-row-name { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.pj-row-sub { font-size: 12.5px; font-weight: 600; color: var(--pj-muted); }

/* ── Tabla de resultados ── */
.pj-table-scroll { position: relative; overflow-x: auto; margin: 0 -4px; }   /* relative: lo que es sólo para lectores de pantalla no se sale */
.pj-table { width: 100%; border-collapse: collapse; min-width: 520px; font-size: 14px; }
.pj-table th {
  padding: 10px 8px; text-align: left; font-size: 10.5px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--pj-muted);
}
.pj-table th:first-child, .pj-table td:first-child { padding-left: 4px; }
.pj-table td { padding: 14px 8px; border-top: 1px solid #F1F2F4; vertical-align: middle; }
.pj-th-right, .pj-td-score, .pj-td-res { text-align: right; }
.pj-td-date { font-weight: 700; color: #374151; white-space: nowrap; }
.pj-td-strong { font-weight: 700; }
.pj-td-soft { color: var(--pj-soft); }
.pj-td-score { font-weight: 800; white-space: nowrap; }
.pj-res {
  display: inline-flex; width: 28px; height: 28px; border-radius: 50%;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 900;
}
.pj-res.is-win { background: var(--pj-green-bg); color: var(--pj-green-tx); }
.pj-res.is-loss { background: #fde8d8; color: #9A3412; }

/* ── Lista de datos (My profile) ── */
.pj-dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px 28px; }
.pj-dl-item { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pj-dl dt { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--pj-muted); }
.pj-dl dd { margin: 0; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.pj-dd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Ajustes: icono gris. */
.pj-row-ico-gray { background: #F3F4F6; color: #374151; }

/* ── En el teléfono ── */
@media (max-width: 720px) {
  .pj-appbar-in { padding: 0 16px; min-height: 62px; }
  .pj-appbar-logo img, .pj-appbar-img { width: 112px; }
  .pj-appbar .pj-nav { display: none; }
  .pj-me-name { display: none; }
  .pj-me svg { display: none; }
  .pj-tabbar:not([hidden]) {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: #fff; border-top: 1px solid var(--pj-line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(8, 15, 46, .06);
  }
  .pj-tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 50px; justify-content: center;
    border-radius: 12px; color: var(--pj-muted); font-size: 11px; font-weight: 800; text-decoration: none;
  }
  .pj-tabbar a[aria-current="page"] { color: var(--pj-blue); background: rgba(23, 76, 204, .06); }
  body.pj-con-barra { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  body.pj-con-barra .pj-toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .pj-wrap { padding: 24px 16px 40px; gap: 20px; }
  .pj-panel { padding: 20px 18px; }
  .pj-footer-in { padding: 18px 16px; }
  .pj-choices-narrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Los resultados, como tarjetitas en vez de una tabla cortada. */
  .pj-table-scroll { overflow: visible; margin: 0; }
  .pj-table, .pj-table tbody { display: block; min-width: 0; }
  .pj-table thead { display: none; }
  .pj-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center;
    column-gap: 12px; row-gap: 2px; padding: 12px 0; border-top: 1px solid #F1F2F4;
  }
  .pj-table td, .pj-table td:first-child { padding: 0; border: 0; }
  .pj-td-date { grid-column: 1; grid-row: 1; font-size: 12px; color: var(--pj-muted); }
  .pj-td-strong { grid-column: 1; grid-row: 2; }
  .pj-td-soft { grid-column: 1; grid-row: 3; font-size: 13px; }
  .pj-td-score { grid-column: 2; grid-row: 1 / 4; }
  .pj-td-res { grid-column: 3; grid-row: 1 / 4; }
}
