#background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: -2;
}

#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  transition: 1s opacity;
}

body {
  font-family: 'Arial', sans-serif;
  overflow: hidden;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 100vh;
  transition: background 0.8s ease-in-out;
}

body.meditation-state {
  background: #000;
}

body.thinking-state {
  background-image: url('../resources/panda-thinking.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Introduction Dialog Styles */
.intro-dialog-container {
  position: fixed;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  max-width: 90vw;
  width: 600px;
}

.dialog-bubble {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 20px;
  border: 3px solid #c896fa;
  box-shadow:
    0 0 10px #c896fa,
    0 0 20px #c896fa,
    0 0 30px rgba(200, 150, 250, 0.5),
    inset 0 0 10px rgba(200, 150, 250, 0.1);
  animation: dialogBounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}



.dialog-content {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  min-height: 60px;
}

.dialog-text {
  font-size: 18px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  flex: 1;
}

.typing-cursor {
  font-size: 18px;
  color: #c896fa;
  font-weight: bold;
  animation: blink 1s infinite;
  margin-left: 2px;
}

.dialog-next-btn {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.9);
  border: 3px solid #ffd200;
  border-radius: 15px;
  cursor: pointer;
  transform: skew(-15deg);
  transition: all 0.4s ease;
  margin: 0 auto;
  display: block;
  box-shadow:
    0 0 5px #ffd200,
    0 0 10px #ffd200,
    0 0 15px #ffd200,
    inset 0 0 5px rgba(255, 210, 0, 0.3),
    inset 0 2px 2px rgba(255, 255, 255, 0.2);
  opacity: 0;
  transform: skew(-15deg) translateY(10px);
  animation: buttonFadeIn 0.5s ease forwards;
}

.dialog-next-btn > * {
  transform: skew(15deg);
}

.dialog-next-btn:hover {
  background: rgba(255, 210, 0, 0.2);
  transform: skew(-15deg) translateY(-2px);
  box-shadow:
    0 0 8px #ffd200,
    0 0 15px #ffd200,
    0 0 25px #ffd200,
    inset 0 0 8px rgba(255, 210, 0, 0.4),
    inset 0 3px 3px rgba(255, 255, 255, 0.3);
}

@keyframes dialogBounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(50px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05) translateY(0px);
  }
  70% {
    transform: scale(0.95) translateY(0px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0px);
  }
}



@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

@keyframes buttonFadeIn {
  0% {
    opacity: 0;
    transform: skew(-15deg) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: skew(-15deg) translateY(0px);
  }
}



.input-section {
  position: fixed;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  padding: 25px;
  border-radius: 20px;
  z-index: 10;
  transition: all 0.5s ease;
  max-width: 90vw;
  width: 600px;
}

.input-section.hidden {
  opacity: 0;
  pointer-events: none;
}

.email-collection-section {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.5s, transform 0.5s;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  display: none;
}

.email-collection-section .input-container {
  flex-direction: column;
}

.email-instruction-text {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 16px;
  color: #fff;
  font-weight: 500;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
  line-height: 1.4;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  max-width: 90vw;
  padding: 0 20px;
}

.email-instruction-text.visible {
  opacity: 1;
  pointer-events: auto;
}

.name-fields-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.name-fields-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.email-collection-section.visible {
  opacity: 1;
  pointer-events: auto;
  display: block;
}

.email-submitted-message {
  display: none;
  position: fixed;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  color: white;
  font-size: 1.2rem;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}

.email-submitted-message.visible {
  display: block;
}


.button-row {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.skip-btn {
  padding: 12px 24px;
  font-size: 16px;
  background: rgba(128, 128, 128, 0.2);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.8);
  border: 4px solid rgba(128, 128, 128, 0.5);
  border-radius: 15px;
  cursor: pointer;
  white-space: nowrap;
  transform: skew(-15deg);
  transition: all 0.4s ease;
  box-shadow:
    0 0 2px rgba(128, 128, 128, 0.4),
    inset 0 0 2px rgba(128, 128, 128, 0.2);
}

.skip-btn:hover {
  background: rgba(128, 128, 128, 0.4);
  border-color: rgba(128, 128, 128, 0.7);
  color: white;
}
   .input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
   }
   
.center-buttons {
    flex: 1;
}

input[type="text"],
input[type="email"] {
  flex: 1;
  min-width: 250px;
  padding: 12px 16px;
  font-size: 16px;
  border: 4px solid #c896fa;
  border-radius: 15px;
  outline: none;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  transform: skew(-15deg);
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.4s ease;
  box-shadow:
    0 0 5px #d8b4fe,
    0 0 10px #c896fa,
    0 0 15px #c896fa,
    0 0 20px #a855f7,
    inset 0 0 5px rgba(200, 150, 250, 0.3),
    inset 0 2px 2px rgba(255, 255, 255, 0.2),
    inset 0 -2px 2px rgba(139, 69, 19, 0.1);
}



input[type="text"].has-text,
input[type="email"].has-text {
  box-shadow:
    0 0 2.5px #d8b4fe,
    0 0 5px #c896fa,
    0 0 7.5px #c896fa,
    0 0 10px #a855f7,
    inset 0 0 2.5px rgba(200, 150, 250, 0.15),
    inset 0 2px 2px rgba(255, 255, 255, 0.1),
    inset 0 -2px 2px rgba(139, 69, 19, 0.05);
}

input[type="text"]:focus,
input[type="email"]:focus {
  border-color: #d8b4fe;
  background: rgba(0, 0, 0, 0.5);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.generate-btn {
  padding: 12px 24px;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.9);
  border: 4px solid #c896fa;
  border-radius: 15px;
  cursor: pointer;
  white-space: nowrap;
  transform: skew(-15deg);
  transition: all 0.4s ease;
  box-shadow:
    0 0 5px #d8b4fe,
    0 0 10px #c896fa,
    0 0 15px #c896fa,
    0 0 20px #a855f7,
    inset 0 0 5px rgba(200, 150, 250, 0.3),
    inset 0 2px 2px rgba(255, 255, 255, 0.2),
    inset 0 -2px 2px rgba(139, 69, 19, 0.1);
}

.generate-btn > * {
  transform: skew(15deg);
}

.generate-btn.inactive {
  background: rgba(128, 128, 128, 0.1);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.7);
  border: 4px solid rgba(128, 128, 128, 0.3);
  cursor: not-allowed;
  box-shadow:
    0 0 1px rgba(128, 128, 128, 0.2),
    inset 0 0 1px rgba(128, 128, 128, 0.1);
}

.generate-btn.active {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.9);
  border: 4px solid #ffd200;
  cursor: pointer;
  box-shadow:
    0 0 5px #ffd200,
    0 0 10px #ffd200,
    0 0 15px #ffd200,
    0 0 20px #ffed4e,
    inset 0 0 5px rgba(255, 210, 0, 0.3),
    inset 0 2px 2px rgba(255, 255, 255, 0.2),
    inset 0 -2px 2px rgba(139, 69, 19, 0.1);
}

.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.7) !important;
}

.generate-btn:hover:not(:disabled):not(.inactive) {
  background: #ffd200;
  transform: skew(-15deg) translateY(-1px);
  border-color: #ffd200;
  color: #333;
  box-shadow:
    0 0 8px #ffd200,
    0 0 15px #ffd200,
    0 0 25px #ffd200,
    0 0 35px #ffed4e,
    inset 0 0 8px rgba(255, 210, 0, 0.4),
    inset 0 3px 3px rgba(255, 255, 255, 0.3),
    inset 0 -3px 3px rgba(139, 69, 19, 0.2);
}

.help-text {
 text-align: center;
 font-size: 14px;
 color: #fff;
 margin-bottom: 15px;
 font-style: italic;
 text-shadow:
   0 0 5px rgba(0, 0, 0, 1),
   0 0 10px rgba(0, 0, 0, 0.95), 
   0 0 20px rgba(0, 0, 0, 0.8);
 font-weight: 500;
}

.prompt-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  max-height: 250px;
  overflow-y: auto;
  padding: 10px;
}

.prompt-btn {
  padding: 8px 16px;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 210, 0, 0.6);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.4s ease;
  text-align: left;
  transform: skew(-15deg);
  margin: 1px 2px;
  white-space: nowrap;
  width: fit-content;
  box-shadow:
    0 0 3px rgba(255, 210, 0, 0.4),
    0 0 6px rgba(255, 210, 0, 0.2),
    inset 0 0 2px rgba(255, 255, 255, 0.2);
}

.prompt-btn > * {
  transform: skew(15deg);
}

.prompt-btn:hover,
.prompt-btn:focus {
  background: #ffd200;
  transform: skew(-8deg) translateY(-1px);
  color: #333;
  border: 2px solid #ffd200;
  box-shadow:
    0 0 4px #ffd200,
    0 0 8px #ffd200,
    0 0 12px #ffd200,
    0 0 16px #ffed4e,
    inset 0 0 4px rgba(255, 210, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    inset 0 -1px 1px rgba(139, 69, 19, 0.2);
}

.thinking-indicator {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  padding: 15px 20px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 5px rgba(200, 150, 250, 0.4),
    0 0 10px rgba(200, 150, 250, 0.2),
    inset 0 0 2px rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 20;
  font-size: 14px;
}

.thinking-indicator.visible {
  display: block;
  opacity: 1;
}

.energy-orb {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  background: radial-gradient(circle, #64dce1 0%, #4fc3c7 50%, #3ba5a8 100%);
  box-shadow:
    0 0 20px #64dce1,
    0 0 40px #64dce1,
    0 0 60px #64dce1;
}

.restart-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  color: rgba(255, 255, 255, 0.9);
  border: 3px solid #ffd200;
  border-radius: 12px;
  cursor: pointer;
  z-index: 300;
  transition: all 0.3s ease;
  transform: skew(-15deg);
  box-shadow:
    0 0 5px #ffd200,
    0 0 10px #ffd200,
    0 0 15px #ffd200;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
}

.restart-btn > * {
  transform: skew(15deg);
}

.restart-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.skip-btn-dialog {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  color: rgba(255, 255, 255, 0.9);
  border: 3px solid #ffd200;
  border-radius: 12px;
  cursor: pointer;
  z-index: 300;
  transition: all 0.3s ease;
  transform: skew(-15deg);
  box-shadow:
    0 0 5px #ffd200,
    0 0 10px #ffd200,
    0 0 15px #ffd200;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
}

.skip-btn-dialog.visible {
  opacity: 1;
  pointer-events: auto;
}

.skip-btn-dialog:hover,
.skip-btn-dialog:focus {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-color: #ffd200;
  box-shadow:
    0 0 8px #ffd200,
    0 0 15px #ffd200,
    0 0 25px #ffed4e;
}

.restart-btn:hover,
.restart-btn:focus {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-color: #ffd200;
  box-shadow:
    0 0 8px #ffd200,
    0 0 15px #ffd200,
    0 0 25px #ffed4e;
}

/* Credits */
.credits {
  position: fixed;
  bottom: 10px;
  right: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-style: italic;
  z-index: 100;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  max-width: 200px;
  text-align: right;
  line-height: 1.2;
}

.pdf-preview {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-2deg) scale(0.85);
  background: white;
  padding: 40px 30px;
  border-radius: 8px;
  width: 60%;
  max-width: 600px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}

.pdf-preview.visible {
  opacity: 1;
  pointer-events: auto;
  animation: fadeInLetter 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#generatedImageContainer {
  position: absolute;
  bottom: -200px;
  right: -120px;
  width: 500px;
  height: 281px;
  z-index: 50;
  transform: rotate(2deg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#generatedImageContainer.visible {
  opacity: 1;
  pointer-events: auto;
  animation: fadeInImageContainer 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInImageContainer {
  0% {
    opacity: 0;
    transform: rotate(2deg) scale(0.8) translateY(20px);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: rotate(2deg) scale(1) translateY(0px);
    filter: blur(0px);
  }
}

.image-countdown {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border: 3px solid #c896fa;
  border-radius: 12px;
  box-shadow:
    0 0 5px #d8b4fe,
    0 0 10px #c896fa,
    0 0 15px #c896fa,
    0 0 20px #a855f7,
    inset 0 0 5px rgba(200, 150, 250, 0.3),
    inset 0 2px 2px rgba(255, 255, 255, 0.2),
    inset 0 -2px 2px rgba(139, 69, 19, 0.1);
}

.countdown-content {
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
}

.countdown-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.4);
}

.countdown-timer {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 8px;
  text-shadow: 
    0 0 10px #c896fa,
    0 0 20px #c896fa,
    0 0 30px #a855f7;
  animation: pulse 2s infinite;
}

.countdown-subtext {
  font-size: 14px;
  opacity: 0.8;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.6);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes fadeInStamp {
  0% {
    opacity: 0;
    transform: scale(1.5) rotate(15deg);
  }
  80% {
    opacity: 1;
    transform: scale(0.9) rotate(5deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(2deg);
  }
}

@keyframes fadeInLetter {
  0% {
    opacity: 0;
    transform: translate(-50%, -60%) rotate(-5deg) scale(0.3);
    filter: blur(8px);
  }
  30% {
    opacity: 0.3;
    transform: translate(-50%, -55%) rotate(-3deg) scale(0.6);
    filter: blur(4px);
  }
  60% {
    opacity: 0.8;
    transform: translate(-50%, -52%) rotate(-1deg) scale(0.95);
    filter: blur(1px);
  }
  85% {
    opacity: 1;
    transform: translate(-50%, -48%) rotate(0deg) scale(1.05);
    filter: blur(0px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-2deg) scale(0.85);
    filter: blur(0px);
  }
}

#generatedImageContainer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  opacity: 0;
}

#generatedImageContainer img.visible {
  animation: fadeInStamp 0.6s ease-out forwards;
}

.pdf-preview p {
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  margin: 0;
  z-index: 1;
  position: relative;
}

.pdf-preview a {
  color: #C896FA;
  text-decoration: none;
  position: relative;
  transition: all 0.3s ease;
}

.pdf-preview a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #C896FA;
  transition: width 0.3s ease;
}

.pdf-preview a:hover::after {
  width: 100%;
}

.signature {
  margin-top: 20px;
  text-align: right;
  font-size: 36px;
  color: #000 !important;
  z-index: 1 !important;
  position: relative !important;
  background: white;
  padding: 5px;
  display: block !important;
  width: fit-content;
  margin-left: auto;
  margin-right: 0;
}

.pdf-footer {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: 10px;
  color: #666;
  font-family: 'Arial', sans-serif;
  z-index: 200;
  opacity: 0.7;
}

/* Hide mobile button on desktop */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  /* Show mobile button, hide desktop button */
  .mobile-only {
    display: block !important;
  }
  
  .desktop-only {
    display: none !important;
  }
  .intro-dialog-container {
    width: 95vw;
    bottom: 33%;
  }
  
  .dialog-bubble {
    padding: 20px;
    border-radius: 15px;
  }
  
  .dialog-text {
    font-size: 16px;
  }
  
  .dialog-next-btn {
    padding: 10px 20px;
    font-size: 14px;
  }

    .email-collection-section {
    width: 95vw;
  }
  
  .email-collection-section .input-container {
    align-items: center;
  }
  
    .name-fields-row input, 
  #emailInput {
    box-sizing: border-box;
  }
  
  .name-fields-row, 
  .name-fields-row input, 
  #emailInput {
    width: 100%;
  }

  .input-section {
    width: 95vw;
    padding: 20px;
    bottom: 5%;
  }

  .prompt-buttons {
    grid-template-columns: 1fr;
    max-height: 150px;
  }

  .input-container {
    flex-direction: column;
  }

      input[type="text"],
  input[type="email"] {
    box-sizing: border-box;
    min-width: 100%;
    flex-basis: 100%;
  }
  
  .name-fields-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .name-fields-row input[type="text"] {
    min-width: 100%;
    flex: none;
  }

  .envelope-container {
    width: 90vw;
    max-width: 400px;
    height: auto;
    aspect-ratio: 1.5;
  }

  .letter-final {
    width: 90vw;
    max-width: 90vw;
    padding: 30px 20px;
  }

  .envelope-tooltip {
    font-size: 10px;
    padding: 6px 10px;
  }
  
    .image-countdown {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  
    .pdf-preview {
    padding-bottom: 120px;
    position: relative;
    width: 90vw;
    max-width: none;
    height: auto;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  #generatedImageContainer {
    position: absolute;
    width: 150px;
    height: 84px;
    bottom: 10px;
    right: 10px;
    transform: rotate(5deg);
  }

  .openday-btn {
    position: fixed;
    bottom: 60px;
    left: 35px;
    right: 35px;
    transform: skew(-15deg);
    width: calc(100vw - 70px);
    height: auto;
    padding: 14px 20px;
    font-size: 14px;
    z-index: 999;
    border-radius: 15px;
    max-width: calc(100vw - 70px);
    text-align: center;
    line-height: 1.3;
    font-weight: 600;
    white-space: normal;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.9);
    border: 4px solid #ffd200;
    cursor: pointer;
    transition: all 0.4s ease;
    opacity: 0;
    transform: skew(-15deg) translateY(20px);
    pointer-events: none;
    box-shadow: 0 0 5px #ffd200,
      0 0 10px #ffd200,
      0 0 15px #ffd200,
      0 0 20px #ffed4e,
      inset 0 0 5px rgba(255, 210, 0, 0.3),
      inset 0 2px 2px rgba(255, 255, 255, 0.2),
      inset 0 -2px 2px rgba(139, 69, 19, 0.1);
  }
  
  .openday-btn > * {
    transform: skew(15deg);
  }
  
  .openday-btn:hover {
    background: #ffd200;
    color: #333;
    border-color: #ffd200;
    transform: skew(-15deg) translateY(-2px) scale(1.05);
    box-shadow:
      0 0 8px #ffd200,
      0 0 15px #ffd200,
      0 0 25px #ffd200,
      0 0 35px #ffed4e,
      inset 0 0 8px rgba(255, 210, 0, 0.4),
      inset 0 3px 3px rgba(255, 255, 255, 0.3),
      inset 0 -3px 3px rgba(139, 69, 19, 0.2);
  }
  
  .openday-btn.visible {
    opacity: 1;
    transform: skew(-15deg) translateY(0) scale(1);
    pointer-events: auto;
    animation: fadeInScaleUp 0.5s ease-in-out;
  }

  .pdf-preview p {
    margin-bottom: 20px;
  }

  .signature {
    margin-top: 10px;
    margin-bottom: 20px;
  }

  #generatedImageContainer {
    position: relative !important;
    width: 90% !important;
    height: auto !important;
    aspect-ratio: 16/9;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
    margin-top: 20px;
  }
  
  #generatedImageContainer.visible {
    animation: fadeInImageContainerMobile 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  
  .countdown-text {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  .countdown-timer {
    font-size: 36px;
  }
  
  .countdown-subtext {
    font-size: 12px;
  }
}

@keyframes fadeInImageContainerMobile {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0px);
    filter: blur(0px);
  }
}

@keyframes fadeInScaleUpMobile {
  from {
    opacity: 0;
    transform: skew(-15deg) translateY(20px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: skew(-15deg) translateY(0) scale(1);
  }
}

@keyframes fadeInFAB {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.3);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* Letter Final Presentation */
.letter-final {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: #ffffff;
  padding: 40px 30px;
  border-radius: 8px;
  width: 60%;
  max-width: 600px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 100;
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Georgia', serif;
  line-height: 1.6;
  color: #333;
}

.letter-final::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../resources/crinkled-paper-texture.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.03;
  border-radius: 8px;
  pointer-events: none;
}

.letter-final.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.letter-final .signature {
  margin-top: 30px;
  text-align: right;
  font-size: 48px;
  color: #000;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
  position: relative;
  z-index: 1;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
  backdrop-filter: blur(5px);
  transition: display 0.3s;
}

.modal.visible {
    display: block;
}

@keyframes zoomIn {
  from {transform: translate(-50%, -50%) scale(0)}
  to {transform: translate(-50%, -50%) scale(1)}
}

.modal.visible .modal-content {
  animation: zoomIn 0.3s ease-out;
}

.modal-content {
  margin: auto;
  display: block;
  width: 90%;
  max-width: 80vh;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

@media (orientation: portrait) {
  #background-container {
    background-image: url('../resources/bg_nopanda_vertical.jpg');
  }
}

@media (orientation: landscape) {
  #background-container {
    background-image: url('../resources/bg_nopanda_horizontal.jpg');
  }
}

/* OpenDay Button Styles - Desktop */
@media (min-width: 769px) {
  .openday-btn {
    position: absolute;
    bottom: -80px;
    left: -50px;
    padding: 24px 48px;
    max-width: 280px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.9);
    border: 4px solid #ffd200;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transform: skew(-15deg);
    transition: all 0.4s ease;
    white-space: normal;
    line-height: 1.3;
    text-align: center;
    z-index: 20;
    opacity: 0;
    transform: skew(-15deg) translateY(20px);
    pointer-events: none;
    box-shadow: 0 0 5px #ffd200,
      0 0 10px #ffd200,
      0 0 15px #ffd200,
      0 0 20px #ffed4e,
      inset 0 0 5px rgba(255, 210, 0, 0.3),
      inset 0 2px 2px rgba(255, 255, 255, 0.2),
      inset 0 -2px 2px rgba(139, 69, 19, 0.1);
  }

  .openday-btn > * {
    transform: skew(15deg);
  }

  .openday-btn.visible {
    opacity: 1;
    transform: skew(-15deg) translateY(0) scale(1);
    pointer-events: auto;
    animation: fadeInScaleUp 0.5s ease-in-out;
  }

  .openday-btn:hover {
    background: #ffd200;
    color: #333;
    border-color: #ffd200;
    transform: skew(-15deg) translateY(-2px) scale(1.05);
    box-shadow:
      0 0 8px #ffd200,
      0 0 15px #ffd200,
      0 0 25px #ffd200,
      0 0 35px #ffed4e,
      inset 0 0 8px rgba(255, 210, 0, 0.4),
      inset 0 3px 3px rgba(255, 255, 255, 0.3),
      inset 0 -3px 3px rgba(139, 69, 19, 0.2);
  }

  .openday-btn:active {
    transform: skew(-15deg) translateY(0) scale(1);
    box-shadow:
      0 0 5px #ffd200,
      0 0 10px #ffd200,
      0 0 15px #ffd200,
      0 0 20px #ffed4e,
      inset 0 0 5px rgba(255, 210, 0, 0.3),
      inset 0 2px 2px rgba(255, 255, 255, 0.2),
      inset 0 -2px 2px rgba(139, 69, 19, 0.1);
  }
}

/* Letter Concentration Overlay Styles */
.letter-envelope-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-2deg) scale(0.85);
  width: 100vw;
  height: 100vh;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.letter-envelope-overlay.visible {
  opacity: 1;
  pointer-events: auto;
  animation: fadeInLetter 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.letter-envelope-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
  animation: fadeOutOverlay 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.letter-envelope-overlay .envelope-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.letter-envelope-overlay .envelope-image {
  width: 80vw;
  max-width: 800px;
  min-width: 600px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
  animation: envelopeBreathe 3s infinite ease-in-out;
  transition: all 0.6s ease;
}

.letter-envelope-overlay.opening .envelope-image {
  transform: scale(1.1);
  opacity: 0.8;
}

.letter-envelope-overlay .envelope-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) skew(-15deg);
  padding: 20px 50px;
  font-size: 24px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.9);
  border: 4px solid #ffd200;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.4s ease;
  z-index: 10;
  box-shadow:
    0 0 8px #ffd200,
    0 0 15px #ffd200,
    0 0 25px #ffd200,
    0 0 35px #ffed4e,
    inset 0 0 8px rgba(255, 210, 0, 0.3),
    inset 0 3px 3px rgba(255, 255, 255, 0.2),
    inset 0 -3px 3px rgba(139, 69, 19, 0.1);
}

.letter-envelope-overlay .envelope-btn:hover {
  background: #ffd200;
  color: #333;
  border-color: #ffd200;
  transform: translate(-50%, -50%) skew(-15deg) translateY(-3px) scale(1.05);
  box-shadow:
    0 0 12px #ffd200,
    0 0 20px #ffd200,
    0 0 30px #ffd200,
    0 0 40px #ffed4e,
    inset 0 0 10px rgba(255, 210, 0, 0.4),
    inset 0 4px 4px rgba(255, 255, 255, 0.3),
    inset 0 -4px 4px rgba(139, 69, 19, 0.2);
}

.letter-envelope-overlay .envelope-btn:active {
  transform: translate(-50%, -50%) skew(-15deg) scale(0.95);
  box-shadow:
    0 0 6px #ffd200,
    0 0 12px #ffd200,
    0 0 18px #ffd200,
    0 0 24px #ffed4e,
    inset 0 0 6px rgba(255, 210, 0, 0.3),
    inset 0 2px 2px rgba(255, 255, 255, 0.2),
    inset 0 -2px 2px rgba(139, 69, 19, 0.1);
}

.letter-envelope-overlay .envelope-btn > * {
  transform: skew(15deg);
}

@keyframes concentrationPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 10px #d8b4fe,
      0 0 20px #c896fa,
      0 0 30px #c896fa,
      0 0 40px #a855f7,
      inset 0 0 10px rgba(200, 150, 250, 0.3),
      inset 0 4px 4px rgba(255, 255, 255, 0.2),
      inset 0 -4px 4px rgba(139, 69, 19, 0.1);
  }
  50% {
    transform: scale(1.02);
    box-shadow:
      0 0 15px #d8b4fe,
      0 0 30px #c896fa,
      0 0 45px #c896fa,
      0 0 60px #a855f7,
      inset 0 0 15px rgba(200, 150, 250, 0.4),
      inset 0 4px 4px rgba(255, 255, 255, 0.3),
      inset 0 -4px 4px rgba(139, 69, 19, 0.15);
  }
}

@keyframes fadeOutOverlay {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes envelopeBreathe {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
  }
  50% {
    transform: scale(1.01);
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.6));
  }
}

@keyframes envelopeToLetter {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
  }
  30% {
    transform: scale(1.05) rotate(2deg);
    opacity: 0.8;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.4));
  }
  70% {
    transform: scale(1.3) rotate(8deg);
    opacity: 0.2;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
  }
  100% {
    transform: scale(1.8) rotate(15deg);
    opacity: 0;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.1));
  }
}

/* Mobile responsiveness for envelope overlay */
@media (max-width: 768px) {
  .letter-envelope-overlay .envelope-image {
    width: 95vw;
    min-width: 400px;
    max-width: 600px;
  }
  
  .letter-envelope-overlay .envelope-btn {
    padding: 16px 40px;
    font-size: 20px;
    transform: translate(-50%, -50%) skew(-15deg);
  }
  
  .letter-envelope-overlay .envelope-btn:hover {
    transform: translate(-50%, -50%) skew(-15deg) translateY(-2px) scale(1.03);
  }
  
  .letter-envelope-overlay .envelope-btn:active {
    transform: translate(-50%, -50%) skew(-15deg) scale(0.97);
  }
}

/* Admin Credits */
.admin-credits {
  position: fixed;
  bottom: 10px;
  right: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-style: italic;
  z-index: 1000;
  max-width: 200px;
  text-align: right;
  line-height: 1.2;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  backdrop-filter: blur(5px);
}

.admin-credits a {
  color: #ffd200;
  text-decoration: none;
}

@keyframes fadeInScaleUp {
  from {
    opacity: 0;
    transform: skew(-15deg) translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: skew(-15deg) translateY(0) scale(1);
  }
}


