body { display: flex; flex-direction: column; height: 100vh; }

.leiste { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 14px; }
body.embed .leiste { padding: 4px 4px 6px; }
body.embed #duell, body.embed #aufloesen { display: none; }
#fortschritt { font-weight: 600; }

.arena {
  flex: 1; min-height: 0;
  display: grid; gap: 10px; padding: 0 14px 14px;
  grid-template-columns: 1.25fr 1fr;
  grid-template-rows: 1fr 1fr auto;
  grid-template-areas: "karten quelltext" "karten vorschau" "urteil urteil";
}
body.embed .arena { padding: 0 4px 4px; }
.karten { grid-area: karten; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.quelltext { grid-area: quelltext; }
.vorschau { grid-area: vorschau; }
.urteil { grid-area: urteil; }

.karte {
  flex: 1; min-height: 0; border: 3px solid var(--linie); border-left-width: 10px; border-radius: 10px;
  padding: 8px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--bg);
  transition: opacity .25s, box-shadow .25s;
}
.karte .kopf { display: flex; justify-content: space-between; gap: 8px; font-size: 0.75em; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--grau); }
.karte .regel { font-family: var(--mono); font-size: 1.05em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.karte input {
  font: inherit; font-family: var(--mono); color: var(--text); background: var(--flaeche);
  border: 2px solid var(--linie); border-radius: 6px; padding: 2px 6px; width: 13em;
}
.karte input:focus-visible { outline: 3px solid var(--rot); outline-offset: 1px; }
body.embed .karte input { border-color: transparent; background: transparent; padding: 2px 0; width: auto; field-sizing: content; min-width: 1ch; }
.karte .wichtig { color: var(--rot); font-weight: 700; }

.tripel { display: flex; gap: 6px; }
.tripel div { flex: 1; text-align: center; border-radius: 8px; padding: 2px 4px; }
.tripel b { display: block; font-size: 1.5em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tripel span { font-size: 0.7em; color: var(--grau); }
.tripel .a { background: #fde6ec; }
.tripel .b { background: #e8eff4; }
.tripel .c { background: #eef5e3; }
.tripel.sonder div { background: var(--flaeche); }
.tripel.aus { opacity: .45; }
.karte .notiz { font-size: 0.8em; color: var(--grau); margin: 0; }

.karte.sieger { box-shadow: 0 0 0 4px var(--ok); }
.karte.verlierer { opacity: .5; }

.quelltext pre { margin: 0; padding: 8px 12px; font-size: 0.8em; line-height: 1.45; overflow: auto; flex: 1; white-space: pre-wrap; }
.quelltext pre b { color: var(--rot); }
#vorschau { flex: 1; border: 0; width: 100%; background: #fff; }

.urteil {
  margin: 0; min-height: 2.4em; padding: 8px 14px; border-radius: 10px; font-size: 1.05em;
  background: var(--flaeche); color: var(--grau); display: flex; align-items: center;
}
.urteil.offen { font-style: italic; }
.urteil.zu { background: var(--ok-hell); color: var(--text); }
.urteil.zu b { color: var(--ok); }
.urteil.widerspruch { background: var(--rot-hell); }

@media (max-width: 760px) {
  .arena { grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: "karten" "quelltext" "vorschau" "urteil"; }
  .vorschau { min-height: 120px; }
}
