* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Avenir Next', 'Helvetica Neue', sans-serif;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe, #ede9fe, #dbeafe);
  background-size: 400% 400%;
  animation: bgShift 12s ease infinite;
}

@keyframes bgShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---- Game Screen ---- */

.game-screen {
  display: flex;
  height: 100%;
  width: 100%;
}

/* ---- Character Select Panel (left side) ---- */

.character-select-panel {
  width: 120px;
  min-width: 120px;
  height: 100%;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-right: 2px solid rgba(255, 255, 255, 0.9);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.char-select-btn {
  width: 90px;
  height: 90px;
  border-radius: 16px;
  border: 3px solid #e5e7eb;
  background: white;
  padding: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s, transform 0.15s;
}

.char-select-btn.active {
  border-width: 4px;
  transform: scale(1.05);
}

.char-select-btn img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.char-select-name {
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  margin-top: -4px;
  flex-shrink: 0;
}

/* ---- Clothing Panel (right side, single column, scrollable) ---- */

.clothing-panel {
  width: 260px;
  min-width: 260px;
  height: 100%;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-left: 2px solid rgba(255, 255, 255, 0.9);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.clothing-thumb {
  /* Width & height set by JS to match display scale */
  background: white;
  border-radius: 12px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e5e7eb;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  flex-shrink: 0;
}

.clothing-thumb:active {
  border-color: #3b82f6;
  background: #eff6ff;
}

.clothing-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* ---- Stage (center) ---- */

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1d4ed8;
  text-shadow: 1px 1px 0 #bfdbfe;
  padding: 10px 0 5px;
  flex-shrink: 0;
}

.character-area {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
}

.base-character {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* Clothing overlaid on character — free positioned */
.equipped-item {
  position: absolute;
  pointer-events: none;
}

.equipped-item img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Drag ghost */
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.8;
}

.drag-ghost img {
  width: 100%;
  height: 100%;
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  .character-select-panel {
    width: 80px;
    min-width: 80px;
    padding: 10px 6px;
  }

  .char-select-btn {
    width: 60px;
    height: 60px;
  }

  .char-select-name {
    font-size: 0.55rem;
  }

  .clothing-panel {
    width: 200px;
    min-width: 200px;
    padding: 14px 20px;
  }

  .title {
    font-size: 1.1rem;
  }
}
