:root {
  --bg: #f6f2ea;
  --ink: #22211f;
  --muted: #706b63;
  --line: #d8d0c3;
  --card: #fffaf1;
  --accent: #2f5d50;
  --accent-light: #e2eee8;
  --danger: #9a3a2f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #fffaf1 0, var(--bg) 40%, #efe7db 100%);
  color: var(--ink);
  line-height: 1.5;
}

main {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.hero {
  margin-bottom: 28px;
}

.kicker {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .78rem;
}

h1 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: .95;
  letter-spacing: -.04em;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
}

.card {
  background: rgba(255, 250, 241, .88);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(20px, 4vw, 34px);
  box-shadow: 0 18px 60px rgba(72, 56, 32, .08);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.hint {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: .9rem;
  margin-top: 2px;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  font: inherit;
  background: #fffdf8;
  color: var(--ink);
}

.score-row {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.42);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  align-items: center;
}

button, .button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  background: var(--accent);
  color: white;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.secondary, .button.secondary {
  background: var(--accent-light);
  color: var(--accent);
}

button.danger {
  background: #f1ddd9;
  color: var(--danger);
}

.status {
  color: var(--muted);
  min-height: 1.4em;
}

.session-box {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  margin: 20px 0;
}

@media (max-width: 720px) {
  .session-box { grid-template-columns: 1fr; }
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
  background: #fffdf8;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  font-size: .88rem;
  color: var(--muted);
}

tfoot td {
  font-weight: 800;
  background: #f5efe5;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

@media (max-width: 820px) {
  .summary { grid-template-columns: 1fr; }
}

.metric {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: rgba(255,255,255,.42);
}

.metric span {
  color: var(--muted);
  font-size: .9rem;
}

.metric strong {
  display: block;
  font-size: 2rem;
  line-height: 1.1;
  margin-top: 3px;
}

.small {
  font-size: .92rem;
  color: var(--muted);
}

.start-card {
  max-width: 820px;
}

.start-session-box {
  display: block;
  margin-top: 0;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 18px;
}

.choice-card {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  background: rgba(255,255,255,.5);
  color: var(--ink);
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.choice-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 14px 38px rgba(72, 56, 32, .08);
}

.choice-card strong {
  display: block;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.05;
  letter-spacing: -.03em;
}

.choice-card span:last-child {
  color: var(--muted);
}

.choice-kicker {
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

code {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 6px;
}

@media (max-width: 720px) {
  .choice-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 160px; }
}


.guide-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  box-shadow: 0 12px 34px rgba(72, 56, 32, .18);
}

.guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(25, 23, 20, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 30;
}

.guide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(720px, 100%);
  height: 100dvh;
  overflow-y: auto;
  background: #fffaf1;
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 70px rgba(72, 56, 32, .18);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 40;
  padding: clamp(18px, 4vw, 34px);
}

.guide-open .guide-overlay {
  opacity: 1;
  pointer-events: auto;
}

.guide-open .guide-panel {
  transform: translateX(0);
}

.guide-panel__head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.guide-panel h2 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: .95;
  letter-spacing: -.04em;
}

.guide-panel h3 {
  margin: 0 0 14px;
  font-size: 1.35rem;
}

.guide-close {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
}

.guide-block {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.48);
  padding: clamp(16px, 3vw, 24px);
  margin-bottom: 18px;
}

.pyramid-wrap {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 360px) 1fr;
  gap: 14px;
  align-items: stretch;
  margin: 8px 0 16px;
}

.pyramid {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0;
  background:
    linear-gradient(63deg, transparent 49.2%, var(--accent) 49.5%, var(--accent) 50.5%, transparent 50.8%),
    linear-gradient(117deg, transparent 49.2%, var(--accent) 49.5%, var(--accent) 50.5%, transparent 50.8%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 0 18px 18px;
}

.pyramid-layer {
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 4px solid var(--accent);
  min-height: 58px;
  text-align: center;
}

.pyramid-layer strong {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: clamp(.95rem, 2.4vw, 1.45rem);
  line-height: 1.05;
}

.layer-1 { height: 24%; }
.layer-2 { height: 21%; }
.layer-3 { height: 19%; }
.layer-4 { height: 17%; }
.layer-5 { height: 14%; }

.pyramid-side {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  align-items: center;
  font-weight: 800;
  font-size: .95rem;
}

.pyramid-side--left { color: var(--danger); text-align: right; }
.pyramid-side--right { color: var(--accent); }

.score-legend {
  display: grid;
  gap: 10px;
}

.score-legend div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
}

.score-legend strong {
  font-size: 1.15rem;
  color: var(--accent);
}

@media (max-width: 720px) {
  .guide-toggle {
    right: 14px;
    bottom: 14px;
  }
  .pyramid-wrap {
    grid-template-columns: 1fr;
  }
  .pyramid-side {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto;
    gap: 8px;
    font-size: .78rem;
    text-align: left;
  }
  .pyramid {
    min-height: 320px;
  }
}


/* Vaste SVG-weergave binnen het zijpaneel. */
.pyramid-figure {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  margin: 8px 0 16px;
}

.pyramid-figure svg {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 720px) {
  .pyramid-figure svg {
    width: 112%;
    max-width: none;
    margin-left: -6%;
  }
}
