:root {
  --wc-bg: #f3f7f4;
  --wc-surface: #ffffff;
  --wc-text: #1b1f23;
  --wc-muted: #64748b;
  --wc-primary: #198754;
  --wc-primary-dark: #10663f;
  --wc-border: #dbe5df;
  --wc-header: #113322;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html { font-size: 16px; }
}

body {
  margin-bottom: 60px;
  color: var(--wc-text);
  background:
    radial-gradient(circle at 15% -10%, rgba(25, 135, 84, 0.10), transparent 30%),
    radial-gradient(circle at 85% -20%, rgba(17, 51, 34, 0.12), transparent 35%),
    var(--wc-bg);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem rgba(25, 135, 84, .35);
}

.site-header {
  background: linear-gradient(120deg, var(--wc-header), #1f5138);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.top-accent {
  height: 4px;
  background: linear-gradient(90deg, #6dd5a2, #2ea16c, #6dd5a2);
}

.navbar-dark .nav-link { color: rgba(255,255,255,.88); }
.navbar-dark .nav-link:hover,
.navbar-dark .nav-link:focus { color: #fff; }

.navbar-dark .nav-link.admin-nav-link {
  color: #ffe9a9;
  font-weight: 600;
}

.navbar-dark .nav-link.admin-nav-link:hover,
.navbar-dark .nav-link.admin-nav-link:focus {
  color: #fff6cf;
}

.brand-ball {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.16);
}

.brand-title {
  color: #fff;
  font-weight: 700;
  line-height: 1;
}

.brand-subtitle {
  font-size: .7rem;
  color: rgba(255,255,255,.8);
}

.user-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  color: rgba(255,255,255,.9);
}

.user-chip-name {
  font-size: .95rem;
  font-weight: 600;
  color: rgba(255,255,255,.95);
}

.user-chip-domain {
  font-size: .72rem;
  color: rgba(255,255,255,.72);
}

.content-shell {
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(219, 229, 223, .7);
  border-radius: 12px;
  padding-top: 1rem;
}

.card-surface,
.stat-card {
  border: 1px solid var(--wc-border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .04);
}

.stat-label {
  color: var(--wc-muted);
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0;
}

.prediction-section .card-header {
  background: #f8fbf9;
  border-bottom: 1px solid var(--wc-border);
}

.prediction-table th { white-space: nowrap; }

.prediction-table .prediction-col {
  min-width: 320px;
  white-space: nowrap;
}

.rules-box {
  border: 1px solid var(--wc-border);
  background: #f7fbf8;
}

.top-team-select {
  width: 250px;
  min-width: 250px;
}

.bonus-team-select {
  width: 250px;
  min-width: 250px;
}

.top-team-select-unsaved {
  border-color: #f0ad4e;
  box-shadow: 0 0 0 0.15rem rgba(240, 173, 78, .2);
}

.top-team-select-row {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: nowrap;
}

.top-team-selected-flag {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.top-scorer-selected-summary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.top-scorer-entry {
  display: grid;
  gap: .5rem;
  max-width: 620px;
}

.top-scorer-manual-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr);
  gap: .5rem;
}

.fixture-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem;
}

.team-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: #eef6f1;
  font-size: .75rem;
  font-weight: 700;
  color: #2d5a44;
}

.flag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(120deg, #1f8555, #8cc7a7);
}

.team-flag-img,
.team-flag-fallback {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d6e3db;
  background: #fff;
  overflow: hidden;
  font-size: .75rem;
}

.team-flag-img {
  object-fit: cover;
}

.team-name { margin-right: .2rem; }

.score-form .score-input {
  width: 56px;
  text-align: center;
}

.locked-score {
  font-weight: 700;
  color: #334155;
}

.row-locked {
  background: #fbfcfd;
}

.validation-error-banner {
  background: #dc3545;
  color: #fff;
  border: 1px solid #b02a37;
  border-radius: .375rem;
  padding: .5rem .75rem;
}

.result-row-invalid > td {
  border-top: 2px solid #dc3545;
  border-bottom: 2px solid #dc3545;
  background: #fff5f5;
}

.result-row-invalid > td:first-child {
  border-left: 2px solid #dc3545;
}

.result-row-invalid > td:last-child {
  border-right: 2px solid #dc3545;
}

.team-most-cards-row > td {
  background: #fff8cc !important;
}

.player-edit-row > td {
  background: #eef9f1 !important;
}

.leaderboard-table .is-current-user {
  background: rgba(25, 135, 84, .10);
}

.rank-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #edf2ef;
  font-weight: 700;
}

.rank-1 { background: #ffe28a; }
.rank-2 { background: #d8dee7; }
.rank-3 { background: #f0c8a0; }

.table > :not(caption) > * > * {
  border-bottom-color: #e5ece7;
}

@media (max-width: 991.98px) {
  .user-chip { margin: .5rem 0; align-items: flex-start; }
  .content-shell { border-radius: 0; border-left: 0; border-right: 0; }
}

@media (max-width: 767.98px) {
  .stat-value { font-size: 1.5rem; }
  .team-name { font-size: .9rem; }
  .top-scorer-manual-row { grid-template-columns: 1fr; }
}
