/* --------------------------------------------------
   GLOBALS
-------------------------------------------------- */
body {
  margin: 0;
  font-family: Lora, Georgia, serif;
  background: linear-gradient(180deg, #3b0d11, #1a0305);
  color: #fff;
  overflow-x: hidden;
}

.wrap {
  max-width: 1100px;
  margin: 40px auto;
  padding: 20px;
}

h1 {
  font-size: clamp(28px, 7vw, 56px);
  font-weight: 900;
  color: #ff6b81;
  text-align: center;
  text-shadow: 0 0 12px rgba(255,100,120,.9), 0 0 22px rgba(255,60,90,.7);
  margin: 0;
}

/* --------------------------------------------------
   GRID
-------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}

@media (min-width: 760px) {
  .grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.tile {
  height: 90px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdfc, #ffeef0);
  color: #8b0f1b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  cursor: pointer;
  position: relative;
  z-index: 10;
  font-weight: 700;
  font-size: 20px;
}

.door-id {
  font-weight: 900;
  font-size: 24px;
}

/* --------------------------------------------------
   MODAL
-------------------------------------------------- */
.overlay {
  z-index: 4000;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: #fff;
  color: #000;
  border-radius: 14px;
  padding: 20px;
  max-width: 900px;
  width: 94%;
  box-shadow: 0 0 30px rgba(0,0,0,.4);
  max-height: 90vh;
  overflow: auto;
  position: relative;
}

.btn-close {
  margin-top: 20px;
  padding: 10px 16px;
  background: #b91c2a;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
}

.media-preview {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 10px;
  display: block;
}

/* --------------------------------------------------
   FALLING EFFECTS
-------------------------------------------------- */
.falling {
  position: fixed;
  inset: 0;
  width: 100%;
  pointer-events: none;
  z-index: 2000;
  overflow: hidden;
}

.snow, .heartUp {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: center;
}

@keyframes snowFall {
  0% { transform: translate3d(var(--x), -20vh, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--x), 120vh, 0) rotate(360deg); opacity: 0; }
}

@keyframes heartRise {
  0% { transform: translate3d(var(--x), 120vh, 0) scale(.8) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--x), -20vh, 0) scale(1.2) rotate(180deg); opacity: 0; }
}

/* --------------------------------------------------
   ADMIN BUTTON
-------------------------------------------------- */
.admin-button {
  display: block;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  border-radius: 14px;
  background: #ff8fa3;
  color: white;
  border: none;
  z-index: 5000;
  cursor: pointer;
  font-family: 'Lora', serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(255,120,140,.4);
}

@media (max-width: 700px) {
  .admin-button {
    display: none !important;
  }
}

/* --------------------------------------------------
   ADMIN PANEL
-------------------------------------------------- */
.admin-modal h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

.admin-grid {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.admin-left { flex: 1; }
.admin-right { width: 330px; }

@media (max-width: 520px) {
  .admin-grid { flex-direction: column; }
  .admin-right { width: auto; }
}

.admin-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.admin-preview {
  width: 100%;
  min-height: 200px;
  padding: 10px;
  background: #fafafa;
  border-radius: 12px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

/* Buttons */
.btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #eee;
}

.btn-primary {
  background: #ff8fa3;
  color: #fff;
}

.btn-danger {
  background: #c71f37;
  color: #fff;
}
