:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #65706b;
  --line: #dce4de;
  --paper: #f6f7f3;
  --panel: #ffffff;
  --green: #0f766e;
  --red: #be123c;
  --amber: #b45309;
  --blue: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

body.is-locked {
  min-height: 100vh;
  overflow: hidden;
}

body.is-locked .app-header,
body.is-locked main,
body.is-locked .app-footer {
  display: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(7, 12, 10, 0.78), rgba(23, 33, 27, 0.54)),
    url("assets/hero-pitch.png") center / cover;
}

.login-screen[hidden] {
  display: none;
}

.login-panel {
  width: min(430px, 100%);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 13, 11, 0.88);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  color: #fff;
}

.login-panel h1 {
  margin-bottom: 22px;
  font-size: 2.3rem;
}

.login-fields {
  display: grid;
  gap: 12px;
}

.login-fields label {
  display: grid;
  gap: 7px;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 750;
}

.login-fields input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.login-fields input:focus {
  outline: 2px solid #ff6b00;
  outline-offset: 2px;
}

.login-error {
  min-height: 22px;
  margin: 12px 0;
  color: #fecdd3;
  font-weight: 750;
}

.login-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  background: #ff6b00;
  color: #111;
  cursor: pointer;
  font-weight: 850;
}

.app-header {
  min-height: 220px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 36px clamp(18px, 4vw, 56px);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.88), rgba(23, 33, 27, 0.78)),
    url("assets/hero-pitch.png") center 58% / cover;
  color: #fff;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 800;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.45rem;
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: -56px auto 28px;
}

.status-pill,
.ghost-button,
.tab {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 750;
}

.status-pill {
  white-space: nowrap;
}

.status-pill.is-live {
  background: rgba(20, 184, 166, 0.28);
}

.scoreboard-band,
.controls-band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 33, 27, 0.11);
}

.scoreboard-band {
  padding: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.ghost-button {
  flex: 0 0 auto;
  border-color: var(--line);
  background: var(--ink);
  cursor: pointer;
}

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

.leader-card,
.player-card,
.group-card,
.match-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.leader-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-top: 4px solid var(--accent);
}

.leader-card p,
.player-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.leader-card strong {
  font-size: 1.45rem;
}

.rank {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent), white 80%);
  color: var(--accent);
  font-weight: 850;
}

.controls-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 18px 0;
  padding: 12px;
  box-shadow: none;
}

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

.tab {
  min-width: 86px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.tab.is-active {
  background: var(--green);
  color: #fff;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.search input {
  width: min(320px, 44vw);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--ink);
}

.view {
  display: none;
}

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

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

.player-card {
  padding: 16px;
  border-left: 5px solid var(--accent);
}

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

.swatch,
.owner-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

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

.team-chip {
  min-height: 44px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.team-chip.is-out {
  opacity: 0.58;
}

.team-chip small {
  color: var(--muted);
  font-weight: 800;
}

.flag {
  font-size: 1.3rem;
}

.team-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.team-table,
.group-card table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.owner-dot {
  margin-right: 7px;
  vertical-align: -1px;
}

.status,
.match-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status.live {
  background: #dcfce7;
  color: #166534;
}

.status.out {
  background: #ffe4e6;
  color: var(--red);
}

.group-card {
  padding: 14px;
}

.group-card h3 {
  font-size: 1.2rem;
}

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

.match-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
}

.match-row time,
.match-status {
  color: var(--muted);
}

.fixture {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}

.fixture span:last-child {
  text-align: right;
}

.fixture strong {
  min-width: 52px;
  text-align: center;
  font-size: 1.05rem;
}

.app-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 860px) {
  .app-header {
    min-height: 260px;
    flex-direction: column;
  }

  .leaderboard,
  .player-grid,
  .group-grid {
    grid-template-columns: 1fr;
  }

  .controls-band,
  .section-head,
  .app-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    align-items: stretch;
    flex-direction: column;
  }

  .search input {
    width: 100%;
  }

  .match-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 20px, 1180px);
  }

  .team-chips,
  .fixture {
    grid-template-columns: 1fr;
  }

  .fixture span:last-child,
  .fixture strong {
    text-align: left;
  }
}
