* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  font-family: 'Georgia', 'Times New Roman', serif;
  overflow-x: hidden;
  position: relative;
}

.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #2a2218 url('background.jpg') center center / contain no-repeat;
  z-index: -2;
}

.background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
}

/* Header */
.header {
  text-align: center;
  padding: 40px 20px 20px;
  font-size: 3rem;
  color: #fff;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.7), 0 0 20px rgba(0,0,0,0.4);
  font-style: italic;
  letter-spacing: 2px;
}

/* Message Button - top left */
.message-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.2s;
  z-index: 10;
}

.message-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
}

.message-btn svg {
  width: 26px;
  height: 26px;
  opacity: 0.85;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  max-width: 450px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal h2 {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 15px;
  font-weight: normal;
  font-style: italic;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

#messageText {
  width: 100%;
  height: 120px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
}

#messageText:focus {
  border-color: #7c6a4f;
}

.send-btn {
  margin-top: 12px;
  padding: 10px 30px;
  background: #7c6a4f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.send-btn:hover {
  background: #5e503c;
}

.modal-status {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #666;
  min-height: 1.2em;
}

.modal-status.success {
  color: #4a7c59;
}

.modal-status.error {
  color: #c0392b;
}

/* Fortune Cookie - bottom left */
.fortune-container {
  position: fixed;
  bottom: 25px;
  left: 25px;
  z-index: 10;
}

.fortune-cookie {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s;
}

.fortune-cookie:hover {
  transform: scale(1.1);
}

.cookie-svg {
  width: 80px;
  height: 55px;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.4));
}

.cookie-label {
  color: #fff;
  font-size: 0.75rem;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
  margin-top: 2px;
  opacity: 0.8;
}

/* Fortune Message */
.fortune-message {
  display: none;
  position: absolute;
  bottom: 80px;
  left: 0;
  min-width: 250px;
  max-width: 320px;
  animation: fortuneIn 0.4s ease;
}

.fortune-message.active {
  display: block;
}

@keyframes fortuneIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fortune-paper {
  background: #fef9e7;
  border: 1px solid #d4a843;
  border-radius: 6px;
  padding: 16px 20px;
  box-shadow: 2px 3px 10px rgba(0,0,0,0.25);
  position: relative;
}

.fortune-paper::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 20px;
  width: 16px;
  height: 16px;
  background: #fef9e7;
  border-right: 1px solid #d4a843;
  border-bottom: 1px solid #d4a843;
  transform: rotate(45deg);
}

#fortuneText {
  font-style: italic;
  color: #5a4a2f;
  font-size: 0.95rem;
  line-height: 1.5;
}

.fortune-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  justify-content: flex-end;
}

.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: transform 0.2s;
}

.like-btn svg {
  fill: #ccc;
  transition: fill 0.3s;
}

.like-btn:hover svg {
  fill: #e74c3c;
  transform: scale(1.2);
}

.like-btn.liked svg {
  fill: #e74c3c;
}

@keyframes likePopup {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.like-btn.pop {
  animation: likePopup 0.3s ease;
}

.like-count {
  font-size: 0.75rem;
  color: #9a8a6a;
}

/* Responsive */
@media (max-width: 600px) {
  .header {
    font-size: 1.8rem;
    padding: 30px 15px 15px;
  }

  .message-btn {
    width: 44px;
    height: 44px;
    top: 15px;
    left: 15px;
  }

  .fortune-container {
    bottom: 15px;
    left: 15px;
  }

  .cookie-svg {
    width: 65px;
    height: 45px;
  }

  .fortune-message {
    min-width: 200px;
    max-width: 260px;
  }
}
