/* Predict layout — two-column on desktop, stacked on mobile.
   The sidebar's height is decoupled from its content via an
   absolute-positioned inner wrapper, so the row height comes from
   the predict-main column on the left and the sidebar fills that
   height while its list scrolls internally. */
.predict-layout {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
}

.predict-main {
  flex: 1;
  min-width: 0;
}

/* Sidebar shell — relative anchor, takes the row height (= form
   column height). Has no flow children of its own. */
.predict-sidebar {
  position: relative;
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Sidebar inner — absolutely fills the shell so its content can't
   push the shell taller than the predict form. The list inside
   becomes the scrolling area. */
.predict-sidebar-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.predict-sidebar-inner > .sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 0.875rem 1rem 0.625rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Filtros por fecha */
.predict-sidebar-inner > .sidebar-filters {
  padding: 0.5rem 0.5rem 0.5rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

/* Select nativo, estilizado para que matchee el theme. */
.sidebar-filter-select {
  width: 100%;
  background: var(--input);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem 0.65rem;
  padding-right: 2rem;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a877c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 12px;
  transition: border-color 120ms;
}
.sidebar-filter-select:hover  { border-color: var(--line-strong); }
.sidebar-filter-select:focus  { border-color: var(--accent); }
.sidebar-filter-select option { background: var(--bg-2); color: var(--fg); }

.sidebar-filter-btn {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all 120ms;
  white-space: nowrap;
}

.sidebar-filter-btn:hover {
  color: var(--text-1);
  border-color: var(--border-hover);
}

.sidebar-filter-btn.-active {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
}

/* Header de sección dentro del sidebar (Ida / Vuelta / Jornada) */
.sidebar-section-header {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 0.625rem 0.75rem 0.25rem;
}

.sidebar-section-header:first-child {
  padding-top: 0.25rem;
}

/* Lista con scrollbar estilizada */
.predict-sidebar-inner > .sidebar-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;        /* allow the list to shrink and scroll */
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.predict-sidebar-inner > .sidebar-list::-webkit-scrollbar {
  width: 4px;
}

.predict-sidebar-inner > .sidebar-list::-webkit-scrollbar-track {
  background: transparent;
}

.predict-sidebar-inner > .sidebar-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.predict-sidebar-inner > .sidebar-list::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Mini match card */
.match-thumb {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text-2);
  transition: background 120ms, border-color 120ms, color 120ms;
}

.match-thumb:hover {
  background: var(--bg-raised);
  color: var(--text-1);
}

.match-thumb.-active {
  background: var(--bg-raised);
  border-color: var(--green);
  color: var(--text-1);
}

.match-thumb.-predicted > .thumb-check {
  color: var(--green);
}

.match-thumb > .thumb-number {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-3);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.match-thumb.-active > .thumb-number {
  color: var(--green);
}

.match-thumb > .thumb-body {
  flex: 1;
  min-width: 0;
}

.match-thumb > .thumb-body > .thumb-teams {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.match-thumb > .thumb-body > .thumb-teams > .thumb-flag {
  display: inline-flex;
  flex-shrink: 0;
}

.match-thumb > .thumb-body > .thumb-teams > .thumb-vs {
  font-size: 0.6875rem;
  color: var(--text-3);
  font-weight: 400;
}

.match-thumb > .thumb-body > .thumb-meta {
  font-size: 0.6875rem;
  color: var(--text-3);
  margin-top: 0.2rem;
}

.match-thumb > .thumb-body > .thumb-pred {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green);
  margin-top: 0.2rem;
}

.match-thumb > .thumb-check {
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* Mobile: sidebar goes below main content */
@media (max-width: 900px) {
  .predict-layout {
    flex-direction: column;
  }

  .predict-main {
    max-width: 100%;
    width: 100%;
  }

  .predict-sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }
  .predict-sidebar-inner {
    position: static;
    inset: auto;
  }

  .predict-sidebar-inner > .sidebar-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    max-height: 320px;
  }
}

@media (max-width: 480px) {
  .predict-sidebar-inner > .sidebar-list {
    grid-template-columns: 1fr;
    max-height: 260px;
  }
}

/* Navigation between matches */
.predict-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.predict-nav > .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-2);
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 150ms;
}

.predict-nav > .nav-link:hover {
  border-color: var(--green);
  color: var(--green);
}

.predict-nav > .nav-link.-disabled {
  opacity: 0.3;
  pointer-events: none;
}

.predict-nav > .counter {
  font-weight: 600;
  font-size: 0.9375rem;
}

/* Predict card */
.predict-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.predict-card > .header {
  padding: 1rem 0.875rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 640px) {
  .predict-card > .header {
    padding: 1.25rem 1.5rem;
  }
}

.predict-card > .header > .meta {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}

.predict-card > .header > .matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .predict-card > .header > .matchup {
    gap: 1.5rem;
  }
}

.predict-card > .header > .matchup > .team {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.predict-card > .header > .matchup > .team > .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.predict-card > .header > .matchup > .team > .name {
  font-weight: 700;
  font-size: 1rem;
}

@media (min-width: 640px) {
  .predict-card > .header > .matchup > .team > .name {
    font-size: 1.25rem;
  }
}

.predict-card > .header > .matchup > .team > .code {
  font-size: 0.75rem;
  color: var(--text-3);
}

.predict-card > .header > .matchup > .divider {
  font-size: 1.25rem;
  color: var(--text-3);
}

/* Body */
.predict-card > .body {
  padding: 1rem 0.875rem;
}

@media (min-width: 640px) {
  .predict-card > .body {
    padding: 1.5rem;
  }
}

.predict-card > .body .question {
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.predict-card > .body .locked-msg {
  text-align: center;
  padding: 2rem;
  color: var(--text-2);
}

/* Pick grid — 3 big buttons */
.pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}

.pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  cursor: pointer;
  transition: all 150ms;
  color: var(--text-2);
}

.pick-btn:hover {
  border-color: var(--green);
  color: var(--text-1);
}

.pick-btn.-selected {
  border-color: var(--green);
  background: var(--green-dim);
  color: var(--green);
}

.pick-btn > .team-name {
  font-weight: 700;
  font-size: 1rem;
}

.pick-btn > .label {
  font-size: 0.75rem;
  color: var(--text-3);
}

.pick-btn.-selected > .label {
  color: var(--green);
}

/* Score section */
.score-section {
  background: var(--bg-raised);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.score-section > .title {
  font-size: 0.9375rem;
  color: var(--text-2);
  margin-bottom: 0.75rem;
}

.score-section > .title > strong {
  color: var(--gold);
}

/* Main variant — score is the primary input */
.score-section.-main {
  background: var(--bg-raised);
  border: 2px solid var(--border);
  padding: 1.5rem 0.75rem 1.25rem;
}

@media (min-width: 640px) {
  .score-section.-main {
    padding: 2rem 1.5rem 1.5rem;
  }
}

.score-section.-main > .inputs > input {
  width: 60px;
  height: 60px;
  font-size: 1.625rem;
  border-width: 2px;
}

@media (min-width: 640px) {
  .score-section.-main > .inputs > input {
    width: 72px;
    height: 72px;
    font-size: 2rem;
  }
}

.score-section.-main > .inputs > .sep {
  font-size: 1.5rem;
}

@media (min-width: 640px) {
  .score-section.-main > .inputs > .sep {
    font-size: 1.75rem;
  }
}

.score-section.-main > .inputs > .team-label {
  font-size: 0.75rem;
  width: 36px;
}

@media (min-width: 640px) {
  .score-section.-main > .inputs > .team-label {
    font-size: 0.875rem;
    width: 44px;
  }
}

.score-section.-main > .hint {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-3);
}

.score-section.-main > .hint > strong {
  color: var(--text-2);
}

.score-section > .inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .score-section > .inputs {
    gap: 0.75rem;
    flex-wrap: nowrap;
  }
}

.score-section > .inputs > .team-label {
  font-size: 0.8125rem;
  color: var(--text-3);
  font-weight: 600;
  width: 36px;
}

.score-section > .inputs > .team-label.-right { text-align: right; }
.score-section > .inputs > .team-label.-left { text-align: left; }

.score-section > .inputs > input {
  width: 56px;
  height: 56px;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  color: var(--text-1);
  font-weight: 700;
  font-size: 1.5rem;
}

.score-section > .inputs > input:focus {
  outline: none;
  border-color: var(--green);
}

.score-section > .inputs > .sep {
  color: var(--text-3);
  font-weight: 700;
  font-size: 1.25rem;
}

/* Submit */
.submit-row {
  display: flex;
  justify-content: center;
}

.submit-btn {
  padding: 0.75rem 3rem;
  background: var(--green);
  color: var(--text-inv);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms;
}

.submit-btn:hover {
  background: var(--green-hover);
}

/* ─── Stats summary (tope de predict page) ─── */

.predict-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.predict-stats > .stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  text-align: center;
}

.predict-stats > .stat > .value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.predict-stats > .stat > .value.-exact  { color: var(--green); }
.predict-stats > .stat > .value.-result { color: var(--blue); }

.predict-stats > .stat > .value > .over {
  font-size: 1rem;
  color: var(--text-3);
  font-weight: 500;
}

.predict-stats > .stat > .label {
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

@media (max-width: 640px) {
  .predict-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Main panel: partido finalizado ─── */

.predict-card > .header > .score-final {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-1);
  padding: 0 1rem;
  line-height: 1;
}

.predict-card > .header > .score-final > .sep {
  color: var(--text-3);
  margin: 0 0.5rem;
}

.predict-card .result-summary {
  padding: 1.5rem;
  text-align: center;
}

.predict-card .result-summary > .your-pick {
  font-size: 1rem;
  color: var(--text-2);
  margin: 0 0 1rem;
}

.predict-card .result-summary > .your-pick > strong {
  color: var(--text-1);
  font-size: 1.125rem;
}

.predict-card .result-summary > .no-pick {
  color: var(--text-3);
  font-style: italic;
}

.predict-card .result-summary > .pts-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 500;
}

.predict-card .result-summary > .pts-badge.-exact {
  background: var(--green-dim);
  color: var(--green);
}

.predict-card .result-summary > .pts-badge.-result {
  background: var(--blue-dim, rgba(59, 130, 246, 0.15));
  color: var(--blue, #60a5fa);
}

.predict-card .result-summary > .pts-badge.-zero {
  background: var(--bg-hover);
  color: var(--text-3);
}

/* ─── Sidebar thumbs: finished states ─── */

.match-thumb.-finished {
  opacity: 0.9;
}

.match-thumb.-finished.-missed {
  opacity: 0.65;
}

.match-thumb > .thumb-body > .thumb-pred.-final {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  flex-wrap: wrap;
}

.match-thumb > .thumb-body > .thumb-pred.-final > .sep {
  color: var(--text-3);
}

.match-thumb > .thumb-pts {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-pill);
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.match-thumb > .thumb-pts.-exact {
  background: var(--green-dim);
  color: var(--green);
}

.match-thumb > .thumb-pts.-result {
  background: var(--blue-dim, rgba(59, 130, 246, 0.15));
  color: var(--blue, #60a5fa);
}

.match-thumb > .thumb-pts.-zero {
  background: var(--bg-hover);
  color: var(--text-3);
}
