body {
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at center, #1b1e2b 0%, #0e101a 100%);
  color: #f0e6ff;
  font-family: "Georgia", serif;
  overflow-x: hidden;
}

.lantern-frame {
  position: absolute;
  top: 0;
  left: 20px;
  width: 120px;
  height: 140px;

  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0px;
  z-index: 10;
}

.lantern-container {
  transform-origin: top center;
  animation: swing 4s ease-in-out infinite;
  width: 100px;
}

.lantern-container img {
  width: 100%;
  filter: drop-shadow(0 0 10px #ffcc66);
}

@keyframes swing {
  0%,
  100% {
    transform: rotate(2deg);
  }
  50% {
    transform: rotate(-2deg);
  }
}

.category-sidebar {
  position: absolute;
  top: 160px;
  left: 20px;
  max-width: 240px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.04);
}

.category-sidebar summary {
  font-size: 1.05rem;
  font-weight: bold;
  color: #f7f7ff;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.3s ease;
}

.category-sidebar details[open] > summary {
  color: #ffc;
}

.subcategory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 10px;
  transition: all 0.4s ease-in-out;
}

.subcategory {
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.subcategory:hover {
  background: rgba(255, 255, 255, 0.15);
}

.subcategory.active {
  background: rgba(255, 255, 255, 0.25);
}

.main-ui {
  margin-left: 300px;
  padding: 40px 20px 80px;
}

.generate-box {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.generate-button {
  padding: 10px 25px;
  font-size: 1.2rem;
  border: none;
  border-radius: 6px;
  background: #7a5ccc;
  color: white;
  cursor: pointer;
  transition: all 0.4s ease;
  opacity: 0;
}

.generate-button.active {
  opacity: 1;
  transition: opacity 1.5s ease-in-out;
}

.generate-button:disabled {
  background: #555;
  cursor: wait;
}

.names-log {
  margin-top: 20px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  border-top: 1px solid #333;
  font-size: 0.95rem;
  color: #ccc;
  text-align: left;
}

.support-text {
  margin-top: 30px;
  text-align: center;
  font-size: 0.9rem;
  color: #aaa;
}

.legal {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 0.7rem;
  color: #666;
  max-width: 250px;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .category-sidebar {
    position: static;
    max-width: 100%;
    margin: 0 auto;
    margin-top: 180px;
  }

  .main-ui {
    margin-left: 0;
    padding: 20px;
  }

  .lantern-frame {
    left: 50%;
    transform: translateX(-50%);
  }
}
.nickname-output {
  margin-top: 10px;
  font-size: 1.4rem;
  color: #fff;
  font-family: "Cinzel", serif;
  text-shadow: 0 0 3px #333;
}
.subcategory {
  cursor: pointer;
  padding: 6px 10px;
  margin: 4px;
  border-radius: 6px;
  background-color: #222;
  color: white;
  transition: background-color 0.2s ease;
}

.subcategory:hover {
  background-color: #444;
}

.subcategory.selected {
  background-color: #6c63ff;
  color: #fff;
}

.subcategory.disabled {
  opacity: 0.3;
  pointer-events: none;
}
/* History */
.history-panel {
  position: fixed;
  right: 20px;
  top: 60px;
  width: 250px;
  max-height: 400px;
  overflow-y: auto;
  background: #111;
  border: 2px solid #666;
  padding: 10px;
  z-index: 999;
}

.history-panel.hidden {
  display: none;
}

.history-entry {
  padding: 4px 8px;
  margin-bottom: 4px;
  background: #222;
  color: #eee;
  font-family: monospace;
  border-left: 3px solid #888;
  transition: background 0.3s;
}
.history-entry:hover {
  background: #333;
}

.history-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.6rem;
  cursor: pointer;
  color: #aaa;
  z-index: 999;
}
.progress-bar {
  width: 0%;
  height: 4px;
  background-color: #6c63ff;
  border-radius: 3px;
  margin-top: 12px;
  transition: width 6s linear;
  opacity: 0;
}

.progress-bar.active {
  opacity: 1;
}