:root {
  --bg: #f5f1e8;
  --ink: #15221f;
  --muted: #65706b;
  --line: #d8d0c2;
  --panel: #fffaf1;
  --accent: #0d6b57;
  --accent-2: #b4233a;
  --gold: #d7a934;
  --blue: #1f5f8b;
  --tenant-tint-rgb: 13, 107, 87;
  --decor-local-1: url("/prode-static/th.webp");
  --decor-local-2: url("/prode-static/OIP.webp");
  --decor-local-3: url("/prode-static/descargar.webp");
  --decor-web-1: url("https://upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Lionel-Messi-Argentina-2022-FIFA-World-Cup.jpg/500px-Lionel-Messi-Argentina-2022-FIFA-World-Cup.jpg");
  --decor-web-2: url("/prode-static/OIP.webp");
  --decor-web-3: url("/prode-static/descargar.webp");
  --shadow: 0 18px 45px rgba(33, 29, 22, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #fff8ea 0%, var(--bg) 38%, #eef4f1 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  isolation: isolate;
}

body[data-tenant] {
  background:
    radial-gradient(circle at top left, rgba(var(--tenant-tint-rgb), 0.20), transparent 34rem),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, white) 0%, var(--bg) 42%, color-mix(in srgb, var(--accent) 8%, white) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url("/prode-static/descargar.webp");
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  filter: blur(2px) saturate(1.05);
  transform: scale(1.02);
  pointer-events: none;
}

body>* {
  position: relative;
  z-index: 1;
}

body[data-auth-gate="global"] .topbar,
body[data-auth-gate="global"] .summary-band,
body[data-auth-gate="global"] .brand-watermark,
body[data-auth-gate="global"] main>.view:not(#lobby),
body[data-auth-gate="global"] #lobby>.section-head,
body[data-auth-gate="global"] #globalTournamentLobby,
body[data-auth-gate="global"] #globalSession {
  display: none !important;
}

body[data-auth-gate="global"] #lobby {
  display: block;
}

body[data-auth-gate="global"] #globalLogin {
  position: fixed;
  inset: 0;
  z-index: 1200;
  margin: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.88), rgba(255, 255, 255, 0.92)),
    url("/prode-static/descargar.webp") center / cover;
}

.brand-watermark {
  position: fixed;
  left: 50%;
  /* Lo empuja al medio */
  transform: translateX(-50%);
  /* Lo centra perfectamente sobre su propio eje */
  bottom: 14px;
  z-index: 20;
  display: block;
  width: clamp(86px, 10vw, 132px);
  opacity: 1;
  filter: none;
  transition: opacity 0.2s ease, filter 0.2s ease;
  pointer-events: auto;
}

.brand-watermark:hover {
  opacity: 1;
  filter: none;
}

body[data-tenant] .brand-watermark {
  left: 50%;
  transform: translateX(-50%);
  bottom: 104px;
  /* Lo sube un poquito más cuando estás dentro de un torneo de empresa */
  z-index: 35;
  width: clamp(72px, 7vw, 98px);
  opacity: 1;
  pointer-events: auto;
}

.brand-watermark img {
  display: block;
  width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.95);
}

button.secondary {
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, white);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 28px clamp(16px, 4vw, 48px) 18px;
  z-index: 100;
}

body[data-tenant] .topbar {
  margin-bottom: 22px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 74%, var(--ink)));
  color: white;
  box-shadow: var(--shadow);
}

body[data-tenant] .topbar p,
body[data-tenant] .eyebrow {
  color: color-mix(in srgb, white 82%, var(--panel));
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.brand-description {
  max-width: 560px;
  margin: 10px 0 0;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 3.5vw, 2.8rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

p {
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  background: rgba(255, 250, 241, 0.8);
  border: 1px solid var(--line);
  color: var(--ink);
}

.tab.is-active {
  background: var(--accent);
  color: white;
}

body[data-tenant] .tab {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  color: white;
}

body[data-tenant] .tab.is-active {
  background: white;
  color: var(--accent);
}

main {
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto 48px;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.summary-band div {
  position: relative;
  min-height: 128px;
  overflow: hidden;
  padding: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--panel)), var(--panel));
  isolation: isolate;
}

.summary-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.22;
  filter: blur(2px) saturate(1.1);
  transform: scale(1.04);
  pointer-events: none;
}

.summary-band span,
.summary-band strong {
  position: relative;
  z-index: 1;
}

.summary-band span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.summary-band strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.home-matches-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 16px;
}

.home-rules-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.45;
}

.home-status-card {
  min-height: 132px;
}

.home-empty {
  align-self: center;
  margin: 8px 0;
  color: var(--ink);
  font-weight: 750;
  text-align: center;
}

.home-fixture-line {
  display: grid;
  /* CAMBIO CLAVE: Cambiamos 32px por auto para que se estire según el marcador */
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  font-weight: 900;
}

.home-fixture-line b {
  color: var(--ink);
  text-align: center;
  /* NUEVO: Evita que el resultado se parta en dos renglones */
  white-space: nowrap;
  /* NUEVO: Le da un respiro a los costados para que no se pegue a las banderas */
  padding: 0 5px;
}

.home-fixture-line .team-badge {
  display: flex;
  width: 100%;
  justify-content: center;
}

.home-fixture-line .flag {
  object-fit: cover !important;
  object-position: center !important;
}

.home-rules-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(33, 29, 22, 0.10);
}

.home-rules-panel h2,
.home-rules-panel p {
  margin: 0;
}

.home-rules-panel h2 {
  font-size: 1.2rem;
}

.home-rules-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.home-rules-panel button {
  min-width: 118px;
}

.home-install-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(33, 29, 22, 0.10);
}

.home-install-logo {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.home-install-logo img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.home-install-panel h2,
.home-install-panel p {
  margin: 0;
}

.home-install-panel h2 {
  font-size: 1.15rem;
}

.home-install-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.home-install-steps {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.4;
}

.home-install-steps span {
  font-weight: 900;
}

.match-schedule {
  display: block;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.group-match .match-schedule {
  grid-column: 1 / -1;
}

body[data-tenant] .tournament-admin-only,
body[data-tenant] #tournamentList {
  display: none;
}

/* Avatar button for user session */
.avatar-button {
  width: 40px;
  height: 40px;
  padding: 4px;
  border-radius: 10px;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(16, 16, 16, 0.08);
  cursor: pointer;
}

.avatar-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 7px;
}

/* Small modal panel used for the session menu */
.modal-panel.small {
  width: 280px;
  max-width: calc(100% - 32px);
}

.session-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 18px;
}

.session-menu-actions .secondary {
  text-align: left;
}

.session-menu-actions .danger {
  background: #b4233a;
  color: white;
  border: 0;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.info-table td {
  padding: 8px 6px;
  vertical-align: middle;
}

.info-table input {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

/* Dropdown anchored to topbar avatar */
.session-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.session-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(16, 16, 16, 0.12);
  padding: 8px;
  z-index: 9999;
}

.session-dropdown .session-dropdown-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
}

.session-dropdown .secondary {
  width: 100%;
  text-align: left;
}

.dropdown-info-panel {
  padding: 8px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}



.lock-banner,
.live-status,
.empty-live,
.form-status,
.phase-status {
  margin: 18px 0;
  border: 1px solid #efd38a;
  border-radius: 8px;
  background: #fff4cc;
  color: #5f4410;
  padding: 14px 16px;
  font-weight: 850;
}

.predictor-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.real-match-top-controls {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 10px;
  margin: 0 0 10px;
}

.real-match-top-controls[hidden] {
  display: none;
}

.real-match-top-controls .real-match-actions {
  justify-content: flex-start;
  margin: 0;
}

.predictor-subtab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 9px 14px;
  font-weight: 850;
}

.predictor-subtab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.real-matches-panel {
  display: grid;
  gap: 12px;
  margin: 12px 0 18px;
}

.real-match-save-panel[hidden] {
  display: none;
}

.real-match-save-panel #saveRealMatchPredictions {
  min-width: 190px;
  min-height: 48px;
  box-shadow: 0 10px 22px rgba(12, 112, 77, 0.20);
}

.real-match-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 14px;
}

.real-match-card.is-locked {
  opacity: 0.76;
}

.real-match-head,
.real-match-teams,
.real-match-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.real-match-head {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.real-match-teams {
  justify-content: center;
}

.real-match-score {
  display: flex;
  align-items: center;
  gap: 8px;
}

.real-match-score input {
  width: 62px;
  text-align: center;
}

.real-match-score .score-wrapper {
  width: 58px;
  flex: 0 0 58px;
}

.real-match-score .score-wrapper input {
  width: 100%;
}

.real-match-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 24px 0 16px;
  position: sticky;
  bottom: 12px;
  z-index: 20;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.section-head.compact {
  margin-top: 34px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.player-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.payment-gate {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 240px) minmax(260px, 360px);
  align-items: center;
  gap: 18px;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.payment-gate[hidden] {
  display: none;
}

.payment-gate h2 {
  margin-bottom: 8px;
}

.payment-gate strong {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 1.25rem;
}

.payment-qr {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  font-weight: 850;
  padding: 12px;
}

.payment-qr img {
  width: min(210px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
}

.payment-form {
  display: grid;
  gap: 12px;
}

.company-login,
.company-areas,
.global-login {
  position: relative;
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 18px;
  overflow: hidden;
  isolation: isolate;
}

.company-login {
  position: fixed;
  inset: 0;
  z-index: 1000;
  place-items: center;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(50, 50, 50, 0.92), rgba(99, 16, 9, 0.92)),
    url("/prode-static/descargar.webp") center / cover;
  border: 0;
  padding: 24px;
}

.company-login-card {
  width: min(100%, 420px);
  border: 1px solid rgba(50, 50, 50, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 45px rgba(20, 15, 12, 0.28);
  padding: 34px;
  backdrop-filter: blur(10px);
}

.login-brand-logo {
  display: block;
  width: 148px;
  max-width: 62%;
  height: auto;
  margin: 0 auto 18px;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
}

.company-login-card .login-kicker {
  margin: 0 0 4px;
  color: #631009;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

.company-login-card h2 {
  margin: 0 0 10px;
  color: #2c3e50;
  font-size: 1.65rem;
  text-align: center;
}

.company-login-card p {
  margin: 0 0 20px;
  color: #6f6259;
  text-align: center;
  font-weight: 700;
}

.company-login-card label {
  color: #5f625f;
  font-weight: 800;
}

.company-login-card input {
  min-height: 50px;
  border-color: transparent;
  background: #f7f3eb;
  color: #323232;
}

.company-login-card input::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, white);
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  width: 100%;
  padding-right: 46px;
}

.password-toggle,
.company-login-card .password-toggle,
.modal-panel .password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5f625f;
  font-size: 1rem;
  line-height: 1;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: rgba(99, 16, 9, 0.08);
  filter: none;
}

.password-toggle.is-visible {
  background: rgba(99, 16, 9, 0.12);
  color: #631009;
}

.company-login-card button:not(.secondary) {
  width: 100%;
  background: #631009;
  color: #ffffff;
  min-height: 48px;
}

.company-login-card .login-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.company-login-card .login-actions button {
  width: 100%;
  min-height: 48px;
}

.company-login-card .login-home-link {
  margin-top: 10px;
  text-align: center;
}

.company-login-card .login-home-link a {
  color: var(--muted);
  font-size: 0.85rem;
}

.company-login-card .password-toggle {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  background: transparent;
  color: #5f625f;
}

.company-login-card .login-create-toggle,
.company-login-card .login-forgot-toggle {
  width: 100%;
  justify-content: center;
  background: transparent;
  border-color: rgba(99, 16, 9, 0.22);
  color: #631009;
}

.company-login-card .login-forgot-toggle {
  min-height: 40px;
  border-color: rgba(99, 16, 9, 0.34);
  background: #fff8ec;
  color: #631009;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.company-login::before,
.company-areas::before,
.global-login::before {
  background-image: var(--decor-web-1);
  background-position: 76% center;
  opacity: 0.08;
}

.company-login>*,
.company-areas>*,
.global-login>* {
  position: relative;
  z-index: 1;
}

.company-login-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}

.company-session {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, white);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 9%, white);
  padding: 12px 14px;
}

.company-session span {
  color: var(--muted);
  font-weight: 800;
}

.tournament-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.tournament-form button {
  align-self: end;
}

.tournament-list,
.leaderboard-table {
  display: grid;
  gap: 10px;
  flex-wrap: wrap;
}

.tournament-card,
.leaderboard-panel,
.leaderboard-row,
.leaderboard-head {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
  isolation: isolate;
}

.tournament-card::before {
  background-image: var(--decor-web-2);
  background-position: 70% center;
  opacity: 0.10;
}

.leaderboard-panel::before {
  background-image: var(--decor-web-3);
  background-position: center;
  opacity: 0.08;
}

.tournament-card,
.leaderboard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.tournament-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.button-link {
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, white);
  border-radius: 6px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 850;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.lobby-list {
  margin-top: 18px;
}

.lobby-admin-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.lobby-card.is-locked {
  opacity: 0.86;
}

.tournament-results {
  margin-top: 28px;
}

.results-admin {
  margin-top: 18px;
}

.admin-dashboard,
.admin-panel,
.admin-users {
  display: grid;
  gap: 14px;
}

.admin-global-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.admin-diagnostics {
  display: grid;
  gap: 16px;
}

.admin-diagnostic-summary {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.admin-diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.admin-diagnostic-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.admin-diagnostic-card h3,
.admin-diagnostic-card p {
  margin: 0;
}

.admin-diagnostic-card small,
.admin-diagnostic-card p {
  color: var(--muted);
}

.admin-diagnostic-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.admin-diagnostic-card dl div {
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 6%, white);
  padding: 9px;
}

.admin-diagnostic-card dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-diagnostic-card dd {
  margin: 2px 0 0;
  color: var(--accent2);
  font-size: 1.15rem;
  font-weight: 900;
}

.admin-diagnostic-recent {
  display: grid;
  gap: 10px;
}

.admin-user-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(140px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.admin-user-filters label {
  margin: 0;
}

.admin-user-filters input,
.admin-user-filters select {
  min-height: 38px;
}

.admin-user-filters strong {
  align-self: center;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .admin-user-filters {
    grid-template-columns: 1fr;
  }
}

.admin-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
}

.admin-subtab {
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, white);
  background: color-mix(in srgb, var(--accent) 10%, white);
  color: var(--accent);
}

.admin-subtab.is-active {
  background: var(--accent);
  color: white;
}

.danger {
  border-color: color-mix(in srgb, #9f1d1d 36%, var(--line));
  color: #9f1d1d;
}

.danger:hover {
  background: color-mix(in srgb, #9f1d1d 10%, white);
}

.profile-card {
  max-width: 400px !important;
  width: 90%;
  border-radius: 16px !important;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  padding: 0 !important;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--ink); /* Usa el color oscuro que ya tenés en el prode */
  color: #ffffff;
}

.profile-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.profile-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.avatar-container {
  width: 110px;
  height: 110px;
  border-radius: 12px; /* Cuadrado con bordes redondeados */
  overflow: hidden;
  border: 3px solid var(--accent);
  background: #f8fafc;
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-container img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Mantiene la proporción para que no se estire */
}

.btn-change-avatar {
  background: transparent;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  transition: opacity 0.2s;
}

.btn-change-avatar:hover { opacity: 0.8; }

.profile-info-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-item label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.readonly-field {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  font-size: 1rem;
  cursor: not-allowed;
}

.btn-secondary-profile {
  width: 100%;
  padding: 12px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-profile:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.profile-border-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.border-option {
  width: 92px;
  min-height: 46px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.border-option.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, white);
}

.border-option:disabled {
  cursor: not-allowed;
  opacity: 1;
  background: #fff;
}

.border-option.is-locked .border-option-preview {
  filter: grayscale(0.15);
}

.border-option-preview {
  width: 30px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid #cbd5e1;
  display: block;
  background: #f8fafc;
}

.border-option-preview.border-none {
  border-color: #cbd5e1;
  box-shadow: inset 0 0 0 1px #eef2f7;
}

.border-option-preview.border-gold {
  border-color: #d7a934;
  background: linear-gradient(135deg, #fff7cc, #d7a934);
  box-shadow: 0 0 0 2px rgba(215, 169, 52, 0.32), 0 0 12px rgba(215, 169, 52, 0.6);
}

.border-option-preview.border-neon {
  border-color: #00ffcc;
  background: linear-gradient(135deg, #e6fffb, #00ffcc);
  box-shadow: 0 0 0 2px rgba(0, 255, 204, 0.24), 0 0 12px rgba(0, 255, 204, 0.7);
}

.border-option-preview.border-fire {
  border-color: #ff4500;
  background: linear-gradient(135deg, #ffe0b2, #ff4500);
  box-shadow: 0 0 0 2px rgba(255, 69, 0, 0.24), 0 0 12px rgba(255, 140, 0, 0.72);
}

.border-option-text {
  display: block;
  font-size: 0.7rem;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}

.profile-border-legend {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.pw-input {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s;
}

.pw-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 14px;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(150px, 0.85fr) minmax(140px, 0.75fr) minmax(130px, 0.65fr) minmax(230px, 1fr);
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  padding: 12px;
}

.admin-user-row.is-pending {
  border-color: color-mix(in srgb, var(--gold) 60%, var(--line));
  background: color-mix(in srgb, var(--gold) 10%, white);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, white);
}

.status-badge.status-pending {
  color: #7a5200;
  background: #fff1bf;
}

.status-badge.status-rejected {
  color: #9f1d1d;
  background: #ffe0e0;
}

.request-actions {
  flex-wrap: wrap;
}

.admin-user-row span,
.admin-user-row small {
  min-width: 0;
}

.admin-user-row strong,
.admin-user-row small {
  display: block;
  overflow-wrap: anywhere;
}

.admin-user-row small {
  color: var(--muted);
  font-weight: 700;
}

.admin-user-row b,
.admin-user-row em {
  font-style: normal;
  font-weight: 900;
}

.inline-check {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 8px;
}

.inline-check input {
  width: auto;
  min-height: 0;
}

.admin-user-actions {
  display: flex;
  gap: 8px;
}

.admin-user-actions button {
  flex: 1 1 0;
  padding: 0 10px;
}

.home-games {
  margin-top: 24px;
}

.game-center {
  margin-top: 0;
}

.game-center-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.game-center-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 82%, white);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 10px;
}

.daily-games {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
}

.game-card {
  position: relative;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 16px;
  overflow: hidden;
}

.game-card.is-completed> :not(.game-completed-panel) {
  opacity: 0.28;
  filter: saturate(0.8);
  pointer-events: none;
}

.game-completed-panel {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 22px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(var(--tenant-tint-rgb), 0.16), rgba(255, 255, 255, 0.9)),
    rgba(255, 255, 255, 0.82);
  border: 2px solid color-mix(in srgb, var(--accent) 38%, white);
}

.game-completed-badge {
  justify-self: center;
  width: max-content;
  border-radius: 999px;
  background: #237a57;
  color: white;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-completed-panel strong {
  color: var(--ink);
  font-size: 1.35rem;
}

.game-completed-panel small {
  color: var(--muted);
  font-weight: 800;
}

.game-card h3,
.game-card p {
  margin: 0;
}

.custom-match-card.is-locked {
  background: color-mix(in srgb, var(--panel) 78%, #f1f1f1);
}

.custom-match-card.is-locked input,
.custom-match-card.is-locked select {
  opacity: 0.62;
}

.match-timing {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.game-shirt-frame {
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 9%, white);
  overflow: hidden;
}

.game-shirt-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  width: 154px;
  min-height: 124px;
  border-radius: 6px 6px 14px 14px;
  color: var(--shirt-secondary);
  font-weight: 900;
  background: var(--shirt-primary);
  box-shadow: 0 14px 24px rgba(33, 29, 22, 0.18);
}

.game-shirt-placeholder.shirt-stripes {
  background: repeating-linear-gradient(90deg, var(--shirt-primary) 0 24px, var(--shirt-secondary) 24px 48px);
}

.game-shirt-placeholder.shirt-center {
  background: linear-gradient(90deg, var(--shirt-secondary) 0 28%, var(--shirt-primary) 28% 72%, var(--shirt-secondary) 72%);
}

.game-shirt-placeholder::before,
.game-shirt-placeholder::after {
  content: "";
  position: absolute;
  top: 18%;
  width: 18%;
  height: 42%;
  border-radius: 8px;
  background: var(--shirt-primary);
}

.game-shirt-placeholder::before {
  left: 18%;
  transform: rotate(18deg);
}

.game-shirt-placeholder::after {
  right: 18%;
  transform: rotate(-18deg);
}

.game-shirt-placeholder strong {
  position: relative;
  z-index: 1;
  font-size: 58px;
  line-height: 1;
}

.game-shirt-placeholder small {
  position: relative;
  z-index: 1;
  max-width: 70%;
  color: currentColor;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.shirt-neck {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 22px;
  border-radius: 0 0 999px 999px;
  background: rgba(255, 255, 255, 0.9);
}

.camisetadle-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.camisetadle-form .letter-guess:first-child {
  grid-column: 1 / -1;
}

.letter-guess {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.letter-guess legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.letter-grid,
.wordle-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.letter-grid input {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.letter-gap {
  width: 14px;
  height: 34px;
}

.letter-grid input.hit {
  background: #237a57;
  border-color: #237a57;
  color: white;
}

.letter-grid input.near {
  background: #d7a934;
  border-color: #d7a934;
  color: #1d1d1d;
}

.letter-grid input.miss {
  background: #e8e2d8;
  color: var(--muted);
}

.game-guess-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.stadium-guess-form .letter-guess {
  grid-column: 1 / -1;
}

.stadium-guess-form button {
  justify-self: end;
}

.game-result {
  min-height: 22px;
  color: var(--muted);
  font-weight: 800;
}

.stadium-visual {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 9%, white);
  overflow: hidden;
}

.stadium-visual span {
  display: block;
  height: 70%;
  border: 2px solid color-mix(in srgb, var(--accent) 58%, white);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 20%, white) 0 8px, rgba(255, 255, 255, 0.7) 8px 16px);
  transform: translateY(22px);
}

.stadium-visual span:nth-child(2) {
  height: 92%;
  transform: translateY(8px);
}

.stadium-clues {
  display: grid;
  gap: 8px;
}

.stadium-clues p {
  border: 1px solid color-mix(in srgb, var(--accent) 18%, white);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, white);
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 800;
}

.feedback-game-form {
  display: grid;
  gap: 10px;
}

.feedback-rating {
  display: grid;
  grid-template-columns: repeat(5, minmax(38px, 1fr));
  gap: 8px;
}

.feedback-rating input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.feedback-rating span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 82%, white);
  font-weight: 900;
  cursor: pointer;
}

.feedback-rating input:checked+span {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, white);
  color: var(--accent2);
}

.feedback-scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.feedback-comment {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.feedback-response-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.feedback-response-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 64px minmax(180px, 2fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 12px;
}

.feedback-response-row span {
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 13%, white);
  color: var(--accent2);
  font-weight: 900;
  padding: 7px 10px;
  text-align: center;
}

.feedback-response-row p {
  margin: 0;
}

.game-completed-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, white);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, white);
  padding: 12px;
}

.game-completed-inline span {
  color: var(--accent2);
  font-weight: 900;
}

.admin-theme-form,
.admin-games-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-theme-form .wide,
.admin-games-form .wide {
  grid-column: span 4;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(50, 50, 50, 0.46);
}

.modal-panel {
  width: min(100%, 520px);
  max-height: min(760px, 92vh);
  overflow: auto;
  border: 1px solid #d8c8ad;
  border-radius: 12px;
  background: #fff8ec;
  box-shadow: 0 24px 80px rgba(99, 16, 9, 0.24);
  padding: 18px;
}

.verification-code-panel {
  width: min(100%, 420px);
}

.verification-code-panel .section-head {
  position: static;
  margin-top: 0;
}

.verification-code-form input {
  min-height: 54px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 4px;
}

.verification-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.verification-actions button {
  width: 100%;
}

.icon-close {
  align-self: start;
}

.tournament-card h3,
.leaderboard-head h3 {
  margin: 0 0 4px;
}

.tournament-card p,
.leaderboard-head p {
  margin: 0;
}

.tournament-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.leaderboard-panel {
  padding: 14px;
}

.leaderboard-row {
  position: relative; /* Clave para poder centrar los puntos flotando */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(1px);
  border-radius: 8px; 
  flex-wrap: wrap;
}

.leaderboard-row b {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  flex-shrink: 0;
  margin-right: 12px;
}

.leaderboard-row span {
  display: grid;
  gap: 2px;
  font-weight: 900;
  flex: 1; 
  text-align: left;
}

.leaderboard-row small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.leaderboard-row strong {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent-2);
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.6); 
  padding: 2px 8px;
  border-radius: 6px;
  z-index: 2;
}

.leaderboard-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 800;
  flex: 1; 
  text-align: right;
}

.current-user-rank-card {
  position: sticky;
  top: 8px;
  z-index: 12;
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 10px;
  margin-bottom: 4px;
  border: 2px solid rgba(42, 157, 143, 0.68);
  border-radius: 8px;
  background: rgba(232, 255, 249, 0.98);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(6px);
}

.current-user-rank-card > small {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.current-user-rank-summary {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.current-user-rank-summary b {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}

.current-user-rank-summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--ink);
  font-weight: 900;
}

.current-user-rank-summary strong {
  color: var(--accent-2);
  white-space: nowrap;
}

.current-user-rank-summary em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

textarea {
  min-height: 118px;
  padding: 10px 12px;
  resize: vertical;
}

.custom-template-field {
  grid-column: span 2;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.group-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
  box-shadow: 0 12px 30px rgba(33, 29, 22, 0.08);
  overflow: hidden;
  isolation: isolate;
}

.group-card::before,
.custom-match-card::before,
.match-card::before,
.thirds-panel::before,
.tournament-card::before,
.leaderboard-panel::before,
.live-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--decor-local-1);
  background-size: cover;
  background-position: center;
  opacity: 0.16;
  filter: blur(2px) saturate(1.12);
  transform: scale(1.04);
  pointer-events: none;
}

.group-card::after,
.custom-match-card::after,
.match-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(var(--tenant-tint-rgb), 0.18), transparent 18%, transparent 82%, rgba(var(--tenant-tint-rgb), 0.16)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.92));
  pointer-events: none;
}

.match-card.has-flag-bg::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.80), rgba(255, 255, 255, 0.96) 42%, rgba(255, 255, 255, 0.96) 58%, rgba(255, 255, 255, 0.80)),
    var(--team-flag-left, none),
    var(--team-flag-right, none);
  background-repeat: no-repeat;
  background-size: 100% 100%, 52% auto, 52% auto;
  background-position: center, left center, right center;
  opacity: 0.74;
}

.group-card>*,
.custom-match-card>*,
.match-card>*,
.thirds-panel>*,
.tournament-card>*,
.leaderboard-panel>*,
.live-card>* {
  position: relative;
  z-index: 1;
}

.groups-grid .group-card:nth-child(3n + 1)::before {
  background-image: var(--decor-local-1);
}

.groups-grid .group-card:nth-child(3n + 2)::before {
  background-image: var(--decor-web-2);
}

.groups-grid .group-card:nth-child(3n + 3)::before {
  background-image: var(--decor-web-3);
}

.tournament-card::before {
  background-image: var(--decor-web-2);
  background-position: 70% center;
  opacity: 0.10;
}

.leaderboard-panel::before {
  background-image: var(--decor-web-3);
  background-position: center;
  opacity: 0.08;
}

.custom-sheet {
  display: grid;
  gap: 14px;
}

.custom-sheet[hidden] {
  display: none;
}

.custom-title {
  align-items: end;
}

.custom-title label {
  min-width: min(320px, 100%);
}

.custom-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-teams span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 7px 10px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.custom-fixtures {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 12px;
}

.custom-match-card {
  position: relative;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
  overflow: hidden;
  isolation: isolate;
}

.custom-match-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 12px 56px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.custom-match-line input {
  text-align: center;
  font-weight: 900;
}

.custom-match-line b {
  text-align: center;
  color: var(--muted);
}

.group-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, var(--ink)));
  color: white;
  font-weight: 900;
}

.group-title span {
  color: #f1c85f;
  font-size: 0.8rem;
}

.group-title>span {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 78%;
}

.round button.score-btn.up {
  width: 47px;
}

.round button.score-btn.down {
  width: 47px;
}

.standings-panel {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch; /* Suaviza el scroll en iOS */
}
/* Distribución: 6 grupos por fila en móviles, 4 en escritorio */
.standings-grid {
    display: grid;
    /* En móviles (pantallas pequeñas), definimos 6 columnas */
    grid-template-columns: repeat(6, 200px); 
    gap: 10px;
    padding: 10px;
}

.group-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    font-size: 0.8rem; /* Tamaño optimizado para leer bien en móvil */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mini-standings-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  padding: 10px 0 4px;
}

.standings-group-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(20, 95, 82, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(242, 249, 247, 0.86)),
    var(--decor-local-1) center / cover;
  box-shadow: 0 10px 24px rgba(26, 41, 36, 0.10);
  padding: 10px;
}

.standings-group-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #d6b16a);
  opacity: 0.9;
}

.standings-group-card h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 950;
}

.standings-group-card h4::after {
  content: "4 equipos";
  border-radius: 999px;
  background: rgba(20, 95, 82, 0.10);
  color: var(--muted);
  padding: 2px 6px;
  font-size: 0.56rem;
  font-weight: 900;
}

.standings-group-card table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 5px;
  font-size: 0.68rem;
}

.standings-group-card th {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 950;
  text-transform: uppercase;
}

.standings-group-card th,
.standings-group-card td {
  padding: 3px 4px;
  text-align: center;
}

.standings-group-card th:nth-child(2),
.standings-group-card td:nth-child(2) {
  text-align: left;
}

.standings-group-card tbody tr {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 1px rgba(20, 95, 82, 0.07);
}

.standings-group-card tbody td:first-child {
  border-radius: 7px 0 0 7px;
  color: var(--accent);
  font-weight: 950;
}

.standings-group-card tbody td:last-child {
  border-radius: 0 7px 7px 0;
}

.standings-group-card tbody td:nth-child(2) {
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}

.standings-group-card tbody td:nth-child(3) {
  font-weight: 950;
}

.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: inherit;
}

.team-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.flag,
.flag-placeholder {
  flex: 0 0 auto;
  display: inline-block;
  width: 22px;
  height: 15px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
  object-fit: cover;
  /* Esto evita que se recorte, antes era cover */
  object-position: center;
  /* Esto la mantiene bien centrada */
  background-color: transparent;
  overflow: hidden;
}

.flag-placeholder {
  display: inline-grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, #d9dedb);
  color: var(--accent);
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0;
}

.match-real-result {
  width: fit-content;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, white);
  color: var(--accent);
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 850;
}

.selectors {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(1px);
}

.group-matches {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.matchday-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.matchday-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 241, 0.86)),
    var(--decor-local-1) center / cover;
  box-shadow: 0 12px 28px rgba(33, 29, 22, 0.10);
  padding: 16px;
  overflow: hidden;
  isolation: isolate;
}

.matchday-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.group-matches-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.mini-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #c8d8d1;
  background: #e6eee9;
  color: var(--accent);
  font-size: 0.74rem;
}

.group-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 10px 42px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
}

.matchday-card .group-match {
  grid-template-columns: minmax(0, 1fr) 54px 14px 54px minmax(0, 1fr);
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 850;
}

.group-match input {
  min-height: 32px;
  padding: 0 6px;
  text-align: center;
  font-weight: 900;
}

.matchday-card .group-match input {
  min-height: 42px;
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  background: rgba(255, 255, 255, 0.94);
  font-size: 1rem;
}

.group-match b {
  color: var(--muted);
  text-align: center;
}

.group-match .team-badge,
.teams-line .team-badge,
.custom-match-line .team-badge {
  overflow: hidden;
  display: flex;
  width: 100%;
  justify-content: center;
  /* Esto centra la bandera y el texto en su mitad */
}

.group-match .team-badge span {
  white-space: nowrap;
}

.group-standings {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  border-radius: 8px;
  background: #f6f8f5;
  padding: 8px;
}

.standings-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 34px 34px 34px;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 0.74rem;
}

.standings-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.standings-row b,
.standings-row strong,
.standings-row small {
  text-align: center;
}

.standings-header {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.selector-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border-radius: 8px;
  isolation: isolate;
}

.selector-row.has-flag-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.42)),
    var(--team-flag);
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: center;
  opacity: 0.78;
  filter: saturate(1.18);
  pointer-events: none;
}

.selector-row>* {
  position: relative;
  z-index: 1;
}

.selector-row.has-flag-bg select {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(1px);
}

.place {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #edf3ef;
  color: var(--accent);
  font-weight: 900;
}

.bracket {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  overflow: visible;
  padding-bottom: 4px;
}

.thirds-panel {
  position: relative;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 14px;
  overflow: hidden;
  isolation: isolate;
}

.thirds-panel::before {
  background-image: var(--decor-web-1);
  background-position: 72% center;
  opacity: 0.10;
}

.thirds-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.thirds-head h3,
.thirds-head p {
  margin: 0;
}

.thirds-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.third-select {
  font-size: 0.78rem;
}

.thirds-empty {
  color: var(--muted);
  font-weight: 800;
}

/* --- BORDES DESBLOQUEABLES --- */
.avatar-button {
  transition: all 0.3s ease;
  border: 3px solid transparent;
  border-radius: 999px;
}

/* Borde Oro */
.border-gold {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 4px var(--gold), 0 0 16px rgba(215, 169, 52, 0.75) !important;
}

/* Borde Neón (Animado) */
.border-neon {
  border-color: #00ffcc !important;
  box-shadow: 0 0 0 4px #00ffcc, 0 0 20px rgba(0, 255, 204, 0.95) !important;
  animation: pulse-neon 2s infinite alternate;
}

/* Borde Fuego (Animado) */
.border-fire {
  border-color: #ff4500 !important;
  box-shadow: 0 0 0 4px #ff4500, 0 0 20px #ff8c00 !important;
  animation: pulse-fire 1.5s infinite alternate;
}

@keyframes pulse-neon {
  from { box-shadow: 0 0 0 2px #00ffcc, 0 0 10px rgba(0,255,204,0.5); }
  to { box-shadow: 0 0 0 4px #00ffcc, 0 0 20px rgba(0,255,204,1); }
}

@keyframes pulse-fire {
  from { box-shadow: 0 0 0 2px #ff4500, 0 0 10px #ff8c00; }
  to { box-shadow: 0 0 0 4px #ff0000, 0 0 20px #ff4500; }
}

/* Tienda de recompensas */
.rewards-store {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.reward-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.reward-card .preview-border {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--line);
}

.round {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.round h3 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.92rem;
  text-transform: uppercase;
  color: var(--blue);
}

.match-card {
  position: relative;
  display: grid;
  gap: 9px;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px;
  overflow: hidden;
  isolation: isolate;
}

.round:nth-child(4n + 1) .match-card::before {
  background-image: var(--decor-web-1);
}

.round:nth-child(4n + 2) .match-card::before {
  background-image: var(--decor-local-2);
}

.round:nth-child(4n + 3) .match-card::before {
  background-image: var(--decor-web-2);
}

.round:nth-child(4n + 4) .match-card::before {
  background-image: var(--decor-local-3);
}

.match-card label {
  font-size: 0.78rem;
}

.match-title {
  display: flex;
  justify-content: space-between;
  /* Esto empuja un elemento a cada lado */
  align-items: center;
  /* Alinea los textos verticalmente */
  width: 100%;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.teams-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 850;
}

.teams-line span {
  overflow-wrap: anywhere;
}

.knockout-team-side {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.knockout-team-left {
  justify-content: flex-start;
}

.knockout-team-right {
  justify-content: flex-end;
}

.knockout-team-side .team-badge {
  flex: 1 1 auto;
  min-width: 0;
}

.teams-line .score-wrapper {
  width: 47px;
  min-width: 47px;
  flex: 0 0 47px;
}

.knockout-team-right .team-badge {
  order: 2;
}

.knockout-team-right .score-wrapper {
  order: 1;
}

.knockout-score-input {
  width: 48px;
  min-height: 36px;
  padding: 0 8px;
  text-align: center;
  font-weight: 900;
}

.teams-line .team-badge {
  color: var(--ink);
}

.knockout-team-left .team-badge {
  justify-content: flex-start;
}

.knockout-team-right .team-badge {
  justify-content: flex-end;
}

.teams-line b {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  text-transform: uppercase;
}

.score-row {
  display: grid;
  grid-template-columns: 56px 14px 56px;
  align-items: center;
  gap: 8px;
}

.score-row input {
  min-height: 36px;
  padding: 0 8px;
  text-align: center;
  font-weight: 900;
}

.score-row span {
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

/* Cuando el usuario está DENTRO de un torneo privado (Prueba1, etc.) */
body[data-tenant] #dropdownLobbyBtn {
  display: none !important;
  /* Escondemos el botón de Torneos y Lobby */
}

body[data-tenant] #dropdownGlobalBtn {
  display: none !important;
  /* Forzamos a que se muestre el botón de Prode Global */
}

/* Forzar a que los párrafos del menú desplegable de usuario sean oscuros siempre */
.session-dropdown p {
  color: var(--ink) !important;
}

/* Fondo general de la pantalla de login: mezcla el color principal con tonos oscuros */
.company-login {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, var(--ink) 20%), color-mix(in srgb, var(--accent) 40%, var(--ink) 60%)),
    url("/prode-static/descargar.webp") center / cover !important;
}

/* Tarjeta de login con fondo adaptable */
.company-login-card {
  background: var(--panel) !important;
  border-color: var(--line) !important;
}

/* Textos de la tarjeta usando la tinta seleccionada */
.company-login-card h2,
.company-login-card p {
  color: var(--ink) !important;
}

/* Kicker superior (Prode Mundial) y el botón principal */
.company-login-card .login-kicker {
  color: var(--accent) !important;
}

.company-login-card button:not(.secondary) {
  background: var(--accent) !important;
  color: #ffffff !important;
}

/* Inputs adaptados al panel */
.company-login-card input {
  background: color-mix(in srgb, var(--line) 30%, var(--panel)) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
}

.company-login-card input::placeholder {
  color: var(--muted) !important;
}

/* Contenedor de logos gemelos */
.login-logos-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.login-logos-container img {
  max-height: 70px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
  margin: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  /* Sombra elegante para que resalten */
}

.submit-panel {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 26px 0 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 16px 36px rgba(33, 29, 22, 0.16);
  backdrop-filter: blur(8px);
}

.submit-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.submit-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.submit-panel .actions {
  flex: 0 0 auto;
}

.submit-panel > div {
  min-width: 0;
}

.submit-panel #savePrediction {
  min-width: 190px;
  min-height: 48px;
  box-shadow: 0 10px 22px rgba(12, 112, 77, 0.20);
}

.validator {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 18px;
}

.file-drop {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 2px dashed #b8c7bf;
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.file-drop input {
  display: none;
}

.file-drop span {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 900;
}

.score-card {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 18px;
}

.score-card .empty {
  margin: 0;
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.live-card {
  position: relative;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 14px;
  overflow: hidden;
  isolation: isolate;
}

.live-card::before {
  background-image: var(--decor-web-1);
  background-position: 80% center;
  opacity: 0.10;
}

.live-grid .live-card:nth-child(3n + 2)::before {
  background-image: var(--decor-web-2);
}

.live-grid .live-card:nth-child(3n + 3)::before {
  background-image: var(--decor-local-3);
}

.live-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.live-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.live-score b {
  text-align: center;
  color: var(--accent-2);
}

.live-state {
  justify-self: start;
  border-radius: 999px;
  background: #edf3ef;
  color: var(--accent);
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfaf7;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 1.3rem;
}

/* Estilos para Minitorneos */
.minitournaments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.minitournament-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.minitournament-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ink);
}

.minitournament-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-light);
  flex: 1;
}

.mini-players {
  font-size: 0.85rem;
  color: var(--ink-lighter);
  display: block;
}

.minitournament-card button {
  margin-top: auto;
  width: 100%;
}

.leaderboard-container, 
#leaderboardView {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important; /* Eliminamos paddings raros que achiquen los carteles */
  margin: 0 auto !important;
  display: flex;
  flex-direction: column;
  gap: 12px; /* Separación elegante entre carteles */
}

/* Forzamos a que cada fila de usuario tenga el mismo ancho exacto que el cartel superior */
.user-leaderboard-row,
.leaderboard-card-row {
  width: 100% !important;
  box-sizing: border-box !important; /* Evita que el padding ensanche la caja por fuera */
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Espaciado interno para el nuevo bloque de "Exactos" */
.user-row-details {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Ocultar las flechas nativas por completo */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* Contenedor que agrupa el input y los botones */
.score-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
}

/* Diseño de los botones Arriba/Abajo */
.score-btn {
  width: 100%;
  height: 28px; /* Altura perfecta para el pulgar */
  min-height: 28px;
  padding: 0;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 1;
}

/* Efectos al tocar/pasar el mouse */
.score-btn:hover:not(:disabled),
.score-btn:active:not(:disabled) {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.score-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f0f0f0;
}

/* Ajustes para que encastren como piezas de lego con el input */
.score-wrapper .score-btn.up {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: -1px; /* Para fusionar los bordes */
}

.score-wrapper .score-btn.down {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: -1px;
}

/* Ajustes al input original para que encaje al medio */
.score-wrapper input[type="number"] {
  border-radius: 0 !important; /* Cuadrado para pegar con los botones */
  min-height: 42px !important;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 900;
  position: relative;
  z-index: 2; /* Queda por encima para que los bordes se vean bien */
  margin: 0;
}

@media (min-width: 1051px) {
    .standings-grid {
        grid-template-columns: repeat(4, 1fr); /* Vuelve a 4 columnas */
    }
}

@media (max-width: 1050px) {
  .groups-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-games {
    grid-template-columns: 1fr;
  }

  .minitournaments-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .matchday-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .thirds-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .standings-row {
  display: flex;
  justify-content: space-between;
  grid-template-columns: 24px minmax(0, 1fr) 34px 34px 34px;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 0.74rem;
}
}

@media (max-width: 780px) {

  .topbar,
  .section-head,
  .submit-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-band,
  .home-matches-grid,
  .home-install-panel,
  .home-rules-panel,
  .player-form,
  .payment-gate,
  .company-login-form,
  .tournament-form,
  .validator {
    grid-template-columns: 1fr;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }

  .live-grid,
  .matchday-grid,
  .game-guess-form,
  .camisetadle-form,
  .live-score,
  .admin-user-row,
  .thirds-grid,
  .group-match,
  .standings-row {
    grid-template-columns: 1fr;
  }

  .leaderboard-row {
    display: grid !important;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    text-align: left !important;
  }

  .leaderboard-row b {
    margin-right: 0;
  }

  .leaderboard-row span {
    min-width: 0;
  }

  .leaderboard-row strong {
    position: static;
    transform: none;
    justify-self: end;
    white-space: nowrap;
    font-size: 0.95rem;
  }

  .leaderboard-row em,
  .leaderboard-row button {
    grid-column: 2 / -1;
    justify-self: stretch;
    text-align: left !important;
    min-width: 0 !important;
  }

  .current-user-rank-summary {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .current-user-rank-summary em {
    grid-column: 2 / -1;
  }

  .admin-theme-form,
  .admin-games-form {
    grid-template-columns: 1fr;
  }

  .admin-theme-form .wide,
  .admin-games-form .wide {
    grid-column: auto;
  }

  .feedback-response-row {
    grid-template-columns: 1fr;
  }

  .admin-diagnostic-summary,
  .admin-diagnostic-card dl {
    grid-template-columns: 1fr;
  }

  .groups-grid {
    grid-template-columns: 1fr;
  }

  .round {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .teams-line {
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    justify-items: center;
    width: 100%;
    text-align: center;
  }

  .teams-line b {
    display: block;
  }

  .knockout-team-left {
    justify-content: center;
    text-align: center;
  }

  .knockout-team-right {
    justify-content: center;
    text-align: center;
  }

  .knockout-team-side .team-badge {
    flex: 0 1 auto;
    max-width: 100%;
    justify-content: center;
    text-align: center;
  }

  .group-match {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap !important; /* La magia: prohíbe el salto de línea */
    gap: 8px !important; /* Reduce un poquito el espacio entre elementos */
  }

  .knockout-score-input {
    width: 45px !important; /* Achicamos el input para que no ocupe toda la pantalla */
    text-align: center;
    padding: 4px;
  }

  .group-match span {
    flex-shrink: 0; /* Evita que las banderitas se aplasten o se deformen */
    min-width: 35px;
    text-align: center;
  }

  .round .score-btn {
    width: 53px !important; /* Achicamos un poco el ancho del botón */
    height: 22px !important; /* Achicamos la altura */
    padding: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0.85); /* Reduce el botón entero proporcionalmente para que no sobresalga */
  }
  
  .round .score-row { /* Si los botones están dentro de un contenedor propio que los empuja, ajustamos su espacio */
    gap: 4px !important; /* Le quitamos separación a los elementos para que todo encaje */
  }
  
  .round .group-match {
    gap: 4px !important; /* Aseguramos que el contenedor del input + botones no desborde */
  }

  .group-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem; /* Fuente más pequeña para que quepa todo */
  }

  .group-card th, .group-card td {
      padding: 2px 4px; /* Reducimos el padding al mínimo */
      text-align: center;
  }

  /* Alineación específica para el nombre del equipo a la izquierda */
  .group-card td:nth-child(1) {
      text-align: left;
      font-weight: bold;
      white-space: nowrap; /* Evita que el nombre del equipo se parta en dos líneas */
  }

  .standings-row {
  display: flex;
  justify-content: space-between;
  grid-template-columns: 24px minmax(0, 1fr) 34px 34px 34px;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 0.74rem;
}

  .actions button {
    flex: 1 1 150px;
  }

  .modal-backdrop {
    align-items: end;
    place-items: end center;
    padding: 12px;
  }

  .modal-panel {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 14px;
    border-radius: 10px;
  }

  .modal-panel .section-head.compact {
    align-items: stretch;
    gap: 8px;
    margin: 0 0 12px;
  }

  .form-status,
  .phase-status,
  .live-status,
  .lock-banner {
    width: 100%;
    margin: 12px 0;
    padding: 12px;
    font-size: 0.92rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .verification-actions {
    grid-template-columns: 1fr;
  }

  .submit-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    bottom: 8px;
    padding: 12px;
  }

  .submit-panel > div {
    width: 100%;
  }

  .submit-panel .actions,
  .submit-panel #savePrediction,
  .real-match-save-panel #saveRealMatchPredictions {
    width: 100%;
  }

  .submit-panel p {
    display: none;
  }

  .teams-line {
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    gap: 10px;
    justify-items: center;
    text-align: center;
  }

  .teams-line b {
    display: block;
  }

  .knockout-team-left {
    justify-content: center;
  }

  .knockout-team-right {
    justify-content: center;
  }
}


/* Password visibility buttons must stay inside the input, not inherit login button styles. */
.company-login-card button.password-toggle,
.modal-panel button.password-toggle,
button.password-toggle {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  display: inline-grid !important;
  place-items: center !important;
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #5f625f !important;
  transform: translateY(-50%) !important;
  box-shadow: none !important;
}

.company-login-card button.password-toggle:hover,
.modal-panel button.password-toggle:hover,
button.password-toggle:hover,
.company-login-card button.password-toggle.is-visible,
.modal-panel button.password-toggle.is-visible,
button.password-toggle.is-visible {
  background: rgba(99, 16, 9, 0.10) !important;
  color: #631009 !important;
  filter: none !important;
}

.password-toggle svg {
  display: block;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

@media (max-width: 780px) {
  .mini-standings-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }

  .standings-group-card {
    padding: 10px;
  }

  .standings-group-card table {
    border-collapse: separate;
    border-spacing: 0 4px;
    font-size: 0.72rem;
  }
}

@media (max-width: 460px) {
  .mini-standings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}
