@import url("https://fonts.googleapis.com/css2?family=Padauk:wght@400;700&display=swap");

:root {
  --gold-glow: rgba(255, 223, 0, 0.8);
  --gold-shadow: rgba(255, 223, 0, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.15);
  --panel-bg: rgba(11, 13, 33, 0.85);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Padauk", sans-serif;
  touch-action: manipulation;
  user-select: none;
}

.power-by {
  position: fixed;
  background: #00000083;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: sans-serif;
  font-size: 11px;
  color: #ffffff;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 5px;
  text-align: right;
  line-height: 1.3;
}

#bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image: url("./access/B.webp");
}

@media (max-width: 768px) {
  #bg-layer {
    background-image: url("./access/MB.webp");
  }
}

/* Loading Screen Styles */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #0b0d21;
  transition: opacity 0.6s ease-out;
}

.loading-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6);
  z-index: 1;
}

.loading-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 85%;
  max-width: 400px;
  background: rgba(11, 13, 33, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--gold-glow);
  padding: 30px 20px;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
}

.loading-title {
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
  text-align: center;
}

.progress-container {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  overflow: hidden;
  padding: 2px;
  border: 1px solid rgba(255, 215, 0, 0.5);
  margin-bottom: 12px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff8c00, #ffd700);
  border-radius: 4px;
  transition: width 0.2s ease-out;
  box-shadow: 0 0 10px #ffd700;
}

.loading-percentage {
  color: #ffd700;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

#stars-container,
#fireworks-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
}
#stars-container {
  height: 100%;
}
#fireworks-container {
  height: 70%;
  z-index: 1;
}

.star {
  position: absolute;
  background-color: white;
  border-radius: 50%;
  animation: twinkle linear infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.firework-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: realisticExplode 2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes realisticExplode {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0.2);
    opacity: 0;
  }
}

.lantern-float-wrapper {
  position: absolute;
  bottom: 30%;
  pointer-events: auto;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
}

.lantern-hover-target {
  padding: 25px;
  cursor: pointer;
  transform-origin: center center;
  transform: scale(var(--base-scale, 1));
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lantern-hover-target:hover {
  transform: scale(calc(var(--base-scale, 1) * 1.25));
}

@keyframes floatFromThirtyPercent {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateY(-80vh);
    opacity: 0;
  }
}

@keyframes sway {
  0%,
  100% {
    transform: translateX(-15px) rotate(-3deg);
  }
  50% {
    transform: translateX(15px) rotate(3deg);
  }
}

.lantern-body {
  position: relative;
  animation: sway 4.5s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lantern-img {
  width: 65px;
  height: auto;
  filter: drop-shadow(0 0 15px rgba(255, 147, 41, 0.8));
}

.lantern-user .lantern-img {
  width: 85px;
  filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1));
}

/* Floating Action Buttons */
.action-btn-group {
  position: fixed;
  top: 25px;
  right: 25px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 50;
  align-items: flex-end;
}

.collapsible-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
}

.collapsible-controls.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.floating-btn {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--gold-glow);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: 0 4px 15px var(--gold-shadow);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 20px rgba(255, 223, 0, 0.8);
  transform: scale(1.1);
}

.floating-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.glass-modal {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 2px solid var(--gold-glow);
  box-shadow: 0 0 25px var(--gold-shadow);
  border-radius: 24px;
  padding: 40px 30px;
  width: 85%;
  max-width: 500px;
  text-align: center;
  transform: scale(0.8) translateY(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .glass-modal {
  transform: scale(1) translateY(0);
}

.help-modal-content {
  max-width: 550px;
  text-align: left;
  max-height: 85vh;
  overflow-y: auto;
}

.help-body {
  color: #fdf5e6;
  font-size: 14px;
  line-height: 1.6;
}

.help-section {
  margin-bottom: 15px;
}

.help-section h3 {
  color: #ffd700;
  font-size: 16px;
  margin-bottom: 4px;
}

.help-section ul {
  padding-left: 20px;
  margin: 5px 0;
}

.modal-title {
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.wish-input {
  width: 100%;
  background: #fdf5e6;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 18px;
  color: #333;
  outline: none;
  font-family: "Padauk", sans-serif;
  text-align: center;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
  transition: border-color 0.2s ease;
}

.wish-input.error {
  border-color: #ef4444;
}

.wish-display-text {
  color: #fdf5e6;
  font-size: 24px;
  line-height: 1.6;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  padding: 20px 10px;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9b71, #e74c3c);
  border: 2px solid #fff;
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
  transition: transform 0.2s;
  z-index: 10;
}
.close-btn:hover {
  transform: scale(1.1);
}

.launch-btn {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  border: 3px solid #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
  transition: transform 0.2s;
}
.launch-btn:hover {
  transform: translateX(-50%) scale(1.1);
}
.launch-icon {
  fill: #fff;
  width: 30px;
  height: 30px;
}

/* Settings Drawer Fixed */
.settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.settings-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.settings-drawer {
  position: absolute;
  right: 0;
  top: 0;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: var(--panel-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-left: 2px solid var(--gold-glow);
  padding: 55px 20px 20px 20px;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  color: #fff;
}
.settings-overlay.active .settings-drawer {
  transform: translateX(0);
}

.drawer-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #ffd700;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
  padding-bottom: 10px;
}

.settings-label {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
  color: #fdf5e6;
}

.add-wish-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 10px;
}
.add-wish-row {
  display: flex;
  gap: 8px;
}
.add-wish-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  outline: none;
  font-family: "Padauk", sans-serif;
  background: #fdf5e6;
  color: #333;
}
.add-wish-select, .add-wish-count {
  padding: 8px;
  border-radius: 8px;
  border: none;
  outline: none;
  font-family: "Padauk", sans-serif;
  background: #fdf5e6;
  color: #333;
}
.add-wish-btn {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  border: none;
  border-radius: 8px;
  padding: 8px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
}

.share-link-btn {
  width: 100%;
  background: linear-gradient(135deg, #00b09b, #96c93d);
  border: none;
  border-radius: 8px;
  padding: 10px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 15px;
  font-family: "Padauk", sans-serif;
  transition: transform 0.2s;
}
.share-link-btn:hover {
  transform: scale(1.02);
}

.clear-all-btn {
  width: 100%;
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid #ff6b6b;
  border-radius: 8px;
  padding: 8px;
  color: #ff6b6b;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 15px;
  font-family: "Padauk", sans-serif;
  transition: 0.2s;
}
.clear-all-btn:hover {
  background: #ff6b6b;
  color: #fff;
}

.wish-list-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 5px;
}
.wish-list-container::-webkit-scrollbar {
  width: 4px;
}
.wish-list-container::-webkit-scrollbar-thumb {
  background: var(--gold-glow);
  border-radius: 4px;
}

.wish-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.4;
}
.wish-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-right: 10px;
}
.wish-count-badge {
  font-size: 11px;
  color: #ffd700;
  margin-top: 2px;
}
.delete-btn {
  background: rgba(231, 76, 60, 0.2);
  color: #ff6b6b;
  border: 1px solid #ff6b6b;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  flex-shrink: 0;
}
.delete-btn:hover {
  background: #ff6b6b;
  color: #fff;
}
textarea.add-wish-input {
  resize: none;
  font-size: 13px;
  line-height: 1.4;
}