:root {
  --purple: #37003c;
  --pink: #e90052;
  --green: #00ff85;
  --grey: #f4f4f6;
  --text: #2c2c2c;
  --border: #e8e8ec;
  --muted: #8a8a92;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--grey);
  color: var(--text);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

nav {
  background: var(--purple);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

nav .brand {
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}
nav .brand span { color: var(--green); }

nav .links a, nav .links button {
  color: white;
  text-decoration: none;
  margin-left: 18px;
  font-size: 0.95rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
nav .links a:hover, nav .links button:hover { color: var(--green); }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

h1 { font-size: 1.4rem; margin: 0 0 4px; line-height: 1.3; }
h2 { font-size: 1.05rem; margin: 28px 0 0; }
.subtitle { color: var(--muted); font-size: 0.88rem; margin: 0 0 20px; line-height: 1.6; }

.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.flash {
  background: #fff2e0;
  border-left: 4px solid var(--pink);
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.error {
  background: #fde8e8;
  border-left: 4px solid #c0392b;
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* ---- Fixture row: two stacked lines, fixed-width columns so everything lines up ---- */
.fixture-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.fixture-row:last-child { border-bottom: none; }

.fixture-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team {
  flex: 1 1 0;
  min-width: 0;
  font-weight: 600;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team.home { text-align: right; }
.team.away { text-align: left; }

.score-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.score-inputs input {
  width: 42px;
  height: 40px;
  padding: 0;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0;
}
.score-inputs input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(233,0,82,0.12);
}
.score-inputs input:disabled {
  background: var(--grey);
  color: var(--muted);
  border-color: var(--border);
}
.score-inputs span {
  color: #ccc;
  font-weight: 700;
}

.fixture-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--muted);
}

.kickoff-time {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}

.fixture-result {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text);
  font-size: 0.8rem;
  white-space: nowrap;
}

.points-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
}
.points-3, .points-exact { background: var(--green); color: var(--purple); }
.points-1, .points-correct { background: #ffe08a; color: #6b5100; }
.points-0 { background: var(--grey); color: var(--muted); }

.rules {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--muted);
}
.rules .swatch {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-weight: 700;
  margin-right: 5px;
  font-size: 0.7rem;
}

button, .btn {
  background: var(--pink);
  color: white;
  border: none;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1.2;
}
button:hover, .btn:hover { opacity: 0.9; }
.btn-secondary { background: var(--purple); }
.btn-sm {
  padding: 5px 14px;
  font-size: 0.76rem;
  border-radius: 6px;
}

form.inline { display: inline; }

input[type=text], input[type=email], input[type=password], input[type=datetime-local], input[type=number] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 14px;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus,
input[type=datetime-local]:focus, input[type=number]:focus {
  outline: none;
  border-color: var(--pink);
}
label { font-size: 0.82rem; color: #555; font-weight: 600; display: block; margin-bottom: 5px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.3px; }
tr.me { background: #fff8ec; font-weight: 700; }
.rank { color: var(--muted); width: 28px; }

.locked-badge {
  background: var(--grey);
  color: var(--muted);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}

/* ---- Gameweek switcher: horizontal pill row ---- */
.gw-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.gw-nav::-webkit-scrollbar { display: none; }
.gw-nav a {
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--purple);
  font-size: 0.82rem;
  font-weight: 600;
  background: white;
  border: 1.5px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.gw-nav a.current {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
}

@media (max-width: 380px) {
  .team { font-size: 0.85rem; }
  .score-inputs input { width: 36px; height: 36px; font-size: 0.9rem; }
  .card { padding: 16px; }
}
