/* A calm, tactile game shelf: warm paper, ink, and small touches of colour. */
.games-page {
  --game-ink: #17324d;
  --game-blue: #204d9a;
  --game-teal: #176b5c;
  --game-sun: #f2c665;
  color: var(--game-ink);
  background: #fffaf0;
}
.games-page .download-header { border-color: #e6dcc9; }
.games-page .worksheet-entry a {
  background: #fffefa;
  border: 1px solid #d3d9d5;
  color: #214a78;
  box-shadow: 0 3px 0 rgba(36, 65, 76, .05);
}
.games-page .worksheet-entry a:hover { background: #f0f5fc; }
.games-page .worksheet-kicker {
  color: #176b5c;
  font-size: .72rem;
  letter-spacing: .14em;
}
.games-page .worksheet-intro h1 {
  color: var(--game-ink);
  letter-spacing: -.045em;
  line-height: 1.08;
}
.games-page .worksheet-intro > p:not(.worksheet-kicker) { line-height: 1.6; }
.games-page .game-primary {
  border-radius: 12px;
  min-height: 48px;
  box-shadow: 0 3px 0 rgba(18, 44, 72, .18);
  text-decoration: none;
}
.games-page .game-secondary { border-radius: 12px; min-height: 48px; }
.games-page :is(button,a,input,select,summary):focus-visible {
  outline: 3px solid #006a7a;
  outline-offset: 3px;
}

/* The overview is a shelf of equally weighted, distinct game cards. */
.games-index .worksheet-intro {
  margin: 28px 0 28px;
  padding: clamp(27px, 4vw, 48px);
  border-color: #ead9ac;
  border-radius: 28px;
  background: linear-gradient(112deg, #ffefc2 0%, #fff9e9 63%, #e4f3e9 100%);
  box-shadow: 0 9px 30px rgba(73, 68, 45, .05);
}
.games-index .worksheet-intro::after {
  width: 174px;
  height: 112px;
  border: 0;
  border-radius: 0;
  right: 5%;
  top: 21%;
  background-image: radial-gradient(circle, #c99a42 3px, transparent 3.5px);
  background-size: 24px 24px;
  opacity: .32;
}
.games-index .worksheet-intro h1 { max-width: 16ch; }
.games-index .games-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.games-index .game-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  min-width: 0;
  padding: 22px;
  border: 1px solid #e6e1d5;
  border-radius: 22px;
  background: #fffefa;
  box-shadow: 0 10px 25px rgba(30, 52, 62, .06);
}
.games-index .game-card::before {
  inset: 0 0 auto;
  width: auto;
  height: 6px;
  background: #e4b449;
}
.games-index .game-card:nth-child(2)::before { background: #32947e; }
.games-index .game-card:nth-child(3)::before { background: #6288c3; }
.games-index .game-card.connect4-entry::before { background: #d95d39; }
.games-index .game-card.race-entry::before { background: #204d9a; }
.games-index .game-card > div:last-child {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
}
.games-index .game-card .worksheet-kicker { color: #81580e; }
.games-index .game-card:nth-child(2) .worksheet-kicker { color: #176b5c; }
.games-index .game-card:nth-child(3) .worksheet-kicker { color: #315d9a; }
.games-index .game-card.connect4-entry .worksheet-kicker { color: #b5401e; }
.games-index .game-card.race-entry .worksheet-kicker { color: #204d9a; }
.games-index .game-card h2 { font-size: clamp(23px, 2.2vw, 28px); }
.games-index .game-card p { color: #435c6b; }
.games-index .game-card .game-card-detail { margin-bottom: 20px; }
.games-index .game-card .game-primary { margin-top: auto; }
.games-index .game-card:nth-child(2) .game-primary { background: #176b5c; border-color: #176b5c; }
.games-index .game-card:nth-child(3) .game-primary { background: #204d9a; border-color: #204d9a; }
.games-index .game-card.connect4-entry .game-primary { background: #176b5c; border-color: #176b5c; }
.games-index .game-card.race-entry .game-primary { background: #204d9a; border-color: #204d9a; }
.games-index .game-card:nth-child(2) .game-primary:hover { background: #105446; }
.games-index .game-card:nth-child(3) .game-primary:hover { background: #183d7a; }
.games-index .game-card.connect4-entry .game-primary:hover { background: #105446; }
.games-index .game-card.race-entry .game-primary:hover { background: #183d7a; }
.games-index .game-card .bingo-mini,
.games-index .game-card .game-preview,
.games-index .game-card .tic-preview,
.games-index .game-card .connect4-preview,
.games-index .game-card .race-preview {
  width: 100%;
  max-width: 210px;
  margin: 3px auto 0;
}
@media (min-width: 681px) {
  .games-index .game-card > div:first-child { height: 210px; min-height: 210px; max-height: 210px; }
}
.games-index .game-card .bingo-mini { background: #fff5d6; box-shadow: 0 6px 0 #f1e1bd; }
.games-index .game-card .domino-preview { padding: 12px; border-radius: 15px; background: #e8f6ee; }
.games-index .game-card .domino-preview div { box-shadow: 0 3px 0 #cde8d9; }
.games-index .game-card .memory-preview { padding: 12px; border-radius: 15px; background: #eaf1fc; aspect-ratio: 1; box-sizing: border-box; }
.games-index .game-card .memory-preview span { min-width: 0; min-height: 0; width: 100%; height: 100%; aspect-ratio: 1; border-color: #b5cbe6; box-shadow: 0 4px 0 #d7e4f3; box-sizing: border-box; }

/* Play setup pages: a clear heading, quiet explanatory card and crisp controls. */
.bingo-page #bingo > .worksheet-intro,
#domino .worksheet-intro,
#memory .worksheet-intro {
  border-radius: 24px;
  box-shadow: 0 8px 25px rgba(30, 52, 62, .04);
}
.bingo-page #bingo > .worksheet-intro { background: #fff2ce; border-color: #ead5a3; }
#domino .worksheet-intro { background: #e5f5ed; border-color: #b8dccc; }
#memory .worksheet-intro { background: #eaf2ff; border-color: #c5d6ee; }
#memory .worksheet-intro h1 { color: #173b70; }
#memory .worksheet-intro .worksheet-kicker { color: #315e98; }
#memory .worksheet-intro > p:not(.worksheet-kicker) { color: #365776; }
#memory .worksheet-intro::after { border-color: #c8d9f2; }
.games-page .game-settings {
  border-color: #e0e0d7;
  border-radius: 22px;
  background: #fffefa;
  box-shadow: 0 10px 28px rgba(27, 52, 67, .06);
}
.games-page .game-settings h2 { letter-spacing: -.025em; }
.games-page .game-settings fieldset { border-bottom-color: #e8e6dd; }
.games-page .game-settings select,
.games-page .game-settings input[type=number] {
  min-height: 48px;
  border-radius: 10px;
  border-color: #9bafbc;
  background-color: #fff;
}
.games-page .bingo-row-options span { min-height: 46px; border-radius: 10px; }
.games-page .bingo-explainer { border-radius: 22px; }
.bingo-page .bingo-explainer { background: #e8f5ed; border-color: #c6e2d1; }
#domino .bingo-explainer, #memory .bingo-explainer { background: #fff5dc; border-color: #efdfb7; }
#memory .game-primary, #memory .bingo-row-options input:checked + span { background: #204d9a; border-color: #204d9a; color: #fff; }
#memory .game-primary:hover { background: #183d7a; border-color: #183d7a; }
#memory .memory-solution input { accent-color: #204d9a; }
#memory .bingo-row-options span { color: #284a70; border-color: #b3c7df; }
#memory .memory-result { background: #f2f7ff; border-color: #c9d9ed; }
#memory .memory-cards span { color: #244e82; border-color: #b5cae4; box-shadow: 0 3px 0 #e2ebf7; }
#memory .memory-cards span:nth-child(even) { color: #694600; border-color: #e1ce98; background: #fff9e5; }
.games-page .draw-panel { border-radius: 22px; background: #eef6ff; }
.games-page .game-detail, .games-page .session-panel { border-radius: 17px; background: #fffefa; }

@media (min-width: 851px) {
  .games-index .worksheet-intro::after {
    width: 300px;
    height: 190px;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    background: url('/assets/rechen-karten.webp') center/contain no-repeat;
    opacity: 1;
  }
  .games-index .worksheet-intro > p:not(.worksheet-kicker) { max-width: calc(100% - 330px); }
}

@media (max-width: 980px) {
  .games-index .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .games-index .worksheet-intro { margin: 18px 0 24px; padding: 26px 22px; border-radius: 21px; }
  .games-index .worksheet-intro::after { width: 90px; height: 90px; right: -10px; top: -4px; background-size: 21px 21px; }
  .games-index .games-grid { grid-template-columns: 1fr; gap: 14px; }
  .games-index .game-card { gap: 19px; padding: 22px; border-radius: 19px; }
  .games-index .game-card .bingo-mini, .games-index .game-card .game-preview, .games-index .game-card .tic-preview { max-width: 155px; margin: 2px 0 0; }
  .bingo-page #bingo > .worksheet-intro, #domino .worksheet-intro, #memory .worksheet-intro { border-radius: 20px; }
}
@media (max-width: 360px) {
  .games-page .bingo-row-options { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .games-index .worksheet-intro::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .games-page *, .games-page *::before, .games-page *::after { scroll-behavior: auto !important; }
}
