/* ========== BASE ========== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "SF Pro Text", sans-serif;
}

body {
  position: relative;
  background:
    radial-gradient(circle at 15% 15%, rgba(236, 72, 153, 0.35), transparent 60%),
    radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.30), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(129, 140, 248, 0.28), transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(251, 191, 36, 0.18), transparent 60%),
    radial-gradient(circle at top, #020617, #000);
  background-size: 160% 160%;
  animation: bg-shift 22s ease-in-out infinite alternate;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ninsoare peste fundal, sub conținut */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(248, 250, 252, 0.9) 0 1.2px, transparent 1.3px),
    radial-gradient(circle, rgba(248, 250, 252, 0.7) 0 1px, transparent 1.1px),
    radial-gradient(circle, rgba(248, 250, 252, 0.8) 0 1.4px, transparent 1.5px);
  background-size: 200px 200px, 260px 260px, 320px 320px;
  background-position: 0 0, 50px -80px, -60px 40px;
  animation: snow-fall 25s linear infinite;
}

/* screen flash */

#flash-overlay {
  position: fixed;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
}

.flash-active {
  animation: flash-screen 240ms ease-out;
}

@keyframes flash-screen {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* animated background */

@keyframes bg-shift {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 50% 100%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* ninsoare animată */

@keyframes snow-fall {
  0% {
    background-position: 0 0, 50px -80px, -60px 40px;
  }
  100% {
    background-position: 0 400px, 50px 320px, -60px 360px;
  }
}

/* ========== LAYOUT ========== */

.app {
  width: 100%;
  max-width: 960px;
  padding: 16px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  z-index: 1; /* deasupra ninsorii */
}

.camera-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ========== CAMERA (SMALL) ========== */

.camera {
  width: 210px; /* smaller camera */
  border-radius: 18px 18px 30px 30px;
  background: radial-gradient(circle at 20% 0, #111827, #020617);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(148, 163, 184, 0.35);
  padding: 12px 12px 10px;
  position: relative;
}

.camera::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -16px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.7), transparent);
  filter: blur(8px);
  z-index: -1;
}

.camera-top-strip {
  height: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
}

.camera-rainbow {
  width: 28px;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(
    to right,
    #ff3b30,
    #ff9500,
    #ffcc00,
    #34c759,
    #0a84ff,
    #5856d6
  );
}

.camera-front {
  display: grid;
  grid-template-columns: 60px 1fr 50px;
  grid-template-rows: 80px 46px;
  grid-template-areas:
    "flash lens view"
    ". lens controls";
  column-gap: 6px;
  row-gap: 6px;
  align-items: center;
}

/* flash */

.camera-flash {
  grid-area: flash;
  width: 56px;
  height: 42px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 20%, #e5e7eb, #4b5563);
  box-shadow:
    inset 0 0 8px rgba(0, 0, 0, 0.7),
    0 4px 8px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

.camera-flash::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 10%, #f9fafb, #9ca3af);
}

.camera-flash.flash-on {
  animation: flash-lamp 320ms ease-out;
}

@keyframes flash-lamp {
  0% {
    box-shadow:
      inset 0 0 4px rgba(0, 0, 0, 0.6),
      0 0 0 rgba(251, 191, 36, 0);
    filter: brightness(1.2);
  }
  30% {
    box-shadow:
      inset 0 0 0 rgba(0, 0, 0, 0.3),
      0 0 20px rgba(252, 211, 77, 1);
    filter: brightness(1.8);
  }
  100% {
    box-shadow:
      inset 0 0 6px rgba(0, 0, 0, 0.7),
      0 0 0 rgba(0, 0, 0, 0);
    filter: brightness(1);
  }
}

/* lens */

.camera-lens {
  grid-area: lens;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 0, #111827, #020617);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.9),
    0 0 0 3px #020617,
    0 0 0 6px rgba(31, 41, 55, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-lens-inner {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: #000;
}

.camera-lens-inner video {
  width: 140%;
  height: 140%;
  object-fit: cover;
  transform: translate(-10%, -10%);
  filter: contrast(1.05) saturate(1.2);
}

.lens-glass {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.45), transparent 55%);
  mix-blend-mode: screen;
}

/* viewfinder + controls */

.camera-viewfinder {
  grid-area: view;
  justify-self: end;
  width: 54px;
  height: 46px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 15%, #f9fafb, #4b5563);
  box-shadow:
    inset 0 0 8px rgba(0, 0, 0, 0.9),
    0 4px 8px rgba(0, 0, 0, 0.7);
}

.camera-controls {
  grid-area: controls;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.camera-led {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #bbf7d0, #22c55e);
  box-shadow: 0 0 10px rgba(34, 197, 94, 1);
}

.camera-icon {
  width: 34px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #111827, #020617);
}

/* shutter button */

.camera-shutter {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  justify-self: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 20%, #ff9a9a, #ff1d25);
  box-shadow:
    0 6px 14px rgba(248, 113, 113, 0.7),
    0 0 0 2px rgba(15, 23, 42, 0.9);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.camera-shutter:active {
  transform: translateY(1px) scale(0.97);
  box-shadow:
    0 3px 8px rgba(248, 113, 113, 0.8),
    0 0 0 2px rgba(15, 23, 42, 0.9);
}

/* bottom slot */

.camera-bottom {
  margin-top: 8px;
  background: linear-gradient(180deg, #030712, #020617);
  border-radius: 14px 14px 26px 26px;
  padding: 6px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.camera-logo {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: #e5e7eb;
  opacity: 0.9;
}

.camera-slot {
  margin: 0 auto;
  width: 90%;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, #020617, #0f172a);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.8),
    0 1px 2px rgba(148, 163, 184, 0.6);
}

/* buttons */

.shutter-main-btn,
.clear-btn {
  appearance: none;
  border-radius: 999px;
  border: none;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.shutter-main-btn {
  color: #0b1120;
  background: radial-gradient(circle at 30% 20%, #f97373, #fb7185);
}

.clear-btn {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.18);
}

.shutter-main-btn:active,
.clear-btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

.shutter-main-btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.camera-hint {
  font-size: 11px;
  color: #9ca3af;
  max-width: 220px;
  text-align: center;
  line-height: 1.5;
}

/* ========== POLAROID ========== */

.polaroid {
  position: fixed; /* full-screen, nu limitat la un perete */
  width: 170px;
  height: 210px;
  background: #fffbf2;
  border-radius: 8px;
  padding: 8px 8px 12px;
  box-shadow: 0 22px 36px rgba(0, 0, 0, 0.9);
  transform-origin: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  z-index: 9999;
}

.polaroid.dragging {
  cursor: grabbing;
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.95);
}

.polaroid:hover:not(.dragging) {
  transform: translateY(-3px) rotate(var(--tilt, 0deg));
}

/* brăduț de Crăciun pe colțul polaroidului */
.polaroid::after {
  content: "🎄";
  position: absolute;
  top: -6px;
  left: -4px;
  font-size: 20px;
  transform: rotate(-10deg);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

/* photo area */

.polaroid-photo-frame {
  position: relative;
  width: 100%;
  height: 68%;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
}

/* instalație de Crăciun pe margine */

.polaroid-photo-frame::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(circle, #f97373 0 55%, transparent 60%) 0 0 / 18px 18px repeat-x,
    radial-gradient(circle, #22c55e 0 55%, transparent 60%) 0 100% / 18px 18px repeat-x,
    radial-gradient(circle, #fde047 0 55%, transparent 60%) 0 0 / 18px 18px repeat-y,
    radial-gradient(circle, #38bdf8 0 55%, transparent 60%) 100% 0 / 18px 18px repeat-y;
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(248, 250, 252, 0.9));
  animation: twinkle 2.8s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% {
    opacity: 0.6;
    filter: drop-shadow(0 0 2px rgba(248, 250, 252, 0.7));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(248, 250, 252, 1));
  }
  100% {
    opacity: 0.75;
    filter: drop-shadow(0 0 3px rgba(248, 250, 252, 0.85));
  }
}

.polaroid-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* glow pe poză când treci cu mouse-ul */

.polaroid-photo-frame:hover {
  box-shadow: 0 0 14px rgba(248, 250, 252, 0.9);
  transform: scale(1.02);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* developing effect */

.polaroid.developing .polaroid-photo-frame img {
  filter: grayscale(1) contrast(1.2) brightness(1.1);
  animation: develop 3.5s ease-out forwards;
}

@keyframes develop {
  0% {
    filter: grayscale(1) contrast(1.3) brightness(1.2);
  }
  60% {
    filter: grayscale(0.2) contrast(1.05) brightness(1.05);
  }
  100% {
    filter: grayscale(0) contrast(1) brightness(1);
  }
}

/* caption */

.polaroid-caption {
  margin-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.25);
  padding-top: 4px;
  font-family: "Bradley Hand", "Comic Sans MS", system-ui, sans-serif;
  font-size: 12px;
  color: #1f2933;
  min-height: 28px;
  outline: none;
  white-space: pre-wrap;
}

.polaroid-caption[contenteditable="true"]:empty::before {
  content: "Write something…";
  color: #c4c4c4;
}

/* pin */

.polaroid-pin {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 30% 20%, #fff, #ef4444);
  box-shadow: 0 3px 7px rgba(15, 23, 42, 0.75);
  cursor: pointer;
}

.polaroid-pin::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  filter: blur(0.6px);
}

.polaroid.pinned .polaroid-pin {
  background: radial-gradient(circle at 30% 20%, #fff, #22c55e);
}

/* delete button */

.polaroid-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.polaroid-close:hover {
  background: rgba(248, 113, 113, 0.95);
}

/* buton de download pe polaroid */

.polaroid-download {
  position: absolute;
  top: 4px;
  right: 26px; /* ca să nu se suprapună cu X-ul */
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.polaroid-download:hover {
  background: rgba(56, 189, 248, 0.95);
}
/* ========== BASE ========== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "SF Pro Text", sans-serif;
}

body {
  position: relative;
  background:
    radial-gradient(circle at 15% 15%, rgba(236, 72, 153, 0.35), transparent 60%),
    radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.30), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(129, 140, 248, 0.28), transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(251, 191, 36, 0.18), transparent 60%),
    radial-gradient(circle at top, #020617, #000);
  background-size: 160% 160%;
  animation: bg-shift 22s ease-in-out infinite alternate;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ninsoare peste fundal, sub conținut */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(248, 250, 252, 0.9) 0 1.2px, transparent 1.3px),
    radial-gradient(circle, rgba(248, 250, 252, 0.7) 0 1px, transparent 1.1px),
    radial-gradient(circle, rgba(248, 250, 252, 0.8) 0 1.4px, transparent 1.5px);
  background-size: 200px 200px, 260px 260px, 320px 320px;
  background-position: 0 0, 50px -80px, -60px 40px;
  animation: snow-fall 25s linear infinite;
}

/* screen flash */

#flash-overlay {
  position: fixed;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
}

.flash-active {
  animation: flash-screen 240ms ease-out;
}

@keyframes flash-screen {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* animated background */

@keyframes bg-shift {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 50% 100%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* ninsoare animată */

@keyframes snow-fall {
  0% {
    background-position: 0 0, 50px -80px, -60px 40px;
  }
  100% {
    background-position: 0 400px, 50px 320px, -60px 360px;
  }
}

/* ========== LAYOUT ========== */

.app {
  width: 100%;
  max-width: 960px;
  padding: 16px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  z-index: 1; /* deasupra ninsorii */
}

.camera-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ========== CAMERA (SMALL) ========== */

.camera {
  width: 210px; /* smaller camera */
  border-radius: 18px 18px 30px 30px;
  background: radial-gradient(circle at 20% 0, #111827, #020617);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(148, 163, 184, 0.35);
  padding: 12px 12px 10px;
  position: relative;
}

.camera::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -16px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.7), transparent);
  filter: blur(8px);
  z-index: -1;
}

.camera-top-strip {
  height: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
}

.camera-rainbow {
  width: 28px;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(
    to right,
    #ff3b30,
    #ff9500,
    #ffcc00,
    #34c759,
    #0a84ff,
    #5856d6
  );
}

.camera-front {
  display: grid;
  grid-template-columns: 60px 1fr 50px;
  grid-template-rows: 80px 46px;
  grid-template-areas:
    "flash lens view"
    ". lens controls";
  column-gap: 6px;
  row-gap: 6px;
  align-items: center;
}

/* flash */

.camera-flash {
  grid-area: flash;
  width: 56px;
  height: 42px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 20%, #e5e7eb, #4b5563);
  box-shadow:
    inset 0 0 8px rgba(0, 0, 0, 0.7),
    0 4px 8px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

.camera-flash::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 10%, #f9fafb, #9ca3af);
}

.camera-flash.flash-on {
  animation: flash-lamp 320ms ease-out;
}

@keyframes flash-lamp {
  0% {
    box-shadow:
      inset 0 0 4px rgba(0, 0, 0, 0.6),
      0 0 0 rgba(251, 191, 36, 0);
    filter: brightness(1.2);
  }
  30% {
    box-shadow:
      inset 0 0 0 rgba(0, 0, 0, 0.3),
      0 0 20px rgba(252, 211, 77, 1);
    filter: brightness(1.8);
  }
  100% {
    box-shadow:
      inset 0 0 6px rgba(0, 0, 0, 0.7),
      0 0 0 rgba(0, 0, 0, 0);
    filter: brightness(1);
  }
}

/* lens */

.camera-lens {
  grid-area: lens;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 0, #111827, #020617);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.9),
    0 0 0 3px #020617,
    0 0 0 6px rgba(31, 41, 55, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-lens-inner {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: #000;
}

.camera-lens-inner video {
  width: 140%;
  height: 140%;
  object-fit: cover;
  transform: translate(-10%, -10%);
  filter: contrast(1.05) saturate(1.2);
}

.lens-glass {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.45), transparent 55%);
  mix-blend-mode: screen;
}

/* viewfinder + controls */

.camera-viewfinder {
  grid-area: view;
  justify-self: end;
  width: 54px;
  height: 46px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 15%, #f9fafb, #4b5563);
  box-shadow:
    inset 0 0 8px rgba(0, 0, 0, 0.9),
    0 4px 8px rgba(0, 0, 0, 0.7);
}

.camera-controls {
  grid-area: controls;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.camera-led {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #bbf7d0, #22c55e);
  box-shadow: 0 0 10px rgba(34, 197, 94, 1);
}

.camera-icon {
  width: 34px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #111827, #020617);
}

/* shutter button */

.camera-shutter {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  justify-self: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 20%, #ff9a9a, #ff1d25);
  box-shadow:
    0 6px 14px rgba(248, 113, 113, 0.7),
    0 0 0 2px rgba(15, 23, 42, 0.9);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.camera-shutter:active {
  transform: translateY(1px) scale(0.97);
  box-shadow:
    0 3px 8px rgba(248, 113, 113, 0.8),
    0 0 0 2px rgba(15, 23, 42, 0.9);
}

/* bottom slot */

.camera-bottom {
  margin-top: 8px;
  background: linear-gradient(180deg, #030712, #020617);
  border-radius: 14px 14px 26px 26px;
  padding: 6px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.camera-logo {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: #e5e7eb;
  opacity: 0.9;
}

.camera-slot {
  margin: 0 auto;
  width: 90%;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, #020617, #0f172a);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.8),
    0 1px 2px rgba(148, 163, 184, 0.6);
}

/* buttons */

.shutter-main-btn,
.clear-btn {
  appearance: none;
  border-radius: 999px;
  border: none;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.shutter-main-btn {
  color: #0b1120;
  background: radial-gradient(circle at 30% 20%, #f97373, #fb7185);
}

.clear-btn {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.18);
}

.shutter-main-btn:active,
.clear-btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

.shutter-main-btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.camera-hint {
  font-size: 11px;
  color: #9ca3af;
  max-width: 220px;
  text-align: center;
  line-height: 1.5;
}

/* ========== POLAROID ========== */

.polaroid {
  position: fixed; /* full-screen, nu limitat la un perete */
  width: 170px;
  height: 210px;
  background: #fffbf2;
  border-radius: 8px;
  padding: 8px 8px 12px;
  box-shadow: 0 22px 36px rgba(0, 0, 0, 0.9);
  transform-origin: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  z-index: 9999;
}

.polaroid.dragging {
  cursor: grabbing;
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.95);
}

.polaroid:hover:not(.dragging) {
  transform: translateY(-3px) rotate(var(--tilt, 0deg));
}

/* brăduț de Crăciun pe colțul polaroidului */
.polaroid::after {
  content: "🎄";
  position: absolute;
  top: -6px;
  left: -4px;
  font-size: 20px;
  transform: rotate(-10deg);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

/* photo area */

.polaroid-photo-frame {
  position: relative;
  width: 100%;
  height: 68%;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
}

/* instalație de Crăciun pe margine */

.polaroid-photo-frame::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(circle, #f97373 0 55%, transparent 60%) 0 0 / 18px 18px repeat-x,
    radial-gradient(circle, #22c55e 0 55%, transparent 60%) 0 100% / 18px 18px repeat-x,
    radial-gradient(circle, #fde047 0 55%, transparent 60%) 0 0 / 18px 18px repeat-y,
    radial-gradient(circle, #38bdf8 0 55%, transparent 60%) 100% 0 / 18px 18px repeat-y;
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(248, 250, 252, 0.9));
  animation: twinkle 2.8s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% {
    opacity: 0.6;
    filter: drop-shadow(0 0 2px rgba(248, 250, 252, 0.7));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(248, 250, 252, 1));
  }
  100% {
    opacity: 0.75;
    filter: drop-shadow(0 0 3px rgba(248, 250, 252, 0.85));
  }
}

.polaroid-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* glow pe poză când treci cu mouse-ul */

.polaroid-photo-frame:hover {
  box-shadow: 0 0 14px rgba(248, 250, 252, 0.9);
  transform: scale(1.02);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* developing effect */

.polaroid.developing .polaroid-photo-frame img {
  filter: grayscale(1) contrast(1.2) brightness(1.1);
  animation: develop 3.5s ease-out forwards;
}

@keyframes develop {
  0% {
    filter: grayscale(1) contrast(1.3) brightness(1.2);
  }
  60% {
    filter: grayscale(0.2) contrast(1.05) brightness(1.05);
  }
  100% {
    filter: grayscale(0) contrast(1) brightness(1);
  }
}

/* caption */

.polaroid-caption {
  margin-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.25);
  padding-top: 4px;
  font-family: "Bradley Hand", "Comic Sans MS", system-ui, sans-serif;
  font-size: 12px;
  color: #1f2933;
  min-height: 28px;
  outline: none;
  white-space: pre-wrap;
}

.polaroid-caption[contenteditable="true"]:empty::before {
  content: "Write something…";
  color: #c4c4c4;
}

/* pin */

.polaroid-pin {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 30% 20%, #fff, #ef4444);
  box-shadow: 0 3px 7px rgba(15, 23, 42, 0.75);
  cursor: pointer;
}

.polaroid-pin::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  filter: blur(0.6px);
}

.polaroid.pinned .polaroid-pin {
  background: radial-gradient(circle at 30% 20%, #fff, #22c55e);
}

/* delete button */

.polaroid-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.polaroid-close:hover {
  background: rgba(248, 113, 113, 0.95);
}

/* buton de download pe polaroid */

.polaroid-download {
  position: absolute;
  top: 4px;
  right: 26px; /* ca să nu se suprapună cu X-ul */
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.polaroid-download:hover {
  background: rgba(56, 189, 248, 0.95);
}
/* ========== BASE ========== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "SF Pro Text", sans-serif;
}

body {
  position: relative;
  background:
    radial-gradient(circle at 15% 15%, rgba(236, 72, 153, 0.35), transparent 60%),
    radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.30), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(129, 140, 248, 0.28), transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(251, 191, 36, 0.18), transparent 60%),
    radial-gradient(circle at top, #020617, #000);
  background-size: 160% 160%;
  animation: bg-shift 22s ease-in-out infinite alternate;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ninsoare peste fundal, sub conținut */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(248, 250, 252, 0.9) 0 1.2px, transparent 1.3px),
    radial-gradient(circle, rgba(248, 250, 252, 0.7) 0 1px, transparent 1.1px),
    radial-gradient(circle, rgba(248, 250, 252, 0.8) 0 1.4px, transparent 1.5px);
  background-size: 200px 200px, 260px 260px, 320px 320px;
  background-position: 0 0, 50px -80px, -60px 40px;
  animation: snow-fall 25s linear infinite;
}

/* screen flash */

#flash-overlay {
  position: fixed;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
}

.flash-active {
  animation: flash-screen 240ms ease-out;
}

@keyframes flash-screen {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* animated background */

@keyframes bg-shift {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 50% 100%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* ninsoare animată */

@keyframes snow-fall {
  0% {
    background-position: 0 0, 50px -80px, -60px 40px;
  }
  100% {
    background-position: 0 400px, 50px 320px, -60px 360px;
  }
}

/* ========== LAYOUT ========== */

.app {
  width: 100%;
  max-width: 960px;
  padding: 16px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  z-index: 1; /* deasupra ninsorii */
}

.camera-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ========== CAMERA (SMALL) ========== */

.camera {
  width: 210px; /* smaller camera */
  border-radius: 18px 18px 30px 30px;
  background: radial-gradient(circle at 20% 0, #111827, #020617);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(148, 163, 184, 0.35);
  padding: 12px 12px 10px;
  position: relative;
}

.camera::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -16px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.7), transparent);
  filter: blur(8px);
  z-index: -1;
}

.camera-top-strip {
  height: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
}

.camera-rainbow {
  width: 28px;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(
    to right,
    #ff3b30,
    #ff9500,
    #ffcc00,
    #34c759,
    #0a84ff,
    #5856d6
  );
}

.camera-front {
  display: grid;
  grid-template-columns: 60px 1fr 50px;
  grid-template-rows: 80px 46px;
  grid-template-areas:
    "flash lens view"
    ". lens controls";
  column-gap: 6px;
  row-gap: 6px;
  align-items: center;
}

/* flash */

.camera-flash {
  grid-area: flash;
  width: 56px;
  height: 42px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 20%, #e5e7eb, #4b5563);
  box-shadow:
    inset 0 0 8px rgba(0, 0, 0, 0.7),
    0 4px 8px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

.camera-flash::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 10%, #f9fafb, #9ca3af);
}

.camera-flash.flash-on {
  animation: flash-lamp 320ms ease-out;
}

@keyframes flash-lamp {
  0% {
    box-shadow:
      inset 0 0 4px rgba(0, 0, 0, 0.6),
      0 0 0 rgba(251, 191, 36, 0);
    filter: brightness(1.2);
  }
  30% {
    box-shadow:
      inset 0 0 0 rgba(0, 0, 0, 0.3),
      0 0 20px rgba(252, 211, 77, 1);
    filter: brightness(1.8);
  }
  100% {
    box-shadow:
      inset 0 0 6px rgba(0, 0, 0, 0.7),
      0 0 0 rgba(0, 0, 0, 0);
    filter: brightness(1);
  }
}

/* lens */

.camera-lens {
  grid-area: lens;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 0, #111827, #020617);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.9),
    0 0 0 3px #020617,
    0 0 0 6px rgba(31, 41, 55, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-lens-inner {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: #000;
}

.camera-lens-inner video {
  width: 140%;
  height: 140%;
  object-fit: cover;
  transform: translate(-10%, -10%);
  filter: contrast(1.05) saturate(1.2);
}

.lens-glass {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.45), transparent 55%);
  mix-blend-mode: screen;
}

/* viewfinder + controls */

.camera-viewfinder {
  grid-area: view;
  justify-self: end;
  width: 54px;
  height: 46px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 15%, #f9fafb, #4b5563);
  box-shadow:
    inset 0 0 8px rgba(0, 0, 0, 0.9),
    0 4px 8px rgba(0, 0, 0, 0.7);
}

.camera-controls {
  grid-area: controls;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.camera-led {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #bbf7d0, #22c55e);
  box-shadow: 0 0 10px rgba(34, 197, 94, 1);
}

.camera-icon {
  width: 34px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #111827, #020617);
}

/* shutter button */

.camera-shutter {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  justify-self: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 20%, #ff9a9a, #ff1d25);
  box-shadow:
    0 6px 14px rgba(248, 113, 113, 0.7),
    0 0 0 2px rgba(15, 23, 42, 0.9);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.camera-shutter:active {
  transform: translateY(1px) scale(0.97);
  box-shadow:
    0 3px 8px rgba(248, 113, 113, 0.8),
    0 0 0 2px rgba(15, 23, 42, 0.9);
}

/* bottom slot */

.camera-bottom {
  margin-top: 8px;
  background: linear-gradient(180deg, #030712, #020617);
  border-radius: 14px 14px 26px 26px;
  padding: 6px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.camera-logo {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: #e5e7eb;
  opacity: 0.9;
}

.camera-slot {
  margin: 0 auto;
  width: 90%;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, #020617, #0f172a);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.8),
    0 1px 2px rgba(148, 163, 184, 0.6);
}

/* buttons */

.shutter-main-btn,
.clear-btn {
  appearance: none;
  border-radius: 999px;
  border: none;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.shutter-main-btn {
  color: #0b1120;
  background: radial-gradient(circle at 30% 20%, #f97373, #fb7185);
}

.clear-btn {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.18);
}

.shutter-main-btn:active,
.clear-btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

.shutter-main-btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.camera-hint {
  font-size: 11px;
  color: #9ca3af;
  max-width: 220px;
  text-align: center;
  line-height: 1.5;
}

/* ========== POLAROID ========== */

.polaroid {
  position: fixed; /* full-screen, nu limitat la un perete */
  width: 170px;
  height: 210px;
  background: #fffbf2;
  border-radius: 8px;
  padding: 8px 8px 12px;
  box-shadow: 0 22px 36px rgba(0, 0, 0, 0.9);
  transform-origin: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  z-index: 9999;
}

.polaroid.dragging {
  cursor: grabbing;
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.95);
}

.polaroid:hover:not(.dragging) {
  transform: translateY(-3px) rotate(var(--tilt, 0deg));
}

/* brăduț de Crăciun pe colțul polaroidului */
.polaroid::after {
  content: "🎄";
  position: absolute;
  top: -6px;
  left: -4px;
  font-size: 20px;
  transform: rotate(-10deg);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

/* photo area */

.polaroid-photo-frame {
  position: relative;
  width: 100%;
  height: 68%;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
}

/* instalație de Crăciun pe margine */

.polaroid-photo-frame::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(circle, #f97373 0 55%, transparent 60%) 0 0 / 18px 18px repeat-x,
    radial-gradient(circle, #22c55e 0 55%, transparent 60%) 0 100% / 18px 18px repeat-x,
    radial-gradient(circle, #fde047 0 55%, transparent 60%) 0 0 / 18px 18px repeat-y,
    radial-gradient(circle, #38bdf8 0 55%, transparent 60%) 100% 0 / 18px 18px repeat-y;
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(248, 250, 252, 0.9));
  animation: twinkle 2.8s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% {
    opacity: 0.6;
    filter: drop-shadow(0 0 2px rgba(248, 250, 252, 0.7));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(248, 250, 252, 1));
  }
  100% {
    opacity: 0.75;
    filter: drop-shadow(0 0 3px rgba(248, 250, 252, 0.85));
  }
}

.polaroid-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* glow pe poză când treci cu mouse-ul */

.polaroid-photo-frame:hover {
  box-shadow: 0 0 14px rgba(248, 250, 252, 0.9);
  transform: scale(1.02);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* developing effect */

.polaroid.developing .polaroid-photo-frame img {
  filter: grayscale(1) contrast(1.2) brightness(1.1);
  animation: develop 3.5s ease-out forwards;
}

@keyframes develop {
  0% {
    filter: grayscale(1) contrast(1.3) brightness(1.2);
  }
  60% {
    filter: grayscale(0.2) contrast(1.05) brightness(1.05);
  }
  100% {
    filter: grayscale(0) contrast(1) brightness(1);
  }
}

/* caption */

.polaroid-caption {
  margin-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.25);
  padding-top: 4px;
  font-family: "Bradley Hand", "Comic Sans MS", system-ui, sans-serif;
  font-size: 12px;
  color: #1f2933;
  min-height: 28px;
  outline: none;
  white-space: pre-wrap;
}

.polaroid-caption[contenteditable="true"]:empty::before {
  content: "Write something…";
  color: #c4c4c4;
}

/* pin */

.polaroid-pin {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 30% 20%, #fff, #ef4444);
  box-shadow: 0 3px 7px rgba(15, 23, 42, 0.75);
  cursor: pointer;
}

.polaroid-pin::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  filter: blur(0.6px);
}

.polaroid.pinned .polaroid-pin {
  background: radial-gradient(circle at 30% 20%, #fff, #22c55e);
}

/* delete button */

.polaroid-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.polaroid-close:hover {
  background: rgba(248, 113, 113, 0.95);
}

/* buton de download pe polaroid */

.polaroid-download {
  position: absolute;
  top: 4px;
  right: 26px; /* ca să nu se suprapună cu X-ul */
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.polaroid-download:hover {
  background: rgba(56, 189, 248, 0.95);
}
