/* Judoclub Ypenburg — huisstijl (oranje) */
:root {
  --primary: hsl(24 100% 50%);
  --primary-deep: hsl(18 95% 44%);
  --primary-soft: hsl(28 100% 95%);
  --ink: hsl(24 10% 12%);
  --ink-soft: hsl(25 8% 38%);
  --charcoal: #2b2b2b;
  --bg: hsl(30 30% 97%);
  --card: #ffffff;
  --border: hsl(24 14% 88%);
  --border-strong: hsl(24 14% 80%);
  --green: #3fa34d;
  --red: #d64545;
  --radius: 0.85rem;
  --shadow-sm: 0 1px 3px hsl(24 30% 10% / .08), 0 1px 2px -1px hsl(24 30% 10% / .08);
  --shadow-md: 0 6px 16px -6px hsl(24 40% 20% / .18);
  --shadow-lg: 0 18px 40px -12px hsl(24 40% 20% / .28);
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Public Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 100% -10%, hsl(28 100% 92% / .7), transparent 60%),
    var(--bg);
  min-height: 100vh;
}
[x-cloak] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--charcoal);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: .6rem 1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand img { height: 40px; width: auto; display: block; border-radius: 6px; }
.brand .sub { font-family: var(--font-display); font-size: 1.05rem; line-height: 1; }
.brand .sub small { display: block; font-family: var(--font-body); font-weight: 500;
  color: hsl(28 100% 78%); font-size: .72rem; margin-top: 3px; }
.topbar .spacer { flex: 1; }

/* ---------- Tabs ---------- */
.tabs {
  max-width: 1180px; margin: 0 auto; padding: 0 1rem;
  display: flex; gap: .35rem; overflow-x: auto;
}
.tab {
  appearance: none; border: none; background: transparent; cursor: pointer;
  color: hsl(0 0% 100% / .8); font-family: var(--font-display); font-weight: 600;
  font-size: .92rem; padding: .7rem .95rem; border-radius: 10px 10px 0 0;
  white-space: nowrap; transition: background .15s, color .15s;
}
.tab:hover { background: hsl(0 0% 100% / .1); color: #fff; }
.tab.active { background: var(--bg); color: var(--primary-deep); }

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1rem 4rem; }
.section-title { font-size: 1.4rem; margin: 0 0 1rem; }
.muted { color: var(--ink-soft); }

.btn {
  appearance: none; cursor: pointer; font-family: var(--font-display); font-weight: 600;
  border-radius: 10px; border: 1px solid transparent; padding: .55rem .9rem; font-size: .9rem;
  display: inline-flex; align-items: center; gap: .45rem; transition: filter .15s, background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: hsl(0 0% 100% / .12); color: #fff; border-color: hsl(0 0% 100% / .25); }
.btn-ghost:hover { background: hsl(0 0% 100% / .2); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-deep); }
.btn-sm { padding: .35rem .6rem; font-size: .82rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: .9rem; }
.stat { padding: 1rem 1.1rem; }
.stat .n { font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1;
  color: var(--primary-deep); }
.stat .l { color: var(--ink-soft); font-size: .82rem; margin-top: .35rem; text-transform: uppercase; letter-spacing: .04em; }

/* progress */
.progress { height: 12px; background: var(--primary-soft); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-deep)); }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); background: #fff;
  padding: 2.5rem 1.5rem; text-align: center; transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .big { font-size: 2.4rem; }

/* ---------- Belt chip ---------- */
.belt { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; }
.belt .dot { width: 14px; height: 14px; border-radius: 4px; border: 1px solid hsl(24 10% 60% / .4); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--border); }
table.data th { font-family: var(--font-display); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-soft); background: hsl(30 30% 98%); position: sticky; top: 0; }
table.data tbody tr:hover { background: var(--primary-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Poule cards ---------- */
.group-block { margin-bottom: 1.8rem; }
.group-head { display: flex; align-items: baseline; gap: .6rem; margin: 0 0 .8rem; }
.group-head h3 { font-size: 1.15rem; margin: 0; }
.badge { font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-deep); font-family: var(--font-display); }
.badge.ok { background: hsl(130 45% 92%); color: #2a7a37; }
.poule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px,1fr)); gap: .9rem; }
.poule-card { padding: .9rem 1rem; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .06s; }
.poule-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-2px); }
.poule-card .top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.poule-card .wl { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.poule-card .mat { font-size: .72rem; color: var(--ink-soft); }
.poule-card ul { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .85rem; color: var(--ink-soft); }
.poule-card li { margin: .1rem 0; }
.mini-progress { height: 6px; margin-top: .6rem; }

/* ---------- Jurytafel ---------- */
.jury { display: grid; grid-template-columns: 290px 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 820px) { .jury { grid-template-columns: 1fr; } }
.poule-picker { max-height: 74vh; overflow-y: auto; padding: .5rem; }
.pp-group { font-family: var(--font-display); font-weight: 700; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-soft); margin: .7rem .4rem .3rem; }
.pp-item { display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .5rem .6rem; border-radius: 9px; cursor: pointer; font-size: .9rem; }
.pp-item:hover { background: var(--primary-soft); }
.pp-item.active { background: var(--primary); color: #fff; }
.pp-item.active .pp-dot { background: #fff; }
.pp-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--border-strong); flex: none; }
.pp-dot.ok { background: var(--green); }
.pp-dot.part { background: var(--primary); }

.match-row {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: center;
  padding: .55rem; border: 1px solid var(--border); border-radius: 12px; margin-bottom: .55rem;
  background: #fff;
}
.match-row .who { font-weight: 600; font-size: .95rem; }
.match-row .who.right { text-align: right; }
.match-row .who.win { color: var(--primary-deep); }
.match-row .who.lose { color: var(--ink-soft); }
.wbtns { display: flex; gap: .3rem; justify-content: center; }
.wbtn {
  appearance: none; cursor: pointer; border: 1px solid var(--border-strong); background: #fff;
  border-radius: 8px; padding: .4rem .55rem; font-size: .78rem; font-weight: 700; font-family: var(--font-display);
  color: var(--ink-soft); min-width: 40px; transition: all .12s;
}
.wbtn:hover { border-color: var(--primary); }
.wbtn.sel { background: var(--primary); border-color: var(--primary); color: #fff; }
.wbtn.sel.draw { background: var(--ink-soft); border-color: var(--ink-soft); }

.standings td.rank { font-family: var(--font-display); font-weight: 800; color: var(--primary-deep); width: 44px; }
.standings tr.r1 { background: hsl(45 100% 94%); }
.medal { font-size: 1.05rem; }

.pill { display:inline-block; padding:.15rem .5rem; border-radius:999px; font-size:.72rem; font-weight:700; }
.pill.done { background: hsl(130 45% 92%); color:#2a7a37; }
.pill.busy { background: var(--primary-soft); color: var(--primary-deep); }

/* podium (uitslagen) */
.podium-card { padding: 1rem; }
.podium-card h4 { margin: 0 0 .2rem; font-size: 1rem; }
.podium { list-style:none; margin:.6rem 0 0; padding:0; }
.podium li { display:flex; align-items:center; gap:.6rem; padding:.35rem .1rem; border-bottom:1px dashed var(--border); }
.podium li:last-child { border-bottom:none; }
.podium .pos { width: 28px; font-family: var(--font-display); font-weight:800; }
.podium .pts { margin-left:auto; font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size:.85rem; }

/* toast */
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--charcoal); color: #fff; padding: .7rem 1.1rem; border-radius: 10px;
  box-shadow: var(--shadow-lg); font-weight: 600; z-index: 100; }
.toast.err { background: var(--red); }

.empty { text-align:center; padding: 3rem 1rem; color: var(--ink-soft); }
.spinner { width:22px;height:22px;border:3px solid var(--primary-soft);border-top-color:var(--primary);
  border-radius:50%; animation: spin .7s linear infinite; display:inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Jurytafel: wedstrijden + ranglijst naast elkaar, stapelen op smal scherm */
.jury-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ===================== RESPONSIVE (tablet / mobiel) ===================== */

/* Grote touch-doelen op apparaten zonder muis (tablet/telefoon) */
@media (hover: none) and (pointer: coarse) {
  .wbtn { min-width: 52px; padding: .6rem .5rem; font-size: .95rem; }
  .tab { padding: .8rem 1rem; }
  .pp-item { padding: .7rem .6rem; }
  .btn { padding: .6rem .9rem; }
  input[type="search"], input[type="text"], input[type="password"] { font-size: 16px; } /* voorkomt inzoomen iOS */
}

/* iPad portret en kleiner: jurytafel-kolommen onder elkaar */
@media (max-width: 900px) {
  .jury-body { grid-template-columns: 1fr; }
}

/* iPad-breedte: poule-keuzelijst boven, niet te hoog */
@media (max-width: 820px) {
  .poule-picker { max-height: 40vh; }
}

/* Tablet en kleiner: iets compactere marges */
@media (max-width: 768px) {
  .wrap { padding: 1.1rem .85rem 3.5rem; }
  .section-title { font-size: 1.25rem; }
  .topbar-inner { padding: .55rem .75rem; gap: .5rem; }
  .brand img { height: 34px; }
  .brand .sub { font-size: .95rem; }
  .brand .sub small { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabs { padding: 0 .5rem; gap: .15rem; }
  .stat { padding: .8rem .9rem; }
  .stat .n { font-size: 1.6rem; }
  .poule-grid { grid-template-columns: 1fr 1fr; }
}

/* Telefoon: knoplabels verbergen (alleen icoon), alles gestapeld */
@media (max-width: 560px) {
  .grid-stats { grid-template-columns: 1fr 1fr; }
  .poule-grid { grid-template-columns: 1fr; }
  .topbar .lbl { display: none; }               /* toon alleen het icoon op de knoppen */
  .topbar .spacer { display: none; }
  .brand .sub small { max-width: 40vw; }
  .match-row .who { font-size: .9rem; word-break: break-word; }
  .section-title { font-size: 1.15rem; }
}

/* Heel smalle telefoons: stats onder elkaar */
@media (max-width: 380px) {
  .grid-stats { grid-template-columns: 1fr; }
  .match-row { grid-template-columns: 1fr auto 1fr; gap: .3rem; padding: .5rem .4rem; }
  .wbtn { min-width: 46px; }
}
