@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Poppins:wght@300;400;500;600&display=swap');

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d0716;
  font-family: 'Poppins', sans-serif;
}

#canvas-holder { width: 100vw; height: calc(100vh - 92px); display: block; }
canvas { display: block; }

.task-menu-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 11;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(13, 7, 22, 0.78);
  color: #fdf3ff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.task-menu-btn:hover { transform: scale(1.06); }
.task-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(90deg, #ff2e88, #ffd23f);
  color: #0d0716;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 16px;
}

.info-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 11;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(13, 7, 22, 0.78);
  color: #fdf3ff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.info-btn:hover { transform: scale(1.06); }
.info-tooltip {
  position: fixed;
  top: 64px;
  left: 16px;
  z-index: 11;
  max-width: 240px;
  background: rgba(13, 7, 22, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fdf3ff;
  font-size: 12.5px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.info-tooltip.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

.task-dropdown {
  position: fixed;
  top: 68px;
  right: 16px;
  z-index: 11;
  width: 230px;
  background: rgba(13, 7, 22, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
  color: #fdf3ff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.task-dropdown.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.task-dropdown h2 {
  font-family: 'Bungee', cursive;
  font-size: 14px;
  font-weight: 400;
  background: linear-gradient(90deg, #ff2e88, #ffd23f, #00e5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.task-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }

.task {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 400;
  color: #e6d9f0;
  transition: color 0.4s ease, opacity 0.4s ease;
}

.task .box {
  width: 16px;
  height: 16px;
  border: 1.5px solid #00e5ff;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.task.done { color: #8a7a9a; text-decoration: line-through; opacity: 0.75; }
.task.done .box { background: #ff2e88; border-color: #ff2e88; }
.task.carrying .box { border-color: #ffd23f; box-shadow: 0 0 8px rgba(255,210,63,0.6); }

.hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(13, 7, 22, 0.65);
  color: #fdf3ff;
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 12px;
  letter-spacing: 0.3px;
  transition: opacity 0.6s ease;
  border: 1px solid rgba(255,46,136,0.25);
  max-width: 90vw;
  text-align: center;
}

.chime-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  background: rgba(13, 7, 22, 0.85);
  color: #ffd23f;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  border: 1px solid rgba(0,229,255,0.3);
}
.chime-toast.show { opacity: 1; transform: translateY(0); }

.avatar-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 15;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 210, 63, 0.5);
  background: rgba(13, 7, 22, 0.8);
  color: #ffd23f;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.avatar-btn:hover { transform: scale(1.08); }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(13, 7, 22, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 20px;
}
.overlay.show { display: flex; }

.panel {
  background: linear-gradient(160deg, #1c0f2e, #2a0e45);
  border: 1px solid rgba(255, 210, 63, 0.35);
  border-radius: 20px;
  padding: 34px 36px;
  text-align: center;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px rgba(255,46,136,0.1);
}
.panel h1 {
  font-family: 'Bungee', cursive;
  font-size: 21px;
  background: linear-gradient(90deg, #ff2e88, #ffd23f, #00e5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
}
.panel .sub {
  font-size: 13px;
  color: #cbb8de;
  margin-bottom: 22px;
}

.swatch-row { margin-bottom: 18px; text-align: left; }
.swatch-row .row-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #00e5ff;
  margin-bottom: 8px;
}
.style-options { display: flex; gap: 10px; }
.style-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0,229,255,0.35);
  background: rgba(255,255,255,0.03);
  color: #fdf3ff;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.style-btn.selected { border-color: #ff2e88; background: rgba(255,46,136,0.15); }

.gender-toggle { display: flex; gap: 8px; margin-bottom: 12px; }
.gender-btn {
  flex: 1;
  padding: 9px 0;
  border-radius: 10px;
  border: 1px solid rgba(0,229,255,0.35);
  background: rgba(255,255,255,0.03);
  color: #cbb8de;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.gender-btn.active { border-color: #ff2e88; background: rgba(255,46,136,0.18); color: #fdf3ff; }

.carousel { display: flex; align-items: center; justify-content: center; gap: 10px; }
.carousel-arrow {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0,229,255,0.35);
  background: rgba(255,255,255,0.04);
  color: #fdf3ff;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.carousel-arrow:hover { transform: scale(1.08); background: rgba(255,255,255,0.1); }
.carousel-stage { width: 220px; touch-action: pan-y; }
.carousel-thumb-wrap {
  width: 220px; height: 275px; border-radius: 12px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, rgba(255,210,63,0.12), rgba(13,7,22,0.4));
  border: 1px solid rgba(0,229,255,0.3);
  display: flex; align-items: center; justify-content: center;
}
.carousel-thumb { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 0.3s ease; }
.carousel-thumb.loaded { opacity: 1; }
.carousel-name { text-align: center; font-size: 17px; font-weight: 600; color: #fdf3ff; margin-top: 10px; }
.carousel-select-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px 0;
  border-radius: 10px;
  border: 1px solid rgba(255,210,63,0.4);
  background: rgba(255,255,255,0.03);
  color: #fdf3ff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.carousel-select-btn.picked { border-color: #ffd23f; background: rgba(255,210,63,0.18); }

.panel button.start-btn {
  margin-top: 6px;
  background: linear-gradient(90deg, #ff2e88, #ffd23f);
  color: #0d0716;
  border: none;
  padding: 12px 30px;
  border-radius: 24px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.panel button.start-btn:hover { transform: scale(1.05); }

.end-card p {
  font-size: 14px;
  color: #cbb8de;
  line-height: 1.6;
  margin-bottom: 22px;
}

.minimap {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 1px solid rgba(255,210,63,0.4);
  background: rgba(13,7,22,0.65);
  display: none;
}

.music-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 12;
  height: 92px;
  width: 100%;
  background: rgba(13, 7, 22, 0.94);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(0, 229, 255, 0.4);
  padding: 10px 20px;
  color: #fdf3ff;
  text-align: center;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.music-bar.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.music-bar-track { font-size: 13px; color: #ffd23f; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 10px; }
.dj-progress { width: 100%; height: 5px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.dj-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #ff2e88, #ffd23f); }
.music-bar-note { font-size: 11.5px; color: #cbb8de; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.joystick-base {
  position: fixed;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(13, 7, 22, 0.28);
  border: 2px solid rgba(0, 229, 255, 0.2);
  z-index: 15;
  display: none;
  touch-action: none;
}
.joystick-base.active-touch { display: block; }
.joystick-thumb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin-left: -26px;
  margin-top: -26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff2e88, #ffd23f);
  box-shadow: 0 0 14px rgba(255,46,136,0.5);
  pointer-events: none;
}

@media (max-width: 700px) {
  .joystick-base { width: 104px; height: 104px; }
  .joystick-thumb { width: 46px; height: 46px; margin-left: -23px; margin-top: -23px; }
}
