/* ============================================================================
   OPMAAK — Robin Hood Boechout
   Geen enkele kleurwaarde in dit bestand. Alles komt uit css/theme.css.
   ============================================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  font-family: var(--font-sans);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  display: flex;
  justify-content: center;
  overscroll-behavior-y: none;      /* geen pull-to-refresh tijdens invoeren */
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--go); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- app-schil ---------- */
.app {
  width: 100%; max-width: var(--app-max); min-height: 100dvh;
  background: var(--bg); position: relative;
  display: flex; flex-direction: column;
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
}

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px var(--pad-screen) 10px;
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(var(--bg) 72%, transparent);
  padding-top: calc(14px + env(safe-area-inset-top));
}
.topbar[hidden] { display: none; }

.mark { width: 26px; height: 26px; flex: none; }
.wordmark {
  font-family: var(--font-cond); font-weight: 700; font-size: 20px;
  letter-spacing: .05em; line-height: 1.05;
}
.wordmark small {
  display: block; font-family: var(--font-sans); font-weight: 500; font-size: 10px;
  letter-spacing: .12em; color: var(--text-dim);
}

.namepill {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 4px 13px 4px 5px;
  font-size: 13px; font-weight: 600; max-width: 46%;
}
.namepill[hidden] { display: none; }
.namepill .av {
  width: 25px; height: 25px; border-radius: 50%;
  background: var(--surface-raised); color: var(--text-soft); flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-cond); font-size: 13px;
}
.namepill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.screen { flex: 1; padding: 2px var(--pad-screen) 96px; overflow-y: auto; }
.screen.no-nav { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.viewtitle {
  font-family: var(--font-cond); font-weight: 700; font-size: 27px;
  letter-spacing: .01em; margin: 6px 0 14px;
}

/* ---------- bouwstenen ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 14px;
}
.card + .card { margin-top: 10px; }
.row    { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.label  { font-size: 11px; letter-spacing: .09em; color: var(--text-dim); font-weight: 600; }
.num {
  font-family: var(--font-cond); font-weight: 700;
  font-variant-numeric: tabular-nums; line-height: .92;
}
.n-xl { font-size: 64px; } .n-lg { font-size: 44px; }
.n-md { font-size: 28px; } .n-sm { font-size: 20px; }
.muted { color: var(--text-dim); }
.meta  { font-size: 13px; color: var(--text-soft); }
.hr    { height: 1px; background: var(--line); margin: var(--gap) -14px; }
.stack-sm { margin-top: var(--gap-sm); }
.stack    { margin-top: var(--gap); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: var(--tap-btn); border-radius: 14px;
  font-weight: 700; font-size: 16px; letter-spacing: .02em;
}
.btn-go    { background: var(--go); color: var(--go-ink); box-shadow: 0 6px 18px var(--go-glow); }
.btn-go:disabled { background: var(--surface-raised); color: var(--text-dim); box-shadow: none; cursor: not-allowed; }
.btn-quiet { background: var(--surface-raised); border: 1px solid var(--line); color: var(--text); }
.btn-ghost { border: 1px solid var(--line); color: var(--text-soft); min-height: var(--tap-min); font-size: 14px; }
.btn-warn  { background: var(--warn); color: var(--warn-ink); }
.btn-sm    { min-height: 38px; font-size: 13px; padding: 0 14px; width: auto; border-radius: 10px; }
.btn-danger-text { color: var(--warn); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .07em;
  padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap;
}
.b-gold   { background: color-mix(in srgb, var(--cert-gold) calc(var(--badge-tint) * 100%), transparent);
            color: var(--cert-gold); box-shadow: inset 0 0 0 1px var(--cert-gold); }
.b-silver { background: color-mix(in srgb, var(--silver) calc(var(--badge-tint) * 100%), transparent);
            color: var(--silver); box-shadow: inset 0 0 0 1px var(--silver); }
.b-bronze { background: color-mix(in srgb, var(--bronze) calc(var(--badge-tint) * 100%), transparent);
            color: var(--bronze-text); box-shadow: inset 0 0 0 1px var(--bronze); }
.b-none   { background: var(--surface-raised); color: var(--text-dim); }
.b-pr     { background: var(--pr); color: var(--pr-ink); }
.b-live   { background: color-mix(in srgb, var(--go) calc(var(--badge-tint) * 100%), transparent);
            color: var(--go); box-shadow: inset 0 0 0 1px var(--go); }

/* ---------- ringkleuren (pijlwaarde) ---------- */
.arw {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-cond); font-weight: 700; font-variant-numeric: tabular-nums;
}
.r-gold  { background: var(--ring-gold);  color: var(--ring-gold-ink); }
.r-red   { background: var(--ring-red);   color: var(--ring-red-ink); }
.r-blue  { background: var(--ring-blue);  color: var(--ring-blue-ink); }
.r-black { background: var(--ring-black); color: var(--ring-black-ink); box-shadow: inset 0 0 0 1px var(--line); }
.r-white { background: var(--ring-white); color: var(--ring-white-ink); }
.r-miss  { background: transparent;       color: var(--text-dim); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- onderbalk ---------- */
.nav {
  position: fixed; bottom: 0; width: 100%; max-width: var(--app-max);
  display: grid; grid-auto-flow: column;
  background: var(--nav-bg); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30;
}
.nav[hidden] { display: none; }
.nav button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; font-size: 10.5px; font-weight: 600; letter-spacing: .03em;
  color: var(--text-dim); position: relative;
}
.nav button[aria-current="page"] { color: var(--go); }
.nav svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.nav .dot {
  position: absolute; top: 4px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--go); transform: translateX(14px);
}

/* ---------- formulier ---------- */
.field { margin-bottom: 11px; }
.field label {
  display: block; font-size: 11px; letter-spacing: .09em;
  color: var(--text-dim); font-weight: 600; margin-bottom: 5px;
}
.field select, .field input {
  width: 100%; min-height: 50px;
  background: var(--surface-raised); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-field);
  padding: 0 14px; font: 600 16px var(--font-sans);   /* 16px: iOS zoomt niet */
  appearance: none;
}
.field select { background-image: var(--chevron); background-repeat: no-repeat; background-position: right 14px center; }
.readonly-field {
  display: flex; align-items: center; gap: 10px; min-height: 50px;
  background: var(--surface-raised); border: 1px solid var(--line);
  border-radius: var(--r-field); padding: 0 14px;
}
.readonly-field .lock { width: 17px; stroke: var(--text-dim); fill: none; stroke-width: 1.8; flex: none; }

/* ---------- onboarding ---------- */
.onboard { display: flex; flex-direction: column; justify-content: center; min-height: 72dvh; text-align: center; }
.onboard .logo { width: 58px; margin: 0 auto 18px; }
.gbtn {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  width: 100%; min-height: 56px; background: var(--google-btn-bg); color: var(--google-btn-ink);
  border-radius: 14px; font: 600 16px var(--font-sans);
}
.acct {
  display: flex; align-items: center; gap: var(--gap); width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 15px;
}
.acct .av {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-raised); color: var(--text-soft); flex: none;
  display: flex; align-items: center; justify-content: center;
  font: 700 14px var(--font-cond);
}
.warntext { color: var(--warn); }

/* ---------- score-invoer ---------- */
.scorehead {
  background: linear-gradient(155deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--line); border-radius: var(--r-hero);
  padding: var(--gap-lg); position: relative; overflow: hidden;
}
.seriestrip { display: flex; gap: 4px; margin-top: 13px; }
.seg { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.seg.done { background: var(--go); }
.seg.now  { background: var(--text); }
.slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap-xs); margin-top: 14px; }
.slot { aspect-ratio: 1; border-radius: 11px; font-size: 21px; }
.slot.empty  { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: transparent; }
.slot.cursor { box-shadow: inset 0 0 0 2px var(--go); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-sm); margin-top: 14px; }
.key {
  height: var(--tap-key); border-radius: var(--r-key); font-size: 27px;
  font-family: var(--font-cond); font-weight: 700;
  display: flex; align-items: center; justify-content: center; transition: transform .06s;
}
.key:active { transform: scale(.94); }
.key:disabled { opacity: .35; }
.tally {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-field); overflow: hidden; margin-top: var(--gap);
}
.tally div { background: var(--surface); padding: 10px 8px; text-align: center; }
.saveline {
  display: flex; align-items: center; gap: 7px; font-size: 12px;
  color: var(--text-dim); margin-top: var(--gap); justify-content: center;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--go); flex: none; }
.pulse.pending { background: var(--warn); }

/* ---------- historiek ---------- */
.filters { display: flex; gap: 7px; margin-bottom: var(--gap); }
.filters select {
  flex: 1; min-height: 42px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 0 30px 0 14px; font: 600 13px var(--font-sans); appearance: none;
  background-image: var(--chevron-sm); background-repeat: no-repeat; background-position: right 12px center;
}
.hcard {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 12px 14px; margin-bottom: 8px;
}
.hcard .bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--line); }

/* ---------- scorekaart: papieren artefact, strak raster ---------- */
.sheet { border: 1px solid var(--line); border-radius: var(--r-sheet); overflow: hidden; font-variant-numeric: tabular-nums; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sheet th {
  background: var(--surface-sunken); color: var(--text-dim);
  font-size: 10px; letter-spacing: .08em; font-weight: 700; padding: 7px 0;
}
.sheet td { text-align: center; padding: 7px 0; border-top: 1px solid var(--line); font-weight: 600; }
.sheet td:first-child { color: var(--text-dim); font-size: 11px; letter-spacing: .04em; }
.sheet .tot { background: var(--surface-sunken); font-family: var(--font-cond); font-size: 16px; }
.sheet .cum { color: var(--text-soft); font-size: 12px; font-weight: 500; }
.sheet .brk td {
  background: var(--surface-raised); color: var(--text-soft);
  font-size: 10px; letter-spacing: .16em; font-weight: 700; padding: 5px 0;
}
.sheet .sum td { background: var(--surface-sunken); font-family: var(--font-cond); font-size: 16px; }
.sheet .sum .cert-label { color: var(--text-dim); font-family: var(--font-sans); font-size: 11px; font-weight: 600; }
.a { display: inline-flex; width: 23px; height: 23px; border-radius: 6px;
     align-items: center; justify-content: center; font-family: var(--font-cond);
     font-weight: 700; font-size: 14px; }
.selcell { box-shadow: 0 0 0 2px var(--go) !important; }
.sheet button.a { cursor: pointer; }
.fixpad { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap-xs); margin-top: var(--gap); }
.fixpad button {
  height: var(--tap-min); border-radius: 10px;
  font-family: var(--font-cond); font-weight: 700; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- modal ---------- */
.overlay {
  position: fixed; inset: 0; background: var(--overlay);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.sheetwrap {
  width: 100%; max-width: var(--app-max); max-height: 92dvh; overflow-y: auto;
  background: var(--surface-sunken); border-radius: var(--r-hero) var(--r-hero) 0 0;
  border-top: 1px solid var(--line);
  padding: var(--gap-lg) var(--pad-screen) calc(30px + env(safe-area-inset-bottom));
}
.grab { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }

/* ---------- installkaart ---------- */
.install { display: flex; gap: var(--gap); align-items: flex-start; }
.install .ico { width: 26px; flex: none; stroke: var(--go); fill: none; stroke-width: 1.7; }
.install .x {
  margin-left: auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-raised); color: var(--text-dim); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}

/* ---------- meldingen ---------- */
.toast {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  font-weight: 600; font-size: 13.5px; padding: 11px 18px;
  border-radius: var(--r-pill); z-index: 60; box-shadow: var(--shadow);
  max-width: 380px; text-align: center;
}
.offlinebar {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--warn); color: var(--warn-ink);
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  padding: 5px; position: sticky; top: 0; z-index: 25;
}
.offlinebar[hidden] { display: none; }

.spinner {
  width: 26px; height: 26px; margin: 40px auto; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--go);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.emptystate { text-align: center; padding: 28px var(--pad-screen); }
.footnote { font-size: 11px; color: var(--text-dim); text-align: center; margin: 14px 0 0; line-height: 1.5; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.legend i { width: 14px; height: 2px; display: block; }
