/* GHM-Quiz — Schulatmosphäre (Hönne / Kreide / Sandstein), kein Frisör-Theme */
:root {
  --ink: #12241c;
  --forest: #1e3d30;
  --moss: #2f5c45;
  --mist: #e4efe8;
  --paper: #f3f7f4;
  --chalk: #f7faf8;
  --amber: #d4a017;
  --amber-deep: #a67c0a;
  --sand: #c4a882;
  --river: #3d6b7a;
  --danger: #b33a2b;
  --ok: #2a7a4b;
  --muted: #5a7266;
  --line: rgba(18, 36, 28, 0.12);
  --shadow: 0 18px 50px rgba(18, 36, 28, 0.14);
  --radius: 18px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 107, 122, 0.22), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(212, 160, 23, 0.14), transparent 50%),
    linear-gradient(165deg, #d7e6de 0%, var(--mist) 40%, #c9d9d0 100%);
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

a {
  color: var(--river);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--forest);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.75rem 0 3.5rem;
}

.brand {
  text-align: center;
  margin-bottom: 1.75rem;
  animation: rise 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--forest), var(--moss));
  color: var(--chalk);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 24px rgba(30, 61, 48, 0.28);
  margin-bottom: 0.85rem;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}

.brand__sub {
  margin: 0.45rem 0 0;
  font-size: 1.05rem;
  color: var(--muted);
}

.brand__sub a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(90, 114, 102, 0.35);
}

.brand__sub a:hover {
  color: var(--forest);
  border-bottom-color: var(--forest);
}

.panel {
  background: color-mix(in srgb, var(--paper) 92%, white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 1.85rem);
  animation: rise 800ms cubic-bezier(0.2, 0.8, 0.2, 1) 80ms both;
}

.panel[hidden],
.view[hidden] {
  display: none !important;
}

.lede {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  color: var(--muted);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0 0 1.35rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  border-radius: 999px;
  padding: 0.78rem 1.35rem;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(160deg, var(--moss), var(--forest));
  color: var(--chalk);
  box-shadow: 0 10px 22px rgba(30, 61, 48, 0.22);
}

.btn--primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn--ghost {
  background: transparent;
  color: var(--forest);
  border: 1px solid rgba(30, 61, 48, 0.22);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(30, 61, 48, 0.06);
}

.btn--amber {
  background: linear-gradient(160deg, #e0b328, var(--amber-deep));
  color: #1a1608;
}

.btn--danger-ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(179, 58, 43, 0.28);
}

.privacy {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--muted);
}

.progress {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.progress__label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.progress__track {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(18, 36, 28, 0.08);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--river), var(--moss));
  border-radius: inherit;
  transition: width 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.category-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--forest);
  background: rgba(47, 92, 69, 0.12);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.7rem;
}

.question-text {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.6vw, 1.7rem);
  line-height: 1.25;
  font-weight: 600;
}

.uncertain {
  display: inline-block;
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--amber-deep);
  background: rgba(212, 160, 23, 0.14);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
}

.answer-form {
  display: grid;
  gap: 0.85rem;
}

.answer-input,
.text-input,
.select-input,
.textarea-input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--chalk);
  border: 1px solid rgba(18, 36, 28, 0.16);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.answer-input:focus,
.text-input:focus,
.select-input:focus,
.textarea-input:focus {
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(47, 92, 69, 0.16);
}

.choices {
  display: grid;
  gap: 0.55rem;
}

.choice {
  text-align: left;
  font: inherit;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid rgba(18, 36, 28, 0.14);
  background: var(--chalk);
  padding: 0.85rem 1rem;
  transition: border-color 140ms ease, background 140ms ease;
}

.choice:hover:not(:disabled) {
  border-color: var(--moss);
  background: #eef6f1;
}

.choice.is-selected {
  border-color: var(--moss);
  background: rgba(47, 92, 69, 0.1);
}

.feedback {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  animation: pop 280ms ease both;
}

.feedback--ok {
  background: rgba(42, 122, 75, 0.12);
  color: #174c2e;
}

.feedback--bad {
  background: rgba(179, 58, 43, 0.1);
  color: #7a241a;
}

.feedback strong {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.note {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.result-score {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  margin: 0.2rem 0 0.35rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1.1rem 0 1.35rem;
}

.stat {
  background: rgba(18, 36, 28, 0.04);
  border-radius: 12px;
  padding: 0.85rem;
}

.stat__label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.stat__value {
  font-weight: 700;
  font-size: 1.15rem;
}

.cat-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.cat-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(61, 107, 122, 0.08);
  font-size: 0.95rem;
}

.name-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

.tab {
  border: 1px solid rgba(30, 61, 48, 0.18);
  background: transparent;
  color: var(--forest);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.tab.is-active {
  background: var(--forest);
  color: var(--chalk);
  border-color: var(--forest);
}

.error-banner {
  background: rgba(179, 58, 43, 0.1);
  color: #7a241a;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.loading {
  color: var(--muted);
  font-style: italic;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 540px) {
  .shell {
    width: min(100% - 1.25rem, 720px);
    padding-top: 1.25rem;
  }

  .actions {
    flex-direction: column;
  }

  .actions .btn {
    width: 100%;
  }
}
