/* ── TLC Teddies – interactive colouring page ──────────────────────────── */

.tc-page {
  background: linear-gradient(160deg, #fce8f6 0%, #e8edff 55%, #e8f8f0 100%);
  min-height: calc(100vh - 80px);
  padding: 2rem 1rem 4rem;
}

.tc-wrap {
  max-width: 500px;
  margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.tc-heading {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1a1a2e;
  text-align: center;
  margin: 0 0 0.3rem;
  letter-spacing: -0.5px;
}

.tc-intro {
  text-align: center;
  color: #555;
  margin: 0 0 1.2rem;
  font-size: 1.05rem;
}

/* ── Colour palette ──────────────────────────────────────────────────────── */
.tc-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 1rem;
}

.tc-swatch {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid rgba(0,0,0,0.12);
  background: var(--c, #ccc);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.tc-swatch:hover  { transform: scale(1.15); }

.tc-swatch.active {
  border-color: #1a1a2e;
  box-shadow: 0 0 0 3px #1a1a2e;
  transform: scale(1.2);
}

.tc-swatch--eraser {
  background: #f5f5f5 !important;
  color: #444;
  border-color: #ccc;
}
.tc-swatch--eraser svg {
  width: 22px;
  height: 22px;
  pointer-events: none;
}

/* ── Brush size row ──────────────────────────────────────────────────────── */
.tc-brush-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1.2rem;
}

.tc-brush-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
}

.tc-brush-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2.5px solid rgba(0,0,0,0.14);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
  padding: 0;
  flex-shrink: 0;
}

.tc-brush-btn:hover { transform: scale(1.12); }

.tc-brush-btn.active {
  border-color: #1a1a2e;
  box-shadow: 0 0 0 3px #1a1a2e;
  transform: scale(1.18);
}

.tc-brush-dot {
  display: block;
  border-radius: 50%;
  background: #1a1a2e;
  flex-shrink: 0;
}

/* ── Canvas wrapper ──────────────────────────────────────────────────────── */
.tc-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 18px;
  border: 3px solid #e5e7eb;
  box-shadow: 0 6px 30px rgba(0,0,0,0.13);
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Teddy outline image — top layer, always in front of painting.
   mix-blend-mode: multiply makes white pixels transparent so painting shows through. */
.tc-teddy-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
  mix-blend-mode: multiply;
}

/* Drawing canvas — bottom layer, receives all touch/mouse events */
.tc-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  display: block;
}

/* ── Actions row ─────────────────────────────────────────────────────────── */
.tc-actions {
  margin-top: 1.2rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.tc-clear-btn,
.tc-submit-btn {
  border-radius: 50px;
  padding: 0.75rem 1.8rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.tc-clear-btn {
  background: #fff;
  border: 2.5px solid #d1d5db;
  color: #374151;
}
.tc-clear-btn:hover {
  background: #fff5f5;
  border-color: #ef4444;
  color: #dc2626;
  transform: scale(1.04);
}
.tc-clear-btn:active { transform: scale(0.97); }

.tc-submit-btn {
  background: #1a1a2e;
  border: 2.5px solid #1a1a2e;
  color: #fff;
}
.tc-submit-btn:hover {
  background: #2d2d4e;
  border-color: #2d2d4e;
  transform: scale(1.04);
}
.tc-submit-btn:active { transform: scale(0.97); }

/* ── Result message ──────────────────────────────────────────────────────── */
.tc-result {
  text-align: center;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 600;
  min-height: 1.5rem;
  transition: opacity 0.3s;
}
.tc-result--ok  { color: #16a34a; }
.tc-result--err { color: #dc2626; }

/* ── Confirmation modal ──────────────────────────────────────────────────── */
.tc-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
}
.tc-modal-overlay.active { display: flex; }

.tc-modal {
  background: #fff;
  border-radius: 20px;
  padding: 2rem 2rem 1.75rem;
  text-align: center;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: modalPop 0.22s ease-out;
}

@keyframes modalPop {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.tc-modal-bear { font-size: 3rem; line-height: 1; margin-bottom: 0.5rem; }

.tc-modal-title {
  font-family: 'Barlow', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #1a1a2e;
  margin: 0 0 0.4rem;
}

.tc-modal-body {
  color: #555;
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

.tc-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.tc-modal-cancel,
.tc-modal-confirm {
  padding: 0.65rem 1.4rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
.tc-modal-cancel  { background: #f3f4f6; border: 2px solid #e5e7eb; color: #374151; }
.tc-modal-confirm { background: #1a1a2e; border: 2px solid #1a1a2e; color: #fff; }
.tc-modal-cancel:hover  { background: #e5e7eb; }
.tc-modal-confirm:hover { background: #2d2d4e; transform: scale(1.04); }

/* ── Thank you screen ────────────────────────────────────────────────────── */
.tc-thankyou {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #fce8f6 0%, #e8edff 100%);
  border-radius: 18px;
  border: 3px solid #e5e7eb;
  box-shadow: 0 6px 30px rgba(0,0,0,0.10);
  text-align: center;
}
.tc-thankyou.visible {
  display: flex;
  animation: tcThankYouIn 0.5s ease-out forwards;
}
@keyframes tcThankYouIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1);   }
}

.tc-thankyou-icon { font-size: 4rem; display: block; margin-bottom: 0.75rem; }
.tc-thankyou-inner p {
  font-family: 'Barlow', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.25;
  margin: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .tc-swatch    { width: 44px; height: 44px; }
  .tc-palette   { gap: 8px; }
  .tc-heading   { font-size: 1.75rem; }
  .tc-brush-btn { width: 42px; height: 42px; }
}
