/* Web page: gamebox container */
.ct-gamebox {
  position: relative;
  min-height: 560px;
  width: 100%;
  aspect-ratio: 3 / 2;
  margin-bottom: 56px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 90%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 100% 100% at 50% 30%, rgba(34, 197, 94, 0.04) 0%, transparent 45%),
    radial-gradient(ellipse 100% 100% at 50% 50%, rgba(30, 58, 138, 0.15) 0%, transparent 65%),
    linear-gradient(180deg, #0c1222 0%, #1e293b 40%, #0f172a 70%, #0c1222 100%);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    inset 0 0 150px rgba(0, 0, 0, 0.25),
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(148, 163, 184, 0.1);
}

.ct-gamebox::before {
  content: "Character World";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #e7efff;
  background: rgba(34, 211, 238, 0.18);
  border: 1px solid rgba(34, 211, 238, 0.4);
  pointer-events: none;
  z-index: 3;
}

/* Cheerup overlay scoped to gamebox - transparent to show gamebox background */
.ct-gamebox #chrmOverlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: block;
  background: transparent !important;
  pointer-events: auto;
  overflow: visible;
}

.ct-gamebox #chrmCircleContainer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 300px;
  width: 300px;
  z-index: 11;
}

.ct-gamebox #chrmCircleContainer .chrmld-main {
  width: 300px;
  height: 300px;
  position: absolute;
}

.ct-gamebox #chrmCircleContainer .chrmld-sub {
  width: 100px;
  height: 100px;
  position: absolute;
}

.ct-gamebox #chrmCircleContainer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ct-gamebox #chrmBtn {
  position: absolute;
  bottom: 70px;
  right: 20px;
  height: 60px;
  width: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 12;
  display: block;
}

.ct-gamebox #chrmBtn img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.ct-gamebox #cs-addchrm {
  position: absolute;
  bottom: 12px;
  right: 20px;
  text-align: center;
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  background: royalblue;
  border-radius: 20px;
  z-index: 12;
  display: block;
}

#chrmExit {
  display: none;
}

/* Character picker modal */
#ct-char-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483648;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

#ct-char-picker-modal {
  background: rgba(15, 20, 35, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 24px;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

#ct-char-picker-modal h3 {
  color: #fff;
  margin: 0 0 12px;
  font-size: 18px;
}

#ct-char-picker-modal p {
  color: rgba(255, 255, 255, 0.8);
  margin: 8px 0;
  font-size: 14px;
}

#ct-current-characters,
#ct-select-characters {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 12px 0;
}

#ct-current-characters > div,
#ct-select-characters > div {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

#ct-select-characters > div:hover {
  border-color: #2196F3;
  transform: scale(1.05);
}

#ct-select-characters > div.selected {
  border: 3px solid #4CAF50;
  background-color: rgba(76, 175, 80, 0.2);
}

#ct-current-characters img,
#ct-select-characters img {
  width: 100%;
  max-width: 70px;
  height: auto;
  display: block;
  border-radius: 6px;
}

#ct-addchars-btn {
  margin-top: 16px;
  padding: 12px 20px;
  background: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
}

#ct-addchars-btn:disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.7;
}
