html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: system-ui, sans-serif;
  background: linear-gradient(#8ecae6, #edf6f9);
  padding: 20px;
}

/* ❄️ Snow background */
.snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(white 2px, transparent 2px),
    radial-gradient(white 1.5px, transparent 1.5px),
    radial-gradient(white 1px, transparent 1px);
  background-size: 100px 100px, 150px 150px, 200px 200px;
  animation: snow-fall 20s linear infinite;
  z-index: -1;
}

@keyframes snow-fall {
  to {
    background-position: 0 1000px, 0 1500px, 0 2000px;
  }
}

/* 🎨 FLOATING PALETTE */
.floating-palette {
  position: fixed;
  left: 30vh;
  top: 55%;
  transform: translateY(-50%);
  z-index: 20;
}

.palette-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
}

/* Palette */
.palette {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.color-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #222;
  cursor: pointer;
  padding: 0;
  background: transparent;
}

.color-btn::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--btn-color);
}

.color-btn.active {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
}

/* Custom color */
.custom-color {
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.custom-color input {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  cursor: pointer;
}

/* 🎛️ Controls */
.controls {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.controls .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-group .btn,
.controls .btn {
  border-radius: 10px;
  font-weight: 600;
  padding: 0.5rem 1.2rem;
  border-width: 2.5px;
  color: #b22222;
  background: #fff0f0;
  border-color: #b22222;
  box-shadow: 0 3px 6px rgba(178, 34, 34, 0.4);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.4s ease,
    transform 0.2s ease;
  cursor: pointer;
}

.btn-group .btn.active,
.controls .btn.active {
  background-color: #b22222;
  color: #fff8f0;
  border-color: #8b0000;
  box-shadow: 0 0 15px 4px #b22222;
  transform: scale(1.1);
  z-index: 2;
}

/* ✏️ SVG Drawing */
.drawing {
  max-height: 60vh;
  width: auto;
  max-width: 100%;
}

.drawing * {
  fill: white;
  stroke: black;
  stroke-width: 3;
}

/* 🖼️ RIGHT-SIDE GALLERY PANEL */
.gallery-container {
  position: fixed;
  right: 20px;
  top: 55%;
  transform: translateY(-50%);

  width: 360px;
  max-height: 360px;

  padding: 12px;
  border-radius: 18px;

  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);

  z-index: 15;

  display: flex;
  flex-direction: column;
}

/* Gallery title */
.gallery-title {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}

/* Scrollable grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;

  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Scrollbar */
.gallery::-webkit-scrollbar {
  width: 6px;
}

.gallery::-webkit-scrollbar-thumb {
  background: #b22222;
  border-radius: 10px;
}

/* Thumbnail cards */
.thumb {
  width: 100%;
  padding: 6px;

  border-radius: 14px;
  background: white;
  border: 1px solid #ddd;

  display: flex;
  flex-direction: column;
  align-items: center;

  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.thumb img {
  width: 100%;
  max-height: 90px;
  object-fit: contain;
}

.thumb small {
  font-size: 0.65rem;
  margin-top: 4px;
  text-align: center;
  color: #333;
  user-select: none;
}
