/*
  The A4 board ("Moja plansza"), drawn by board.js.
  The sheet is always built at its real size (210 x 297 mm). On screen a "frame" around it
  shrinks it to fit (board.js sets the scale); on paper it prints at 100%.
  Colours come from the semantic tokens, so data-print="mono" on the sheet turns it black and white.
*/

/* The frame clips the scaled-down sheet on screen. */
.nz-sheet-frame {
  position: relative;
  overflow: hidden;
  background: var(--nz-color-paper);
  box-shadow: var(--nz-shadow-paper);
  aspect-ratio: 210 / 297;
}

.nz-sheet {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--nz-page-width);
  height: var(--nz-page-height);
  transform: scale(var(--nz-sheet-scale, 0.5));
  transform-origin: 0 0;
  box-sizing: border-box;
  padding: var(--nz-page-margin-y) var(--nz-page-margin-x);
  display: flex;
  flex-direction: column;
  background: var(--nz-color-paper);
  color: var(--nz-color-text);
  font-family: var(--nz-font-text);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Header: logo, name, title and subtitle on the left, the 44 mm picture on the right. */
.nz-sheet-header {
  height: var(--nz-header-height);
  display: flex;
  justify-content: space-between;
  flex: none;
}

.nz-sheet-heading {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nz-sheet-logo {
  width: var(--nz-print-logo-width);
  height: auto;
  display: block;
  margin-left: -1mm;
}

.nz-sheet-person {
  margin-top: 6mm;
  font-size: var(--nz-print-label);
  font-weight: var(--nz-weight-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  max-width: 130mm;
}

.nz-sheet-title {
  margin: 1.5mm 0 0;
  font-family: var(--nz-font-display);
  font-weight: var(--nz-weight-display);
  font-size: var(--nz-print-headline);
  line-height: 1;
  white-space: nowrap;
}

.nz-sheet-title em {
  color: var(--nz-color-accent);
}

.nz-sheet-subtitle {
  margin-top: 3mm;
  font-size: var(--nz-print-body);
  font-weight: var(--nz-weight-medium);
}

.nz-sheet-picture {
  width: var(--nz-picture-size);
  height: var(--nz-picture-size);
  flex: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.nz-sheet-picture img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

[data-print="mono"] .nz-sheet-picture img {
  filter: grayscale(1) contrast(1.05);
}

/* Fields in rows of five, grouped by reward. */
.nz-sheet-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 7mm;
}

.nz-group {
  display: flex;
  flex-direction: column;
  gap: var(--nz-field-gap);
}

.nz-row {
  display: grid;
  grid-template-columns: repeat(5, var(--nz-field-width));
  gap: var(--nz-field-gap);
}

.nz-field {
  position: relative;
  box-sizing: border-box;
  height: var(--nz-field-height, var(--nz-field-height-30));
  border: var(--nz-field-border) solid var(--nz-color-field-frame);
  border-radius: var(--nz-radius-field);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The field just before a reward has a stronger terracotta frame. */
.nz-field.is-milestone {
  border: var(--nz-field-border-milestone) solid var(--nz-color-field-milestone);
}

/* The number sits in a gap in the top frame line, out of the sticker's way. */
.nz-field-number {
  position: absolute;
  top: -2mm;
  left: var(--nz-field-number-inset);
  padding: 0 0.8mm;
  background: var(--nz-color-paper);
  font-size: var(--nz-print-field-number);
  font-weight: var(--nz-weight-bold);
  line-height: 1;
}

.nz-field.is-milestone .nz-field-number {
  color: var(--nz-color-accent);
}

/* Reward bands: peach along the way, terracotta with a sunrise at the end. */
.nz-band {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  height: var(--nz-band-height, var(--nz-band-height-step));
  padding: 0 4.8mm;
  border-radius: var(--nz-radius-band);
  background: var(--nz-color-reward-step-bg);
  color: var(--nz-color-reward-step-text);
  display: flex;
  align-items: center;
  gap: 4mm;
}

.nz-band-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8mm;
}

.nz-band-kicker {
  font-size: 7pt;
  font-weight: var(--nz-weight-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
}

.nz-band-name {
  font-family: var(--nz-font-display);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
}

.nz-band-number {
  font-family: var(--nz-font-display);
  font-style: italic;
  font-size: 20pt;
  line-height: 1;
}

.nz-band.is-final {
  padding: 0 5mm;
  gap: 5mm;
  background: var(--nz-color-reward-final-bg);
  color: var(--nz-color-reward-final-text);
  border: var(--nz-band-border-final) solid var(--nz-color-reward-final-border);
}

.nz-band.is-final .nz-band-text {
  max-width: 112mm;
  gap: 1.2mm;
  position: relative;
}

.nz-band.is-final .nz-band-name {
  line-height: 1.08;
}

.nz-band.is-final .nz-band-name.is-wrapped {
  white-space: normal;
}

.nz-band.is-final .nz-band-number {
  position: relative;
  font-size: 26pt;
  margin-right: calc(var(--nz-band-height) * var(--nz-sunrise-ratio));
}

/* The sunrise: a small sun over a lilac hill, in the right end of the final band. */
.nz-sunrise {
  position: absolute;
  right: 0;
  bottom: 0;
  width: calc(var(--nz-band-height) * var(--nz-sunrise-ratio));
  height: 100%;
}

.nz-sun {
  position: absolute;
  left: 52%;
  bottom: 34%;
  width: calc(var(--nz-band-height) * 0.5);
  height: calc(var(--nz-band-height) * 0.5);
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--nz-color-sun);
}

.nz-hill {
  position: absolute;
  left: -8%;
  right: -30%;
  bottom: -62%;
  height: 100%;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--nz-color-hill);
}

[data-print="mono"] .nz-sun,
[data-print="mono"] .nz-hill {
  border: 0.6mm solid var(--nz-color-reward-final-border);
}

/* Sample stickers, only on the decorative boards of the home page. */
.nz-sample-label {
  width: 30mm;
  height: 14mm;
  background: var(--nz-white);
  box-shadow: var(--nz-shadow-label);
  transform: rotate(-4deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7pt;
  font-weight: var(--nz-weight-bold);
}

.nz-sample-dot {
  width: 18mm;
  height: 18mm;
  border-radius: 50%;
  background: var(--nz-peach);
}

.nz-sample-dot.is-lilac {
  background: var(--nz-lilac);
}

.nz-sample-dot.is-terracotta {
  background: var(--nz-terracotta);
}

.nz-sample-tick {
  width: 16mm;
  height: 16mm;
  color: var(--nz-ink);
}
