*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #16a34a;
  --green-dark: #166534;
  --green-light: #dcfce7;
  --gold: #d97706;
  --bg: #f0fdf4;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --red: #dc2626;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  background: var(--green-dark);
  color: white;
  padding: 0.9rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

header h1 { font-size: 1.1rem; font-weight: 700; }

nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }

nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  transition: background 0.15s;
}
nav a:hover { background: rgba(255,255,255,0.15); color: white; }

main { max-width: 820px; margin: 0 auto; padding: 2rem 1rem 4rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

h2 { font-size: 1rem; font-weight: 600; color: var(--green-dark); margin-bottom: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--green); color: white; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-gold { background: var(--gold); color: white; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input[type="text"],
input[type="number"],
input[type="password"],
input[type="datetime-local"] {
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  background: white;
  width: 100%;
  transition: border-color 0.15s;
}
input[type="number"] { width: 4rem; text-align: center; }
input:focus { outline: none; border-color: var(--green); }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.form-group { margin-bottom: 1rem; }

/* Match cards */
.match-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  background: white;
}
.match-card.locked { opacity: 0.7; }

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.match-teams {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.match-vs { color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.match-meta { font-size: 0.78rem; color: var(--muted); }

.prediction-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.prediction-label { font-size: 0.8rem; color: var(--muted); }

.score-actual {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-dark);
  padding: 0 0.25rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-exact { background: #d1fae5; color: #065f46; }
.badge-correct { background: #fef3c7; color: #92400e; }
.badge-none { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #e0e7ff; color: #3730a3; }
.badge-locked { background: #f1f5f9; color: #475569; }

/* Leaderboard */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.7rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }
tr.highlight td { background: var(--green-light); }

.rank { font-weight: 700; font-size: 1rem; }

.alert { padding: 0.7rem 0.9rem; border-radius: 8px; font-size: 0.875rem; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }

.loading { text-align: center; color: var(--muted); padding: 2.5rem; }

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.25rem 0 0.5rem;
}
.section-label:first-child { margin-top: 0; }

footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}
footer a { color: var(--muted); }

@media (max-width: 560px) {
  header { flex-direction: column; text-align: center; }
  .match-teams { font-size: 0.85rem; }
}
