/* ==========================================================================
   ESSEVEE DESIGN SYSTEM
   Clubkleuren SV Zulte Waregem: rood & groen, bijnaam "Essevee".
   Signature: de diagonale "sjaal-sash" bovenaan elke pagina + grasstrepen-
   textuur op de achtergrond, als een stadion bij avondwedstrijd.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Kleuren — afgeleid van het officiële clublogo (rood/groen/goud) */
  --ew-red: #C8102E;
  --ew-red-dark: #8C0B21;
  --ew-green: #0B6E4F;
  --ew-green-dark: #073F2D;
  --ew-gold: #FFD204;
  --ew-pitch: #0A160F;       /* achtergrond: donkere avondwedstrijd-grastint */
  --ew-pitch-line: rgba(255,255,255,0.035);
  --ew-paper: #F4F1E6;       /* kaarten / lichte vlakken */
  --ew-ink: #12160F;
  --ew-muted: #9FB0A3;
  --ew-line: rgba(255,255,255,0.09);
  --ew-radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background:
    repeating-linear-gradient(
      100deg,
      var(--ew-pitch) 0px, var(--ew-pitch) 40px,
      #0C1912 40px, #0C1912 80px
    );
  color: #EDEFE9;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
}

a { color: var(--ew-gold); }

/* ---------- Sash banner (signature element) ---------- */
.ew-sash {
  position: relative;
  background: #0D1C13;
  padding: 16px 28px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-bottom: 3px solid var(--ew-gold);
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}
/* Het rood-groene "sjaal"-lint bovenaan, als accent i.p.v. volle diagonale knip */
.ew-sash::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    100deg,
    var(--ew-red) 0px, var(--ew-red) 36px,
    var(--ew-green) 36px, var(--ew-green) 72px
  );
}
.ew-sash .ew-wordmark {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ew-sash .ew-wordmark span { color: var(--ew-gold); }

.ew-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-left: auto;
  margin-right: 24px;
}
.ew-nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.ew-nav a:hover { color: #fff; border-color: var(--ew-gold); }
.ew-nav a[aria-current="page"] { color: #fff; border-color: var(--ew-green); }

/* ---------- Layout containers ---------- */
.ew-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.ew-page.wide { max-width: 1000px; }

.ew-lede {
  color: var(--ew-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

/* ---------- Cards ---------- */
.ew-card {
  background: var(--ew-paper);
  color: var(--ew-ink);
  border-radius: var(--ew-radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  border-left: 5px solid var(--ew-green);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.ew-card.accent-red { border-left-color: var(--ew-red); }
.ew-card a { color: var(--ew-green-dark); font-weight: 600; }
.ew-card .ew-meta { color: #6b7a70; font-size: 0.82rem; margin-bottom: 6px; }

/* ---------- Buttons ---------- */
.ew-btn {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 18px;
  border: none;
  border-radius: 6px;
  background: var(--ew-gold);
  color: #1a1400;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.1s ease;
}
.ew-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ew-btn.ghost {
  background: transparent;
  border: 2px solid var(--ew-gold);
  color: var(--ew-gold);
}
.ew-btn.small { padding: 5px 12px; font-size: 0.75rem; }

/* ---------- Forms ---------- */
.ew-input, .ew-select {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #d7d2c2;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  color: var(--ew-ink);
}

/* ---------- Status badges ---------- */
.ew-badge {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
}
.ew-badge.open { background: #DDF3E4; color: var(--ew-green-dark); }
.ew-badge.locked { background: #FDEBC8; color: #8A5A00; }
.ew-badge.finished { background: #E7E4D8; color: #6b7a70; }

/* ---------- Tables (klassement) ---------- */
.ew-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--ew-paper);
  color: var(--ew-ink);
  border-radius: var(--ew-radius);
  overflow: hidden;
}
.ew-table th {
  background: var(--ew-green-dark);
  color: #fff;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-align: left;
  padding: 10px 12px;
}
.ew-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #E4E0D2;
  font-size: 0.92rem;
}
.ew-table tr:nth-child(odd) td { background: rgba(11,110,79,0.04); }
.ew-table tr:first-child td { font-weight: 700; }

/* ---------- Chat ---------- */
.ew-chat-panel {
  background: rgba(244,241,230,0.06);
  border: 1px solid var(--ew-line);
  border-radius: var(--ew-radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.ew-chat-messages {
  flex: 1;
  overflow-y: auto;
  font-size: 0.85rem;
  margin-bottom: 10px;
  max-height: 400px;
}
.ew-chat-messages div { margin-bottom: 5px; line-height: 1.4; }
.ew-chat-messages .system { color: #7d8c81; font-style: italic; }
.ew-chat-messages .nick { color: var(--ew-gold); font-weight: 600; }

/* ---------- Auth widget (in de sash) ---------- */
.ew-authwidget {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  color: #fff;
}
.ew-authwidget button {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  background: var(--ew-gold);
  color: #1a1400;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
}
.ew-authwidget .ew-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
}

/* ---------- Login/register modal ---------- */
.ew-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,10,7,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.ew-modal {
  background: var(--ew-paper);
  color: var(--ew-ink);
  border-radius: var(--ew-radius);
  padding: 26px 28px;
  width: 320px;
  max-width: 90vw;
  border-top: 5px solid var(--ew-red);
}
.ew-modal h3 { margin-top: 0; }
.ew-modal .ew-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.ew-modal .ew-tab {
  flex: 1; text-align: center; padding: 7px;
  font-family: 'Oswald', sans-serif; text-transform: uppercase; font-size: 0.8rem;
  border-radius: 6px; cursor: pointer; background: #E7E4D8; color: #6b7a70;
}
.ew-modal .ew-tab.active { background: var(--ew-green); color: #fff; }
.ew-modal .field { margin-bottom: 10px; }
.ew-modal .field label { display: block; font-size: 0.8rem; margin-bottom: 3px; color: #556; }
.ew-modal .field input { width: 100%; }
.ew-modal .ew-error { color: var(--ew-red-dark); font-size: 0.85rem; margin: 6px 0 0; }
.ew-modal .ew-submit { width: 100%; margin-top: 6px; }
.ew-modal-link {
  font-size: 0.8rem; color: var(--ew-green); text-align: right; margin: -4px 0 12px;
  cursor: pointer; text-decoration: underline;
}
.ew-authwidget .ew-account-link {
  color: #fff; font-size: 0.85rem; text-decoration: underline; margin: 0 4px;
}


/* ---------- Responsive tabellen: horizontaal scrollbaar op smalle schermen ---------- */
.ew-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--ew-radius);
}
.ew-table-wrap .ew-table { min-width: 480px; }

/* ---------- Canvas-games: schalen mee met het scherm, nooit breder dan de viewport ---------- */
canvas {
  max-width: 100%;
  height: auto;
  touch-action: manipulation;
}

@media (max-width: 700px) {
  .ew-sash { padding: 12px 14px; gap: 10px; }
  .ew-sash .ew-wordmark { font-size: 1.15rem; }
  .ew-nav { gap: 14px; margin-right: 0; order: 3; width: 100%; justify-content: center; }
  .ew-page { padding: 18px 14px 50px; }

  /* iOS zoomt automatisch in bij focus op inputs met font-size < 16px — dit voorkomt dat */
  .ew-input, .ew-select { font-size: 16px; }

  /* Grotere, duimvriendelijke knoppen op mobiel (Apple HIG: min. 44px) */
  .ew-btn { padding: 12px 20px; font-size: 0.9rem; min-height: 44px; }
  .ew-btn.small { padding: 9px 16px; min-height: 38px; }

  .match-row { flex-direction: column; align-items: stretch !important; }
  .match-row input { width: 100% !important; }
  .match-row .ew-btn { width: 100%; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
/* ==========================================================================
   MEESTERWERK-POLISH — verfijningslaag bovenop het bestaande systeem.
   Eén signatuur, consequent doorgetrokken: het rood-groen-gouden sjaallint
   keert terug onder elke titel, in knoppen en in de sash-glans.
   ========================================================================== */

/* Stadionlicht: zachte gloed van bovenaf over de hele site */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 45% at 50% -12%, rgba(255,243,196,0.09), transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 115%, rgba(11,110,79,0.14), transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.ew-sash, .ew-page { position: relative; z-index: 1; }

/* Zachte fade-in bij het laden van elke pagina */
@keyframes ew-page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.ew-page { animation: ew-page-in 0.4s ease-out both; }

/* Sash: langzame glans over het sjaallint, als stadionverlichting die passeert */
.ew-sash::after {
  content: "";
  position: absolute;
  top: 0; left: -30%;
  width: 30%; height: 6px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: ew-sash-shine 7s ease-in-out infinite;
}
@keyframes ew-sash-shine {
  0%, 60% { left: -30%; }
  85%, 100% { left: 105%; }
}
.ew-sash .ew-wordmark { text-shadow: 0 2px 10px rgba(0,0,0,0.5); }

/* Titels: mini-sjaallint als onderstreping (het signatuur, overal terug) */
.ew-page h2 {
  position: relative;
  padding-bottom: 10px;
}
.ew-page h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 64px; height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    var(--ew-red) 0 33%, var(--ew-green) 33% 66%, var(--ew-gold) 66% 100%);
}

/* Knoppen: goudverloop, diepte en een duidelijke indruk-status */
.ew-btn {
  background: linear-gradient(180deg, #FFDF45, var(--ew-gold) 55%, #E6BD00);
  box-shadow: 0 2px 0 #A88A00, 0 4px 12px rgba(0,0,0,0.35);
}
.ew-btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 3px 0 #A88A00, 0 6px 16px rgba(0,0,0,0.4); }
.ew-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #A88A00, 0 2px 6px rgba(0,0,0,0.35); }
.ew-btn.ghost { background: transparent; box-shadow: none; }
.ew-btn.ghost:hover { background: rgba(255,210,4,0.12); }

/* Kaarten: gloss bovenaan + lift bij hover */
.ew-card {
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}
.ew-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 42%;
  border-radius: var(--ew-radius) var(--ew-radius) 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.35), transparent);
  pointer-events: none;
}
.ew-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.4); }

/* Tabellen: rij-hover en een gouden rand rond het geheel */
.ew-table { box-shadow: 0 0 0 1px rgba(255,210,4,0.15), 0 4px 14px rgba(0,0,0,0.3); }
.ew-table tbody tr { transition: background 0.12s ease; }
.ew-table tbody tr:hover td { background: rgba(255,210,4,0.12); }

/* Badges met een klein gekleurd stipje ervoor */
.ew-badge::before { content: "●"; margin-right: 5px; font-size: 0.6rem; vertical-align: 1px; }
.ew-badge.open::before { color: var(--ew-green); }
.ew-badge.locked::before { color: #C88A00; }
.ew-badge.finished::before { color: #8a8a7a; }

/* Toegankelijk toetsenbordfocus in clubgoud */
:focus-visible {
  outline: 2px solid var(--ew-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Tekstselectie in clubkleur */
::selection { background: var(--ew-green); color: #fff; }

/* Scrollbalk in clubstijl (WebKit) */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #0C1912; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--ew-green), var(--ew-green-dark));
  border-radius: 6px;
  border: 2px solid #0C1912;
}
::-webkit-scrollbar-thumb:hover { background: var(--ew-gold); }

/* Reduced motion: ook de nieuwe animaties uitschakelen */
@media (prefers-reduced-motion: reduce) {
  .ew-page { animation: none; }
  .ew-sash::after { animation: none; display: none; }
}
