/* Componenten. Kleuren en maten komen uit theme.css. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.45;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--color-primary);
}

.muted {
  color: var(--color-text-muted);
  font-weight: 400;
}

.icon {
  width: var(--icon-size);
  height: var(--icon-size);
  flex: none;
}

/* ---------- Topbalk ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--topbar-height);
  padding: var(--space-3) var(--gutter);
  padding-top: max(var(--space-3), env(safe-area-inset-top));
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.topbar--center {
  justify-content: center;
}

.topbar__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar__eyebrow,
.wordmark {
  font-family: var(--font-display);
  color: var(--color-accent);
  text-transform: lowercase;
  letter-spacing: var(--tracking-caps);
}

.topbar__eyebrow {
  font-size: var(--text-xs);
  line-height: 1;
}

.wordmark {
  font-size: var(--text-lg);
}

.topbar__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -2px;
  color: var(--color-text);
  border-radius: var(--radius-round);
  text-decoration: none;
}

.icon-btn .icon {
  width: 40px;
  height: 40px;
}

.icon-btn--light {
  color: var(--color-on-accent);
}

.icon-btn--light .icon {
  width: 30px;
  height: 30px;
}

/* ---------- Pagina, secties, kaarten ---------- */

.page {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) var(--space-7);
  padding-bottom: max(var(--space-7), env(safe-area-inset-bottom));
}

.page--tight {
  padding-top: var(--space-4);
}

.display {
  margin: 0 0 var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

.label {
  margin: 0 0 var(--space-3);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

.section + .section {
  margin-top: var(--space-6);
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: var(--space-5);
}

/* ---------- Formulieren ---------- */

.form {
  display: grid;
  gap: var(--space-4);
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.input {
  width: 100%;
  height: var(--control-height);
  padding: 0 var(--space-4);
  font: inherit;
  color: var(--color-text);
  background: var(--color-surface-strong);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
  outline: none;
}

.input:focus-visible {
  border-color: var(--color-accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--control-height);
  padding: 0 var(--space-5);
  font: inherit;
  font-weight: var(--weight-bold);
  font-size: var(--btn-font-size);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
}

.btn .icon {
  width: 24px;
  height: 24px;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
}

.btn--outline {
  background: var(--color-surface-strong);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--link {
  width: auto;
  min-height: 44px;
  margin-top: var(--space-4);
  padding: 0;
  background: none;
  color: var(--color-primary);
  font-size: var(--text-sm);
}

.btn:focus-visible,
.icon-btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.alert {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid currentColor;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.form .alert {
  margin: 0;
}

.alert--error {
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

.alert--success {
  color: var(--color-success);
  background: var(--color-success-soft);
}

/* ---------- Dialogen (verborgen bewerken, hulp) ---------- */

.sheet {
  width: min(calc(100% - 2 * var(--gutter)), var(--content-max));
  max-height: calc(100dvh - 2 * var(--gutter));
  padding: var(--space-5);
  color: var(--color-text);
  background: var(--color-surface);
  border: 0;
  border-radius: var(--radius);
}

.sheet::backdrop {
  background: rgb(0 0 0 / 0.45);
}

.sheet .btn--link {
  margin-top: 0;
  justify-self: center;
}

.sheet__list {
  margin: 0 0 var(--space-5);
  padding-left: 1.2em;
  display: grid;
  gap: var(--space-2);
}

/* ---------- /account (profiel) ---------- */

.page-account {
  background: var(--color-profile-bg);
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--gutter) var(--space-5);
  padding-top: env(safe-area-inset-top);
  color: var(--color-on-accent);
  text-align: center;
  /* Diagonale banen + stippen rechts, zoals het profielconcept */
  background:
    radial-gradient(circle, rgb(255 255 255 / 0.4) 1.3px, transparent 1.8px) 0 0 / 11px 11px,
    linear-gradient(110deg, var(--color-accent-soft) 0%, var(--color-accent-soft) 18%, var(--color-accent) 46%, #ff8a00 66%, var(--color-accent-soft) 100%);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, var(--color-accent-soft) 0%, #ffb11f 22%, var(--color-accent) 48%, transparent 70%);
  pointer-events: none;
}

.hero > * {
  position: relative;
}

.hero__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% + 2 * var(--space-2));
  height: var(--topbar-height);
}

.hero__actions {
  display: flex;
  gap: var(--space-4);
}

.icon-btn--badge {
  position: relative;
}

.icon-btn--badge::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 2px;
  width: 11px;
  height: 11px;
  background: var(--color-badge);
  border-radius: var(--radius-round);
}

.avatar {
  display: grid;
  place-items: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  margin-top: var(--space-1);
  padding: 0;
  color: var(--color-on-accent);
  font: inherit;
  border: 1.5px solid rgb(255 255 255 / 0.9);
  border-radius: var(--radius-round);
  background: linear-gradient(180deg, var(--color-accent-soft) 0%, var(--color-accent) 70%);
  overflow: hidden;
  cursor: pointer;
}

.avatar[data-busy] {
  opacity: 0.6;
}

.avatar__add {
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
}

.avatar__add .icon {
  width: 46px;
  height: 46px;
}

.avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__name {
  margin: var(--space-5) 0 0;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  /* Lang drukken opent het verborgen bewerkvenster */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.hero__meta {
  margin: var(--space-1) 0 0;
  font-size: var(--text-md);
  letter-spacing: 0.02em;
}

.tag {
  margin-top: var(--space-2);
  padding: 2px var(--space-4);
  border: 1.5px solid rgb(255 255 255 / 0.95);
  font-size: var(--text-md);
  letter-spacing: 0.02em;
}

.profile {
  padding-bottom: max(var(--space-7), env(safe-area-inset-bottom));
}

.profile > .alert {
  margin: var(--space-4) var(--gutter) 0;
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0 var(--space-4);
}

.menu li {
  border-bottom: 2px dotted var(--color-border);
}

.menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  min-height: var(--menu-item-height);
  padding: 0;
  color: var(--color-text);
  font: inherit;
  font-size: 1.1875rem;
  font-weight: 500;
  text-align: left;
  background: none;
  border: 0;
  cursor: default;
}

.menu__item .icon {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
}

.profile__cta {
  padding: var(--space-5) var(--space-4) 0;
}

.btn--tall {
  min-height: var(--btn-tall-height);
}

.btn--tall .icon {
  width: 26px;
  height: 26px;
}

.perks {
  padding: var(--space-6) 0 0 var(--gutter);
}

.perks__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-right: var(--gutter);
}

.link-caps {
  padding: 0;
  color: var(--color-primary);
  font: inherit;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  background: none;
  border: 0;
  cursor: default;
}

.perks__row {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
}

.perk {
  flex: 0 0 86%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 150px;
  padding: var(--space-5);
  color: #ffffff;
}

.perk--dark {
  background: #1f1d4d;
}

.perk--accent {
  flex-basis: 40%;
  background: var(--color-accent);
}

.perk__big {
  font-family: var(--font-display);
  font-size: 3.25rem;
  line-height: 1;
}

.perk__text {
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

/* ---------- /show (toegangsscherm) ---------- */

.page-show {
  display: flex;
  flex-direction: column;
  /* svh = hoogte mét browser- en systeembalken, zodat onderaan niets wegvalt */
  height: 100vh;
  height: 100svh;
  overflow-y: auto; /* vangnet: scrollen i.p.v. afknippen als het toch niet past */
  background: var(--color-bg);
}

/* Witte balk bovenaan, zoals op de andere pagina's */
.show-top {
  flex: none;
  display: flex;
  align-items: center;
  min-height: var(--show-top-height);
  padding: 0 var(--space-4);
  padding-top: env(safe-area-inset-top);
  background: var(--color-surface);
}

.show-top .icon {
  width: 28px;
  height: 28px;
}

.show {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-6) calc(var(--space-4) + env(safe-area-inset-bottom));
}

/* Het vak is zo hoog als de QR, zodat alles van boven aansluit. Tijdens het
   meten (show.js) neemt het tijdelijk alle vrije hoogte in. */
.show__stage {
  flex: 0 0 auto;
  min-height: 0;
  display: grid;
  place-items: start center;
  overflow: hidden;
}

.show__stage.is-measuring {
  flex: 1 1 0;
}

.qr-block {
  display: flex;
  flex-direction: column;
}

.qr-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;  /* altijd puur wit, ongeacht het thema */
  border: var(--qr-frame-width) solid var(--color-accent);
}

.qr-frame__canvas {
  display: block;
  image-rendering: pixelated;
}

.qr-frame[data-state="empty"] .qr-frame__canvas {
  visibility: hidden;
}

.qr-frame__empty {
  position: absolute;
  top: 45%;
  margin: 0;
  color: #6e665c;
  font-weight: var(--weight-bold);
}

.qr-frame:not([data-state="empty"]) .qr-frame__empty {
  display: none;
}

/* Label onder de QR, buiten de witrand zodat de quiet zone vrij blijft */
.qr-frame__label {
  padding: 1px var(--space-5);
  color: #ffffff;
  background: var(--color-accent);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.qr-progress {
  height: var(--qr-progress-height);
  margin-top: var(--space-3);
  background: var(--color-border);
}

.qr-progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--color-accent);
  transition: width 0.1s linear;
}

.qr-progress[data-stale="true"] .qr-progress__fill {
  background: var(--stale-color);
}

.show__info {
  padding-top: var(--space-5);
  text-align: center;
}

.show__title {
  margin: 0 0 var(--space-3);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--color-text);
}

.show__text {
  margin: 0 auto;
  max-width: 34ch;
  color: #4a4a4a;
  font-size: var(--text-sm);
}

.show__status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
}

.show__actions {
  display: grid;
  gap: var(--space-1);
  padding-top: var(--space-5);
}

.show__actions .btn--primary {
  min-height: 46px;
  font-size: var(--text-sm);
  border-radius: var(--radius);
}

.btn--text {
  min-height: 44px;
  color: var(--color-accent);
  background: none;
  text-transform: none;
  letter-spacing: 0;
  cursor: default;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
}

.conn__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-round);
  background: var(--color-text-muted);
}

.conn[data-state="online"] {
  display: none;
}

.conn[data-state="offline"] {
  color: var(--color-danger);
}

.conn[data-state="offline"] .conn__dot {
  background: var(--color-danger);
}

.conn[data-state="connecting"] .conn__dot {
  animation: pulse 1s ease-in-out infinite;
}

.age {
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.age[data-stale="true"] {
  color: var(--stale-color);
}

@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

/* Lage schermen: tekst compacter zodat de QR zo groot mogelijk blijft */
@media (max-height: 700px) {
  .show__text {
    display: none;
  }
  .show__info {
    padding-top: var(--space-3);
  }
  .show__actions {
    padding-top: var(--space-3);
  }
}

/* ---------- App-pagina's: topbalk + navigatiebalk ---------- */

.page-app {
  background: var(--color-bg);
  padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
}

.page-home,
.page-clubs {
  /* ruimte voor de vaste paarse knop boven de navigatiebalk */
  padding-bottom: calc(var(--tabbar-height) + var(--access-bar-height) + env(safe-area-inset-bottom));
}

.appbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--appbar-height);
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  background: var(--color-surface);
}

.appbar__profile {
  justify-self: start;
  display: grid;
  color: var(--color-text);
}

.appbar__profile .icon {
  width: var(--appbar-profile-size);
  height: var(--appbar-profile-size);
}

.appbar__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--color-text);
}

.appbar__icon {
  position: relative;
  display: grid;
}

.appbar__icon .icon {
  width: var(--appbar-icon-size);
  height: var(--appbar-icon-size);
}

.appbar__icon--badge::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -5px;
  width: 10px;
  height: 10px;
  background: var(--color-badge);
  border-radius: var(--radius-round);
}

.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.tabbar__item {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: #6a645c;
  font-size: var(--text-xs);
  text-decoration: none;
}

.tabbar__item .icon {
  width: var(--tabbar-icon-size);
  height: var(--tabbar-icon-size);
  color: #6a645c;
}

.tabbar__item.is-active,
.tabbar__item.is-active .icon {
  color: var(--color-accent);
}

.tabbar__center {
  justify-self: center;
  display: grid;
  place-items: center;
  width: var(--tabbar-center-size);
  height: var(--tabbar-center-size);
  margin-top: -10px;
  color: #ffffff;
  background: var(--color-accent);
  border: 3px solid var(--color-surface);
  border-radius: var(--radius-round);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.15);
}

.tabbar__center .icon {
  width: 24px;
  height: 24px;
}

.access-bar {
  position: fixed;
  inset: auto 0 calc(var(--tabbar-height) + env(safe-area-inset-bottom));
  z-index: 9;
  padding: var(--space-3) var(--gutter);
  background: linear-gradient(transparent, var(--color-surface) 35%);
}

.btn--access {
  min-height: var(--btn-tall-height);
  font-size: 1.125rem;
  border-radius: var(--radius);
}

.btn--access .icon {
  width: 24px;
  height: 24px;
}

.app-content {
  padding: var(--space-6) var(--gutter);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.section-head .label {
  margin: 0;
}

.link-caps--plain {
  text-transform: none;
  font-size: var(--text-lg);
}

.display--page {
  font-size: var(--text-xl);
  margin-bottom: var(--space-5);
}

.display--section {
  font-size: var(--text-xl);
  margin: 0;
}

.label--wide {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* ---------- /home ---------- */

.today {
  padding: var(--space-5) var(--gutter) var(--space-5);
  background: var(--color-surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.today__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.today__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.today__cal .icon {
  width: 34px;
  height: 34px;
}

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
}

.week__day {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--space-2);
}

.week__name {
  font-size: 1rem;
}

.week__day.is-today .week__name {
  font-weight: var(--weight-bold);
}

.week__date {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  max-width: 44px;
  background: #ffffff;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-size: var(--text-md);
}

.week__day.is-today .week__date {
  border-color: var(--color-accent);
  font-weight: var(--weight-bold);
}

.week__day.is-planned::after {
  content: "";
  position: absolute;
  bottom: -14px;
  width: 7px;
  height: 7px;
  background: var(--color-accent);
  border-radius: var(--radius-round);
}

.goal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.goal__text {
  margin: 0;
  font-size: 1.125rem;
  font-weight: var(--weight-bold);
}

.goal__count {
  color: var(--color-accent);
}

.goal__edit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  color: var(--color-primary);
  font: inherit;
  font-size: 1.125rem;
  font-weight: var(--weight-bold);
  background: none;
  border: 0;
  cursor: default;
}

.goal__edit .icon {
  width: 22px;
  height: 22px;
}

.btn--plan {
  min-height: var(--btn-tall-height);
  font-size: 1.0625rem;
  border-radius: var(--radius);
  cursor: default;
}

.reco {
  padding: var(--space-6) 0 var(--space-4) var(--gutter);
}

.reco .section-head {
  padding-right: var(--gutter);
}

.reco__row {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
  padding-right: var(--gutter);
}

.reco-card {
  position: relative;
  flex: 0 0 88%;
  min-height: 230px;
  display: flex;
  align-items: flex-end;
  padding: var(--space-5);
  color: #ffffff;
  overflow: hidden;
}

.reco-card--orange {
  background: linear-gradient(135deg, #ffb24a, var(--color-accent) 55%, #b84c00);
}

.reco-card--purple {
  background: linear-gradient(135deg, #a58ad6, var(--color-primary) 60%, #34156d);
}

.reco-card--dark {
  background: linear-gradient(135deg, #5a5550, #2c2c2c 60%);
}

.reco-card__art {
  position: absolute;
  right: -20px;
  top: 10px;
  opacity: 0.22;
}

.reco-card__art .icon {
  width: 200px;
  height: 200px;
}

.reco-card__fav {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: rgb(0 0 0 / 0.55);
  border-radius: var(--radius-round);
}

.reco-card__fav .icon {
  width: 22px;
  height: 22px;
}

.reco-card__title {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-lg);
  line-height: 1.1;
  text-transform: uppercase;
}

/* ---------- /training ---------- */

.tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.tool {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 66px;
  padding: 0 var(--space-3);
  color: var(--color-text);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.2;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  text-align: left;
  background: var(--color-surface);
  border: 4px solid var(--color-border);
  cursor: default;
}

.tool__icon .icon {
  width: 30px;
  height: 30px;
  color: var(--color-accent);
}

.categories {
  display: grid;
  gap: var(--space-5);
}

.category {
  position: relative;
  min-height: 140px;
  padding: var(--space-5) var(--space-4);
  color: #ffffff;
  overflow: hidden;
}

.category--rust { background: #9b4300; }
.category--lilac { background: #7e6699; }
.category--dark { background: #1f1f1f; }
.category--taupe { background: #7c6f5c; }

.category__art {
  position: absolute;
  right: -10px;
  bottom: -30px;
  opacity: 0.18;
}

.category__art .icon {
  width: 170px;
  height: 170px;
}

.category__title {
  position: relative;
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.category__text {
  position: relative;
  margin: 0;
  max-width: 34ch;
  font-size: var(--text-md);
}

/* ---------- /voortgang ---------- */

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--color-surface);
  border-bottom: 3px solid var(--color-border);
}

.tabs__tab {
  position: relative;
  min-height: 60px;
  padding: 0;
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-lg);
  background: none;
  border: 0;
  cursor: default;
}

.tabs__tab.is-active {
  color: var(--color-accent);
  font-weight: var(--weight-bold);
}

.tabs__tab.is-active::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -3px;
  height: 5px;
  background: var(--color-accent);
}

.app-content--cards {
  display: grid;
  gap: var(--space-6);
}

.panel {
  padding: var(--space-5);
  background: var(--color-surface);
}

.badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.badge {
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  padding: var(--space-6) var(--space-1) var(--space-5);
  color: #ffffff;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, #4a4a4a, #2b2b2b 70%);
}

.badge__art {
  width: 80%;
  margin-bottom: var(--space-3);
}

.badge strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-sm);
}

.badge span {
  font-size: var(--text-sm);
}

.metric__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric__head .label {
  margin: 0;
}

.metric__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.metric__value {
  display: grid;
  margin: var(--space-2) 0 0;
}

.metric__value strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.1;
}

.metric__value span {
  font-size: var(--text-lg);
}

.metric__chart {
  width: 55%;
  max-width: 200px;
}

/* ---------- /clubs ---------- */

.favorites {
  padding: var(--space-6) 0 var(--space-7) var(--gutter);
  background: #e8d6bd;
}

.favorites__row {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scrollbar-width: none;
  padding-right: var(--gutter);
}

.club-card {
  flex: 0 0 44%;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  background: #2c2c2c;
  color: #ffffff;
}

.club-card__visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #9fb6c8 0%, #d9dde0 45%, var(--color-accent) 46%, var(--color-accent) 60%, #c7c9cb 61%);
  color: rgb(255 255 255 / 0.6);
}

.club-card__visual .icon {
  width: 56px;
  height: 56px;
}

.club-card__tag {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-1) var(--space-3);
  color: var(--color-text);
  background: #e8d6bd;
  font-size: var(--text-sm);
}

.club-card__body {
  padding: var(--space-3) var(--space-3) var(--space-4);
}

.club-card__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-md);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.club-card__city {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
}

.club-add {
  flex: 0 0 44%;
  min-width: 160px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-md);
  background: none;
  border: 1.5px solid var(--color-text);
  cursor: default;
}

.club-add .icon {
  width: 34px;
  height: 34px;
}

.busy {
  padding: var(--space-6) var(--gutter) var(--space-5);
}

.busy__title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
}

.busy__chart {
  padding: var(--space-3) var(--space-3) var(--space-3);
  background: var(--color-surface);
}

.busy__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
  text-align: center;
  font-size: var(--text-lg);
}

.busy__days .is-today {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.busy__bars {
  display: block;
  width: 100%;
  height: 70px;
}

.busy__hours {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text);
}

.busy__note {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  font-size: var(--text-lg);
}

.busy__dot {
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border-radius: var(--radius-round);
}

.facilities {
  padding: var(--space-5) var(--gutter) var(--space-6);
}

/* ---------- /scan ---------- */

.viewfinder {
  position: relative;
  aspect-ratio: 4 / 3;
  margin-bottom: var(--space-4);
  background: var(--color-dark);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.viewfinder video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.viewfinder__frame {
  position: absolute;
  inset: 12%;
  border: 3px solid rgb(255 255 255 / 0.55);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.viewfinder[data-state="found"] .viewfinder__frame {
  border-color: var(--color-accent);
}

.status-list {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-5);
}

.status-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  font-size: var(--text-sm);
}

.status-list li + li {
  border-top: 2px dotted var(--color-border);
}

.status-list strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

[data-tone="ok"] {
  color: var(--color-success);
}

[data-tone="warn"] {
  color: var(--color-warning);
}

[data-tone="error"] {
  color: var(--color-danger);
}

[data-tone="muted"] {
  color: var(--color-text-muted);
}

.token-form .muted {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
}

@media (min-width: 720px) {
  .page-scan .page {
    max-width: 640px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
