:root {
  --cream: #f6efe4;
  --pine: #1b3a2b;
  --pine-dark: #10231a;
  --berry: #c65a5a;
  --gold: #d9b467;
  --rose: #e7b1a5;
  --shadow: rgba(16, 35, 26, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", serif;
  color: var(--pine-dark);
  background: radial-gradient(circle at top, #fff7ea 0%, var(--cream) 55%, #ead9c8 100%);
  min-height: 100vh;
}

.admin-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  border: none;
  background: transparent;
  color: transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: none;
  opacity: 0;
  z-index: 10;
}

.admin-toggle.active {
  background: transparent;
  color: transparent;
}

.site-header {
  text-align: center;
  padding: 40px 16px 12px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--berry);
  margin: 0 0 8px;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.subhead {
  margin: 0;
  font-size: 1rem;
  color: #5a4b3f;
}

.tree-wrap {
  width: min(720px, 92vw);
  margin: 24px auto 48px;
  position: relative;
  padding: 24px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 28px;
  box-shadow: 0 24px 60px var(--shadow);
}

.tree-image {
  width: 100%;
  display: block;
  border-radius: 20px;
}

.ornament-layer {
  position: absolute;
  inset: 24px;
  pointer-events: none;
}

.ornament {
  position: absolute;
  width: clamp(36px, 4vw, 52px);
  height: clamp(36px, 4vw, 52px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: var(--rose);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  display: grid;
  place-items: center;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  font-size: 0.75rem;
  color: #3b2320;
  transform: translate(-50%, -50%);
}

.ornament::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 12px;
  height: 10px;
  border-radius: 0 0 6px 6px;
  background: var(--gold);
}

.ornament.locked {
  background: #cbbfb2;
  color: rgba(59, 35, 32, 0.5);
  opacity: 0.5;
  cursor: not-allowed;
}

.ornament.available {
  background: var(--berry);
  color: #fff;
  box-shadow: 0 12px 24px rgba(198, 90, 90, 0.35);
  animation: glow 2.4s ease-in-out infinite;
}

.ornament.opened {
  background: var(--gold);
  color: #3a2f1d;
}

.ornament:hover:not(.locked) {
  transform: translate(-50%, -50%) translateY(-4px) scale(1.04);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.2);
}

@keyframes glow {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
    box-shadow: 0 8px 16px rgba(198, 90, 90, 0.2);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-3px);
    box-shadow: 0 16px 24px rgba(198, 90, 90, 0.4);
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 35, 26, 0.6);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 24px;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #fffaf2;
  width: min(560px, 92vw);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 24px 50px var(--shadow);
  position: relative;
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 16px;
  border: none;
  background: transparent;
  font-size: 1.8rem;
  cursor: pointer;
  color: #5a4b3f;
}

.modal-eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.65rem;
  color: var(--berry);
}

.modal-title {
  margin: 0 0 12px;
  font-size: 1.8rem;
}

.modal-body {
  margin: 0 0 16px;
  line-height: 1.5;
  color: #4f4035;
}

.gate-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

#passphrase {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d8c5b1;
  font-size: 1rem;
}

.btn {
  padding: 10px 16px;
  background: var(--pine);
  color: #fffaf2;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
}

.gate-hint {
  margin: 0;
  font-size: 0.9rem;
  color: #7a6758;
}

.gate-error {
  margin: 8px 0 0;
  color: #b84141;
  min-height: 1.2em;
}

.media-slot {
  border: 1px dashed #d9c7b1;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.6);
  max-height: 45vh;
  overflow: hidden;
}

.media-slot img,
.media-slot video {
  display: block;
  width: 100%;
  border-radius: 10px;
  max-height: 40vh;
  object-fit: contain;
}

.media-placeholder {
  color: #9b8170;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .tree-wrap {
    padding: 16px;
  }

  .ornament-layer {
    inset: 16px;
  }

  .modal-card {
    padding: 24px;
  }

  .gate-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
