/* style.css
   Visual concept: a matchday scoreboard on a floodlit pitch.
   Palette:
     --pitch:      #14371F  (deep turf green, primary background)
     --pitch-dark: #0C2415  (darker turf, footer/nav)
     --chalk:      #F4F6F1  (chalk-line white, primary text on dark)
     --ink:        #16211B  (near-black text on light backgrounds)
     --gold:       #D3A64B  (trophy gold, single accent)
     --line:       rgba(244, 246, 241, 0.18) (chalk line at low opacity)
   Type:
     Headings -> "Oswald" (condensed, stadium-signage feel)
     Body     -> "Inter" (clean, legible for data-heavy tables)
*/

@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600&display=swap");

:root {
  --pitch: #14371f;
  --pitch-dark: #0c2415;
  --chalk: #f4f6f1;
  --ink: #16211b;
  --gold: #d3a64b;
  --line: rgba(244, 246, 241, 0.18);
  --red-card: #b5423a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--chalk);
  color: var(--ink);
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: "Oswald", "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.4em 0;
}

a {
  color: inherit;
}

/* --- Top nav: styled like a scoreboard header --- */
.scoreboard-nav {
  background: var(--pitch-dark);
  color: var(--chalk);
  border-bottom: 3px solid var(--gold);
}

.scoreboard-nav .nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.scoreboard-nav .brand {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--chalk);
}

.scoreboard-nav .brand span {
  color: var(--gold);
}

.scoreboard-nav nav a {
  text-decoration: none;
  color: var(--chalk);
  font-size: 0.95rem;
  margin-left: 1.25rem;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.scoreboard-nav nav a:hover,
.scoreboard-nav nav a.active {
  border-bottom: 2px solid var(--gold);
}

/* --- Page container --- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* --- Homepage hero --- */
.hero {
  background: var(--pitch);
  color: var(--chalk);
  padding: 3.5rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  /* faint pitch markings: a center circle, drawn purely in CSS */
  content: "";
  position: absolute;
  right: -80px;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  height: 320px;
  border: 2px solid var(--line);
  border-radius: 50%;
}

.hero-inner {
  max-width: 960px;
  margin: 0 auto;
  position: relative;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  max-width: 14ch;
}

.hero p {
  max-width: 46ch;
  color: rgba(244, 246, 241, 0.85);
  font-size: 1.05rem;
}

/* --- Feature tiles on homepage (deliberately square, not "SaaS cards") --- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 2rem;
}

.tile {
  background: var(--pitch);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--chalk);
  border-top: 3px solid var(--gold);
  transition: background 0.15s ease;
}

.tile:hover {
  background: #1c4a29;
}

.tile h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.tile p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(244, 246, 241, 0.85);
}

/* --- Forms / controls --- */
.controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #d8ddd2;
}

.field label {
  display: block;
  font-size: 0.8rem;
  color: #4a564d;
  margin-bottom: 0.3rem;
}

select, input[type="text"] {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #b9c2ba;
  background: #fff;
  color: var(--ink);
  min-width: 200px;
}

button, .btn {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.1rem;
  background: var(--pitch);
  color: var(--chalk);
  border: none;
  cursor: pointer;
}

button:hover, .btn:hover {
  background: var(--pitch-dark);
}

/* --- Standings table --- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead th {
  text-align: left;
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: #4a564d;
  border-bottom: 2px solid var(--pitch);
  padding: 0.5rem 0.6rem;
}

tbody td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid #e3e7de;
}

tbody tr:hover {
  background: #eef2e9;
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.team-cell img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.pts {
  font-weight: 600;
}

.form-badge {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  line-height: 1.1em;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
  margin-right: 2px;
}

.form-w { background: #3d7a4f; }
.form-d { background: #97904a; }
.form-l { background: var(--red-card); }

/* --- Fixture / match rows --- */
.fixture-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #e3e7de;
  border: 1px solid #e3e7de;
}

.fixture {
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
}

.fixture .side {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
}

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

.fixture img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.fixture .mid {
  text-align: center;
  min-width: 100px;
}

.fixture .score {
  font-family: "Oswald", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.fixture .status {
  font-size: 0.75rem;
  color: #6b756c;
}

.status.live {
  color: var(--red-card);
  font-weight: 600;
}

/* --- Search result cards (team / player) --- */
.result-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #e3e7de;
  border: 1px solid #e3e7de;
}

.result {
  background: #fff;
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.result img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.result .details h3 {
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.result .details p {
  margin: 0;
  font-size: 0.88rem;
  color: #556157;
}

/* --- Error / empty states --- */
.notice {
  background: #fdf3e2;
  border-left: 3px solid var(--gold);
  padding: 0.9rem 1rem;
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

/* --- Footer --- */
footer {
  background: var(--pitch-dark);
  color: var(--line);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .fixture {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .fixture .side.away {
    justify-content: center;
    text-align: center;
  }
  select, input[type="text"] {
    min-width: 100%;
  }
}

/* --- Accessibility: visible focus states --- */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
