/* BingoCreator — dezenter Industrial-Brutalism: dünne Linien, reduzierte Palette, klare Raster */

:root {
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --paper: #f4f3ef;
  --panel: #ffffff;
  --line: #1a1a1a;
  --line-soft: #c9c7c0;
  --accent: #c8432a;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --hairline: 1px;
  --radius: 0px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ececea;
    --ink-soft: #b4b2ac;
    --paper: #161615;
    --panel: #1e1e1c;
    --line: #ececea;
    --line-soft: #46443e;
    --accent: #e35c3f;
  }
}
:root[data-theme="dark"] {
  --ink: #ececea;
  --ink-soft: #b4b2ac;
  --paper: #161615;
  --panel: #1e1e1c;
  --line: #ececea;
  --line-soft: #46443e;
  --accent: #e35c3f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: var(--hairline) solid var(--line);
  padding: 28px 0 20px;
}

.site-header .kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 6px;
}

.site-header h1 {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 0;
  text-transform: uppercase;
}

.site-header h1 span {
  color: var(--accent);
}

.site-header p.sub {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  max-width: 60ch;
}

/* ---------- Stepper ---------- */

.stepper {
  display: flex;
  gap: 0;
  margin: 22px 0 0;
  border: var(--hairline) solid var(--line);
}

.stepper .step {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-right: var(--hairline) solid var(--line);
  position: relative;
}
.stepper .step:last-child { border-right: none; }
.stepper .step.active {
  color: var(--ink);
  background: var(--panel);
}
.stepper .step.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
}
.stepper .step.done { color: var(--ink); }
.stepper .step .n {
  display: inline-block;
  margin-right: 6px;
  opacity: 0.6;
}

.stepper .step-standalone {
  cursor: pointer;
  border-left: var(--hairline) solid var(--line);
}
.stepper .step-standalone:hover {
  background: var(--ink);
  color: var(--paper);
}
.stepper .step-standalone:hover .n { opacity: 0.7; }

/* ---------- Main / panels ---------- */

main { padding: 32px 0 60px; }

.panel {
  border: var(--hairline) solid var(--line);
  background: var(--panel);
  padding: 28px;
  margin-bottom: 20px;
}

.panel + .panel { margin-top: 0; }

.panel h2 {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0 0 4px;
}

.panel .panel-hint {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0 0 22px;
  max-width: 65ch;
}

.hidden { display: none !important; }

/* ---------- Form ---------- */

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}

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

.field.full { grid-column: 1 / -1; }

.field label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field label .req { color: var(--accent); }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--ink);
  cursor: pointer;
}

#free-field-row.disabled .checkbox-label {
  color: var(--ink-soft);
  cursor: not-allowed;
}
#free-field-row.disabled .checkbox-label input {
  cursor: not-allowed;
}

.field .field-note {
  font-size: 12px;
  color: var(--ink-soft);
}

input[type="text"],
input[type="number"],
select,
textarea {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  outline: none;
  width: 100%;
}

textarea {
  font-family: var(--mono);
  font-size: 13px;
  resize: vertical;
  line-height: 1.6;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ---------- Buttons ---------- */

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

button, .btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: var(--hairline) solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 12px 20px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.12s ease, color 0.12s ease;
}

button:hover, .btn:hover {
  background: var(--ink);
  color: var(--paper);
}

button.primary {
  background: var(--ink);
  color: var(--paper);
}
button.primary:hover {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}

button.ghost {
  background: transparent;
}

button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
button:disabled:hover {
  background: var(--panel);
  color: var(--ink);
}

/* ---------- Prompt output ---------- */

.prompt-box {
  position: relative;
}

.prompt-box textarea {
  min-height: 220px;
  background: var(--paper);
}

.copy-feedback {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  margin-left: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.copy-feedback.show { opacity: 1; }

/* ---------- List parsing status ---------- */

.list-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
}

.list-status .dot {
  width: 8px; height: 8px;
  border: var(--hairline) solid var(--line);
  display: inline-block;
}
.list-status.ok .dot { background: var(--ink); }
.list-status.warn .dot { background: var(--accent); border-color: var(--accent); }

/* ---------- Rules / Spielregeln (beamer-optimiert) ---------- */

.rules-panel {
  padding: 32px;
}

.rules-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.rules-title {
  font-family: var(--sans);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 34px;
  letter-spacing: -0.01em;
  text-align: center;
  margin: 0 0 32px;
}

.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: var(--hairline) solid var(--line);
}

.rule-card {
  border-right: var(--hairline) solid var(--line);
  border-bottom: var(--hairline) solid var(--line);
  padding: 30px;
}
.rule-card:nth-child(2n) { border-right: none; }

.rule-num {
  display: block;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 10px;
}

.rule-card h3 {
  font-family: var(--sans);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 14px;
}

.rule-card p {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}

.rules-note {
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  margin: 26px 0 0;
}

@media (max-width: 640px) {
  .rules-grid { grid-template-columns: 1fr; }
  .rule-card:nth-child(2n) { border-right: var(--hairline) solid var(--line); }
  .rules-title { font-size: 26px; }
}

/* Beamer-Vollbildmodus: alles noch einmal deutlich größer */
.rules-panel:fullscreen {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5vh 6vw;
  overflow-y: auto;
}
.rules-panel:fullscreen .rules-title {
  font-size: 6vw;
  margin-bottom: 5vh;
}
.rules-panel:fullscreen .rule-num {
  font-size: 1.6vw;
}
.rules-panel:fullscreen .rule-card {
  padding: 3.2vw;
}
.rules-panel:fullscreen .rule-card h3 {
  font-size: 2.4vw;
}
.rules-panel:fullscreen .rule-card p {
  font-size: 1.6vw;
}
.rules-panel:fullscreen .rules-note {
  font-size: 1.2vw;
  margin-top: 4vh;
}
.rules-panel:fullscreen .rules-top {
  position: absolute;
  top: 2vh;
  right: 2vw;
  left: 2vw;
}
.rules-panel:fullscreen #btn-rules-back {
  visibility: hidden;
}

/* ---------- Error / helper text ---------- */

.error-text {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 8px;
}

/* ---------- Footer / credits ---------- */

.site-footer {
  border-top: var(--hairline) solid var(--line);
  padding: 20px 0 40px;
}

.credits {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
  letter-spacing: 0.02em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

.credits .sep {
  margin: 0 8px;
  color: var(--line-soft);
}

.credits a, .credits button.link {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-soft);
  font: inherit;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  padding: 0;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}

.credits a:hover, .credits button.link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: none;
}

.credits .heart {
  color: var(--accent);
}

/* ---------- Modal (Nutzungsbedingungen) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-box {
  background: var(--panel);
  border: var(--hairline) solid var(--line);
  max-width: 620px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
}

.modal-box h3 {
  font-family: var(--sans);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 18px;
  margin: 0 0 4px;
  border-bottom: var(--hairline) solid var(--line);
  padding-bottom: 14px;
}

.modal-box .modal-updated {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  margin: 10px 0 20px;
}

.modal-box h4 {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 6px;
}

.modal-box p, .modal-box li {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.modal-box ul { margin: 6px 0; padding-left: 20px; }

.modal-close {
  position: absolute;
  top: 22px;
  right: 22px;
  border: var(--hairline) solid var(--line);
  background: var(--panel);
  width: 30px;
  height: 30px;
  padding: 0;
  font-family: var(--mono);
  font-size: 14px;
}

/* Print utility (not directly used since we export PDF, but kept safe) */
@media print {
  .site-header, .site-footer, .stepper { display: none !important; }
}
