* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #1f2937;
}

header {
  background: #1d4ed8;
  color: white;
  padding: 24px;
  text-align: center;
}

header h1 {
  margin: 0 0 8px;
}

header p {
  margin: 0;
}

main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

.panel {
  background: white;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

h2,
h3 {
  margin-top: 0;
}

.settings {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

button,
textarea,
input {
  font: inherit;
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  background: #e5e7eb;
  font-weight: 600;
}

button:hover {
  background: #d1d5db;
}

button.primary {
  background: #2563eb;
  color: white;
}

button.primary:hover {
  background: #1d4ed8;
}

textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px;
}

.bulk-input {
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.hint {
  color: #64748b;
  font-size: 0.95rem;
}

.input-area {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.card {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 16px;
  background: #f8fafc;
}

.card h3 {
  color: #1d4ed8;
}

.form-row {
  margin-bottom: 12px;
}

.form-row label {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.preview {
  min-height: 60px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: white;
  padding: 10px;
  margin-top: 8px;
}

.preview img,
.table-content img,
.student-task img,
.compact-task img,
.compact-table img {
  max-width: 100%;
  max-height: 90px;
  object-fit: contain;
}

table {

  border-collapse: collapse;
  margin-top: 12px;
  text-align:center;
}

th,
td {
  border: 1px solid #dbe3ee;
  padding: 10px;
  vertical-align: top;
}

th {
  background: #e0ecff;
}

.table-content {
  max-width: 280px;
}

.student-task-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.student-task {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  min-height: 120px;
}

.student-task strong {
  color: #1d4ed8;
}

.answer-line {
  margin-top: 14px;
  border-bottom: 1px solid #111827;
  height: 28px;
}

/* 12er-LÜK-Raster: 2 Reihen × 6 Spalten */
.luk-grid,
.front-card-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  max-width: 900px;
}

.luk-cell,
.front-card {
  aspect-ratio: 1 / 1;
  border: 2px solid #111827;
  border-radius: 8px;
  background: white;
  position: relative;
  overflow: hidden;
}

.front-card {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
}

/* Rückseitenkärtchen */
.back-card-preview {
  width: 90px;
  height: 90px;
  border: 2px solid #111827;
  border-radius: 8px;
  background: white;
  position: relative;
  overflow: hidden;
  margin: auto;
}

.back-card-large {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
}

.trapezoid-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.trapezoid-letter-bg {
  fill: white;
  stroke: black;
  stroke-width: 4;
}

.trapezoid-letter {
  fill: black;
  font-size: 36px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: central;
  font-family: Arial, Helvetica, sans-serif;
}

.cell-label {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgba(255, 255, 255, 0.85);
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.prompt-box {
  margin-top: 16px;
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
}

.prompt-box summary {
  cursor: pointer;
  font-weight: 700;
}

pre {
  overflow-x: auto;
  background: #111827;
  color: #e5e7eb;
  padding: 14px;
  border-radius: 10px;
}

/* Kompakte Ansicht */
.compact-copy-area {
  background: white;
  color: #111827;
  padding: 18px;
  border: 2px solid #111827;
  border-radius: 12px;
}

.compact-copy-area h2 {
  text-align: center;
  margin-bottom: 16px;
}

.compact-layout {
  display: flex;
  flex-direction: row;
  gap: 5px;
  align-items: start;
  flex-wrap: wrap;
}

.eignes-layout-links{
	display:flex;
	flex-direction:column;
	garp: 5px;
	flex-wrap:wrap;
}

.compact-tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 50%
}

.compact-task {
  border: 1px solid #9ca3af;
  border-radius: 8px;
  padding: 6px 8px;
  min-height: 42px;
  font-size: 0.95rem;
  min-width: 100px;
}

.compact-task strong {
  color: #111827;
}

.compact-table {
  font-size: 0.9rem;
}

.compact-table th,
.compact-table td {
  padding: 5px 7px;
}

.compact-luk-grid {
  gap: 4px;
  max-width: 360px;
}

.compact-luk-grid .luk-cell {
  border-width: 1px;
  border-radius: 4px;
}

.compact-luk-grid .cell-label {
  font-size: 0.55rem;
  padding: 1px 4px;
}

.compact-luk-grid .trapezoid-letter {
  font-size: 20px;
}

@media print {
  body {
    background: white;
  }

  header,
  .no-print {
    display: none !important;
  }

  main {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .panel {
    box-shadow: none;
    border: none;
    page-break-after: always;
  }

  .student-task-list {
    grid-template-columns: 1fr 1fr;
  }

  .luk-grid,
  .front-card-grid {
    max-width: 100%;
  }

  .front-card {
    font-size: 2.6rem;
  }

  .hint {
    color: #333;
  }

  .compact-layout {
    grid-template-columns: 1.2fr 1fr;
  }

  .compact-copy-area {
    border: 1px solid #111827;
  }

  .compact-luk-grid {
    max-width: 320px;
  }
}