/* Games: the verb table. Tokens come from main.css; filters and cards from exercises.css. */

.verbs-back { margin-bottom: 8px; }
.verbs-select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1.5px solid var(--ink-2);
  border-radius: var(--r-s);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.verbs-select:focus-visible { outline: 3px solid var(--der); outline-offset: 1px; }
.verbs-info { margin-top: 20px; font-weight: 600; }
.verbs-hint { margin-top: 6px; max-width: 46em; font-size: 0.92rem; color: var(--ink-2); }

.verbs-scroll {
  margin-top: 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
}
.verbs-scroll:focus-visible { outline: 3px solid var(--der); outline-offset: 2px; }
.verbs-scroll { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; } /* a sideways swipe moves the table, not the page or the browser's back gesture */
.verbs-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.verbs-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 14px;
  background: var(--band);
  border-bottom: 1.5px solid var(--line);
  text-align: left;
  font-size: 0.92rem;
  white-space: nowrap;
}
.verbs-th-sub { font-weight: 400; color: var(--ink-2); }
.verbs-td { padding: 6px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; height: 52px; }
.verbs-td--inf { font-weight: 600; }
.verbs-table tbody tr:last-child .verbs-td { border-bottom: 0; }

.verbs-cell { display: inline-flex; align-items: center; gap: 6px; }
.verbs-aux { color: var(--ink-2); }
.verbs-input {
  width: 9.5em;
  min-height: 40px;
  padding: 6px 10px;
  border: 1.5px solid var(--ink-2);
  border-radius: var(--r-s);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* 16px keeps iOS from zooming in */
}
.verbs-td--en .verbs-input { width: 12em; }
.verbs-input:focus-visible { outline: 3px solid var(--der); outline-offset: 1px; }
.verbs-input.is-right { border-color: var(--das); background: var(--das-soft); color: var(--das-ink); font-weight: 600; }
.verbs-input.is-wrong { border-color: var(--wrong); border-style: dashed; background: #FFF4F2; }
.verbs-input.is-shown { border-color: var(--line); background: var(--band); color: var(--ink); }
.verbs-answer { padding: 6px 10px; border: 1.5px solid var(--line); border-radius: var(--r-s); background: var(--band); }
.verbs-answer.is-right { border-color: var(--das); background: var(--das-soft); color: var(--das-ink); font-weight: 600; }
.verbs-td--en .verbs-answer { display: inline-block; min-width: 8em; }
.verbs-mark { min-width: 1.1em; font-weight: 700; }
.verbs-input.is-right + .verbs-mark { color: var(--das-ink); }
.verbs-input.is-wrong + .verbs-mark { color: var(--wrong); }

.verbs-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 0 14px;
  background: var(--bg, #F5F8F2);
  border-top: 1.5px solid var(--line);
}
.verbs-status { min-height: 1.5em; font-weight: 600; }
.verbs-buttons { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 600px) {
  .filters__group { grid-template-columns: 1fr; }
  /* One row of three buttons, so the bar that stays at the bottom leaves room for the table. */
  .verbs-actions { gap: 6px; padding: 8px 0 10px; }
  .verbs-status { font-size: 0.92rem; line-height: 1.35; }
  .verbs-buttons { flex-wrap: nowrap; gap: 6px; }
  .verbs-buttons .btn { flex: 1 1 0; min-width: 0; padding: 6px 8px; font-size: 0.88rem; line-height: 1.2; white-space: normal; }
}


/* ---------- Flashcards ---------- */

/* Orange = the English side of a card, purple = the German side. Soft fill, strong edge. */
:root {
  --orange: #E8710A;
  --orange-soft: #FFE0BF;
  --purple: #7B3FB0;
  --purple-soft: #E6D8F5;
}

.cards-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; font-size: 0.95rem; }
.cards-legend li { display: inline-flex; align-items: center; gap: 8px; }
.cards-legend__swatch { width: 22px; height: 22px; border-radius: 6px; border: 2px solid; }
.cards-legend__en .cards-legend__swatch { background: var(--orange-soft); border-color: var(--orange); }
.cards-legend__de .cards-legend__swatch { background: var(--purple-soft); border-color: var(--purple); }

.filters__group--themes { align-items: start; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.theme-btn {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 1.5px solid var(--ink-2);
  border-radius: var(--r-s);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out);
}
.theme-btn:active { transform: scale(0.98); }
.theme-btn:focus-visible { outline: 3px solid var(--der); outline-offset: 2px; }
.theme-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .theme-btn[aria-pressed="false"]:hover { border-color: var(--ink); background: var(--band); }
}
.theme-btn__title { font-weight: 600; line-height: 1.3; }
.theme-btn__count { font-size: 0.85rem; }

.vcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 14px;
  margin-top: 16px;
}
.vcard {
  display: block;
  width: 100%;
  height: 150px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  perspective: 900px;
  transition: transform 160ms var(--ease-out);
}
.vcard:active { transform: scale(0.97); }
.vcard:focus-visible { outline: 3px solid var(--der); outline-offset: 3px; border-radius: var(--r-m); }
.vcard__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 420ms var(--ease-out);
}
.vcard.is-turned .vcard__inner { transform: rotateY(180deg); }
.vcard__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px 12px 12px;
  border: 2px solid;
  border-radius: var(--r-m);
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.vcard__face--back { transform: rotateY(180deg); }
.vcard__face--en { background: var(--orange-soft); border-color: var(--orange); }
.vcard__face--de { background: var(--purple-soft); border-color: var(--purple); }
.vcard__lang { position: absolute; top: 8px; left: 12px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; color: var(--ink-2); }
.vcard__pic { font-size: 2rem; line-height: 1; }
.vcard__text { font-size: 1.15rem; font-weight: 600; line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; }
.vcard__text--long { font-size: 0.95rem; font-weight: 500; }

/* der, die, das in the colours of the whole site. Solid pills read well on any card colour. */
.art {
  display: inline-block;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.92em;
  font-weight: 700;
  line-height: 1.5;
}
.art--der { background: var(--der); color: #fff; }
.art--die { background: var(--die); color: var(--ink); }
.art--das { background: var(--das); color: #fff; }
.cards-legend__art .art { margin-right: 4px; flex-shrink: 0; white-space: nowrap; }
.cards-legend__art { gap: 4px; }
@media (hover: hover) and (pointer: fine) {
  .vcard:hover .vcard__face { box-shadow: 0 4px 14px rgba(29, 43, 36, 0.14); }
}
@media (prefers-reduced-motion: reduce) {
  .vcard, .vcard__inner, .theme-btn { transition: none; }
}
@media (max-width: 600px) {
  .vcards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .vcard { height: 140px; }
  .vcard__text { font-size: 1.05rem; }
}

/* Under each flashcard: hear the German word, mark the card as known. */
.vcard-item { display: flex; flex-direction: column; gap: 6px; }
.vcard-tools { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.vcard-listen, .vcard-known {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}
.vcard-listen { width: 44px; padding: 0; flex-shrink: 0; }
.vcard-known { flex: 1; padding: 0 12px; }
.vcard-listen:active, .vcard-known:active { transform: scale(0.96); }
.vcard-listen:focus-visible, .vcard-known:focus-visible { outline: 3px solid var(--der); outline-offset: 2px; }
.vcard-listen.is-speaking { background: var(--band); border-color: var(--ink); }
.vcard-known svg { opacity: 0.45; }
.vcard-known[aria-pressed="true"] { background: var(--das); border-color: var(--das); color: #fff; }
.vcard-known[aria-pressed="true"] svg { opacity: 1; }
.vcard-item.is-known .vcard__face { border-style: dashed; }
.cards-known-info { margin-top: 2px; font-size: 0.9rem; font-weight: 500; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) {
  .vcard-listen:hover, .vcard-known[aria-pressed="false"]:hover { border-color: var(--ink); background: var(--band); }
}
@media (prefers-reduced-motion: reduce) {
  .vcard-listen, .vcard-known { transition: none; }
}
.verbs-buttons [hidden] { display: none; }

/* ---------- Articles ---------- */
.art-play { margin-top: 20px; max-width: 40em; }
.art-progress { font-weight: 600; color: var(--ink-2); }
.art-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 24px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
  text-align: center;
}
.art-card__pic { font-size: 2.6rem; line-height: 1; }
.art-card__word { font-family: var(--font-display); font-size: clamp(2rem, 7vw, 2.8rem); line-height: 1.15; overflow-wrap: anywhere; }
.art-card__en { color: var(--ink-2); font-size: 1.05rem; }
.art-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.art-choice {
  min-height: 64px;
  border: 3px solid transparent;
  border-radius: var(--r-m);
  font: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out), box-shadow 160ms ease, opacity 160ms ease;
}
.art-choice--der { background: var(--der); color: #fff; }
.art-choice--die { background: var(--die); color: var(--ink); }
.art-choice--das { background: var(--das); color: #fff; }
.art-choice:active:not(:disabled) { transform: scale(0.96); }
.art-choice:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.art-choice:disabled { cursor: default; opacity: 1; }
.art-choice.is-right { color: var(--das-ink); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--das); }
/* (exercises.css gives .is-right / .is-wrong their pale green and red backgrounds; the text colour follows them here) */
.art-choice.is-wrong { color: #8A2B1E; text-decoration: line-through; text-decoration-thickness: 3px; }
.art-choices:has(.is-right, .is-wrong) .art-choice:not(.is-right):not(.is-wrong) { opacity: 0.55; }
@media (hover: hover) and (pointer: fine) {
  .art-choice:hover:not(:disabled) { box-shadow: 0 4px 14px rgba(29, 43, 36, 0.25); }
}
.art-feedback { margin-top: 14px; min-height: 1px; }
.art-feedback.is-right, .art-feedback.is-wrong { padding: 12px 16px; border-radius: var(--r-m); border: 1.5px solid; }
.art-feedback.is-right { border-color: var(--das); background: var(--das-soft); }
.art-feedback.is-wrong { border-color: var(--wrong); background: #FDF4F2; }
.art-feedback.is-right .art-feedback__line { color: var(--das-ink); }
.art-feedback.is-wrong .art-feedback__line { color: #8A2B1E; }
.art-feedback__phrase { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 1.3rem; font-weight: 600; }
.art-feedback__hint { margin-top: 4px; font-size: 0.95rem; color: var(--ink-2); }
.art-next { margin-top: 14px; }
.art-end { margin-top: 20px; max-width: 40em; }
.art-end__title { font-family: var(--font-display); font-size: 1.6rem; }
.art-end__title:focus { outline: none; }
.art-end__text { margin-top: 6px; }
.art-misses { display: grid; gap: 6px; margin: 12px 0 16px; padding: 0; list-style: none; }
.art-misses li { font-size: 1.1rem; font-weight: 600; }
.art-misses__en { font-weight: 400; color: var(--ink-2); }
@media (max-width: 600px) {
  .art-choices { gap: 8px; }
  .art-choice { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .art-choice { transition: none; }
}

/* ---------- Plurals ---------- */
.plu-table { min-width: 600px; }
.plu-table .verbs-td--en .verbs-input { width: 11em; }
.plu-die { font-weight: 600; color: var(--ink-2); }
.plu-pic { font-size: 1.2rem; }
.plu-kind {
  display: inline-block;
  padding: 2px 10px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--band);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.plu-kind-cell { min-width: 11em; }
