:root {
  --bg: #0b1422;
  --bg-2: #101c2f;
  --card: #13223a;
  --line: #22344f;
  --text: #f2f5fa;
  --muted: #9fb0c8;
  --red: #c1272d;
  --green: #1f8a5b;
  --gold: #5ad1f5;
  --gold-soft: rgba(90, 209, 245, .14);
  --radius: 14px;
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --num: "Space Grotesk", "IBM Plex Sans Arabic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
}
button, input, select { font: inherit; color: inherit; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(11, 20, 34, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.brand-logo { width: 30px; height: 28px; flex: none; }
.brand-name { display: inline-flex; align-items: center; gap: 6px; direction: ltr; font-family: var(--num); }
.live-tag { background: var(--red-live, #e5484d); color: #fff; font-size: .72em; padding: 2px 7px; border-radius: 6px; letter-spacing: .04em; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--red); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 7px; border: 2px solid #fff; transform: rotate(45deg); border-radius: 2px; }
.langs { display: flex; gap: 4px; }
.langs button { background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px 10px; color: var(--muted); cursor: pointer; }
.langs button[aria-pressed="true"] { color: var(--text); border-color: var(--line); background: var(--bg-2); }

/* hero */
.hero {
  padding: 56px 0 28px;
  background:
    radial-gradient(600px 240px at 85% 0%, rgba(193, 39, 45, .22), transparent 70%),
    radial-gradient(500px 220px at 10% 10%, rgba(31, 138, 91, .16), transparent 70%);
  position: relative;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image:
    repeating-conic-gradient(from 45deg, var(--gold) 0 25%, transparent 0 50%);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
}
.hero .wrap { position: relative; }
.pill { display: inline-block; padding: 3px 12px; border-radius: 99px; background: var(--gold-soft); color: var(--gold); font-weight: 600; font-size: .85rem; }
h1 { font-size: clamp(1.8rem, 4.6vw, 3rem); line-height: 1.2; margin: 14px 0 10px; max-width: 18ch; letter-spacing: -.01em; }
[dir="rtl"] h1 { letter-spacing: 0; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 56ch; margin: 0; }
.demo { margin-top: 18px; padding: 10px 14px; border: 1px dashed var(--gold); border-radius: 10px; color: var(--gold); font-size: .9rem; max-width: 60ch; }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); font-weight: 600; }
.seg.small button { padding: 7px 10px; font-family: var(--num); }
.field { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.field.col { flex-direction: column; align-items: stretch; gap: 6px; margin-top: 12px; }
.field.grow { flex: 1 1 200px; }
select, input[type="search"], input[type="number"] {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; color: var(--text); min-height: 44px;
}
input[type="search"] { width: 100%; }
select:focus, input:focus, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.stat .k, .p-stats .k { display: block; color: var(--muted); font-size: .82rem; }
.stat strong { display: block; font: 700 1.45rem/1.3 var(--num); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat.accent { background: linear-gradient(135deg, rgba(90, 209, 245, .16), rgba(229, 72, 77, .12)); border-color: rgba(90, 209, 245, .4); }
.stat.accent strong { color: var(--gold); }

/* table */
.board { margin-top: 16px; }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: start; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: var(--bg-2); }
td { border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
.num { text-align: end; font-family: var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-rank { width: 52px; font-family: var(--num); color: var(--muted); }
.medal { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; color: #1a1410; }
.m1 { background: var(--gold); } .m2 { background: #cfd3d6; } .m3 { background: #d08b57; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-txt { min-width: 0; }
.who-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; }
.who-user { color: var(--muted); font-size: .82rem; direction: ltr; unicode-bidi: isolate; }
.flag { font-size: .95rem; margin-inline-start: 6px; }
.avatar { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; overflow: hidden; font-size: .95rem; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 60px; height: 60px; font-size: 1.4rem; }
.earn { color: var(--gold); font-weight: 700; }
.state { margin: 0; padding: 28px; text-align: center; color: var(--muted); }
.state:empty { display: none; }
.board-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--gold); color: #08121f; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.ghost { background: none; border: 1px solid var(--line); color: var(--text); }

/* cards */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2 { margin: 0 0 4px; font-size: 1.2rem; }
.card p { margin: 0; }
.calc-out { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.calc-out div { background: var(--bg-2); border-radius: 12px; padding: 12px; }
.calc-out span { color: var(--muted); font-size: .8rem; font-family: var(--num); }
.calc-out strong { display: block; font: 700 1.35rem var(--num); color: var(--gold); }
.how { margin: 10px 0 12px; padding-inline-start: 20px; }
.how li { margin-bottom: 8px; }
.foot { padding: 36px 0 48px; color: var(--muted); font-size: .85rem; }

/* dialog */
dialog { width: min(520px, 100% - 24px); background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
.p-head { display: flex; align-items: center; gap: 14px; }
.p-id { flex: 1; min-width: 0; }
.p-id h3 { margin: 0; font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-id span { direction: ltr; unicode-bidi: isolate; }
.x { background: var(--bg-2); border: 1px solid var(--line); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.3rem; line-height: 1; }
.p-period { margin-top: 18px; }
.p-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 18px; }
.p-stats div { background: var(--bg-2); border-radius: 12px; padding: 10px 12px; }
.p-stats strong { font: 700 1.1rem var(--num); }
.p-stats div:first-child strong { color: var(--gold); }
.chart { height: 130px; margin: 6px 0 18px; }
.chart svg { width: 100%; height: 100%; display: block; }
h4 { margin: 0; font-weight: 600; }
dialog .btn { width: 100%; }

@media (max-width: 820px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .hide-xs { display: none; }
  th, td { padding: 10px; }
  .who-name { max-width: 16ch; }
  .controls .seg:first-child { width: 100%; }
  .controls .seg:first-child button { flex: 1 1 0; min-width: 0; padding: 7px 4px; font-size: .9rem; }
  .field:not(.grow):not(.col) { flex: 1; }
  .field select { flex: 1; min-width: 0; }
  .stat strong { font-size: 1.2rem; }
}
[hidden] { display: none !important; }
.chart:empty { display: none; }

/* live-badge */
.live-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--red); color: #fff; font: 700 .68rem/1 var(--num); padding: 3px 7px; border-radius: 99px; vertical-align: middle; letter-spacing: .03em; }
.live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.p-id .live-badge { margin-top: 4px; }

/* installeer-balk */
.install { position: fixed; inset-inline: 12px; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 560px; margin-inline: auto; }
.install #install-text { flex: 1; font-size: .92rem; }
.install .btn { min-height: 38px; padding: 0 14px; }
.install .x { width: 34px; height: 34px; flex: none; }
.install .brand-mark { flex: none; }

/* tabbladen Top 100 / Live gevolgd */
.views { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.seg.big button { padding: 10px 18px; font-weight: 600; font-size: 1rem; }
.view-note { margin: 0; }
.league { display: inline-block; font: 600 .7rem/1 var(--num); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 5px; margin-inline-start: 6px; vertical-align: middle; }

.glist { list-style: none; margin: 6px 0 14px; padding: 0; display: grid; gap: 8px; }
.glist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.glist .avatar.sm { width: 32px; height: 32px; font-size: .85rem; }
.glist .earn { font-weight: 600; color: var(--accent, #5ad1f5); white-space: nowrap; }
a.sup { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
dialog { box-sizing: border-box; margin: auto; inset: 0; max-height: calc(100% - 24px); overflow-y: auto; }
.seg.big { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg.big button { white-space: nowrap; }
@media (max-width: 480px) { .seg.big button { padding: 9px 12px; font-size: .92rem; } }
@media (max-width: 480px) { .seg.big { display: flex; width: 100%; } .seg.big button { flex: 1 1 auto; padding: 9px 6px; font-size: .88rem; } }
#net-note{margin:8px 2px 0}

tr.mascot { background: linear-gradient(90deg, rgba(255,196,0,.10), transparent); cursor: pointer; }
tr.mascot .earn, tr.mascot td.num { color: #ffc400; font-weight: 700; font-size: 1.15rem; }
.mascot-tag { color: #ffc400 !important; border-color: rgba(255,196,0,.5) !important; }

tr.mascot .earn { font-size: .95rem; letter-spacing: .02em; }
@media (max-width: 480px) { .who-name { max-width: 15ch; } td, th { padding-inline: 8px; } }

@media (max-width: 480px) { .who-name { max-width: 13ch; } tr.mascot .earn { font-size: .8rem; } .table-wrap th.num { font-size: .8rem; } }
