/* Closer to original Noch mal! sheet colors */
:root {
  --nm-y: #f2d000;
  --nm-b: #1e90d6;
  --nm-g: #2caa3a;
  --nm-o: #ef7a12;
  --nm-p: #c44fa0;
  --nm-r: #e23b35;
}

.nm-sheet {
  font-family: Arial, Helvetica, sans-serif;
  color: #111;
  background: #fff;
  border: 1px solid #222;
  padding: 2mm;
  display: flex;
  flex-direction: column;
  gap: 1mm;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

.nm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2mm;
  border-bottom: 1px solid #333;
  padding-bottom: 0.8mm;
  flex-shrink: 0;
}

.nm-title {
  font-weight: 800;
  font-size: 2.4mm;
  letter-spacing: 0.02em;
}

.nm-variant {
  font-size: 1.7mm;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nm-name {
  font-size: 1.8mm;
  color: #555;
  border-bottom: 0.5px solid #999;
  min-width: 18mm;
  flex: 1;
  margin-left: 2mm;
}

.nm-board-col {
  display: flex;
  flex-direction: column;
  gap: 0.6mm;
  min-width: 0;
  width: 100%;
  flex: 0 0 auto;
}

.nm-board-col .nm-col-labels,
.nm-board-col .nm-col-scores {
  flex-shrink: 0;
}

.nm-board {
  display: grid;
  grid-template-columns: repeat(var(--nm-cols, 15), 1fr);
  grid-template-rows: repeat(var(--nm-rows, 7), 1fr);
  gap: 0;
  width: 100%;
  /* Keep cells square: board height follows width × rows/cols */
  aspect-ratio: var(--nm-cols, 15) / var(--nm-rows, 7);
  flex: 0 0 auto;
  min-height: 0;
  border: 0.5px solid #222;
}

.nm-col-labels,
.nm-col-scores {
  display: grid;
  grid-template-columns: repeat(var(--nm-cols, 15), 1fr);
  gap: 0;
  text-align: center;
  font-size: 1.45mm;
  font-weight: 700;
}

.nm-col-labels span.start {
  color: #c0392b;
  text-decoration: underline;
}

.nm-col-scores .pair {
  display: flex;
  flex-direction: column;
  gap: 0.35mm;
  align-items: stretch;
}

.nm-col-scores .pair .box {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0.5px solid #333;
  border-radius: 0.3mm;
  font-size: 1.85mm;
  font-weight: 800;
  line-height: 1;
  min-height: 2.8mm;
  padding: 0.2mm 0;
  background: #fff;
}

.nm-col-scores .pair .hi { color: #111; }
.nm-col-scores .pair .lo { color: #444; font-weight: 700; }

.nm-cell {
  border-radius: 0;
  border: 0;
  box-shadow: inset 0 0 0 0.35px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  min-width: 0;
  min-height: 0;
}

.nm-cell.start-col {
  box-shadow: inset 0 0 0 0.7px #c0392b;
}

.nm-cell .star {
  font-size: 2.2mm;
  line-height: 1;
  color: rgba(0, 0, 0, 0.6);
}

.nm-cell.c-y { background: var(--nm-y); }
.nm-cell.c-b { background: var(--nm-b); }
.nm-cell.c-g { background: var(--nm-g); }
.nm-cell.c-o { background: var(--nm-o); }
.nm-cell.c-p { background: var(--nm-p); }
.nm-cell.c-r { background: var(--nm-r); }

.nm-extras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2mm;
  width: 100%;
  flex-shrink: 0;
}

.nm-bonus {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.2mm;
  justify-content: stretch;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.nm-bonus-row {
  display: grid;
  grid-template-columns: 3.4mm 1fr 1fr;
  gap: 0.4mm;
  align-items: center;
  font-size: 1.9mm;
  font-weight: 700;
  flex: 1 1 0;
  min-width: 0;
}

.nm-swatch {
  width: 3.4mm;
  height: 3.4mm;
  border-radius: 0.3mm;
  border: 0.45px solid #333;
}
.nm-swatch.c-y { background: var(--nm-y); }
.nm-swatch.c-b { background: var(--nm-b); }
.nm-swatch.c-g { background: var(--nm-g); }
.nm-swatch.c-o { background: var(--nm-o); }
.nm-swatch.c-p { background: var(--nm-p); }
.nm-swatch.c-r { background: var(--nm-r); }

.nm-bonus-row .box {
  border: 0.5px solid #444;
  text-align: center;
  border-radius: 0.3mm;
  padding: 0.35mm 0;
  line-height: 1.15;
  min-height: 3.4mm;
}

.nm-jokers {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5mm;
  flex: 1 1 auto;
  min-width: 0;
}

.nm-jokers span {
  border: 0.55px solid #111;
  border-radius: 0.3mm;
  text-align: center;
  font-size: 2.1mm;
  font-weight: 900;
  background: #fff;
  flex: 1 1 0;
  height: 3.8mm;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
}

.nm-jokers-row {
  display: flex;
  align-items: center;
  gap: 0.8mm;
  width: 100%;
  min-width: 0;
  border: 0.5px solid #222;
  border-radius: 0.4mm;
  padding: 0.55mm 0.8mm;
  background: #fafafa;
}

.nm-jokers-row .nm-joker-label {
  font-size: 2mm;
  font-weight: 800;
  white-space: nowrap;
  flex: 0 0 auto;
}

.nm-score {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5mm;
  font-size: 1.35mm;
  flex-shrink: 0;
}

.nm-score .item {
  border: 0.45px solid #444;
  border-radius: 0.35mm;
  padding: 0.35mm;
  text-align: center;
}

.nm-score .item strong {
  display: block;
  font-size: 1.2mm;
  margin-bottom: 0.7mm;
}

.nm-score .item .line {
  border-bottom: 0.5px solid #999;
  min-height: 2mm;
}

.nm-score .item.total {
  background: #f5f5f5;
  font-weight: 800;
}

/* ——— Kampagne tracker (own A4 page) ——— */
.nm-tracker {
  height: 297mm;
  padding: 12mm 12mm 10mm;
  display: flex;
  flex-direction: column;
  gap: 5mm;
  font-family: Arial, Helvetica, sans-serif;
  background: #fff;
  color: #111;
}

.nm-tracker-head {
  border-bottom: 2px solid #222;
  padding-bottom: 3mm;
}

.nm-tracker-head h1 {
  margin: 0 0 2mm;
  font-size: 7mm;
  letter-spacing: -0.02em;
}

.nm-tracker-head .sub {
  margin: 0;
  font-size: 3.2mm;
  color: #444;
}

.nm-tracker-meta {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 3mm;
  font-size: 3mm;
}

.nm-tracker-meta .line {
  border-bottom: 1px solid #888;
  min-height: 6mm;
  padding-top: 1mm;
}

.nm-tracker-meta label {
  display: block;
  font-size: 2.4mm;
  font-weight: 700;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 1mm;
}

.nm-campaign-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2.5mm;
}

.nm-campaign-game {
  border: 1px solid #333;
  border-radius: 1.5mm;
  padding: 2.5mm 3mm;
  display: grid;
  grid-template-columns: 8mm 1fr 28mm 22mm 18mm;
  gap: 2.5mm;
  align-items: center;
  font-size: 3mm;
}

.nm-campaign-game .num {
  font-weight: 800;
  font-size: 4.5mm;
  text-align: center;
}

.nm-campaign-game .mission strong {
  display: block;
  font-size: 3.2mm;
  margin-bottom: 0.5mm;
}

.nm-campaign-game .mission span {
  color: #444;
  font-size: 2.6mm;
}

.nm-hard {
  display: flex;
  flex-direction: column;
  gap: 0.8mm;
  font-size: 2.4mm;
}

.nm-hard .stars {
  letter-spacing: 0.08em;
  font-size: 3.2mm;
  color: #c47820;
}

.nm-fill {
  border-bottom: 1px solid #999;
  min-height: 5mm;
}

.nm-fill label {
  display: block;
  font-size: 2.2mm;
  color: #666;
  font-weight: 700;
  margin-bottom: 0.5mm;
}

.nm-campaign-foot {
  border-top: 1px solid #ccc;
  padding-top: 3mm;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3mm;
  font-size: 3mm;
}

.nm-campaign-foot .box {
  border: 1px solid #333;
  border-radius: 1mm;
  padding: 2.5mm;
  min-height: 16mm;
}

.nm-campaign-foot .box strong {
  display: block;
  font-size: 2.6mm;
  text-transform: uppercase;
  margin-bottom: 2mm;
}

/* ——— Turnier tracker (own A4 page) ——— */
.nm-turnier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 3.2mm;
  flex: 1;
}

.nm-turnier-table th,
.nm-turnier-table td {
  border: 1px solid #333;
  padding: 2.5mm 2mm;
  text-align: center;
  vertical-align: middle;
}

.nm-turnier-table th {
  background: #f3f3f3;
  font-size: 2.8mm;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nm-turnier-table td.player {
  text-align: left;
  min-width: 32mm;
}

.nm-turnier-table td.total {
  background: #faf6ef;
  font-weight: 800;
  min-width: 16mm;
}

.nm-turnier-table .score-cell {
  min-width: 14mm;
  height: 10mm;
}

.nm-turnier-note {
  font-size: 2.8mm;
  color: #555;
  margin: 0;
}

.nm-turnier-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3mm;
}

.nm-turnier-podium .box {
  border: 1px solid #333;
  border-radius: 1mm;
  padding: 2.5mm;
  font-size: 3mm;
  min-height: 18mm;
}

.nm-turnier-podium .box strong {
  display: block;
  font-size: 2.6mm;
  text-transform: uppercase;
  margin-bottom: 2mm;
}

/* Page layouts */
.nm-page.normal {
  padding: 5mm;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3mm;
  width: 297mm;
  height: 210mm;
  min-height: 210mm;
}

.nm-page.gigantic {
  padding: 5mm;
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4mm;
}

.nm-page.gigantic .nm-sheet {
  min-height: 0;
  padding: 2mm;
  gap: 1mm;
}

.nm-page.gigantic .nm-title { font-size: 3.2mm; }
.nm-page.gigantic .nm-variant { font-size: 2mm; }
.nm-page.gigantic .nm-name { font-size: 2.2mm; min-width: 28mm; }
.nm-page.gigantic .nm-col-labels { font-size: 1.8mm; }
.nm-page.gigantic .nm-col-scores .pair .box {
  font-size: 2.4mm;
  min-height: 3.6mm;
}
.nm-page.gigantic .nm-cell .star { font-size: 3mm; }
.nm-page.gigantic .nm-bonus-row { font-size: 2.6mm; grid-template-columns: 4.2mm 1fr 1fr; }
.nm-page.gigantic .nm-swatch { width: 4.2mm; height: 4.2mm; }
.nm-page.gigantic .nm-bonus-row .box { min-height: 4.2mm; }
.nm-page.gigantic .nm-jokers-row .nm-joker-label { font-size: 2.6mm; }
.nm-page.gigantic .nm-jokers span {
  font-size: 2.8mm;
  height: 5mm;
}
.nm-page.gigantic .nm-score { font-size: 1.8mm; }
.nm-page.gigantic .nm-score .item strong { font-size: 1.6mm; }
.nm-page.gigantic .nm-score .item .line { min-height: 2.8mm; }
.nm-page.gigantic .nm-board { gap: 0; }
