.coloring-page {
  background: var(--surface-muted, #fff7fb);
}

.coloring-hero {
  padding: clamp(28px, 5vw, 56px) 0 clamp(20px, 4vw, 36px);
  scroll-margin-top: 72px;
}

#stiahnutie,
#hra {
  scroll-margin-top: 72px;
}

.coloring-hero-copy h1 {
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  text-wrap: balance;
  margin: 0 0 12px;
}

.coloring-hero-copy p {
  color: var(--ink-600);
  font-size: 1.05rem;
  line-height: 1.6;
  text-wrap: pretty;
  max-width: 38rem;
  margin: 0 0 20px;
}

.coloring-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.coloring-hero-actions .btn {
  min-height: 48px;
  padding-inline: 22px;
}

.coloring-section {
  padding: clamp(28px, 6vw, 64px) 0;
}

.coloring-section .section-title {
  text-wrap: balance;
}

.coloring-section .section-subtitle {
  color: var(--ink-600);
  line-height: 1.65;
  text-wrap: pretty;
  max-width: 40rem;
}

.coloring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 18px;
  margin-top: 28px;
}

.coloring-empty {
  margin: 20px 0 0;
  color: var(--ink-600);
  line-height: 1.6;
}

.coloring-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(244, 114, 182, 0.22);
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
  overflow: hidden;
}

.coloring-card-preview {
  display: block;
  aspect-ratio: 210 / 297;
  background: #fff;
  border-bottom: 1px solid rgba(244, 114, 182, 0.16);
}

.coloring-card-preview img,
.coloring-card-preview object {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.coloring-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
}

.coloring-card-body h3 {
  margin: 0;
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink-900);
}

.coloring-card-body p {
  margin: 0;
  color: var(--ink-600);
  font-size: 0.92rem;
  line-height: 1.45;
}

.coloring-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.coloring-card-actions .btn {
  flex: 1 1 8rem;
  min-height: 48px;
}

.cbn-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.cbn-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cbn-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 10px;
}

.cbn-pick {
  min-height: 48px;
  border: 1.5px solid rgba(244, 114, 182, 0.28);
  background: #fff;
  border-radius: 16px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  color: var(--ink-700);
  cursor: pointer;
  text-align: left;
}

.cbn-pick[aria-pressed="true"] {
  color: #9d174d;
  background: rgba(244, 114, 182, 0.16);
  border-color: #f472b6;
}

.cbn-pick:focus-visible,
.cbn-diff:focus-visible,
.cbn-swatch:focus-visible,
.cbn-board .cbn-cell:focus-visible {
  outline: 3px solid #f472b6;
  outline-offset: 2px;
}

.cbn-difficulty {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cbn-diff {
  min-height: 48px;
  min-width: 7.5rem;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  color: var(--ink-700);
  cursor: pointer;
}

.cbn-diff[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  border-color: transparent;
}

.cbn-stage {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.cbn-board-wrap {
  width: min(100%, 28rem);
  background: #fff;
  border: 1px solid rgba(244, 114, 182, 0.22);
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.08);
  padding: 12px;
  position: relative;
  touch-action: manipulation;
  overscroll-behavior: contain;
}

.cbn-board {
  width: 100%;
  height: auto;
  display: block;
}

.cbn-board .cbn-cell path,
.cbn-board .cbn-cell ellipse,
.cbn-board .cbn-cell circle,
.cbn-board .cbn-cell rect,
.cbn-board .cbn-cell polygon {
  fill: #fff;
  stroke: #171717;
  stroke-width: 3.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  cursor: pointer;
}

.cbn-board .cbn-cell {
  outline: none;
}

.cbn-board .cbn-cell.is-filled path,
.cbn-board .cbn-cell.is-filled ellipse,
.cbn-board .cbn-cell.is-filled circle,
.cbn-board .cbn-cell.is-filled rect,
.cbn-board .cbn-cell.is-filled polygon {
  fill: var(--fill);
}

.cbn-board .cbn-num {
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-size: 20px;
  font-weight: 800;
  fill: #374151;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.cbn-board .cbn-cell.is-filled .cbn-num {
  opacity: 0;
}

.cbn-board .cbn-cell.is-wrong {
  animation: cbn-shake 220ms ease;
}

@keyframes cbn-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.cbn-palette {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(100%, 34rem);
}

.cbn-swatch {
  width: 72px;
  min-height: 72px;
  border-radius: 18px;
  border: 3px solid transparent;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  font: inherit;
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.08);
}

.cbn-swatch[aria-pressed="true"] {
  border-color: #9d174d;
  transform: translateY(-2px);
}

.cbn-swatch-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.18);
}

.cbn-swatch-num {
  font-weight: 800;
  font-size: 1rem;
  color: var(--ink-900);
  line-height: 1;
}

.cbn-swatch-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-600);
  line-height: 1.1;
}

.cbn-status {
  margin: 0;
  min-height: 1.4em;
  text-align: center;
  font-weight: 700;
  color: var(--ink-700);
}

.cbn-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.cbn-actions .btn {
  min-height: 48px;
  min-width: 9rem;
}

.cbn-celebrate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  border-radius: 24px;
  overflow: hidden;
}

.cbn-celebrate[hidden] {
  display: none;
}

.cbn-celebrate-msg {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #9d174d;
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(190, 24, 93, 0.18);
}

.cbn-confetti {
  position: absolute;
  top: -8px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  animation: cbn-fall 1.1s linear forwards;
}

@keyframes cbn-fall {
  to {
    transform: translateY(28rem) rotate(220deg);
    opacity: 0.2;
  }
}

@media (min-width: 900px) {
  .cbn-shell {
    grid-template-columns: 16rem minmax(0, 1fr);
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cbn-board .cbn-cell.is-wrong,
  .cbn-confetti,
  .cbn-swatch[aria-pressed="true"] {
    animation: none;
    transform: none;
  }
}

@media print {
  .site-header,
  .footer,
  .coloring-hero,
  .coloring-downloads,
  .cbn-toolbar,
  .cbn-palette,
  .cbn-actions,
  .cookie-consent-banner,
  .coloring-hero-actions {
    display: none !important;
  }

  .cbn-board-wrap {
    box-shadow: none;
    border: 0;
    width: 100%;
  }
}
