/* ================================================
   GUESTBOOK MODAL - CORKBOARD THEME
   ================================================ */

/* Enlarge modal - SQUARE (no rounded corners) */
#modal-guestbook {
  width: 95% !important;
  max-width: 1400px !important;
  height: 90vh !important;
  /* display: flex !important; REMOVED to allow JS to control visibility */
  flex-direction: column !important;
  border-radius: 0 !important;
}

/* Wood-themed header */
#modal-guestbook .modal-header {
  background: linear-gradient(180deg, #8b6f47 0%, #6b522e 100%) !important;
  border: 4px solid #4a331c !important;
  border-bottom: none !important;
  border-radius: 0 !important;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3) !important;
  padding: 1.2rem 1.5rem !important;
  margin-bottom: 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  position: relative !important;
}

#modal-guestbook .modal-title {
  color: #fff3e0 !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5) !important;
  font-family: "VT323", monospace !important;
  font-size: 1.8rem !important;
  margin: 0 !important;
  text-align: center !important;
}

/* Decorative screw - LEFT side */
#modal-guestbook .modal-header::before {
  content: "" !important;
  position: absolute;
  left: 1.5rem;
  width: 42px;
  height: 42px;
  background: radial-gradient(circle, #c8c8c8 0%, #a0a0a0 50%, #8a8a8a 100%);
  border-radius: 50%;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Decorative screw cross - LEFT horizontal */
#modal-guestbook .modal-header::after {
  content: "";
  position: absolute;
  left: calc(1.5rem + 11px);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 3px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.6) 20%,
    rgba(0, 0, 0, 0.8) 50%,
    rgba(0, 0, 0, 0.6) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
  border-radius: 1px;
  pointer-events: none;
}

/* Decorative screw - LEFT vertical cross line */
.decorative-screw-left::before {
  content: "";
  position: absolute;
  left: calc(1.5rem + 19.5px);
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.6) 20%,
    rgba(0, 0, 0, 0.8) 50%,
    rgba(0, 0, 0, 0.6) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.5);
  border-radius: 1px;
  pointer-events: none;
}

/* Phillips Screw Close Button - RIGHT side */
#modal-guestbook .modal-close {
  background: radial-gradient(
    circle,
    #c8c8c8 0%,
    #a0a0a0 50%,
    #8a8a8a 100%
  ) !important;
  border: none !important;
  font-size: 0 !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: absolute !important;
  right: 1.5rem !important;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.4) !important;
  cursor: pointer !important;
}

/* Phillips cross slot - horizontal */
#modal-guestbook .modal-close::before {
  content: "" !important;
  position: absolute;
  width: 20px;
  height: 3px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.6) 20%,
    rgba(0, 0, 0, 0.8) 50%,
    rgba(0, 0, 0, 0.6) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
  border-radius: 1px;
}

/* Phillips cross slot - vertical */
#modal-guestbook .modal-close::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 20px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.6) 20%,
    rgba(0, 0, 0, 0.8) 50%,
    rgba(0, 0, 0, 0.6) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.5);
  border-radius: 1px;
}

#modal-guestbook .modal-close:hover {
  background: radial-gradient(
    circle,
    #d8d8d8 0%,
    #b0b0b0 50%,
    #9a9a9a 100%
  ) !important;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

#modal-guestbook .modal-close:active {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.4),
    inset 0 -1px 2px rgba(255, 255, 255, 0.3) !important;
}

/* Corkboard Body Styling */
#modal-guestbook .modal-content {
  background: #c67b4a;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.03) 0px,
      rgba(0, 0, 0, 0.03) 1px,
      transparent 1px,
      transparent 3px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.03) 0px,
      rgba(0, 0, 0, 0.03) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.02) 0%, transparent 50%),
    radial-gradient(
      circle at 80% 70%,
      rgba(255, 255, 255, 0.03) 0%,
      transparent 50%
    );
  background-color: #c67b4a;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  padding: 0 !important;
  margin: 0 !important;
  flex: 1 !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

/* ================================================
   GUESTBOOK FORM CONTAINER (STICKY HEADER)
   ================================================ */
.guestbook-form-container {
  background: rgba(139, 111, 71, 0.95);
  border-bottom: 3px solid #5a3d1e;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.guestbook-form {
  max-width: 900px;
  margin: 0 auto;
}

.form-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group-message {
  flex: 2;
}

.guestbook-form label {
  font-family: "VT323", monospace;
  font-size: 1.1rem;
  color: #fff3e0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  font-weight: bold;
}

.guestbook-form input,
.guestbook-form textarea {
  font-family: "VT323", monospace;
  font-size: 1.1rem;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-bottom: 3px solid #5a3d1e;
  border-radius: 4px 4px 0 0;
  outline: none;
  transition: all 0.2s;
  color: #333;
}

.guestbook-form input:focus,
.guestbook-form textarea:focus {
  background: #fff;
  border-bottom-color: #a855f7;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
}

.guestbook-form textarea {
  resize: vertical;
  min-height: 70px;
}

.char-counter {
  font-family: "VT323", monospace;
  font-size: 0.9rem;
  color: rgba(255, 243, 224, 0.7);
  text-align: right;
}

.submit-btn {
  font-family: "VT323", monospace;
  font-size: 1.2rem;
  padding: 0.8rem 2rem;
  background: linear-gradient(180deg, #a855f7 0%, #8b3fd8 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  box-shadow:
    0 4px 12px rgba(168, 85, 247, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.2s;
  font-weight: bold;
  letter-spacing: 1px;
}

.submit-btn:hover {
  background: linear-gradient(180deg, #b865ff 0%, #9b4fe8 100%);
  transform: translateY(-2px);
  box-shadow:
    0 6px 16px rgba(168, 85, 247, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
  box-shadow:
    0 2px 8px rgba(168, 85, 247, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-icon {
  font-size: 1.3rem;
}

.form-error {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border-radius: 6px;
  font-family: "VT323", monospace;
  font-size: 1.1rem;
  display: none;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.form-error.show {
  display: block;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* ================================================
   FLOATING WRITE BUTTON (GLOBAL - OUTSIDE MODAL)
   ================================================ */
.floating-write-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  /* Wood Texture Background */
  background: #8b6f47;
  background-image: linear-gradient(
    180deg,
    #a0826d 0%,
    #8b6f47 10%,
    #6b522e 100%
  );
  color: #fff3e0;
  border: 3px solid #4a331c;
  border-bottom: 6px solid #4a331c; /* 3D effect */
  border-radius: 8px; /* Slightly rounded, not distinct pill shape */
  padding: 1rem 2rem;
  font-family: "VT323", monospace;
  font-size: 1.5rem; /* Larger retro text */
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  /* Deep shadow for "floating" wooden block */
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  transition: all 0.15s ease;
  z-index: 1000;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}

.floating-write-btn:hover {
  transform: translateY(2px); /* Press down slightly */
  border-bottom-width: 4px; /* Reduce 3D height */
  background-image: linear-gradient(
    180deg,
    #b0927d 0%,
    #9b7f57 10%,
    #7b623e 100%
  ); /* Lighter on hover */
  box-shadow:
    0 5px 15px rgba(0, 0, 0, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.floating-write-btn:active {
  transform: translateY(6px); /* Fully pressed */
  border-bottom-width: 0px; /* Flat */
  box-shadow:
    0 0 5px rgba(0, 0, 0, 0.6),
    inset 0 4px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 6px; /* Compensate for lost border height */
}

.floating-write-btn .btn-icon {
  font-size: 1.5rem;
}

/* ================================================
   WRITE POPUP MODAL (GLOBAL - OUTSIDE GUESTBOOK MODAL)
   ================================================ */
.write-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease;
}

.write-popup-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.write-popup {
  /* Retro Wood Card */
  background: #8b6f47;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.03) 0px,
      rgba(0, 0, 0, 0.03) 1px,
      transparent 1px,
      transparent 3px
    ),
    linear-gradient(135deg, #a0826d 0%, #8b6f47 100%);
  border: 4px solid #4a331c;
  border-radius: 0; /* Square retro corners */
  padding: 0;
  width: 90%;
  max-width: 500px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 2px 2px rgba(255, 255, 255, 0.2);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy retro pop */
  overflow: visible; /* Allow decorative elements */
}

@keyframes popIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.popup-header {
  background: linear-gradient(180deg, #6b522e 0%, #5a4223 100%);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 4px solid #3d2b16;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.popup-header h3 {
  font-family: "VT323", monospace;
  font-size: 1.8rem;
  color: #fff3e0;
  margin: 0;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  letter-spacing: 1px;
}

.popup-close {
  background: #c62828;
  border: 3px solid #8e0000;
  color: #fff;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 4px; /* Slightly rounded square */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
  box-shadow: 0 4px 0 #8e0000;
}

.popup-close:hover {
  background: #e53935;
  transform: translateY(2px);
  box-shadow: 0 2px 0 #8e0000;
}

.popup-close:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #8e0000;
}

.popup-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.popup-form label {
  font-family: "VT323", monospace;
  font-size: 1.3rem;
  color: #fff3e0;
  font-weight: bold;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

.popup-form input,
.popup-form textarea {
  font-family: "VT323", monospace;
  font-size: 1.2rem;
  padding: 0.8rem;
  background: #fffcf5; /* Off-white paper color */
  border: 3px solid #5a3d1e;
  border-radius: 4px; /* Small radius */
  outline: none;
  transition: all 0.2s;
  color: #333;
  box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.popup-form input:focus,
.popup-form textarea:focus {
  border-color: #ffd700;
  background: #fff;
  box-shadow:
    inset 2px 2px 5px rgba(0, 0, 0, 0.05),
    0 0 0 2px rgba(255, 215, 0, 0.3);
}

.popup-form textarea {
  resize: none;
  min-height: 120px;
}

.char-counter {
  font-family: "VT323", monospace;
  font-size: 1rem;
  color: rgba(255, 243, 224, 0.8);
  text-align: right;
}

.submit-btn {
  font-family: "VT323", monospace;
  font-size: 1.4rem;
  padding: 0.8rem 2rem;
  background: linear-gradient(180deg, #2e7d32 0%, #1b5e20 100%);
  color: #fff;
  border: 3px solid #0d3811;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  box-shadow:
    0 6px 0 #0d3811,
    0 10px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.1s;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
  width: 100%;
  margin-top: 0.5rem;
}

.submit-btn:hover {
  background: linear-gradient(180deg, #4caf50 0%, #2e7d32 100%);
  transform: translateY(2px);
  box-shadow:
    0 4px 0 #0d3811,
    0 5px 5px rgba(0, 0, 0, 0.3);
}

.submit-btn:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 #0d3811;
}

.btn-icon {
  font-size: 1.3rem;
}

.form-error {
  padding: 0.8rem 1rem;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border-radius: 6px;
  font-family: "VT323", monospace;
  font-size: 1.1rem;
  display: none;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
  position: relative;
  z-index: 1000;
}

.form-error.show {
  display: block;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

.guestbook-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #8b6f47 transparent;
}

/* ================================================
   GUESTBOOK GRID - STICKY NOTES
   ================================================ */
.guestbook-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 1rem;
  justify-content: flex-start;
  align-items: flex-start;
}

/* ================================================
   PIXEL NOTE CARD
   ================================================ */
.pixel-note {
  width: 280px;
  min-height: 220px;
  padding: 1.5rem 1.2rem 1.2rem 1.2rem;
  position: relative;
  font-family: "VT323", monospace;
  box-shadow:
    6px 6px 0 rgba(0, 0, 0, 0.2),
    8px 8px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow: visible;
}

.pixel-note:hover {
  transform: scale(1.02);
  box-shadow:
    8px 8px 0 rgba(0, 0, 0, 0.25),
    10px 10px 0 rgba(0, 0, 0, 0.12);
  z-index: 5;
}

/* Pin Icon at Top Center - Realistic 3D Pushpin */
.note-pin {
  position: absolute;
  top: -8px;
  width: 20px;
  height: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

/* Pushpin Head (Colored Cap) */
.note-pin::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50% 50% 50% 0;
  transform: translateX(-50%) rotate(-45deg);
  box-shadow:
    inset -2px -2px 4px rgba(0, 0, 0, 0.2),
    inset 2px 2px 4px rgba(255, 255, 255, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Pushpin Needle (Silver/Gray) */
.note-pin::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 8px;
  background: linear-gradient(to bottom, #a0a0a0, #707070);
  border-radius: 0 0 1px 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Pin color variants */
.note-pin.pin-red::before {
  background: linear-gradient(135deg, #ff4757, #c0392b);
}

.note-pin.pin-blue::before {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.note-pin.pin-green::before {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.note-pin.pin-yellow::before {
  background: linear-gradient(135deg, #f1c40f, #f39c12);
}

.note-pin.pin-purple::before {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.note-pin.pin-orange::before {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.note-pin.pin-pink::before {
  background: linear-gradient(135deg, #fd79a8, #e84393);
}
/* Avatar */
.note-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%; /* Circular Avatar */
  background: #fff;
  border: 3px solid rgba(0, 0, 0, 0.1);
  image-rendering: auto; /* Smoother for circle */
  object-fit: cover;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
}

/* Header with Avatar and Name */
.note-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px dashed rgba(0, 0, 0, 0.15);
}

.note-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: rgba(0, 0, 0, 0.8);
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
  flex: 1;
  word-break: break-word;
}

/* Message Content */
.note-message {
  font-size: 1.1rem;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.75);
  word-wrap: break-word;
  white-space: pre-wrap;
  flex: 1;
}

/* Footer with Timestamp and Reactions */
.note-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.8rem;
  border-top: 2px dashed rgba(0, 0, 0, 0.15);
  margin-top: auto;
  position: relative;
  overflow: visible;
}

.note-timestamp {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.5);
  font-style: italic;
}

/* ---------------------------------
   REACTION SYSTEM UI
   --------------------------------- */
.reaction-container {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* Main Reaction Button (Trigger) - Shows FIRST */
.reaction-trigger-btn {
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 5;
}

.reaction-trigger-btn:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
}

/* HOVER BRIDGE: Connect trigger to picker so mouse doesn't get lost in gap */
.reaction-trigger-btn::after {
  content: "";
  position: absolute;
  bottom: 100%; /* Starts at top of trigger */
  left: -20px; /* Wider bridge */
  right: -20px;
  width: auto;
  height: 40px; /* Much Taller bridge to reach picker safely */
  background: transparent;
  z-index: 100;
}

.reaction-trigger-btn .heart-icon {
  font-size: 1.2rem;
  color: #e53935;
  transition: transform 0.2s;
}

.reaction-trigger-btn:hover .heart-icon {
  transform: scale(1.1);
}

/* Reaction Picker (Tooltip) - Hidden by default */
.reaction-picker {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  background: #fff;
  border: 3px solid #5a3d1e;
  border-radius: 50px;
  padding: 8px 16px;
  display: flex;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px) scale(0.9);
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
  pointer-events: none;
}

/* Show picker ONLY on hover over TRIGGER BUTTON */
.reaction-trigger-btn:hover .reaction-picker,
.reaction-picker:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: all;
  transition-delay: 0s; /* Instant show */
}

/* Auto-hide after 1 seconds when not hovering trigger button */
.reaction-trigger-btn:not(:hover) .reaction-picker:not(:hover) {
  transition-delay: 1s; /* Reduced from 2s to feel snappier but safe */
}

.reaction-option {
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s;
  user-select: none;
}

.reaction-option:hover {
  transform: scale(1.3);
}

.reaction-option:active {
  transform: scale(0.9);
}

/* Reaction List (Existing Reactions) - Shows AFTER trigger button */
.reactions-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stacked Icons Container */
.reaction-icons-stack {
  display: flex;
  align-items: center;
  position: relative;
}

/* Individual stacked icon */
.reaction-icon-stacked {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  margin-left: -8px;
  position: relative;
  transition: transform 0.2s;
}

.reaction-icon-stacked:first-child {
  margin-left: 0;
}

.reaction-icon-stacked:hover {
  transform: scale(1.15);
  z-index: 2;
}

/* Total count */
.reaction-total-count {
  font-size: 1.1rem;
  color: #5a3d1e;
  font-weight: bold;
  margin-right: 6px;
  background: rgba(255, 255, 255, 0.6);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(90, 61, 30, 0.2);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5);
  font-family: "VT323", monospace;
  min-width: 24px;
  text-align: center;
}

/* Individual reaction tag (for clicking) */
.reaction-tag {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
  color: rgba(0, 0, 0, 0.7);
  cursor: pointer;
  transition: all 0.2s;
}

.reaction-tag:hover {
  background: #fff;
  transform: scale(1.05);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.reaction-tag.active {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.2);
  font-weight: bold;
}

.note-like-btn:active {
  transform: scale(0.95);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.15);
}

.note-like-btn .heart-icon {
  font-size: 1.1rem;
  transition: all 0.2s;
}

.note-like-btn:hover .heart-icon {
  color: #ef4444;
  filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5));
}

/* ================================================
   COLOR VARIANTS - PASTEL
   ================================================ */
.note-yellow {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 3px solid #fbbf24;
}

.note-pink {
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  border: 3px solid #f472b6;
}

.note-blue {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 3px solid #60a5fa;
}

.note-green {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border: 3px solid #34d399;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  #modal-guestbook {
    width: 98% !important;
    height: 95vh !important;
  }

  .floating-write-btn {
    bottom: 1rem;
    right: 1rem;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
  }

  .write-popup {
    width: 95%;
    margin: 1rem;
  }

  .guestbook-body {
    padding: 1rem;
  }

  .guestbook-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
  }

  .pixel-note {
    width: 100%;
    max-width: 100%;
  }
}
/* ================================================
   CUSTOM SCROLLBAR (Wooden Block Style)
   ================================================ */

/* Scrollbar width */
.guestbook-body::-webkit-scrollbar {
  width: 32px; /* Much wider for block look */
}

/* Track (Background) */
.guestbook-body::-webkit-scrollbar-track {
  background: rgba(61, 43, 22, 0.4); /* Darker track */
  border-left: 3px solid rgba(40, 28, 14, 0.5);
  box-shadow: inset 3px 0 8px rgba(0, 0, 0, 0.4);
}

/* Handle (Wooden Block) */
.guestbook-body::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #8b5a2b, #6b4226);
  border: 3px solid #2a1a0a; /* Thicker dark border */
  border-radius: 6px;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.2),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 4px 8px rgba(0, 0, 0, 0.5);
  background-clip: padding-box;
  border-right: 6px solid transparent; /* Spacing */
  border-left: 6px solid transparent;
  min-height: 80px; /* Force minimum height for "block" feel */
}

/* Handle on Hover */
.guestbook-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #a06b3a, #7d4e30);
  border-color: #3e2714;
}
