* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #121212;
  color: #e0e0e0;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

#studio-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 840px;
}

#toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: #1e1e1e;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  width: 100%;
}

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

label {
  font-size: 0.8rem;
  color: #a0a0a0;
}

.btn {
  background: #2a2a2a;
  color: #d0d0d0;
  border: 1px solid #3a3a3a;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.btn:hover {
  background: #383838;
}

.btn.active {
  background: #4a4a4a;
  border-color: #666;
  color: #fff;
}

.btn.action {
  background: #2d4a3e;
  border-color: #3e6b59;
  color: #fff;
}

.btn.warning {
  background: #4a2d2d;
  border-color: #6b3e3e;
  color: #f0a0a0;
}

.btn.warning:hover {
  background: #5a3838;
}

.palette {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #2a2a2a;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease;
}

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

.color-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
}

#custom-color-picker {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  cursor: pointer;
}

#custom-color-picker::-webkit-color-swatch {
  border-radius: 50%;
  border: 2px solid #3a3a3a;
}

/* Dialogue box styling */
.dialogue-box {
  background: #181818;
  border: 1px solid #2a2a2a;
  padding: 10px 16px;
  border-radius: 6px;
  width: 100%;
  font-size: 0.9rem;
  color: #b0b0b0;
  line-height: 1.5;
}

.dialogue-box strong {
  color: #e5989b;
}

#canvas-container {
  position: relative;
  border: 1px solid #333;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  background: #ffffff;
  border-radius: 4px;
  overflow: hidden;
}

#drawing-canvas {
  display: block;
  cursor: crosshair;
}

/* Stage 300 Finale Overlay Styles */
.finale-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.thank-you-card {
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #e2b0c3;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 20px 30px;
  border-radius: 12px;
  text-align: center;
  animation: fadeInPop 1.2s ease-out forwards;
}

.thank-you-card h2 {
  font-family: 'Brush Script MT', 'Cursive', sans-serif;
  font-size: 2.8rem;
  color: #333;
  margin: 0 0 5px 0;
}

.thank-you-card p {
  font-size: 1.1rem;
  color: #666;
}

/* Mashiro Companion Styling */
#mashiro-companion {
  position: absolute;
  bottom: 40px;
  width: 120px;
  z-index: 100;
  pointer-events: none;
  transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  animation: mashiro-float 3s ease-in-out infinite;
}

#mashiro-companion img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

#mashiro-companion.pos-left {
  left: 30px;
  bottom: 50px;
}

#mashiro-companion.pos-hover {
  right: 15%;
  bottom: 220px;
}