:root {
  --red: #e30613;
  --red-deep: #b80510;
  --red-soft: rgba(227, 6, 19, 0.12);
  --black: #111111;
  --ink: #1a1a1a;
  --ink-muted: #5c5c5c;
  --ink-dim: #8a8a8a;
  --white: #ffffff;
  --paper: #f4f4f4;
  --paper-2: #ebebeb;
  --line: rgba(17, 17, 17, 0.1);
  --line-strong: rgba(17, 17, 17, 0.18);
  --win: #1a7a3c;
  --radius: 2px;
  --font-display: "Oswald", sans-serif;
  --font-body: "Manrope", sans-serif;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

*,
*::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: var(--paper);
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #ffffff 0%, #f6f6f6 45%, #efefef 100%);
  pointer-events: none;
}

.atmosphere::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--black) 0 42%, var(--red) 42% 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image:
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 18px,
      #111 18px,
      #111 19px
    );
}

.site-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  animation: rise 0.65s ease-out both;
}

.brand-block {
  display: grid;
  gap: 1.25rem;
  align-items: end;
}

@media (min-width: 720px) {
  .brand-block {
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 1.75rem;
  }
}

.brand-logo {
  display: block;
  width: min(100%, 320px);
  height: auto;
  background: var(--white);
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-style: italic;
  color: var(--black);
}

.brand-sub {
  margin: 0.55rem 0 0;
  max-width: 28rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.header-actions {
  padding-bottom: 0.2rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.7rem 1.15rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:active {
  transform: scale(0.97);
}

.btn-ghost {
  background: var(--white);
  border-color: var(--line-strong);
  color: var(--ink-muted);
}

.btn-ghost:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--red-deep);
  border-color: var(--red-deep);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  display: grid;
  gap: 2.75rem;
}

.section-head {
  margin-bottom: 1.15rem;
}

.fixture-section {
  animation: rise 0.65s ease-out 0.06s both;
}

.fixture-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.1rem;
  margin: -0.35rem 0 1rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.fixture-table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.fixture-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  font-size: 0.9rem;
}

.fixture-table thead th {
  background: var(--black);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.85rem 0.9rem;
  border-bottom: 3px solid var(--red);
}

.fixture-table td {
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  vertical-align: middle;
  font-weight: 600;
}

.fixture-table tbody tr:last-child td {
  border-bottom: none;
}

.fixture-table .vs-col {
  text-align: center;
  color: var(--ink-dim);
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: 0.06em;
  width: 3.5rem;
}

.fixture-table tbody tr.serie-a {
  background: #eaf3fb;
}

.fixture-table tbody tr.serie-b {
  background: #eaf7ef;
}

.fixture-table tbody tr.serie-c {
  background: #ffffff;
}

.serie-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  border-radius: 2px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  line-height: 1;
}

.serie-a .serie-pill {
  background: #1f4e79;
}

.serie-b .serie-pill {
  background: #1a7a3c;
}

.serie-c .serie-pill {
  background: var(--red);
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-style: italic;
  line-height: 1;
  color: var(--black);
}

.section-head p {
  margin: 0.35rem 0 0;
  color: var(--ink-dim);
  font-size: 0.85rem;
}

.standings-section {
  animation: rise 0.65s ease-out 0.1s both;
}

.standings-grid {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .standings-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.group-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.group-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.8rem 1rem 0.6rem;
  border-bottom: 3px solid var(--red);
  background: var(--black);
  color: var(--white);
}

.group-card-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-style: italic;
  line-height: 1;
}

.group-card-head span {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.standings-table th {
  padding: 0.45rem 0.35rem;
  font-weight: 700;
  color: var(--ink-dim);
  text-align: center;
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}

.standings-table th:first-child,
.standings-table td:first-child {
  text-align: left;
  padding-left: 0.85rem;
}

.standings-table th:last-child,
.standings-table td:last-child {
  padding-right: 0.85rem;
}

.standings-table td {
  padding: 0.55rem 0.35rem;
  text-align: center;
  border-bottom: 1px solid rgba(17, 17, 17, 0.05);
  vertical-align: middle;
}

.standings-table tr:last-child td {
  border-bottom: none;
}

.standings-table tbody tr:hover {
  background: var(--red-soft);
}

.pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-right: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 2px;
  background: var(--paper-2);
  color: var(--ink-muted);
}

.pos.is-top {
  background: var(--red);
  color: var(--white);
}

.team-name {
  font-weight: 600;
  text-align: left;
  max-width: 9.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pts-cell {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}

.status-banner {
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.status-banner.is-error {
  border-left-color: var(--red);
  color: var(--red-deep);
}

.matches-section {
  animation: rise 0.65s ease-out 0.18s both;
}

.match-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.filter {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.filter:hover {
  color: var(--black);
  border-color: var(--black);
}

.filter.is-active {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.matches-list {
  display: grid;
  gap: 0.6rem;
}

.match-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.match-row.is-played {
  border-left: 4px solid var(--red);
}

.match-row.is-hidden {
  display: none;
}

.group-badge {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: var(--black);
  color: var(--white);
}

.match-body {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

@media (min-width: 640px) {
  .match-body {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
  }
}

.side {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

@media (min-width: 640px) {
  .side.away {
    flex-direction: row-reverse;
    text-align: right;
  }
}

.side-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-input {
  width: 2.6rem;
  height: 2.4rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1;
  color: var(--black);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -moz-appearance: textfield;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.score-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
  background: var(--white);
}

.score-input.has-value {
  border-color: var(--black);
  background: var(--white);
}

.vs-label {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  text-transform: uppercase;
  font-style: italic;
}

.match-status {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}

.match-status.is-live {
  color: var(--win);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(100%, 420px);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.login-card .brand-logo {
  width: 100%;
  margin-bottom: 1.25rem;
}

.login-card h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-style: italic;
  text-transform: uppercase;
  font-size: 2rem;
  line-height: 1;
}

.login-card p {
  margin: 0 0 1.25rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

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

.form-field label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.form-field input {
  height: 2.6rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.form-field input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.form-error {
  min-height: 1.25rem;
  margin: 0 0 0.75rem;
  color: var(--red);
  font-size: 0.85rem;
}

.form-actions {
  display: grid;
  gap: 0.6rem;
}

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
}

.admin-bar strong {
  color: var(--red);
}

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: var(--ink-dim);
  font-size: 0.75rem;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
}

.footer-logo {
  width: 140px;
  height: auto;
  opacity: 0.9;
}

.hidden {
  display: none !important;
}

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

@media (max-width: 639px) {
  .match-row {
    grid-template-columns: auto 1fr;
  }

  .match-status {
    grid-column: 1 / -1;
    padding-left: calc(2rem + 1rem);
  }
}
