@font-face {
  font-family: "ZdH Symbols";
  src: url("../fonts/Zdh_symbols_2026-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

:root {
  --paper: #f3efe4;
  --ink: #1d1a16;
  --muted: #70685d;
  --line: #241f1a;
  --soft-line: #c8bfae;
  --panel: #fffaf0;
  --warning: #fff0d8;
  --warning-line: #a66a00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #d9d1c3;
  font-family: Georgia, "Times New Roman", serif;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 3px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.app-header h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
}

.app-header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.print-button {
  border: 2px solid var(--line);
  background: #fff;
  padding: 0.55rem 0.8rem;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(520px, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.editor-column,
.sheet-panel {
  min-width: 0;
}

.column-intro {
  margin: 0 0 0.45rem 16px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.column-intro h2 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.column-intro p {
  margin: 0;
  max-width: 52rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.25;
}

.editor-panel {
  background: var(--panel);
  border: 3px solid var(--line);
  padding: 1rem;
  height: calc(100vh - 2rem);
  overflow: auto;
}

fieldset {
  border: 2px solid var(--line);
  margin: 0 0 1rem;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.35);
}

legend {
  padding: 0 0.35rem;
  font-weight: bold;
  font-size: 1.05rem;
}

label {
  display: block;
  margin: 0.7rem 0 0.25rem;
  font-weight: bold;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0.45rem;
  font: inherit;
}

textarea {
  resize: vertical;
}

.hint,
.field-note,
.counter,
.small-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.hint ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  margin-top: 0.4rem;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-weight: normal;
}

.checkbox-line input {
  width: auto;
}

.counter {
  margin-top: 0.4rem;
  font-weight: bold;
}

.sheet {
  position: sticky;
  top: 1rem;
  background: var(--paper);
  border: 5px double var(--line);
  padding: 1.2rem;
  min-height: calc(100vh - 8rem);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.22);
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  border-bottom: 3px solid var(--line);
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
}

.sheet-header h2 {
  margin: 0;
  font-size: 2rem;
}

.sheet-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.sheet-logo {
  border: 3px solid var(--line);
  padding: 0.6rem;
  font-weight: bold;
  font-size: 1.2rem;
}

.sheet-section {
  border-bottom: 1px solid var(--soft-line);
  padding: 0.75rem 0;
}

.sheet-section h3 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
}

.sheet-section h4 {
  margin: 0 0 0.4rem;
}

.info-grid,
.attribute-grid,
.derived-grid {
  display: grid;
  gap: 0.55rem;
}

.info-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.attribute-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.derived-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-box,
.attribute-box,
.derived-box {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  padding: 0.5rem;
  min-height: 3.2rem;
}

.info-box span,
.attribute-box span,
.derived-box span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.info-box strong,
.attribute-box strong,
.derived-box strong {
  display: block;
  margin-top: 0.2rem;
}

.derived-box strong.dice-row {
  display: inline-flex !important;
  margin-top: 0.35rem;
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-list span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  padding: 0.25rem 0.4rem;
}

.rules-list {
  margin: 0;
  padding-left: 1.2rem;
}

.warnings {
  border: 2px solid var(--warning-line);
  background: var(--warning);
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.warnings h3 {
  margin-top: 0;
}

.warnings ul {
  margin-bottom: 0;
}

/* Würfelsymbole */

.symbol {
  font-family: "ZdH Symbols", Georgia, serif;
}

.dice-row,
.derived-box strong.dice-row {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.45rem;
  white-space: nowrap;
}

.die {
  --die-color: #444444;
  --die-outline: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 0;
  border: none;
  background: transparent;
  line-height: 1;
  overflow: visible;
  vertical-align: middle;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
}

.die .symbol {
  font-family: "ZdH Symbols", Georgia, serif;
  display: inline-block;
  font-size: 1.75rem;
  line-height: 1;
  text-align: center;
  color: var(--die-color) !important;
  -webkit-text-fill-color: var(--die-color);
  text-shadow: var(--die-outline);
}

/* gedeckte Würfelfarben */

.die-schwarz {
  --die-color: #000000;
}

.die-weiss {
  --die-color: #ffffff;
  --die-outline:
    -1px -1px 0 #000000,
     1px -1px 0 #000000,
    -1px  1px 0 #000000,
     1px  1px 0 #000000,
     0   -1px 0 #000000,
     0    1px 0 #000000,
    -1px  0   0 #000000,
     1px  0   0 #000000;
}

.die-rot {
  --die-color: #9e1b1b;
}

.die-blau {
  --die-color: #2f64b7;
}

.die-orange {
  --die-color: #c45a14;
}

.die-gruen,
.die-grün {
  --die-color: #4a8f2b;
}

.die-grau {
  --die-color: #7e8585;
}

.die-lila {
  --die-color: #6f4aa8;
}

.die-gelb {
  --die-color: #d8be18;
  --die-outline:
    -1px -1px 0 #000000,
     1px -1px 0 #000000,
    -1px  1px 0 #000000,
     1px  1px 0 #000000;
}

.die-rosa {
  --die-color: #d98ab8;
  --die-outline:
    -1px -1px 0 #000000,
     1px -1px 0 #000000,
    -1px  1px 0 #000000,
     1px  1px 0 #000000;
}

/* Sonderfarben */

.die-frost {
  --die-color: #86d7e5;
  --die-outline:
    -1px -1px 0 #000000,
     1px -1px 0 #000000,
    -1px  1px 0 #000000,
     1px  1px 0 #000000;
}

.die-feuer {
  --die-color: #b64a1a;
  --die-outline:
    -1px -1px 0 #000000,
     1px -1px 0 #000000,
    -1px  1px 0 #000000,
     1px  1px 0 #000000;
}

.die-gold {
  --die-color: #b9932f;
  --die-outline:
    -1px -1px 0 #000000,
     1px -1px 0 #000000,
    -1px  1px 0 #000000,
     1px  1px 0 #000000;
}


/* kleinere Symbole in Regeltexten */

.hint .die .symbol,
.rules-list .die .symbol {
  font-size: 1.05em;
}

.hint .die,
.rules-list .die {
  vertical-align: 0.1em;
}

.competence-note {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.competence-note .die {
  vertical-align: 0.08em;
  margin: 0 0.08em;
}

.competence-note .die .symbol {
  font-size: 1.05em;
}

.conditional-field {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--soft-line);
}

.is-hidden {
  display: none !important;
}

.money-breakdown {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: normal;
}

/* Linke Spalte und Würfelfarben-Leiste */

.editor-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.editor-panel {
  background: var(--panel);
  border: 3px solid var(--line);
  padding: 1rem;
  height: calc(100vh - 4.5rem);
  overflow: auto;
}

.dice-showcase {
  margin-top: 1.2rem;
  padding: 0;
  border-top: none;
  text-align: center;
}

.dice-showcase-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  align-content: center;
  gap: 0.5rem 0.75rem;
  margin: 0 auto;
  line-height: 1;
}

.dice-showcase-row .die {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.dice-showcase-row .die .symbol {
  font-size: 1.5rem;
  line-height: 1;
}

.dice-showcase-labels,
.dice-showcase h3 {
  display: none;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    max-height: none;
  }

  .sheet {
    position: static;
  }

  .info-grid,
  .attribute-grid,
  .derived-grid,
  .two-columns {
    grid-template-columns: 1fr;
  }
}

/* Korrekturen linke Spalte und Würfelleiste */

@media (min-width: 981px) {
  .editor-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .editor-panel {
    height: calc(100vh - 6rem) !important;
    overflow: auto !important;
  }

  .dice-showcase {
    margin-top: 0.3rem !important;
    padding: 0 !important;
    border-top: none !important;
    text-align: center !important;
  }

  .dice-showcase h3,
  .dice-showcase-labels {
    display: none !important;
  }

  .dice-showcase-row {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    align-content: center !important;
    gap: 0.1rem 0.25rem !important;
    margin: 0 auto !important;
    line-height: 1 !important;
  }

  .dice-showcase-row .die {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
  }

  .dice-showcase-row .die .symbol {
    font-size: 1.5rem !important;
    line-height: 1 !importa