:root {
  --field-deep: #0b3d2e;
  --field-mid: #146b4a;
  --field-light: #1a8f62;
  --chalk: #f4f7f5;
  --ink: #121816;
  --muted: #5c6b63;
  --line: rgba(18, 24, 22, 0.12);
  --accent: #e10600;
  --accent-soft: #ffeceb;
  --gold: #f0c14b;
  --card: #ffffff;
  --shadow: 0 12px 40px rgba(11, 61, 46, 0.12);
  --radius: 16px;
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(20, 107, 74, 0.18), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(225, 6, 0, 0.08), transparent 50%),
    linear-gradient(180deg, #eef5f1 0%, var(--chalk) 40%, #e8efe9 100%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

/* —— Auth / landing —— */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    linear-gradient(180deg, rgba(11, 61, 46, 0.55), rgba(11, 61, 46, 0.78)),
    url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 40h80M40 0v80' stroke='%23ffffff22' stroke-width='2'/%3E%3C/svg%3E"),
    linear-gradient(135deg, var(--field-deep), var(--field-mid));
  background-size: auto, 80px 80px, auto;
}

.auth-panel {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  animation: rise 0.7s ease both;
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand .mark,
.auth-brand .brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 0.75rem;
}

.auth-brand .brand-logo {
  width: 64px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
}

.auth-brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3rem);
  letter-spacing: 0.04em;
  line-height: 0.95;
  color: var(--field-deep);
}

.auth-brand p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  background: #e8efe9;
  padding: 0.3rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.tabs button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.65rem;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fff;
  width: 100%;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(20, 107, 74, 0.35);
  border-color: var(--field-mid);
}

.field input[type="color"] {
  padding: 0.35rem;
  height: 48px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
  margin-top: 0.4rem;
}

.btn-primary:hover {
  background: #c10500;
  box-shadow: 0 8px 24px rgba(225, 6, 0, 0.28);
}

.btn-secondary {
  background: var(--field-deep);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--field-deep);
  border: 1px solid var(--line);
}

.btn-small {
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 10px;
}

.auth-note {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* —— App chrome —— */
.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(11, 61, 46, 0.92);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.05em;
}

.brand-link img,
.brand-link .brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-links a {
  opacity: 0.78;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
  border-bottom-color: var(--gold);
}

.hero-field {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(11, 61, 46, 0.35), rgba(11, 61, 46, 0.15)),
    repeating-linear-gradient(
      90deg,
      #147a52 0,
      #147a52 48px,
      #16905f 48px,
      #16905f 50px
    );
  color: #fff;
  min-height: 220px;
}

.hero-field::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, rgba(0, 0, 0, 0.35), transparent 55%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 1rem;
  padding: 1.75rem 0 1.5rem;
  min-height: 220px;
}

.hero-side {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  opacity: 0.9;
}

.hero-side.right {
  justify-self: end;
  text-align: right;
}

.jersey {
  width: 120px;
  height: 140px;
  margin: 0 auto;
  background: var(--jersey, #004c54);
  background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.18), transparent 45%, rgba(0, 0, 0, 0.28));
  clip-path: polygon(18% 8%, 35% 8%, 42% 0, 58% 0, 65% 8%, 82% 8%, 92% 22%, 88% 100%, 12% 100%, 8% 22%);
  display: grid;
  place-content: center;
  text-align: center;
  color: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  animation: floaty 3.5s ease-in-out infinite;
}

.jersey .name {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-size: 1rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.jersey .num {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 0.9;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.yards-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  min-width: 110px;
  box-shadow: var(--shadow);
}

.yards-pill strong {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
}

.yards-pill span {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.page {
  padding: 1.75rem 0 3.5rem;
}

.page-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: 0.03em;
  color: var(--field-deep);
}

.page-sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .grid-2,
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-side.right {
    justify-self: start;
    text-align: left;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
  }

  .topnav-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}

.panel h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.panel .hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.stat-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.stat-list strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 0.75rem;
  align-items: end;
  margin: 1rem 0 1.25rem;
  min-height: 180px;
}

.podium-item {
  text-align: center;
  animation: rise 0.6s ease both;
}

.podium-item:nth-child(1) {
  animation-delay: 0.1s;
}
.podium-item:nth-child(2) {
  animation-delay: 0.05s;
}
.podium-item:nth-child(3) {
  animation-delay: 0.15s;
}

.podium-item .jersey {
  width: 84px;
  height: 100px;
  margin-bottom: 0.45rem;
}

.podium-item.first .jersey {
  width: 100px;
  height: 118px;
}

.podium-item .who {
  font-weight: 800;
  font-size: 0.92rem;
}

.podium-item .pts {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.rank-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1rem;
}

@media (max-width: 700px) {
  .rank-list {
    grid-template-columns: 1fr;
  }
}

.rank-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.rank-row .pos {
  color: var(--accent);
  font-weight: 800;
}

.you-bar {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  background: #f3f7f4;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-weight: 700;
}

/* —— Quiniela —— */
.week-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.week-bar .label {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--muted);
}

.week-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.week-tabs button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.week-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.alert {
  background: var(--accent-soft);
  color: #8a0d08;
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: 0 12px 12px 0;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.day-block {
  margin-bottom: 1.75rem;
}

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.day-head h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.day-head span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

@media (max-width: 900px) {
  .games-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
}

.game-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}

.game-card.locked {
  opacity: 0.92;
}

.game-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 168px;
}

.side {
  padding: 0.9rem 0.7rem 0.75rem;
  display: grid;
  justify-items: center;
  align-content: space-between;
  gap: 0.45rem;
  color: #fff;
  text-align: center;
}

.side img {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

/* Solo Jets (NYJ) y Giants (NYG): contraste sobre su color primario */
.side.logo-contrast img {
  filter: brightness(0) invert(1) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.side .team {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.score-input {
  width: 64px;
  height: 48px;
  border: 0;
  border-radius: 10px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink);
}

.score-input:disabled {
  background: #f0f0f0;
  color: #666;
}

.vs-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

.game-status {
  text-align: center;
  padding: 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #f5f5f5;
  color: var(--muted);
}

.game-status.ok {
  color: var(--accent);
  background: var(--accent-soft);
}

.game-status.exact {
  color: #0b5;
  background: #e8fff4;
}

.actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  position: sticky;
  bottom: 0.75rem;
  z-index: 30;
  isolation: isolate;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  padding: 0.75rem 1rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--field-deep);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform 0.35s ease;
  z-index: 50;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* —— Picks matrix —— */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

table.picks {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.88rem;
}

table.picks th,
table.picks td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

table.picks th {
  background: var(--field-deep);
  color: #fff;
  font-weight: 700;
}

table.picks td.match {
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

table.picks .empty {
  color: var(--muted);
}

/* —— Admin / Oracle —— */
.admin-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(180px, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.admin-scores {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
}

.admin-scores input[type="number"] {
  width: 72px;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.admin-scores .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.sync-log {
  display: grid;
  gap: 0.4rem;
  max-height: 260px;
  overflow: auto;
}

.sync-log-row {
  display: grid;
  grid-template-columns: 42px 150px 110px 1fr;
  gap: 0.5rem;
  align-items: start;
  font-size: 0.82rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: #f6f8f7;
}

.sync-log-row.ok .sync-log-status {
  color: #146b4a;
  font-weight: 800;
}

.sync-log-row.err {
  background: var(--accent-soft);
}

.sync-log-row.err .sync-log-status {
  color: var(--accent);
  font-weight: 800;
}

.sync-log-at,
.sync-log-src {
  color: var(--muted);
}

@media (max-width: 900px) {
  .admin-row {
    grid-template-columns: 1fr;
  }

  .sync-log-row {
    grid-template-columns: 42px 1fr;
  }

  .sync-log-at,
  .sync-log-src {
    grid-column: 2;
  }
}

.ai-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.ai-card:last-child {
  border-bottom: 0;
}

.ai-logos {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ai-logos img {
  width: 36px;
  height: 36px;
}

.ai-score {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--accent);
  white-space: nowrap;
}

.jersey.mini {
  width: 56px;
  height: 68px;
  animation: none;
}

.jersey.mini .name {
  font-size: 0.55rem;
}

.jersey.mini .num {
  font-size: 1.35rem;
}

.user-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.user-row .meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.user-row .pts-col {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--accent);
}

.fill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.fill-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

.fill-chip.done {
  border-color: #1a8f62;
  background: #e8fff4;
}

.stats-total-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px solid var(--field-deep);
}

.stats-total-line span {
  font-weight: 700;
}

.stats-total-line strong {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--accent);
  line-height: 1;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 700px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

.admin-note {
  background: #f3f7f4;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 500px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.secret-banner {
  background: linear-gradient(90deg, #1a1a1a, #333);
  color: #f0c14b;
  text-align: center;
  padding: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-mock {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
