/* ============================================================
   Spieleabend – gemeinsame Gestaltung
   Idee: Spieltisch-Filz (tiefes Grün-Petrol) + Kreideweiß,
   Ringelblumen-Gelb nur für Dinge, die man jetzt tun soll.
   ============================================================ */

:root {
  --felt: #17423F;
  --felt-deep: #0E2D2B;
  --felt-line: #2D6661;
  --chalk: #F2F5EF;
  --chalk-2: #E3E9E2;
  --paper: #FFFFFF;
  --ink: #13211F;
  --muted: #566B67;
  --marigold: #F5B700;
  --marigold-ink: #3A2A00;
  --good: #2FB57A;
  --bad: #E5484D;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 22px;

  --font-display: "Bricolage Grotesque", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--chalk);
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0 0 .4em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 .8em; }

a { color: inherit; }

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }

/* ---------- Bedienelemente ---------- */

button, .btn {
  font: inherit;
  font-weight: 700;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r-sm);
  padding: .55em 1em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .45em;
  justify-content: center;
  line-height: 1.2;
  touch-action: manipulation;
}
button:hover, .btn:hover { background: var(--chalk-2); }
button:disabled { opacity: .45; cursor: not-allowed; }

.btn-go {
  background: var(--marigold);
  border-color: var(--marigold);
  color: var(--marigold-ink);
}
.btn-go:hover { background: #FFC933; }

.btn-dark { background: var(--felt); border-color: var(--felt); color: var(--chalk); }
.btn-dark:hover { background: var(--felt-deep); }

.btn-good { background: var(--good); border-color: var(--good); color: #fff; }
.btn-good:hover { background: #26a06b; }
.btn-bad  { background: var(--paper); border-color: var(--bad); color: var(--bad); }
.btn-bad:hover { background: #fdecec; }

.btn-quiet { border-color: transparent; background: transparent; padding: .4em .6em; }
.btn-quiet:hover { background: var(--chalk-2); }

.btn-big { font-size: 1.15rem; padding: .85em 1.3em; width: 100%; }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  font: inherit;
  width: 100%;
  padding: .6em .75em;
  border: 2px solid #B9C6C2;
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--felt); }

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

label.field { display: block; margin-bottom: .9em; }
label.field > span { display: block; font-weight: 700; margin-bottom: .25em; }

.row { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1 1 12em; }

/* ---------- Teamfarbe ---------- */

.team-dot {
  width: .8em; height: .8em; border-radius: 50%;
  background: var(--team, var(--muted));
  display: inline-block; flex: none;
}

.chip {
  display: inline-flex; align-items: center; gap: .35em;
  font-size: .85rem; font-weight: 700;
  padding: .2em .65em;
  border-radius: 999px;
  background: var(--chalk-2);
  color: var(--ink);
  white-space: nowrap;
}
.chip-go { background: var(--marigold); color: var(--marigold-ink); }
.chip-good { background: var(--good); color: #fff; }
.chip-bad { background: var(--bad); color: #fff; }
.chip-dim { background: transparent; border: 1.5px solid #B9C6C2; color: var(--muted); }

/* ---------- Meldungen ---------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(150%);
  background: var(--ink);
  color: var(--chalk);
  padding: .7em 1.1em;
  border-radius: var(--r-md);
  max-width: min(92vw, 30rem);
  font-weight: 700;
  z-index: 100;
  transition: transform .25s ease;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--bad); }

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

/* ---------- Gemeinsame Bausteine (Seiten & Plugins) ---------- */

.nowrap { white-space: nowrap; }
.stack { display: grid; gap: .6rem; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }

.panel {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 1.1rem 1.15rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 0 #D3DDD9;
}
.panel > h2:first-child { margin-top: 0; }

.q-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .6rem; }
.q-head h2 { margin: 0; }
.status-line { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 700; }

.solution-box {
  background: var(--felt); color: var(--chalk);
  border-radius: var(--r-sm); padding: .8rem .9rem;
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700;
}
.solution-box small { display: block; font-family: var(--font-body); font-size: .8rem; font-weight: 400; opacity: .8; }

/* Gamemaster-Steuerung */
.live-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.sol { padding: .55rem .7rem; border-radius: var(--r-sm); background: var(--felt); color: var(--chalk); font-weight: 700; margin: .6rem 0 .8rem; }
.tablewrap { overflow-x: auto; }
table.answers { width: 100%; border-collapse: collapse; margin-top: .8rem; }
table.answers th { text-align: left; font-size: .82rem; color: var(--muted); font-weight: 700; padding: .3rem .4rem; border-bottom: 2px solid var(--chalk-2); }
table.answers td { padding: .5rem .4rem; border-bottom: 1px solid var(--chalk-2); vertical-align: middle; }
table.answers td.txt { font-weight: 700; font-size: 1.05rem; }
table.answers tr.ok td { background: #E5F6EE; }
table.answers tr.no td { background: #FCEDED; }
.judge { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }
.judge button { padding: .4em .7em; }
details.jump { margin-top: 1rem; }
details.jump summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.is-current { background: #FFF6D6 !important; border-color: var(--marigold) !important; }

input, select, textarea, button, .btn { box-sizing: border-box; }
