/* style.css — Stil angelehnt an die IDG-Grafik. */

:root {
  --bg: #f4f1ea;
  --ink: #2b2b2b;
  --bar-bg: #ffffff;
  --radius: 14px;
  --gap: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 0 110px;        /* Platz für die fixierte Aktionsleiste unten */
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
}

/* Kopfbereich */
.page-head {
  text-align: center;
  padding: 28px 20px 8px;
}
.page-head h1 {
  margin: 0 0 6px;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.page-head p {
  margin: 0;
  color: #6b6b6b;
  font-size: 1rem;
}

/* Raster der 5 Spalten */
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap);
  max-width: 1280px;
  margin: 20px auto 0;
  padding: 0 16px;
  align-items: start;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Farbiger Kopf jeder Spalte mit Icon, Titel, Untertitel */
.header {
  background: var(--col);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 14px 18px;
  text-align: center;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.icon {
  width: 84px;
  height: 84px;
  margin-bottom: 14px;
}
.icon svg { width: 100%; height: 100%; fill: #fff; }
.header h2 {
  margin: 4px 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
}
.header .subtitle {
  margin: 0;
  font-size: 0.84rem;
  opacity: 0.95;
}

/* Begriff-Buttons */
.terms {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.term {
  /* Standardzustand: heller Farbton der Spaltenfarbe */
  position: relative;
  width: 100%;
  padding: 13px 30px 13px 14px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: color-mix(in srgb, var(--col) 22%, #fff);
  color: #2b2b2b;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s, color 0.15s;
}
.term:hover {
  background: color-mix(in srgb, var(--col) 35%, #fff);
}
.term:active { transform: scale(0.985); }

.term:focus-visible {
  outline: 3px solid #1a1a1a;
  outline-offset: 2px;
}

/* Ausgewählter Zustand: volle Spaltenfarbe, weiße Schrift, Haken */
.term.selected {
  background: var(--col);
  color: #fff;
  border-color: color-mix(in srgb, var(--col) 60%, #000);
}
.term.selected::after {
  content: "✓";
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 800;
  font-size: 1rem;
}

/* Kurzer Hinweis (z. B. Maximalauswahl erreicht) */
.hint {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%) translateY(12px);
  background: #2b2b2b;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
}
.hint.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Fixierte Aktionsleiste unten */
.action-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--bar-bg);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
  z-index: 10;
}
.counter {
  font-weight: 700;
  color: #555;
}
.confirm {
  margin-left: auto;       /* schiebt den Button nach rechts unten */
  padding: 13px 32px;
  border: none;
  border-radius: 999px;
  background: #7e1e3c;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.confirm:hover:not(:disabled) { background: #66162f; }
.confirm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.confirm:focus-visible {
  outline: 3px solid #1a1a1a;
  outline-offset: 2px;
}

/* ---------- Responsiv ---------- */

/* Tablet: 5 Spalten werden zu schmal -> wechsel auf flexibleres Raster */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Letzte Spalte bei ungerader Anzahl über volle Breite */
  .column:nth-child(5) {
    grid-column: 1 / -1;
  }
  .header { min-height: 0; }
}

/* Handy: alles untereinander */
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .column:nth-child(5) { grid-column: auto; }
  .action-bar { padding: 12px 16px; }
  .confirm { padding: 12px 24px; }
}

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