/* ─── Reset & Variables ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:  #1b4332;
  --green-mid:   #2d6a4f;
  --green-light: #52b788;
  --gold:        #c8952a;
  --gold-light:  #f4d03f;
  --bg:          #fdf6e3;
  --card:        #ffffff;
  --text:        #1a1a1a;
  --text-muted:  #666;
  --border:      #ddd;
  --red:         #b03a2e;
  --green-win:   #1e8449;
  --radius:      6px;
  --shadow:      0 2px 8px rgba(0,0,0,.12);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.5;
}

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--green-dark);
  color: #fff;
  padding: .7rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}
.logo {
  font-size: 1.35rem;
  font-weight: 900;
  text-decoration: none;
  color: var(--gold-light);
  font-family: Impact, 'Arial Narrow', 'Franklin Gothic Medium', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.logo .tagline {
  display: block;
  font-size: .62rem;
  font-weight: 400;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: rgba(255,255,255,.55);
  text-transform: none;
  letter-spacing: .3px;
  margin-top: 1px;
}
nav { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem; }
nav a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  padding: .3rem .7rem;
  border-radius: var(--radius);
  font-size: .85rem;
  transition: background .15s, color .15s;
}
nav a:hover { background: rgba(255,255,255,.12); color: var(--gold-light); }
nav a.nav-active { background: rgba(255,255,255,.15); color: #fff; }

/* ─── Flash messages ──────────────────────────────────────────────────────────── */
.flash-zone {
  max-width: 1380px;
  margin: .75rem auto 0;
  padding: 0 1rem;
  width: 100%;
}
.flash {
  background: #fff8e1;
  border-left: 4px solid var(--gold);
  padding: .6rem 1rem;
  border-radius: var(--radius);
  margin-bottom: .4rem;
  font-size: .88rem;
}

/* ─── Main ────────────────────────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 1380px;
  margin: 1.25rem auto 2rem;
  padding: 0 1.5rem;
  width: 100%;
}

/* ─── Hero banner ─────────────────────────────────────────────────────────────── */
.hero {
  background: var(--green-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 2rem 2rem 1.75rem;
  margin-bottom: 1.75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '⚽';
  position: absolute;
  font-size: 9rem;
  opacity: .06;
  right: -1rem;
  top: -1rem;
  line-height: 1;
}
.hero h1 {
  font-family: Impact, 'Arial Narrow', 'Franklin Gothic Medium', sans-serif;
  font-size: 2.6rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--gold-light);
  line-height: 1.1;
}
.hero .hero-sub {
  color: rgba(255,255,255,.65);
  margin-top: .5rem;
  font-size: .95rem;
  font-style: italic;
}

/* ─── Section headers ─────────────────────────────────────────────────────────── */
.section-title {
  font-family: Impact, 'Arial Narrow', sans-serif;
  font-size: 1.35rem;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: .8px;
  border-bottom: 3px solid var(--gold);
  padding-bottom: .35rem;
  margin: 1.5rem 0 1rem;
}
.section-title:first-child { margin-top: 0; }

/* ─── Page title ──────────────────────────────────────────────────────────────── */
.page-title {
  font-family: Impact, 'Arial Narrow', sans-serif;
  font-size: 2rem;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: .2rem;
}
.page-meta {
  color: var(--text-muted);
  font-size: .85rem;
  margin-bottom: 1.25rem;
}

/* ─── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-dark);
  margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--gold);
}

/* ─── Match Day Cards ─────────────────────────────────────────────────────────── */
.md-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.md-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  justify-content: space-between;
}
.md-card > div:first-child { flex-grow: 1; }
.md-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.15); }
/* Multi-match cards get a subtle left accent */
.md-card.md-card-multi {
  border-left: 5px solid var(--green-mid);
}
.md-card-label {
  font-weight: 700;
  font-size: .87rem;
  line-height: 1.4;
}
.md-card-label .match-line {
  display: block;
  margin-bottom: .08rem;
}
.md-card-label .match-line::before {
  content: '⚽ ';
  margin-right: .15rem;
}
.md-card-date  { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }
.md-card-actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: auto; }

/* Each match line in the card label gets a small marker to make multiple matches obvious */
.md-card-label { display: block; }
.md-card-label .match-line { position: relative; padding-left: 1.05rem; margin-bottom: .18rem; font-size: .88rem; line-height: 1.45; }
.md-card-label .match-line::before { content: '•'; position: absolute; left: 0; top: 0; color: var(--green-mid); font-size: 1.05rem; line-height: 1; }

/* ─── Status Badges ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: .15rem .55rem;
  border-radius: 999px;
  letter-spacing: .4px;
}
.badge-open    { background: #d4edda; color: #155724; }
.badge-locked  { background: #fff3cd; color: #856404; }
.badge-settled { background: #cce5ff; color: #004085; }
.badge-pending { background: #f5c6cb; color: #721c24; }

/* ─── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: .48rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
  line-height: 1.4;
}
.btn:active { transform: scale(.97); }
.btn:hover  { opacity: .87; }
.btn-primary   { background: var(--green-dark); color: #fff; }
.btn-gold      { background: var(--gold); color: #fff; }
.btn-danger    { background: var(--red); color: #fff; }
.btn-secondary { background: #eee; color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: .28rem .7rem; font-size: .78rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ─── Forms ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: .85rem; }
.form-row    { display: flex; gap: .75rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }
label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .3rem;
  color: #333;
}
input[type=text],
input[type=number],
input[type=date],
input[type=password],
select,
textarea {
  width: 100%;
  padding: .48rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  background: #fafafa;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(45,106,79,.15);
  background: #fff;
}
textarea { resize: vertical; min-height: 80px; }

/* ─── Credit Meter ────────────────────────────────────────────────────────────── */
.credit-bar-wrap { margin-top: .3rem; }
.credit-bar-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .25rem;
  display: flex;
  justify-content: space-between;
}
.credit-bar {
  height: 8px;
  background: #e0e0e0;
  border-radius: 999px;
  overflow: hidden;
}
.credit-bar-fill {
  height: 100%;
  background: var(--green-mid);
  border-radius: 999px;
  transition: width .3s, background .3s;
}
.credit-bar-fill.over { background: var(--red); }

/* ─── Tables ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
thead tr { background: var(--green-dark); color: #fff; }
thead th {
  padding: .55rem .85rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .3px;
}
tbody tr { border-bottom: 1px solid #eee; transition: background .1s; }
tbody tr:hover { background: #f7f2e6; }
tbody td { padding: .5rem .85rem; vertical-align: middle; }
tfoot tr { background: #f0ebe0; font-weight: 700; }
tfoot td { padding: .5rem .85rem; border-top: 2px solid var(--border); }

/* ─── Result colors ───────────────────────────────────────────────────────────── */
.result-win   { color: var(--green-win);  font-weight: 700; }
.result-loss  { color: var(--red);        font-weight: 700; }
.result-pend  { color: var(--text-muted); font-style: italic; }
.result-break { color: #888; }

/* ─── Leaderboard podium rows ─────────────────────────────────────────────────── */
.podium-1 td { background: #fff9e2 !important; }
.podium-2 td { background: #f5f5f5 !important; }
.podium-3 td { background: #fdf0e8 !important; }
.rank-num { font-family: Impact, sans-serif; font-size: 1.1rem; color: var(--text-muted); }

/* ─── Picks transparency board ────────────────────────────────────────────────── */
.participant-block { margin-bottom: 1.25rem; }
.participant-block-header {
  background: var(--green-dark);
  color: #fff;
  padding: .4rem .85rem;
  font-weight: 700;
  font-size: .88rem;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.participant-block-body {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

/* ─── Two-column layout ───────────────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
}

/* ─── Settle form ─────────────────────────────────────────────────────────────── */
.wu-input {
  width: 90px !important;
  text-align: right;
  font-weight: 700;
}
.settle-row-pname { font-weight: 600; color: var(--green-dark); }

/* ─── Empty state ─────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-style: italic;
  font-size: .95rem;
}

/* ─── Footer ──────────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: .9rem 1rem;
  font-size: .78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ─── Utility ─────────────────────────────────────────────────────────────────── */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.gap-1 { gap: .5rem; }
.flex { display: flex; align-items: center; }
.justify-between { justify-content: space-between; }
.font-bold { font-weight: 700; }
.admin-panel { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .admin-panel { grid-template-columns: 1fr; } }

/* ─── Tournament match day card ───────────────────────────────────────────────── */
.md-card-tournament {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  border: 1px solid #c8952a;
  color: #f0e6cc;
}
.md-card-tournament .md-card-label { color: var(--gold-light); }
.md-card-tournament .md-card-date  { color: rgba(240,230,204,.55); }
.md-card-tournament:hover { box-shadow: 0 4px 20px rgba(200,149,42,.35); }

/* ─── Settled match day card ──────────────────────────────────────────────────── */
.md-card-settled {
  opacity: .55;
  background: var(--bg-main);
  border-color: var(--border);
}
.md-card-settled .md-card-label { text-decoration: line-through; color: var(--text-muted); }
.md-card-settled:hover { transform: none; box-shadow: none; opacity: .7; }

/* ─── Rules page ──────────────────────────────────────────────────────────────── */
.rules-page { max-width: 780px; line-height: 1.7; }
.rules-page h2 { font-size: 1.2rem; color: var(--green-dark); margin: 1.4rem 0 .6rem; }
.rules-page p  { margin-bottom: .75rem; }
.rules-page ul, .rules-page ol { padding-left: 1.4rem; margin-bottom: .75rem; }
.rules-page li { margin-bottom: .3rem; }
.rules-page hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.rules-page pre.rules-formula {
  background: #f4f0e6;
  border-left: 3px solid var(--gold);
  padding: .75rem 1rem;
  font-size: .85rem;
  border-radius: var(--radius);
  margin: .6rem 0 .8rem;
  overflow-x: auto;
}
.rules-page blockquote.rules-quote {
  border-left: 3px solid var(--green-light);
  padding: .5rem 1rem;
  color: var(--text-muted);
  font-style: italic;
  margin: .4rem 0 1rem;
  background: #f9f9f9;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.rules-note {
  background: #fef9e7;
  border: 1px solid #f9e79f;
  border-radius: var(--radius);
  padding: .6rem .9rem;
  font-size: .85rem;
  margin-bottom: .75rem;
  color: #7d6608;
}
