/* 3v3 South Africa — Mobile-First Pitch Referee Portal */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@600;700;800;900&family=Plus+Jakarta+Sans:wght@400;600;700&family=JetBrains+Mono:wght@600;700&display=swap');

:root {
  --green-dark: #0a2618;
  --green: #0d4a2d;
  --gold: #ffb800;
  --bg: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #cbd5e1;
  --font-hero: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

.ref-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, #0d4a2d 0%, #0a2618 75%);
}

.ref-login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 20px;
  padding: 30px;
  border-top: 5px solid var(--gold);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

.ref-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.ref-brand img {
  height: 48px;
  border-radius: 10px;
}

.ref-brand h1 {
  font-family: var(--font-hero);
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--green-dark);
  line-height: 1.1;
}

.ref-brand p {
  font-size: 0.82rem;
  color: var(--muted);
}

.ref-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.ref-field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green-dark);
}

.ref-field input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.ref-error-box {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.ref-hint {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 14px;
}

.ref-footer-links {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.85rem;
}

.ref-footer-links a {
  color: var(--green);
  text-decoration: none;
  font-weight: 700;
}

/* Console */
.ref-topbar {
  background: var(--green-dark);
  color: #ffffff;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--gold);
}

.ref-topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ref-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ref-pitch-badge {
  background: var(--gold);
  color: #000000;
  font-family: var(--font-hero);
  font-weight: 900;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 10px;
}

.ref-identity h2 {
  font-family: var(--font-hero);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.15;
}

.ref-identity p {
  font-size: 0.82rem;
  color: #cbd5e1;
}

.ref-topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ref-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.ref-btn-gold,
.ref-btn-outline,
.ref-btn-danger,
.ref-btn-green {
  font-family: var(--font-hero);
  font-weight: 800;
  font-size: 0.86rem;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  border: none;
}

.ref-btn-gold {
  background: var(--gold);
  color: #000000;
}

.ref-btn-full {
  width: 100%;
  padding: 13px;
  font-size: 1rem;
}

.ref-btn-outline {
  background: #ffffff;
  color: var(--green-dark);
  border: 1px solid var(--border);
}

.ref-btn-danger {
  background: rgba(220, 38, 38, 0.16);
  color: #fecaca;
  border: 1px solid rgba(254, 202, 202, 0.35);
}

.ref-btn-green {
  background: var(--green-dark);
  color: #ffffff;
}

.ref-rules-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 5px solid var(--gold);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
}

.ref-rules-card h3 {
  font-family: var(--font-hero);
  color: var(--green-dark);
  margin-bottom: 8px;
}

.ref-rules-card pre {
  font-family: var(--font-body);
  white-space: pre-wrap;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
}

.ref-timer-bar {
  background: var(--green-dark);
  color: #ffffff;
  border-radius: 16px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.timer-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.timer-digits {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.05;
}

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

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

.ref-section-head h3 {
  font-family: var(--font-hero);
  font-size: 1.25rem;
  color: var(--green-dark);
}

.ref-section-head span {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.ref-matches-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ref-match-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.ref-match-card--live {
  border: 2px solid var(--gold);
}

.ref-match-card--completed {
  border-left: 6px solid #059669;
}

.ref-match-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ref-match-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-dark);
  background: #eef5f1;
  padding: 4px 10px;
  border-radius: 8px;
}

.ref-status-pill {
  font-family: var(--font-hero);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
}

.ref-status-pill--SCHEDULED {
  background: #e2e8f0;
  color: #334155;
}

.ref-status-pill--LIVE {
  background: rgba(255, 184, 0, 0.25);
  color: #92400e;
}

.ref-status-pill--COMPLETED {
  background: rgba(0, 200, 83, 0.16);
  color: #065f46;
}

.ref-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.ref-team-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.ref-team-box h4 {
  font-family: var(--font-hero);
  font-size: 1rem;
  color: var(--green-dark);
  margin-bottom: 10px;
}

.score-stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.score-step-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
}

.score-step-btn:active {
  transform: scale(0.95);
}

.score-val-input {
  width: 56px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 6px;
  background: #ffffff;
}

.ref-vs {
  font-family: var(--font-hero);
  font-weight: 900;
  color: var(--muted);
}

.ref-match-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.ref-notes-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: 0.88rem;
}

.ref-stage-pill {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.ref-tiebreak-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #78350f;
}

.ref-tiebreak-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #f59e0b;
  background: #ffffff;
  font-weight: 700;
}

@media (max-width: 640px) {
  .ref-scoreboard {
    grid-template-columns: 1fr;
  }
  .ref-vs {
    text-align: center;
  }
}
