:root {
  color-scheme: light;
  --bg: #f3f6f4;
  --panel: #ffffff;
  --panel-soft: #f8faf8;
  --ink: #17211d;
  --muted: #65716b;
  --line: #d9e0dc;
  --line-strong: #b9c5be;
  --green: #0a7f57;
  --green-deep: #103c2e;
  --coral: #c95734;
  --gold: #bd8d22;
  --blue: #2f6f9f;
  --shadow: 0 16px 42px rgba(20, 36, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(10, 127, 87, 0.06), transparent 310px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(16px, 3vw, 36px);
  color: #f7fbf8;
  background:
    linear-gradient(90deg, rgba(16, 60, 46, 0.96), rgba(16, 60, 46, 0.88)),
    url("assets/pitch.svg") center / cover no-repeat;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.header-menu {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #f8fbf9;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 780;
  list-style: none;
  white-space: nowrap;
  cursor: pointer;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid rgba(255, 255, 255, 0.72);
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.nav-dropdown[open] summary {
  color: var(--green-deep);
  background: #ffffff;
  border-color: #ffffff;
}

.nav-dropdown[open] summary::after {
  border-top-color: var(--green-deep);
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 30;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  max-height: min(70vh, 620px);
  overflow: auto;
  gap: 10px;
  padding: 14px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(16, 60, 46, 0.2);
  transform: translateX(-50%);
}

.rules-dropdown {
  width: min(420px, calc(100vw - 32px));
}

.predictions-dropdown {
  width: min(340px, calc(100vw - 32px));
}

.dropdown-link,
.prediction-nav-item {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--green-deep);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 790;
  text-align: left;
}

.prediction-nav-list {
  display: grid;
  gap: 6px;
}

.prediction-nav-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.prediction-nav-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prediction-nav-item strong {
  color: var(--green);
}

.hidden-filters {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.read-only .brand::after {
  content: "Modo lectura";
  min-height: 28px;
  padding: 5px 9px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 820;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  color: #ffffff;
  font-weight: 850;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: inherit;
  font-size: 0.74rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  line-height: 1.1;
  opacity: 0.72;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 2.6vw, 2.6rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 0.98rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.top-actions,
.panel-heading,
.section-title,
.segmented,
.score-layout {
  display: flex;
  align-items: center;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.button,
.mode-button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 12px;
  font-weight: 740;
  letter-spacing: 0;
}

.button.secondary {
  color: #f8fbf9;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.button.secondary:hover,
.button.secondary:focus-visible {
  background: rgba(255, 255, 255, 0.2);
}

.button.danger {
  color: #ffffff;
  background: var(--coral);
}

.read-only .dashboard {
  grid-template-columns: minmax(0, 1fr);
}

.read-only .top-actions,
.read-only .control-rail,
.read-only .prediction-editor,
.read-only .score-inputs,
.read-only .ko-score-inputs {
  display: none !important;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px clamp(16px, 3vw, 36px) 32px;
}

.control-rail {
  position: sticky;
  top: 110px;
  display: grid;
  align-self: start;
  gap: 14px;
}

.content-area {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.top-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.today-panel {
  grid-column: 1 / -1;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.today-panel > .panel-heading {
  display: none;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel.compact {
  padding: 16px;
}

.panel-heading {
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.leaderboard-panel {
  min-width: 0;
}

.score-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
}

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

.stat {
  min-height: 72px;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat strong {
  display: block;
  margin-bottom: 4px;
  color: var(--green-deep);
  font-size: 1.35rem;
  line-height: 1;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.field-label {
  display: block;
  margin: 13px 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 780;
}

.input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
}

.input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(10, 127, 87, 0.14);
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.compact-rules {
  gap: 7px;
}

.rule-card,
.scoring-list > div {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-rules .rule-card {
  gap: 2px;
  padding: 7px 8px;
}

.compact-rules .rule-card strong {
  font-size: 0.78rem;
}

.compact-rules .rule-card span {
  font-size: 0.72rem;
  line-height: 1.18;
}

.stats-panel .stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  padding: 14px;
}

.rule-card strong,
.scoring-list strong {
  color: var(--green-deep);
  font-size: 0.84rem;
}

.rule-card span,
.scoring-list span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.scoring-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.today-list {
  display: grid;
  gap: 10px;
  padding: 0;
}

.fifa-sync-note {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  color: var(--green-deep);
  background: #eef7f2;
  border: 1px solid rgba(10, 127, 87, 0.18);
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 760;
}

.today-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.matchday-list {
  gap: 18px;
}

.matchday-split {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.matchday-split > .fifa-sync-note {
  grid-column: 1 / -1;
}

.matchday-section {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.matchday-split .matchday-section + .matchday-section {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.matchday-section-today {
  background: linear-gradient(180deg, #f0faf4 0%, #ffffff 72%);
  border-color: rgba(10, 127, 87, 0.28);
  box-shadow: inset 0 4px 0 var(--green);
}

.matchday-section-yesterday {
  background: linear-gradient(180deg, #f6f4ef 0%, #ffffff 72%);
  border-color: rgba(101, 113, 107, 0.22);
  box-shadow: inset 0 4px 0 #9aa29d;
}

.matchday-section-tomorrow {
  background: linear-gradient(180deg, #eef5fb 0%, #ffffff 72%);
  border-color: rgba(50, 104, 168, 0.24);
  box-shadow: inset 0 4px 0 #3268a8;
}

.matchday-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 2px 2px 8px;
  border-bottom: 1px solid rgba(101, 113, 107, 0.16);
}

.matchday-section-title .eyebrow {
  margin: 0;
  font-size: 1.05rem;
  color: var(--green-deep);
  opacity: 1;
  text-transform: none;
}

.matchday-section-today .matchday-section-title .eyebrow {
  font-size: 1.22rem;
}

.matchday-section-yesterday .matchday-section-title .eyebrow {
  color: #69736d;
}

.matchday-section-tomorrow .matchday-section-title .eyebrow {
  color: #24598f;
}

.matchday-section-title span {
  color: var(--muted);
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(101, 113, 107, 0.16);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 780;
}

.matchday-card {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(16, 60, 46, 0.08);
}

.matchday-top {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.matchday-split .matchday-top {
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.matchday-top h3 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.05;
}

.matchday-split .matchday-top h3 {
  font-size: clamp(1.2rem, 1.65vw, 1.55rem);
}

.matchday-body {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(260px, 1fr);
  gap: 22px;
  padding: 24px;
}

.matchday-split .matchday-body {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
}

.matchday-scoreboard {
  display: grid;
  align-content: start;
  gap: 12px;
}

.matchday-split .matchday-scoreboard {
  gap: 8px;
}

.matchday-team {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  font-weight: 850;
}

.matchday-split .matchday-team {
  font-size: 1.05rem;
}

.matchday-team.away {
  justify-content: flex-start;
}

.matchday-score {
  color: var(--muted);
  font-size: 1.65rem;
  font-weight: 850;
  line-height: 1;
}

.matchday-split .matchday-score {
  font-size: 1.35rem;
}

.matchday-time {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 780;
}

.matchday-split .matchday-time {
  font-size: 0.82rem;
}

.matchday-predictions {
  display: grid;
  align-content: start;
  gap: 8px;
}

.today-player-row {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) 58px 48px;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.today-player-row.sign-hit {
  background: #fff0ad;
  border-color: #ddb92a;
}

.today-player-row.exact-hit {
  background: #ddf4e5;
  border-color: #76c487;
}

.today-player-row.miss-hit {
  background: #ffe0dc;
  border-color: #df897f;
}

.today-player-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-player-row strong {
  color: var(--ink);
  font-size: 0.9rem;
  text-align: center;
}

.today-player-row b {
  color: var(--green-deep);
  font-size: 0.9rem;
  text-align: right;
}

.today-player-row.prediction-header {
  min-height: 24px;
  background: transparent;
  border-color: transparent;
}

.today-player-row.prediction-header span,
.today-player-row.prediction-header strong,
.today-player-row.prediction-header b {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.scoring-panel {
  display: none;
}

.today-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.today-header h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.today-predictions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 7px;
}

.today-result-points {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 9px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
}

.today-real-result {
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 3px;
  min-height: 42px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.today-real-result.played {
  border-left-color: transparent;
}

.today-real-result > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.today-real-result strong {
  color: var(--green-deep);
  font-size: 1.1rem;
  line-height: 1;
  text-align: left;
}

.today-real-result em {
  display: none;
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  line-height: 1.25;
}

.today-points-detail {
  display: grid;
  gap: 6px;
  min-height: 42px;
}

.today-points-detail > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.today-points-detail > em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.today-points-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 5px;
}

.today-points-row {
  display: grid;
  grid-template-columns: minmax(42px, 0.75fr) minmax(38px, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 6px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.68rem;
}

.today-points-row strong,
.today-points-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-points-row span {
  color: var(--muted);
}

.today-points-row b {
  color: var(--green-deep);
  text-align: right;
}

.today-prediction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8rem;
}

.today-prediction strong {
  color: var(--green-deep);
}

.recent-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.recent-result-card {
  display: grid;
  gap: 6px;
  min-height: 68px;
  padding: 9px 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.recent-result-card strong,
.recent-result-card span,
.recent-result-card em {
  display: block;
}

.recent-result-card strong {
  color: var(--green-deep);
  font-size: 0.88rem;
}

.recent-result-card span,
.recent-result-card em {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.recent-result-card em {
  font-style: normal;
  font-weight: 760;
}

.compact-empty {
  margin: 14px;
  padding: 16px;
}

.rule-box {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.rule-box input {
  text-align: center;
}

.pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 0.78rem;
  font-weight: 760;
}

.save-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.leaderboard {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.leader-row {
  display: grid;
  grid-template-columns: 30px minmax(150px, 1.35fr) 64px repeat(4, minmax(96px, 1fr));
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.leader-header {
  min-height: 34px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.leader-header + .leader-row {
  border-color: rgba(189, 141, 34, 0.45);
  background: #fff9e9;
}

.rank {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  background: var(--green);
  font-size: 0.8rem;
  font-weight: 840;
}

.leader-name {
  min-width: 0;
}

.leader-name strong,
.leader-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-name span,
.mini-label {
  color: var(--muted);
  font-size: 0.76rem;
}

.points {
  color: var(--green-deep);
  font-size: 1.05rem;
  font-weight: 840;
  text-align: right;
}

.metric {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
}

.ranking-chart-panel[hidden] {
  display: none;
}

.ranking-chart-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 14px;
  padding: 14px;
}

.ranking-chart {
  display: block;
  width: 100%;
  min-height: 260px;
}

.ranking-chart rect {
  fill: var(--panel-soft);
}

.chart-grid line {
  stroke: rgba(16, 60, 46, 0.12);
}

.chart-grid text,
.chart-labels text {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.chart-axis {
  stroke: rgba(16, 60, 46, 0.26);
  stroke-width: 2;
}

.chart-legend {
  display: grid;
  align-content: start;
  gap: 8px;
}

.chart-legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 6px 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.chart-legend-item span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.chart-legend-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-legend-item em {
  color: var(--green-deep);
  font-style: normal;
  font-weight: 820;
}

.score-breakdown {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.score-breakdown strong {
  color: var(--green-deep);
  font-size: 0.92rem;
  line-height: 1.1;
}

.score-breakdown span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.focus-scoreline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.team-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  font-weight: 820;
}

.team-lockup.away {
  justify-content: flex-end;
  text-align: right;
}

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

.team-name.reverse {
  flex-direction: row-reverse;
}

.team-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flag {
  display: inline-grid;
  width: 34px;
  height: 24px;
  place-items: center;
  flex: 0 0 auto;
  background: #eef4f0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1;
}

.flag-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flag-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.versus {
  color: var(--muted);
  font-weight: 820;
}

.consensus-block {
  display: grid;
  gap: 8px;
}

.consensus-bar {
  display: grid;
  grid-template-columns: var(--home, 1fr) var(--draw, 1fr) var(--away, 1fr);
  height: 12px;
  overflow: hidden;
  background: #edf1ef;
  border-radius: 6px;
}

.bar-home {
  background: var(--green);
}

.bar-draw {
  background: var(--gold);
}

.bar-away {
  background: var(--blue);
}

.consensus-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.focus-predictions {
  display: grid;
  gap: 7px;
}

.prediction-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 58px 70px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.86rem;
}

.prediction-score {
  font-weight: 840;
  text-align: center;
}

.prediction-points {
  color: var(--green-deep);
  font-weight: 820;
  text-align: right;
}

.standings-panel {
  overflow: hidden;
}

.knockout-panel {
  overflow: hidden;
}

.participant-panel {
  overflow: hidden;
}

.participant-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px 0;
}

.summary-metric {
  min-height: 56px;
  padding: 8px 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-metric strong,
.big-points {
  display: block;
  color: var(--green-deep);
  font-size: 1.22rem;
  line-height: 1;
}

.summary-metric span,
.winner-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.participant-thirds {
  margin-top: 10px;
}

.compact-participant-panel {
  box-shadow: none;
}

.compact-participant-panel .panel-heading {
  padding-block: 12px;
}

.compact-thirds {
  margin-bottom: 14px;
  padding-block: 8px;
}

.compact-select {
  display: grid;
  min-width: min(260px, 100%);
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.knockout-summary {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
  padding: 14px;
}

.winner-card {
  display: grid;
  gap: 8px;
  min-height: 84px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.winner-card > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.winner-card.champion {
  background: #fff8e8;
  border-color: rgba(189, 141, 34, 0.45);
}

.thirds-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 14px 14px;
  padding: 10px 12px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.82rem;
}

.thirds-strip strong {
  color: var(--green-deep);
}

.participant-ko-prediction {
  display: grid;
  gap: 12px;
  margin: 0 14px 16px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.participant-ko-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.participant-ko-title strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.participant-ko-title span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

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

.prediction-round {
  min-width: 0;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.prediction-round h4 {
  margin: 0 0 8px;
  color: var(--green-deep);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.team-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-chip {
  min-width: 0;
  min-height: 30px;
  padding: 4px 7px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.team-chip .team-name {
  min-width: 0;
}

.team-chip .team-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

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

.podium-item {
  min-height: 48px;
  padding: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.podium-item > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.podium-item em,
.muted-text {
  color: var(--muted);
  font-size: 0.78rem;
}

.bracket-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
  overflow-x: auto;
}

.bracket-round {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 180px;
}

.bracket-round h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 0 2px;
  color: var(--green-deep);
  background: var(--panel);
  font-size: 0.88rem;
}

.bracket-match {
  display: grid;
  gap: 5px;
  padding: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ko-score-inputs {
  display: grid;
  grid-template-columns: 44px 44px;
  justify-content: center;
  gap: 5px;
  padding-top: 4px;
}

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

.team-pill {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  padding: 4px 7px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 760;
}

.team-pill .team-name {
  max-width: 100%;
}

.team-pill.winner {
  border-color: var(--green);
  box-shadow: inset 3px 0 0 var(--green);
}

.team-pill.muted {
  color: var(--muted);
  opacity: 0.62;
}

.team-pill.empty {
  color: var(--muted);
  justify-content: center;
  border-style: dashed;
}

.seed-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 820;
}

.knockout-note {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 0.8rem;
}

.segmented {
  gap: 4px;
  padding: 4px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-button {
  min-height: 30px;
  color: var(--muted);
  background: transparent;
}

.mode-button.active {
  color: #ffffff;
  background: var(--green);
}

.standings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 12px;
  padding: 14px;
}

.group-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 8px 10px;
  background: var(--green-deep);
  color: #ffffff;
  font-weight: 840;
}

.standing-row {
  display: grid;
  grid-template-columns: minmax(94px, 1fr) 30px 30px 30px 30px;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}

.standing-row.header {
  min-height: 30px;
  color: var(--muted);
  background: var(--panel-soft);
  font-weight: 760;
}

.standing-row.qualified {
  background: #f1fbf6;
}

.standing-row strong {
  display: flex;
  min-width: 0;
  align-items: center;
}

.standing-row .team-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standing-row > span:not(:first-child) {
  text-align: right;
}

.matches-section {
  display: grid;
  gap: 12px;
}

.section-title {
  justify-content: space-between;
  gap: 12px;
}

.section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 1.08rem;
  font-weight: 820;
  text-align: left;
}

.toggle-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #ffffff;
  background: var(--green);
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1;
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.match-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(92px, 1fr);
  gap: 12px;
  min-width: 0;
  min-height: 268px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.match-card.selected {
  border-color: rgba(10, 127, 87, 0.65);
  box-shadow: 0 0 0 3px rgba(10, 127, 87, 0.1);
}

.compact-match-card {
  grid-template-rows: auto;
  gap: 7px;
  min-height: 0;
  padding: 9px 10px;
  box-shadow: none;
}

.compact-match-main {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(78px, auto);
  align-items: center;
  gap: 10px;
}

.compact-match-teams {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  font-weight: 820;
}

.compact-match-teams .team-name {
  min-width: 0;
}

.compact-match-result {
  display: grid;
  gap: 2px;
  text-align: right;
}

.compact-match-result span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 820;
  text-transform: uppercase;
}

.compact-match-result strong {
  color: var(--green-deep);
  font-size: 0.94rem;
  line-height: 1;
}

.match-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

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

.match-teams .team-lockup {
  font-size: 0.93rem;
}

.score-inputs {
  display: grid;
  grid-template-columns: 44px 44px;
  gap: 4px;
}

.score-input {
  width: 44px;
  min-height: 36px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  text-align: center;
  font-weight: 820;
}

.readonly-score {
  display: inline-grid;
  min-width: 64px;
  min-height: 30px;
  place-items: center;
  padding: 5px 9px;
  color: var(--green-deep);
  background: #eef7f2;
  border: 1px solid rgba(10, 127, 87, 0.18);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 840;
  text-align: center;
}

.compact-readonly-score {
  justify-self: end;
}

.ko-readonly-score {
  justify-self: center;
  min-width: 54px;
}

.compact-score-inputs {
  grid-template-columns: 36px 36px;
}

.compact-score-inputs .score-input {
  width: 36px;
  min-height: 30px;
  font-size: 0.82rem;
}

.prediction-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
  max-height: 114px;
  overflow: auto;
}

.compact-predictions {
  max-height: 68px;
  gap: 4px;
}

.compact-prediction-chip {
  display: inline-grid;
  grid-template-columns: minmax(48px, auto) auto auto;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 6px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 6px;
  font-size: 0.68rem;
}

.compact-prediction-chip[data-outcome="home"] {
  border-left-color: var(--green);
}

.compact-prediction-chip[data-outcome="draw"] {
  border-left-color: var(--gold);
}

.compact-prediction-chip[data-outcome="away"] {
  border-left-color: var(--blue);
}

.compact-prediction-chip strong,
.compact-prediction-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-prediction-chip b {
  color: var(--green-deep);
}

.prediction-editor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #eef7f2;
  border: 1px solid rgba(10, 127, 87, 0.18);
  border-radius: 8px;
}

.prediction-editor > span {
  min-width: 0;
  overflow: hidden;
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 790;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prediction-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 7px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 760;
}

.prediction-chip strong {
  color: var(--green-deep);
}

.prediction-chip[data-outcome="home"] {
  border-left: 4px solid var(--green);
}

.prediction-chip[data-outcome="draw"] {
  border-left: 4px solid var(--gold);
}

.prediction-chip[data-outcome="away"] {
  border-left: 4px solid var(--blue);
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  text-align: center;
}

@media (max-width: 1100px) {
  .dashboard,
  .score-layout,
  .top-info-grid {
    grid-template-columns: 1fr;
  }

  .control-rail {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .standings-grid {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
  }

  .knockout-summary {
    grid-template-columns: 1fr;
  }

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

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

  .topbar {
    flex-wrap: wrap;
  }

  .header-menu {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .header-menu {
    flex-wrap: wrap;
    order: 0;
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown summary {
    justify-content: space-between;
    width: 100%;
  }

  .dropdown-panel {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 8px;
    transform: none;
  }

  .control-rail {
    grid-template-columns: 1fr;
  }

  .content-area {
    order: -1;
  }

  .top-info-grid {
    order: -2;
  }

  .standings-grid,
  .match-grid {
    grid-template-columns: 1fr;
  }

  .today-result-points {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .matchday-split {
    grid-template-columns: 1fr;
  }

  .ranking-chart-wrap {
    grid-template-columns: 1fr;
  }

  .ranking-chart {
    min-height: 220px;
  }

  .matchday-split .matchday-section + .matchday-section {
    padding-top: 14px;
    padding-left: 0;
    border-top: 1px solid rgba(101, 113, 107, 0.24);
    border-left: 0;
  }

  .matchday-top {
    padding: 8px 12px;
  }

  .matchday-body {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }

  .matchday-team {
    font-size: 1.35rem;
  }

  .matchday-score {
    font-size: 1.55rem;
  }

  .today-player-row {
    grid-template-columns: minmax(78px, 1fr) 58px 48px;
    min-height: 32px;
    padding: 5px 8px;
  }

  .today-real-result {
    min-height: 0;
    padding-right: 0;
    padding-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .today-points-row {
    grid-template-columns: minmax(42px, 0.75fr) minmax(38px, 1fr) auto;
  }

  .compact-match-main {
    grid-template-columns: 1fr auto;
  }

  .compact-match-teams {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }

  .compact-match-result {
    text-align: left;
  }

  .compact-predictions {
    max-height: 96px;
  }

  .leader-row {
    grid-template-columns: 30px minmax(90px, 1fr) 54px;
    align-items: start;
  }

  .leader-header {
    display: none;
  }

  .leader-row .score-breakdown {
    grid-column: 2 / -1;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    text-align: left;
  }

  .score-breakdown span {
    white-space: normal;
  }

  .panel-heading,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .standing-row {
    grid-template-columns: minmax(104px, 1fr) 30px 30px 30px 30px;
  }

  .participant-ko-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .participant-ko-rounds {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 440px) {
  .dashboard {
    padding-inline: 10px;
  }

  .matchday-top {
    padding: 8px 10px;
  }

  .matchday-body {
    padding: 14px;
  }

  .matchday-top h3 {
    font-size: 1.45rem;
  }

  .today-player-row {
    grid-template-columns: minmax(74px, 1fr) 52px 42px;
    gap: 6px;
  }

  .today-player-row span {
    font-size: 0.82rem;
  }

  .today-player-row strong,
  .today-player-row b {
    font-size: 0.88rem;
  }

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

  .match-teams,
  .focus-scoreline {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .team-lockup.away {
    justify-content: flex-start;
    text-align: left;
  }

  .versus,
  .score-inputs {
    justify-self: start;
  }

  .rules-grid,
  .stat-grid,
  .two-cols,
  .participant-summary {
    grid-template-columns: 1fr;
  }
}

/* Dialog / Modal Styling */
.dialog {
  border: none;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(16, 60, 46, 0.3);
  padding: 0;
  width: min(480px, calc(100vw - 32px));
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
}

.dialog::backdrop {
  background: rgba(10, 30, 23, 0.6);
  backdrop-filter: blur(4px);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--green-deep);
}

.dialog-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.dialog-close:hover {
  color: var(--ink);
}

.dialog-body {
  padding: 20px;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.tab-btn.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.form-group {
  margin-bottom: 14px;
}

.help-text {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.sync-status-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  line-height: 1.4;
}

.sync-status-box.success {
  background: rgba(10, 127, 87, 0.1);
  border-color: var(--green);
  color: var(--green-deep);
}

.sync-status-box.error {
  background: rgba(201, 87, 52, 0.1);
  border-color: var(--coral);
  color: var(--coral);
}

/* Pestañas de grupo */
.group-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 14px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.group-tabs::-webkit-scrollbar {
  display: none;
}
.group-tab-btn {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 2px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.group-tab-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.group-tab-btn.active {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

/* Acordeón de predicciones */
.matchday-predictions-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow: hidden;
}

.matchday-predictions-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 8px 12px;
  background: #ffffff;
  font-size: 0.84rem;
  font-weight: 780;
  color: var(--green-deep);
  cursor: pointer;
  list-style: none;
  user-select: none;
  outline: none;
}

.matchday-predictions-summary::-webkit-details-marker {
  display: none;
}

.matchday-predictions-summary::after {
  content: "+";
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.matchday-predictions-details[open] .matchday-predictions-summary::after {
  content: "-";
}

.matchday-predictions-content {
  padding: 8px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
}
