:root {
  --ink: #131b33;
  --muted: #647086;
  --panel: rgba(255, 255, 255, 0.94);
  --line: rgba(19, 27, 51, 0.12);
  --pink: #e51d73;
  --green: #0bb36b;
  --blue: #1746df;
  --cyan: #14bdd8;
  --yellow: #ffd33d;
  --cream: #fff7df;
  --shadow: 0 24px 70px rgba(19, 27, 51, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(229, 29, 115, 0.16), transparent 26%),
    linear-gradient(225deg, rgba(20, 189, 216, 0.18), transparent 30%),
    linear-gradient(0deg, rgba(255, 211, 61, 0.18), transparent 38%),
    #f7f8fb;
}

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

button {
  border: 0;
  cursor: pointer;
}

.shell {
  width: min(1760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 72px;
}

.hero {
  min-height: 200px;
  color: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background:
    linear-gradient(90deg, rgba(12, 18, 40, 0.96), rgba(12, 18, 40, 0.5)),
    url("imagenes/portadamundial.png") center / cover,
    linear-gradient(135deg, var(--blue), var(--pink));
}

.topbar,
.hero-grid,
.dashboard,
.layout {
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
}

.brand,
.nav-actions,
.user-row,
.hero-stats,
.tabs,
.toolbar,
.match-meta,
.teams,
.prediction-form {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--cyan), var(--yellow));
}

.brand-logo {
  height: 84px;
  width: auto;
  display: block;
  margin-left: 20px;
}

.nav-actions {
  gap: 10px;
}

.ghost-btn {
  min-height: 38px;
  padding: 0 14px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.ghost-btn.danger {
  border-color: rgba(255, 145, 145, 0.5);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 540px;
  gap: 28px;
  padding: 28px 42px 56px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--yellow);
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 16px;
  font-size: clamp(24px, 4vw, 46px);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-text {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 13.5px;
  line-height: 1.6;
}

.hero-stats {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-stats span {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.session-panel,
.metric-card,
.side-panel,
.content-panel,
.specials-form,
.user-import-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.session-panel {
  align-self: end;
  padding: 28px;
  color: var(--ink);
}

.session-panel label,
.specials-form label,
.user-import-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.user-row {
  gap: 8px;
  margin-top: 8px;
}

.email-field {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.email-field input {
  border: 0;
  border-radius: 0;
}

.email-field span {
  padding-right: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

textarea {
  min-height: 128px;
  padding: 12px;
  resize: vertical;
  line-height: 1.4;
}

.user-row button,
.prediction-form button,
.specials-form button,
.user-import-form button,
.scoring-settings-form button,
.group-prediction-form button {
  min-height: 42px;
  padding: 0 16px;
  color: #fff;
  border-radius: 8px;
  background: var(--blue);
  font-weight: 800;
}

.session-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.art-clock {
  color: white;
  font-size: 52px;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1;
  align-self: flex-end;
}
.active-user {
  margin-top: 12px;
  padding: 10px;
  color: var(--green);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}
.session-panel.is-logged-in label {
  font-size: 26px;
  color: var(--ink);
}

.login-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.session-panel.is-logged-in .login-row,
.session-panel.is-logged-in .login-hint {
  display: none;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: -28px 18px 20px;
}

.metric-card {
  padding: 12px 14px;
  box-shadow: 0 14px 34px rgba(19, 27, 51, 0.1);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

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

.layout.is-bracket-mode {
  display: block;
}

.layout.is-bracket-mode .side-panel,
.layout.is-bracket-mode .group-nav,
.layout.is-bracket-mode .toolbar {
  display: none;
}

.layout.is-bracket-mode .content-panel {
  padding: 14px;
}

.side-panel,
.content-panel {
  padding: 18px;
}

.side-panel {
  max-height: 1220px;
  overflow: hidden;
}

.section-title p {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.section-title h2 {
  margin-bottom: 16px;
  font-size: 24px;
}

.ranking-search {
  margin-bottom: 12px;
}

.ranking {
  display: grid;
  gap: 10px;
  margin: 0;
  max-height: 1030px;
  overflow-y: auto;
  padding: 0 4px 0 0;
}

.ranking li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ranking li.ranking-empty {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.ranking strong,
.ranking span {
  display: block;
}

.ranking span {
  color: var(--muted);
  font-size: 13px;
}

.rank-medal {
  display: grid !important;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink) !important;
  background: #eef2f7;
  font-size: 18px !important;
  font-weight: 900;
}

.rank-place-1 .rank-medal {
  background: linear-gradient(135deg, #fff4a6, #e4af21);
}

.rank-place-2 .rank-medal {
  background: linear-gradient(135deg, #ffffff, #b7c3d0);
}

.rank-place-3 .rank-medal {
  background: linear-gradient(135deg, #ffd8a3, #b36b22);
}

.rank-breakdown {
  margin-top: 6px;
  font-size: 12px;
}
.rank-breakdown summary {
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}
.bd-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 11px;
}
.bd-table th,
.bd-table td {
  padding: 3px 6px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.bd-pts {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
  padding-right: 8px;
}
.bd-detail {
  color: var(--muted);
}
.bd-total td {
  font-weight: 700;
  border-top: 2px solid var(--line);
  border-bottom: none;
}

.tabs {
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf2f8;
}

.subtabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 16px;
}

.subtab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.subtab.active {
  color: #fff;
  background: var(--blue);
}

.matches-subpage {
  display: none;
}

.matches-subpage.active {
  display: block;
}

.tab {
  min-height: 38px;
  flex: 1;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 8px 18px rgba(19, 27, 51, 0.08);
}

.group-nav {
  display: grid;
  grid-template-columns: repeat(12, minmax(42px, 1fr));
  gap: 8px;
  margin: 16px 0 12px;
}

.group-pill {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 900;
}

.group-pill.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 10px 24px rgba(23, 70, 223, 0.22);
}

.toolbar {
  gap: 12px;
  margin: 0 0 16px;
}

.toolbar select {
  max-width: 210px;
}

.tab-page {
  display: none;
}

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

.match-list,
.results-list {
  display: grid;
  gap: 12px;
}

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

.match-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.match-card.is-saved {
  border-color: rgba(11, 179, 107, 0.56);
  background: linear-gradient(135deg, rgba(11, 179, 107, 0.24), #fff 42%);
}

.prediction-form.is-readonly input,
.prediction-form.is-readonly select,
.result-row.is-readonly input,
.result-row.is-readonly select,
.group-prediction-form.is-readonly li {
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.58);
}

.match-meta {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.match-meta .date,
.match-meta .venue {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-meta .venue {
  text-align: right;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
}

.teams {
  justify-content: space-between;
  gap: 14px;
  margin: 16px 0;
  font-size: 20px;
}

.teams span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.team {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  flex: 1;
}

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

.flag {
  width: 34px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid rgba(19, 27, 51, 0.12);
  border-radius: 4px;
  object-fit: cover;
  background: #eef1f6;
}

.flag.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.login-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
}

.teams > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: var(--cream);
  font-size: 11px;
  text-transform: uppercase;
}

.prediction-form {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.prediction-form.is-locked {
  opacity: 0.72;
  filter: grayscale(0.45);
}

.prediction-grid {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(74px, 0.8fr) minmax(74px, 0.8fr);
  gap: 8px;
  align-items: center;
}

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

.prediction-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.prediction-grid strong {
  color: var(--ink);
  font-size: 12px;
  text-align: center;
}

.prediction-form label {
  display: block;
}

.prediction-form input,
.prediction-form select,
.result-row input,
.result-row select {
  min-height: 40px;
  padding: 0;
  text-align: center;
  font-size: 20px;
  font-weight: 900;
}

.boolean-field {
  display: grid;
  grid-column: span 1;
}

.first-scorer-field {
  display: flex;
  gap: 8px;
  align-items: center;
  grid-column: 1 / -1;
  width: 100%;
}

.prediction-grid > span.first-scorer-row {
  grid-column: 1 / -1;
}

.first-scorer-field > select {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.first-scorer-team-wrap {
  position: relative;
  width: 48px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #eef1f6;
  cursor: pointer;
}

.first-scorer-team-wrap:has(select:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

.first-scorer-team-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.first-scorer-flag {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.first-scorer-flag-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  pointer-events: none;
}

.boolean-hint {
  text-align: center;
}

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

.prediction-status {
  margin-top: 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.prediction-status.locked {
  color: var(--pink);
}

.specials-form {
  padding: 18px;
}

.group-prediction-form,
.scoring-settings-form {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.group-prediction-form {
  margin-bottom: 12px;
}

.group-prediction-form.is-locked {
  opacity: 0.72;
  filter: grayscale(0.35);
}

.group-prediction-form.is-saved,
.result-row.is-saved,
.real-result-card.is-saved {
  border-color: rgba(11, 179, 107, 0.36);
  background: linear-gradient(135deg, rgba(11, 179, 107, 0.12), #fff 42%);
}

.group-prediction-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.group-prediction-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.position-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.position-actions {
  display: flex;
  gap: 6px;
}

.position-actions button {
  min-height: 32px;
  padding: 0 10px;
  background: var(--green);
  font-size: 12px;
}

.position-actions button:disabled,
.group-prediction-form button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.real-results-list {
  display: grid;
  gap: 10px;
}

.real-result-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.real-result-card span,
.real-result-card p,
.result-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.real-result-card p {
  margin: 0;
}

.result-status {
  color: var(--green);
}

.scoring-rules {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
    border-color: rgba(62, 75, 255, 0.28);
  background: linear-gradient(135deg, #282be647, rgba(13, 235, 6, 0.1));
}

.scoring-rules summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
  list-style: none;
  border-radius: 6px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.15s;
}

.scoring-rules:hover {
  width: 100%;
  background: rgba(223, 5, 5, 0.1);
}

.scoring-rules summary::-webkit-details-marker {
  display: none;
}

.scoring-rules summary strong {
  color: var(--blue);
  font-size: 13px;
}

.scoring-rules[open] summary {
  margin-bottom: 12px;
}

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

.rule-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}

.rule-row strong,
.rule-row b {
  color: var(--blue);
}

.rule-row strong {
  font-size: 14px;
  font-weight: 900;
}

.rule-row.bonus {
  border-color: rgba(229, 29, 115, 0.28);
  background: linear-gradient(135deg, rgba(255, 211, 61, 0.28), rgba(229, 29, 115, 0.08));
}

.rule-row.bonus strong,
.rule-row.bonus b {
  color: var(--pink);
}

.admin-tools {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.user-import-form {
  padding: 18px;
}

.rules-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.rules-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.rules-card legend {
  padding: 0 6px;
  color: var(--blue);
  font-weight: 900;
}

.rules-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rules-card .toggle-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rules-card input[type="checkbox"] {
  min-height: auto;
  width: auto;
}

.settings-warning {
  padding: 12px;
  border: 1px solid rgba(229, 29, 115, 0.28);
  border-radius: 8px;
  color: var(--pink);
  background: rgba(229, 29, 115, 0.08);
  font-weight: 800;
}

.user-import-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0 8px;
}

.special-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

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

.standings-panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.bracket-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(229, 29, 115, 0.08), transparent 28%),
    linear-gradient(225deg, rgba(20, 189, 216, 0.1), transparent 32%),
    rgba(255, 255, 255, 0.94);
  overflow: hidden;
}

.bracket-stage-nav {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bracket-board {
  position: relative;
  overflow-x: auto;
  padding: 8px 4px 18px;
}

.bracket-canvas {
  position: relative;
  width: 1340px;
  height: 1010px;
  transform-origin: top left;
}

.bracket-header {
  position: absolute;
  top: 0;
  width: 132px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.bracket-header.center {
  width: 132px;
}

.bracket-lines {
  position: absolute;
  inset: 36px 0 auto;
  pointer-events: none;
}

.bracket-lines path {
  fill: none;
  stroke: rgba(23, 70, 223, 0.26);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.bracket-match {
  position: absolute;
  z-index: 2;
  width: 132px;
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(19, 27, 51, 0.08);
}

.final-card {
  min-height: 190px;
}

.bronze-card {
  min-height: 154px;
}

.third-place-label {
  position: absolute;
  z-index: 2;
  width: 132px;
  color: var(--blue);
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
}

.bracket-match-top,
.bracket-team,
.bracket-team-main {
  display: flex;
  align-items: center;
}

.bracket-match-top {
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bracket-match-top span {
  order: 2;
  align-self: center;
  color: var(--pink);
  text-decoration: underline;
}

.bracket-team {
  justify-content: space-between;
  gap: 8px;
  min-height: 31px;
  margin-top: 5px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.bracket-team.winner {
  color: var(--blue);
  font-weight: 900;
}

.bracket-team-main {
  min-width: 0;
  gap: 6px;
  font-size: 12px;
}

.bracket-team-main span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-team strong {
  display: grid;
  min-width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-bottom: 2px solid var(--green);
  border-radius: 0;
  background: transparent;
}

.bracket-venue {
  display: none;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.standings-panel.is-hidden {
  display: none;
}

.standings-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 8px;
}

.standings-head .section-title h2 {
  margin-bottom: 0;
}

.standings-head > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.standings-table-wrap {
  overflow-x: auto;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.standings-table th,
.standings-table td {
  padding: 10px;
  border-top: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.standings-table th {
  color: var(--muted);
  background: #f3f5f8;
  font-weight: 800;
}

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

.standings-table tr.is-direct td:first-child {
  border-left: 4px solid var(--green);
}

.standings-table tr.is-third td:first-child {
  border-left: 4px solid var(--yellow);
}

.table-team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.table-flag {
  width: 28px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  object-fit: cover;
}

.result-group-nav {
  display: grid;
  grid-template-columns: repeat(12, minmax(42px, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1.2fr) auto minmax(110px, auto);
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.result-row-head {
  min-width: 0;
}

.result-row p {
  margin: 0;
  font-weight: 800;
}

.result-row small {
  color: var(--muted);
}

.result-row button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.reset-demo-btn {
  display: block;
  min-height: 38px;
  margin-top: 28px;
  padding: 0 16px;
  color: #fff;
  border: 1px solid rgba(229, 29, 115, 0.6);
  border-radius: 8px;
  background: var(--pink);
  font-size: 13px;
  font-weight: 800;
  opacity: 0.82;
}

.reset-demo-btn:hover {
  opacity: 1;
}

.admin-lock {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.content-panel,
.side-panel {
  background: rgba(240, 240, 240, 0.94);
}

.prediction-form button:hover:not(:disabled),
.group-prediction-form button[type="submit"]:hover:not(:disabled),
.user-row button:hover:not(:disabled) {
  opacity: 0.85;
  filter: brightness(1.07);
}

.prediction-form button.is-edit-mode {
  background: var(--green);
}

@media (max-width: 1320px) {
  .match-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .dashboard {
    margin: 16px 0 24px;
  }

  .hero-grid {
    padding: 27px 22px 14px;
  }

  .topbar,
  .nav-actions,
  .toolbar,
  .user-import-actions,
  .result-row,
  .special-grid {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar select {
    max-width: none;
  }

  .prediction-form,
  .result-row,
  .special-grid,
  .user-import-actions,
  .login-row,
  .rules-card,
  .subtabs,
  .group-prediction-list li {
    grid-template-columns: 1fr;
  }

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

  .group-nav {
    grid-template-columns: repeat(6, 1fr);
  }

  .prediction-grid,
  .result-grid {
    grid-template-columns: minmax(82px, 1fr) 64px 64px;
  }

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

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

  .result-group-nav {
    grid-template-columns: repeat(6, 1fr);
  }

  .teams {
    font-size: 16px;
  }

  .standings-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .bracket-board {
    padding-bottom: 12px;
  }
}

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #f7f8fb;
  border-top: 1px solid var(--line);
  padding: 6px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  z-index: 100;
}
