:root {
  --paper-bg: #fff;
  --line-color: #ffe4e6;
  --margin-color: #fda4af;
  --pencil-color: #be185d;
  --accent-pink: #ff85a1;
  --soft-mint: #b9fbc0;
  --lavender: #cfbaf0;
  --twee-yellow: #fbf8cc;
  --font-handwriting: 'Gaegu', cursive;
  --font-ui: 'Sniglet', system-ui;
  --font-display: 'Cherry Bomb One', cursive;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: #dcfce7; /* Very light pastel green */
  /* Pastel Clover Pattern */
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(134, 239, 172, 0.4) 4px, transparent 4px),
    radial-gradient(circle at 50% 50%, rgba(134, 239, 172, 0.4) 4px, transparent 4px);
  background-position: 0 0, 15px 15px;
  background-size: 30px 30px;
  font-family: var(--font-ui);
  overflow: hidden;
}

/* Inverted Lace Border (Colored lace on white background) */
.deco-lace-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background-color: white;
  background-image: radial-gradient(circle at 10px 0px, white 10px, var(--accent-pink) 11px);
  background-size: 20px 20px;
  z-index: 30;
  pointer-events: none;
}

#root {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.notepad-container {
  width: 90vw;
  max-width: 800px;
  height: 90vh;
  background-color: var(--paper-bg);
  box-shadow: 15px 15px 0px rgba(0,0,0,0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 6px solid white;
  border-radius: 40px;
  overflow: hidden;
}

/* Ribbon Banner Decor */
.notepad-container::before {
  content: ' PANGO.SPACE';
  position: absolute;
  top: 15px;
  right: -35px;
  width: 150px;
  background: var(--accent-pink);
  color: white;
  text-align: center;
  padding: 5px 0;
  transform: rotate(45deg);
  font-family: var(--font-display);
  font-size: 0.8rem;
  z-index: 40;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  pointer-events: none;
}

.notepad-container::after {
  content: '';
  position: absolute;
  top: -10px; left: -10px; right: -10px; bottom: -10px;
  border: 4px dashed var(--accent-pink);
  border-radius: 45px;
  pointer-events: none;
}

.sticker-wrapper {
  position: absolute;
  cursor: move;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  z-index: 20;
}

.sticker-wrapper.active {
  outline: 2px dashed var(--accent-pink);
  background: rgba(255, 255, 255, 0.4);
  border-radius: 8px;
}

.sticker-wrapper img {
  max-width: 150px;
  pointer-events: none;
  filter: drop-shadow(2px 2px 0px rgba(0,0,0,0.1));
}

.sticker-control {
  position: absolute;
  background: white;
  border: 2px solid var(--accent-pink);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
}

.text-wrapper {
  position: absolute;
  cursor: move;
  user-select: none;
  white-space: pre-wrap;
  padding: 5px 10px;
  z-index: 25;
}

.text-wrapper.active {
  outline: 2px dashed var(--accent-pink);
  background: rgba(255, 255, 255, 0.4);
  border-radius: 8px;
}

.text-wrapper .sticker-control.remove {
  top: -10px;
  right: -10px;
  display: none;
}

.text-wrapper.active .sticker-control.remove {
  display: flex;
}

.sticker-wrapper.active .sticker-control {
  display: flex;
}

.sticker-control.remove {
  top: -10px;
  right: -10px;
  color: var(--accent-pink);
}

.sticker-control.resize {
  bottom: -10px;
  right: -10px;
  background: var(--soft-mint);
  cursor: nwse-resize;
}

.sticker-control.resize::after {
  content: '↗';
  font-size: 12px;
  font-weight: bold;
  color: #059669;
}

.paper {
  flex: 1;
  position: relative;
  cursor: crosshair;
  background-image: 
    linear-gradient(var(--line-color) 1px, transparent 1px),
    linear-gradient(90deg, transparent 59px, var(--margin-color) 2px, transparent 2px);
  background-size: 100% 28px, 100% 100%;
  background-position: 0 0;
}

.paper::before {
  content: '✿';
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 60px;
  color: var(--accent-pink);
  opacity: 0.2;
  font-family: var(--font-display);
  filter: blur(1px);
  pointer-events: none;
}

.paper::after {
  content: '★';
  position: absolute;
  bottom: 20px;
  left: 80px;
  font-size: 30px;
  color: var(--soft-mint);
  opacity: 0.3;
  font-family: var(--font-display);
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.8));
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  z-index: 10;
}

.toolbar {
  height: 100px;
  background: white;
  border-bottom: 4px solid var(--line-color);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 10px;
  z-index: 10;
  flex-wrap: wrap;
}

.tool-separator {
  width: 2px;
  height: 30px;
  background: var(--line-color);
  margin: 0 5px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-group {
  flex: 1;
  min-width: 120px;
  background: var(--twee-yellow);
  padding: 8px 15px;
  border-radius: 20px;
  border: 2px solid var(--accent-pink);
}

.slider-label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--accent-pink);
  font-weight: 800;
}

.size-value {
  font-family: var(--font-display);
  color: var(--accent-pink);
  min-width: 25px;
  text-align: center;
}

.brush-slider {
  flex: 1;
  cursor: pointer;
  accent-color: var(--accent-pink);
}

.color-picker-wrapper {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--accent-pink);
  overflow: hidden;
  cursor: pointer;
  background: white;
}

.color-picker {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 60px;
  height: 60px;
  cursor: pointer;
  opacity: 0;
}

.color-display {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.tool-btn {
  background: var(--twee-yellow);
  border: 3px solid var(--accent-pink);
  padding: 10px;
  cursor: pointer;
  border-radius: 20px;
  transition: transform 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-pink);
  box-shadow: 0 4px 0px var(--accent-pink);
}

.tool-btn:hover {
  transform: scale(1.05) rotate(2deg);
  background: white;
}

.tool-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0px var(--accent-pink);
}

.tool-btn.active {
  background: var(--accent-pink);
  color: white;
  transform: scale(1.1);
}

.tool-btn svg {
  width: 24px;
  height: 24px;
}

.status {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent-pink);
  text-shadow: 2px 2px 0px white;
}

.ring-binder {
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 40px 0;
  pointer-events: none;
  z-index: 5;
}

.ring {
  width: 25px;
  height: 25px;
  background: var(--accent-pink);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.1);
  position: relative;
}

.ring::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(207, 186, 240, 0.4);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 500px;
  border-radius: 30px;
  border: 4px solid var(--accent-pink);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

.modal-header {
  padding: 20px;
  background: var(--line-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--pencil-color);
  font-family: var(--font-display);
}

.modal-header h3 {
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  color: var(--accent-pink);
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.modal-body li {
  margin-bottom: 12px;
  padding-left: 25px;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.4;
}

.modal-body li::before {
  content: '♥';
  position: absolute;
  left: 0;
  color: var(--accent-pink);
}

.modal-footer {
  padding: 15px;
  text-align: center;
  border-top: 1px dashed var(--line-color);
  font-family: var(--font-handwriting);
  color: var(--accent-pink);
}

.pagedoll-pomeranian {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 80px;
  z-index: 1000;
  pointer-events: auto; /* Changed to auto so child is clickable */
  animation: sit-and-wiggle 6s infinite ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pom-image-container {
  width: 100%;
  height: 80px;
  border-radius: 50%;
  border: 3px solid white;
  overflow: hidden;
  box-shadow: 3px 3px 0px var(--accent-pink);
  background: white;
  pointer-events: none; /* Keep image non-clickable if needed */
}

.pom-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.speech-bubble {
  position: absolute;
  top: -20px;
  left: -30px; /* Positioned to the left of the dog */
  background: white;
  border: 2px solid var(--accent-pink);
  border-radius: 15px;
  padding: 5px 10px;
  font-family: var(--font-handwriting);
  font-size: 0.9rem;
  color: var(--accent-pink);
  white-space: nowrap;
  animation: bounce-speech 3s infinite ease-in-out;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 15px; /* Arrow points right to the dog */
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: white transparent transparent;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -11px;
  right: 14px;
  border-width: 9px 9px 0;
  border-style: solid;
  border-color: var(--accent-pink) transparent transparent;
}

@keyframes sit-and-wiggle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}

@keyframes bounce-speech {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
