@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --line: #e3e3de;
  --text: #1c1c1f;
  --muted: #66666f;
  --orange: #ff5a1f;
  --blue: #2f5bea;
  --red: #e5312b;
  --accent: var(--orange);
  --shadow: 0 1px 2px #0000000d, 0 8px 24px -12px #00000026;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131315;
    --surface: #1c1c20;
    --line: #2d2d33;
    --text: #f1f1f3;
    --muted: #a0a0ab;
    --orange: #ff6d38;
    --blue: #7395ff;
    --shadow: 0 1px 2px #0006, 0 8px 24px -12px #000a;
  }
}

.section-submissions {
  --accent: var(--blue);
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.55 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1 {
  margin: 1rem 0;
  font-size: clamp(2.4rem, 7vw, 4.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

h1 s {
  color: var(--muted);
  font-weight: 500;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 0.08em;
}

.intro {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.15rem;
}

/* header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0.8rem 1rem 0;
}

.site-name {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
}

.site-mark {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
}

.click-counter {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 0.85rem;
}

.total {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.main-nav {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.5rem;
  margin-top: 0.25rem;
}

.nav-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  white-space: nowrap;
}

.nav-group-label {
  margin-right: 0.5rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  display: block;
  padding: 0.55rem 0.6rem 0.7rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.93rem;
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--text);
}

@media (max-width: 40rem) {
  .main-nav a {
    padding: 0.35rem 0.5rem 0.45rem;
  }
}

.main-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

/* layout */

main {
  flex: 1;
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer p {
  margin: 0;
}

/* landing page */

.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
  margin-top: 1rem;
}

@media (min-width: 52rem) {
  .hero {
    grid-template-columns: 1.3fr 1fr;
  }
}

.dialog-stack {
  display: grid;
  justify-self: center;
  max-width: 22rem;
}

.dialog {
  grid-area: 1 / 1;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}

.dialog:nth-child(1) {
  opacity: 0.55;
  transform: rotate(-4deg) translate(-14px, 10px);
}

.dialog:nth-child(2) {
  opacity: 0.8;
  transform: rotate(-1.5deg) translate(-6px, 4px);
}

.dialog-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.dialog-text {
  min-height: 1.4em;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.dialog-button {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 500;
}

.dialog-button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.doors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
}

@media (min-width: 44rem) {
  .doors {
    grid-template-columns: 1fr 1fr;
  }
}

.door {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 12rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.15s;
}

.door:hover {
  transform: translateY(-2px);
}

.door-arcade {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.door-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.door-text {
  max-width: 24rem;
  opacity: 0.85;
}

.door-meta {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.8;
}

.door-submissions .door-meta {
  color: var(--blue);
  opacity: 1;
}

/* arcade menu */

.game-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 12.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.game-card:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
}

.game-card-number {
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 600;
}

.game-card-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.game-card-description {
  color: var(--muted);
  font-size: 0.95rem;
}

.game-card-score {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.game-card-score b {
  color: var(--text);
  font-size: 0.95rem;
}

/* game page */

.game-switcher ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

/* On phones the main menu already lists every game; the switcher would only push the game down. */
@media (max-width: 40rem) {
  .game-switcher {
    display: none;
  }
}

.game-switcher a {
  display: block;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.9rem;
  text-decoration: none;
}

.game-switcher a:hover {
  border-color: var(--text);
}

.game-switcher [aria-current="page"] {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
  font-weight: 600;
}

.game-area {
  min-height: 20rem;
  margin-top: 2rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
}

.game-layout {
  display: grid;
  gap: 1.5rem;
  align-items: start;
  margin-top: 2rem;
}

@media (min-width: 56rem) {
  .game-layout {
    grid-template-columns: 1fr 18rem;
  }
}

.game-layout .game-area {
  margin-top: 0;
}

.button-primary {
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button-primary:hover {
  filter: brightness(1.08);
}

.button-secondary {
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.button-secondary:hover {
  border-color: var(--text);
}

/* shared by the games */

#game {
  color: var(--text);
}

.game-hud {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
}

.game-hud b {
  color: var(--text);
}

.game-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
}

.game-result-text {
  max-width: 28rem;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
}

/* muisaanvraag */

.muis-stage {
  position: relative;
  min-height: clamp(20rem, 55vh, 32rem);
  padding: 1.25rem;
  border-radius: 10px;
  background: var(--bg);
}

.muis-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 30rem;
}

.muis-title {
  margin: 0;
  font-size: 1.25rem;
}

.muis-form .muted {
  margin: -0.5rem 0 0;
}

.muis-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.muis-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.muis-input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.muis-error {
  margin: 0;
  color: var(--red);
  font-size: 0.88rem;
}

.muis-error:empty {
  display: none;
}

.muis-form > .button-primary {
  align-self: flex-start;
}

.muis-date {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.muis-date .muis-input {
  width: 9rem;
}

/* The shortcut: barely visible on purpose. */
.muis-date-today {
  padding: 0;
  border: 0;
  background: none;
  color: var(--bg);
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
}

/* Invisible against the stage until you find it. */
.muis-date-today:hover,
.muis-date-today:focus-visible {
  color: var(--muted);
}

.muis-country {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.muis-country-list {
  display: flex;
  flex-direction: column;
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.muis-country-list[hidden] {
  display: none;
}

.muis-country-option,
.muis-country-more {
  padding: 0.45rem 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}

.muis-country-option:hover {
  background: var(--bg);
}

.muis-country-more {
  color: var(--blue);
  font-weight: 600;
}

.muis-country-list .muted {
  margin: 0;
  padding: 0.45rem 0.75rem;
}

.muis-captcha {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.muis-captcha-question {
  margin: 0;
  font-weight: 600;
}

.muis-captcha-grid {
  display: grid;
  grid-template-columns: repeat(3, 4.5rem);
  gap: 0.35rem;
}

.muis-captcha-tile {
  aspect-ratio: 1;
  padding: 0.5rem;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.muis-captcha-tile svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muis-captcha-tile[aria-pressed="true"] {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 15%, var(--surface));
}

.muis-captcha-done {
  margin: 0;
  color: var(--blue);
  font-weight: 600;
}

/* Overlays (cookie banner, dialogs) cover the form inside the game, not the whole page. */
.muis-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 35%, transparent);
}

/* The form is taller than the screen, so panels stay in view while the player scrolls. */
.muis-panel {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(28rem, 100%);
  max-height: calc(100vh - 2rem);
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.muis-panel .muted {
  margin: 0;
}

.muis-confirm-question {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.muis-panel > .button-primary {
  align-self: flex-start;
}

/* The way out of the timeout: small and easy to miss. */
.muis-timeout-extend {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--surface);
  font: inherit;
  font-size: 0.72rem;
  text-decoration: underline;
  cursor: pointer;
}

/* Invisible against the panel until you find it. */
.muis-timeout-extend:hover,
.muis-timeout-extend:focus-visible {
  color: var(--muted);
}

.muis-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.muis-cookie-list {
  display: flex;
  flex-direction: column;
  min-height: 6rem;
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.muis-cookie {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

/* The shortcut: tiny, grey and last. */
.muis-cookie-refuse {
  align-self: flex-start;
  margin: 0.3rem 0.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.65rem;
  text-decoration: underline;
  cursor: pointer;
}

/* een klik */

.eenklik-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: clamp(20rem, 55vh, 32rem);
  padding: 1.5rem;
  border-radius: 10px;
  background: var(--bg);
  text-align: center;
}

/* No transitions: the light must be on or off, a fade would eat reaction time. */
.eenklik-circle {
  width: min(14rem, 60vw);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: var(--line);
  cursor: pointer;
  touch-action: manipulation;
}

.eenklik-circle.lit {
  background: var(--orange);
  box-shadow: 0 0 60px var(--orange);
}

.eenklik-circle:disabled {
  cursor: default;
}

.eenklik-status {
  max-width: 28rem;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.eenklik-after:empty {
  display: none;
}

.eenklik-after {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.eenklik-after p {
  margin: 0;
}

.eenklik-countdown {
  font-size: 1.5rem;
  font-weight: 700;
}

.eenklik-stage .muted {
  margin: 0;
}

/* weet je het zeker? */

.zeker-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(20rem, 55vh, 32rem);
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg);
}

.zeker-start {
  width: 9rem;
  height: 9rem;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
}

.zeker-dialog {
  width: min(22rem, 90%);
  padding: 1rem 1.25rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.zeker-dialog-title {
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.zeker-dialog-question {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.zeker-dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.zeker-dialog-buttons button {
  transition: transform 0.12s;
}

/* klik de knop */

.knop-arena {
  position: relative;
  height: clamp(20rem, 55vh, 32rem);
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg);
  cursor: crosshair;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* Fast taps during a round must not scroll or zoom the page. */
.knop-arena.playing {
  touch-action: none;
}

.knop-target {
  position: absolute;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.knop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
}

.knop-overlay[hidden] {
  display: none;
}

.knop-result {
  max-width: 28rem;
  font-size: 1.15rem;
  font-weight: 500;
}

.score-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: 26rem;
}

.score-form label {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 12rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: left;
}

.score-form input {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.score-message {
  flex-basis: 100%;
  margin: 0;
  font-weight: 500;
}

.score-message:empty {
  display: none;
}

/* scoreboard */

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

.scoreboard {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.scoreboard h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.scoreboard h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.95rem;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  padding: 0.2rem;
  border-radius: 8px;
  background: var(--bg);
}

.tabs button {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.tabs [aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px #0000001a;
}

.leaderboard-list,
.winners {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}

.leaderboard-list li,
.winners li {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.leaderboard-list li:last-child,
.winners li:last-child {
  border-bottom: 0;
}

.leaderboard-rank {
  width: 1.5rem;
  color: var(--muted);
  text-align: right;
}

.leaderboard-name,
.winners-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score,
.winners-score {
  font-weight: 600;
}

.winners-day {
  color: var(--muted);
}

/* toasts */

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  max-width: 28rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  font-weight: 500;
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}

/* submissions */

.submit-form,
.badge-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.1rem;
  max-width: 36rem;
  margin-top: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
}

.field label {
  font-weight: 500;
}

.field-optional,
.field-hint {
  color: var(--muted);
  font-weight: 400;
}

.field-hint {
  margin: 0;
  font-size: 0.9rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.field textarea {
  resize: vertical;
}

.field [aria-invalid="true"] {
  border-color: var(--red);
}

.field-error {
  margin: 0;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 500;
}

.field-row {
  display: grid;
  gap: 1.1rem;
  width: 100%;
}

@media (min-width: 40rem) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.submit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.5rem;
}

.week-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 2rem 0 1rem;
}

.week-header h2,
.week-header p {
  margin: 0;
}

.submission-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.submission-card {
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.submission-card h2,
.submission-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
  line-height: 1.25;
}

.submission-card p {
  margin: 0 0 0.5rem;
}

.submission-card p:last-child {
  margin-bottom: 0;
}

.archive-list {
  margin-top: 2rem;
}

.archive-week {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.submission-too-many {
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.submission-image {
  display: block;
  width: fit-content;
  margin: 0 0 0.75rem;
}

.submission-image img {
  display: block;
  max-width: 100%;
  max-height: 14rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.submission-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.vote {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.vote-button {
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.vote-button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

.vote-button[aria-pressed="true"]::before {
  content: "✓ ";
}

.vote-button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.vote-count {
  color: var(--muted);
  font-size: 0.92rem;
}

/* admin */

.admin-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.admin-menu a[aria-current="page"] {
  font-weight: 600;
}

.admin-menu form {
  margin-left: auto;
}

.admin-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: 24rem;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-form input {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.admin-games {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.admin-games a[aria-current="page"] {
  font-weight: 600;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-weight: 500;
}

.admin-table .is-hidden td {
  color: var(--muted);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.admin-actions button,
.admin-actions a {
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.admin-submissions {
  display: grid;
  gap: 1rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.admin-submission {
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.admin-submission.is-flagged {
  border-color: var(--red);
}

.admin-submission h3 {
  margin: 0 0 0.25rem;
}

.admin-submission p {
  margin: 0 0 0.5rem;
}

.admin-thumb {
  display: block;
  max-width: min(100%, 16rem);
  max-height: 12rem;
  margin: 0 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-flag {
  color: var(--red);
  font-weight: 600;
}

.submission-description {
  white-space: pre-line;
}

.form-error {
  margin: 0;
  color: var(--orange);
  font-weight: 500;
}

/* keurmerk */

.badge-maker {
  display: grid;
  gap: 2rem;
  align-items: start;
  margin-top: 1.5rem;
}

.badge-maker .badge-form {
  margin-top: 0;
}

.badge-preview :is(svg, img) {
  display: block;
  width: 100%;
  max-width: 22rem;
  height: auto;
  margin-inline: auto;
}

.badge-privacy {
  max-width: 22rem;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.badge-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}

@media (min-width: 52rem) {
  .badge-maker {
    grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  }
}

.badge-share {
  display: grid;
  gap: 1.1rem;
  align-content: start;
}

.badge-share h2 {
  margin: 0;
  font-size: 1.4rem;
}

.copy-field {
  display: flex;
  gap: 0.5rem;
  align-items: start;
}

.copy-field :is(input, textarea) {
  flex: 1;
  min-width: 0;
}

.copy-field textarea {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

/* Fixed paper colours, and the shape of a sheet of A4. No padding here: Safari adds padding on
   top of the height that aspect-ratio gives. */
.certificate {
  width: 100%;
  max-width: 40rem;
  aspect-ratio: 210 / 297;
  margin: 3rem auto 0;
  background: #fff;
  color: #1c1c1f;
  box-shadow: var(--shadow);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

/* The white edge is 4% of the certificate's width, and the sizes inside are in cqw of what's left,
   so the certificate scales like paper. */
.certificate-sheet {
  container-type: inline-size;
  height: 100%;
  padding: 4%;
}

.certificate-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 7cqw 8cqw 6cqw;
  border: 0.5cqw solid #2f5bea;
  outline: 0.2cqw solid #2f5bea;
  outline-offset: -1.5cqw;
  text-align: center;
  font-size: 2.6cqw;
  line-height: 1.45;
}

.certificate-site {
  margin: 0;
  color: #2f5bea;
  font-size: 2.4cqw;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.certificate-title {
  margin: 3cqw 0 0;
  color: inherit;
  font-size: 8cqw;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.certificate-subtitle {
  margin: 1cqw 0 0;
  color: #66666f;
  font-size: 3.2cqw;
}

.certificate-badge {
  width: 34cqw;
  height: auto;
  margin: 4cqw 0;
}

.certificate-fields {
  display: grid;
  gap: 2cqw;
  width: 100%;
  margin: 0;
  text-align: left;
}

.certificate-fields div {
  display: grid;
  grid-template-columns: 28% 1fr;
  gap: 3cqw;
  align-items: end;
}

.certificate-fields dt {
  color: #66666f;
}

.certificate-fields dd {
  min-height: 1.45em;
  margin: 0;
  border-bottom: 0.25cqw dotted transparent;
  font-size: 3.2cqw;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* An empty field becomes a line to fill in with a pen. */
.certificate-fields dd:empty {
  border-bottom-color: #1c1c1f;
}

.certificate-statement {
  margin: 5cqw 0 0;
}

.certificate-signature {
  width: 42cqw;
  margin-top: auto;
}

/* The aspect ratio of its viewBox: without a height, Safari makes an inline SVG 150px tall. */
.certificate-signature svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 180 / 50;
}

.certificate-signature p {
  margin: 0;
  padding-top: 1cqw;
  border-top: 0.25cqw solid #1c1c1f;
  color: #66666f;
  font-size: 2.2cqw;
}

/* Printing the Keurmerk page prints only the certificate, filling one A4 page. Browsers
   without named pages keep their own margins; the certificate then still fits. */
@page certificate {
  size: A4 portrait;
  margin: 0;
}

@media print {
  /* The whole page, not just the certificate: switching named pages forces a page break. */
  body:has(.certificate) {
    page: certificate;
    display: block;
    min-height: 0;
    background: #fff;
  }

  body:has(.certificate) :is(.site-header, .site-footer, main > h1, main > .intro, .badge-maker, .toast-region) {
    display: none;
  }

  body:has(.certificate) main {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* Sized by width and aspect ratio, so it fits one page with or without the browser's own margins.
     Its sheet stays a size container: without one, Safari takes the cqw sizes from the window
     instead of the paper. It holds no SVG text, which Firefox would leave out inside a container. */
  .certificate {
    max-width: none;
    margin: 0;
    box-shadow: none;
    break-inside: avoid;
  }
}

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

  .door:hover,
  .game-card:hover {
    transform: none;
  }
}
