:root {
  --bg: #0d0d10;
  --surface: #1a1a22;
  --surface-2: #24242e;
  --text: #f0f0f5;
  --muted: #8a8a99;
  --route: #4a90ff;
  --opdracht: #ff8a3d;
  --opdracht18: #ff4d6a;
  --random: #b478ff;
  --error: #ff4d4d;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.topbar h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.4rem 0.7rem;
  border-radius: 0.5rem;
}
.nav-link:hover { color: var(--text); background: var(--surface); }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  flex: 1;
  align-content: center;
}

.btn {
  font: inherit;
  font-weight: 700;
  font-size: 1.3rem;
  color: white;
  background: var(--surface);
  border: 0;
  border-radius: 1rem;
  padding: 1.4rem 1rem;
  min-height: 84px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97); }
.btn-route    { background: linear-gradient(135deg, var(--route),    #2d63cc); }
.btn-opdracht { background: linear-gradient(135deg, var(--opdracht), #cc5e1f); }
.btn-18       { background: linear-gradient(135deg, var(--opdracht18), #b6304b); }
.btn-random   { background: linear-gradient(135deg, var(--random),   #7d4dcc); }

.card-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 1.25rem;
}
.hidden { display: none !important; }

.card {
  background: var(--surface);
  border-radius: 1.25rem;
  padding: 2rem 1.5rem;
  text-align: center;
  min-height: 56dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  border: 1px solid var(--surface-2);
  animation: card-in 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card.shuffling .card-content { opacity: 0.4; transform: translateY(4px); filter: blur(2px); }

.card-label {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}
.card.cat-route       .card-label { color: var(--route); }
.card.cat-opdracht    .card-label { color: var(--opdracht); }
.card.cat-opdracht18  .card-label { color: var(--opdracht18); }

.card-content {
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.35;
  max-width: 26ch;
  transition: opacity 160ms, transform 160ms, filter 160ms;
}

.actions { display: flex; gap: 0.75rem; }
.btn-secondary {
  flex: 1;
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  background: var(--surface-2);
  color: var(--text);
  border: 0;
  border-radius: 0.85rem;
  padding: 1rem;
  min-height: 56px;
  cursor: pointer;
  transition: transform 120ms;
}
.btn-secondary:active { transform: scale(0.98); }

.loader {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid var(--surface-2);
  border-top-color: var(--text);
  animation: spin 0.7s linear infinite;
  margin: 1rem auto;
}
.error {
  background: rgba(255,77,77,0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 1rem;
  border-radius: 0.85rem;
  text-align: center;
}

@keyframes card-in {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* /cards overview */
.category {
  background: var(--surface);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--surface-2);
}
.cat-route       { border-left-color: var(--route); }
.cat-opdracht    { border-left-color: var(--opdracht); }
.cat-opdracht18  { border-left-color: var(--opdracht18); }
.category h2 { font-size: 1.15rem; margin-bottom: 0.85rem; }
.category ul { list-style: none; }
.category li {
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 1rem;
  line-height: 1.4;
}
.category li:last-child { border-bottom: 0; }

@media (min-width: 600px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .card-content { font-size: 1.9rem; }
}
