/* =====================================================================
   KNPB — stylesheet
   Theme: royal Dutch navy + Oranje accent, with FIFA-Ultimate-Team cards.
   Fonts: Archivo (body/headlines), Oswald (numbers/labels).
   ===================================================================== */

:root {
  --navy-900: #060d1c;
  --navy-800: #0a1730;
  --navy-700: #0f2147;
  --navy-600: #14305f;
  --orange: #ff6b00;
  --orange-bright: #ff8a2b;
  --ink: #e9eef7;
  --muted: #97a6c2;
  --line: rgba(255, 255, 255, 0.08);

  /* card tiers */
  --gold-1: #f7e7a6; --gold-2: #c8a23b; --gold-3: #6e561a;
  --silver-1: #f0f3f8; --silver-2: #aeb7c6; --silver-3: #6b7384;
  --bronze-1: #f0c79a; --bronze-2: #c07a3d; --bronze-3: #7a4622;
  --goat-1: #2b2b2f; --goat-2: #101013; --goat-gold: #ffd76a;

  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Archivo", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 107, 0, 0.18), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(20, 48, 95, 0.6), transparent 55%),
    var(--navy-900);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* visually-hidden but available to screen readers */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* anchor targets clear the sticky header */
#top, #spelers, #stats, #top-tier { scroll-margin-top: 84px; }

/* keyboard focus — visible on every interactive element */
:focus-visible { outline: 2px solid var(--orange-bright); outline-offset: 2px; }
.fut:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.fut--goat:focus-visible { outline-color: var(--goat-gold); }

/* ============== TOP BAR ============== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(6, 13, 28, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__crest { display: grid; place-items: center; filter: drop-shadow(0 4px 8px rgba(255, 107, 0, 0.35)); }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__text strong { font-size: 22px; font-weight: 900; letter-spacing: 2px; }
.brand__text em { font-style: normal; font-size: 10px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; margin-top: 3px; }
.topnav { display: flex; align-items: center; gap: clamp(10px, 2vw, 26px); }
.topnav a { font-size: 14px; font-weight: 600; color: var(--muted); transition: color 0.2s; }
.topnav a:hover { color: var(--ink); }
.topnav__cta { padding: 9px 16px; border-radius: 999px; background: var(--orange); color: #fff !important; }
.topnav__cta:hover { background: var(--orange-bright); }

/* ============== HERO ============== */
.hero {
  position: relative;
  padding: clamp(56px, 11vw, 130px) clamp(16px, 4vw, 48px) clamp(40px, 7vw, 80px);
  overflow: hidden;
}
.hero__glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(700px 350px at 75% 30%, rgba(255, 107, 0, 0.22), transparent 70%),
    conic-gradient(from 200deg at 90% 0%, rgba(255, 138, 43, 0.15), transparent 30%);
  pointer-events: none;
}
.hero__inner { position: relative; max-width: 1180px; margin: 0 auto; }
.hero__eyebrow {
  display: inline-block; margin: 0 0 18px;
  font-family: "Oswald"; letter-spacing: 4px; text-transform: uppercase; font-size: 13px;
  color: var(--orange-bright);
  padding: 7px 14px; border: 1px solid rgba(255, 107, 0, 0.4); border-radius: 999px;
}
.hero__title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(44px, 10vw, 118px);
  line-height: 0.92;
  letter-spacing: -2px;
  text-transform: uppercase;
}
.hero__title span { color: var(--orange); -webkit-text-stroke: 1px rgba(255,255,255,.1); }
.hero__sub { max-width: 540px; margin: 26px 0 0; font-size: clamp(15px, 2vw, 19px); color: var(--muted); line-height: 1.6; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 700; font-size: 15px; cursor: pointer; border: none;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}
.btn--sm { padding: 11px 18px; font-size: 14px; }
.btn--primary { background: var(--orange); color: #fff; box-shadow: 0 10px 24px rgba(255, 107, 0, 0.35); }
.btn--primary:hover { background: var(--orange-bright); transform: translateY(-2px); }
.btn--ghost { background: rgba(255, 255, 255, 0.06); color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }

/* ticker */
.hero__ticker { margin-top: 48px; overflow: hidden; mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker__track { display: inline-flex; gap: 22px; white-space: nowrap; animation: ticker 38s linear infinite; font-family: "Oswald"; color: var(--muted); font-size: 14px; letter-spacing: 1px; }
.ticker__track span b { color: var(--orange-bright); }
.ticker__track i { color: var(--line); font-style: normal; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ============== STAT STRIP ============== */
.statstrip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  max-width: 1180px; margin: 10px auto 0; padding: 0;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.statstrip__item { padding: 26px 18px; text-align: center; background: var(--navy-800); }
.statstrip__item strong { display: block; font-family: "Oswald"; font-size: clamp(30px, 5vw, 46px); color: var(--orange-bright); line-height: 1; }
.statstrip__item span { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

/* ============== SECTION HEADERS ============== */
.section-title { font-size: clamp(28px, 5vw, 46px); font-weight: 900; letter-spacing: -1px; margin: 0; text-transform: uppercase; }
.section-title--light { color: #fff; }
.section-sub { color: var(--muted); margin: 8px 0 0; font-size: 16px; }
.section-sub--light { color: rgba(255,255,255,.7); }

/* ============== PLAYERS ============== */
.players { max-width: 1280px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) clamp(16px, 4vw, 48px) 40px; }
.players__head { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; }

.search { position: relative; display: flex; align-items: center; min-width: min(420px, 100%); flex: 1 1 320px; max-width: 460px; }
.search__icon { position: absolute; left: 16px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; padding: 16px 44px 16px 46px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); font-size: 15px; font-family: inherit; outline: none;
  transition: border 0.2s, background 0.2s, box-shadow 0.2s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--orange); background: rgba(255,255,255,.08); box-shadow: 0 0 0 4px rgba(255,107,0,.12); }
.search__clear { position: absolute; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255,255,255,.1); color: var(--ink); font-size: 18px; cursor: pointer; line-height: 1; display: grid; place-items: center; }
.search__clear:hover { background: var(--orange); color: #fff; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.chip {
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted);
  font-family: inherit; font-size: 13px; font-weight: 600; transition: all 0.18s;
}
.chip:hover { color: var(--ink); border-color: rgba(255,255,255,.2); }
.chip.is-active { background: var(--orange); border-color: var(--orange); color: #fff; }

.result-count { color: var(--muted); font-size: 13px; margin: 0 0 22px; font-family: "Oswald"; letter-spacing: 1px; }

/* ============== CARD GRID + FUT CARD ============== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
}

.fut {
  --c1: var(--silver-1); --c2: var(--silver-2); --c3: var(--silver-3); --ink-on: #16202e;
  position: relative;
  display: flex; flex-direction: column;
  padding: 20px 18px 16px;
  border: none; cursor: pointer; text-align: left;
  font-family: inherit;
  border-radius: 18px;
  background:
    linear-gradient(160deg, var(--c1) 0%, var(--c2) 46%, var(--c3) 100%);
  color: var(--ink-on);
  box-shadow: var(--shadow);
  opacity: 1;
  animation: cardIn 0.5s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
  overflow: hidden;
  isolation: isolate;
}
.fut::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,255,255,.55), transparent 50%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.06) 0 6px, transparent 6px 14px);
  mix-blend-mode: overlay;
}
.fut:hover { transform: translateY(-8px) scale(1.015); box-shadow: 0 26px 60px rgba(0,0,0,.55); }
@keyframes cardIn { from { transform: translateY(16px); } to { transform: translateY(0); } }
.fut--static { transform: none !important; opacity: 1 !important; animation: none; cursor: default; }

.fut--gold   { --c1: var(--gold-1);   --c2: var(--gold-2);   --c3: var(--gold-3); }
.fut--silver { --c1: var(--silver-1); --c2: var(--silver-2); --c3: var(--silver-3); }
.fut--bronze { --c1: var(--bronze-1); --c2: var(--bronze-2); --c3: var(--bronze-3); }
.fut--goat   { --c1: #3a3a40; --c2: var(--goat-1); --c3: var(--goat-2); --ink-on: var(--goat-gold); }
.fut--goat::before { background: radial-gradient(120% 80% at 50% -10%, rgba(255,215,106,.25), transparent 55%), repeating-linear-gradient(115deg, rgba(255,215,106,.07) 0 6px, transparent 6px 14px); }
.fut--goat .fut__club, .fut--goat .fut__nr { color: rgba(255,215,106,.75); }
.fut--goat .fut__stat-key { color: rgba(255,215,106,.6); }

.fut__band {
  position: absolute; top: 0; left: 0; right: 0;
  background: var(--orange); color: #fff;
  font-family: "Oswald"; font-size: 10px; letter-spacing: 2px; text-align: center;
  padding: 4px; z-index: 2;
}
.fut--captain { box-shadow: 0 0 0 2px var(--orange), var(--shadow); }

.fut__top { display: flex; justify-content: space-between; align-items: flex-start; }
.fut__rating { display: flex; flex-direction: column; align-items: center; line-height: 1; font-family: "Oswald"; }
.fut__num { font-size: 46px; font-weight: 700; }
.fut__pos { font-size: 14px; font-weight: 600; opacity: .8; margin-top: 2px; }
.fut__flag { font-size: 20px; margin-top: 6px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); display: inline-flex; align-items: center; gap: 3px; }
.fut__badge { font-size: 15px; }
.fut__portrait {
  width: 86px; height: 86px; border-radius: 50%;
  background: rgba(0,0,0,.18);
  display: grid; place-items: center;
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: inset 0 -8px 18px rgba(0,0,0,.25);
}
.fut__portrait span { font-family: "Oswald"; font-size: 30px; font-weight: 700; letter-spacing: 1px; }

.fut__name { margin-top: 12px; font-size: 21px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; border-bottom: 2px solid rgba(0,0,0,.18); padding-bottom: 8px; }
.fut__nr { font-family: "Oswald"; font-size: 12px; letter-spacing: 1px; opacity: .7; margin-top: 6px; }

.fut__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 4px; margin-top: 12px; }
.fut__stat { display: flex; align-items: baseline; gap: 5px; justify-content: center; }
.fut__stat-val { font-family: "Oswald"; font-size: 17px; font-weight: 700; }
.fut__stat-key { font-size: 10px; letter-spacing: 1px; opacity: .65; font-weight: 700; }

.fut__club { margin-top: 12px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; opacity: .75; font-weight: 700; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty p { font-size: 22px; margin: 0 0 6px; }

/* ============== TOP TIER / PODIUM ============== */
.toptier {
  max-width: 900px; margin: 40px auto 0; padding: clamp(48px, 8vw, 90px) clamp(16px, 4vw, 48px);
  text-align: center;
}
.podium { list-style: none; margin: 36px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.podium li { list-style: none; }
.podium__row {
  width: 100%; font: inherit; color: inherit; text-align: left;
  display: grid; grid-template-columns: 40px 52px 1fr auto; align-items: center; gap: 16px;
  padding: 14px 20px; border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}
.podium__row:hover { transform: translateX(6px); background: rgba(255,255,255,.07); border-color: rgba(255,107,0,.4); }
.podium__rank { font-family: "Oswald"; font-size: 28px; font-weight: 700; color: var(--orange-bright); text-align: center; }
.podium__chip { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-family: "Oswald"; font-weight: 700; font-size: 16px; color: var(--silver-3); background: linear-gradient(160deg, var(--c1, #ccc), var(--c3, #888)); }
.podium__chip.fut--goat { color: var(--goat-gold); }
.podium__name { display: flex; flex-direction: column; font-weight: 700; font-size: 17px; }
.podium__name small { font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 2px; }
.podium__rating { font-family: "Oswald"; font-size: 30px; font-weight: 700; color: var(--ink); }

/* ============== MODAL ============== */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.empty[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(3, 7, 16, 0.78); backdrop-filter: blur(6px); }
.modal__panel {
  position: relative; z-index: 1; width: min(760px, 100%);
  background: linear-gradient(165deg, var(--navy-700), var(--navy-900));
  border: 1px solid var(--line); border-radius: 22px; padding: 30px;
  box-shadow: var(--shadow); animation: modalIn 0.28s cubic-bezier(.2,.8,.2,1);
}
@keyframes modalIn { from { transform: translateY(24px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__close { position: absolute; top: 14px; right: 16px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--ink); font-size: 22px; cursor: pointer; line-height: 1; }
.modal__close:hover { background: var(--orange); border-color: var(--orange); }

.detail { display: grid; grid-template-columns: 230px 1fr; gap: 30px; align-items: start; }
.detail__card .fut { max-width: 230px; }
.detail__tier { font-family: "Oswald"; letter-spacing: 2px; text-transform: uppercase; color: var(--orange-bright); margin: 4px 0 6px; font-size: 13px; }
.detail__name { font-size: 30px; font-weight: 900; margin: 0; letter-spacing: -.5px; }
.detail__nick { color: var(--muted); margin: 8px 0 0; font-size: 15px; }
.detail__bio { color: var(--ink); opacity: .9; line-height: 1.6; margin: 16px 0 22px; font-size: 15px; }

.detail__bars { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.bar__top { display: flex; justify-content: space-between; font-family: "Oswald"; font-size: 13px; letter-spacing: 1px; margin-bottom: 5px; color: var(--muted); }
.bar__top span:last-child { color: var(--ink); }
.bar__track { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar__fill { height: 100%; width: var(--w); border-radius: 999px; background: linear-gradient(90deg, var(--orange), var(--orange-bright)); animation: barGrow 0.8s cubic-bezier(.2,.8,.2,1); }
@keyframes barGrow { from { width: 0; } }

/* ============== FOOTER ============== */
.footer { text-align: center; padding: 60px 20px 50px; border-top: 1px solid var(--line); margin-top: 60px; color: var(--muted); }
.footer__crest { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 26px; font-weight: 900; letter-spacing: 3px; color: var(--ink); margin-bottom: 14px; }
.footer p { margin: 6px 0; font-size: 14px; }
.footer__fine { font-size: 12px; opacity: .6; }

/* ============== RESPONSIVE ============== */
@media (max-width: 720px) {
  .topnav a:not(.topnav__cta) { display: none; }
  .statstrip { grid-template-columns: repeat(2, 1fr); }
  .players__head { flex-direction: column; align-items: stretch; }
  .search { max-width: 100%; }
  .detail { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .detail__card .fut { margin: 0 auto; }
  .detail__bars { text-align: left; width: 100%; }
  .modal__panel { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .ticker__track { animation: none; }
}
