.tune-group-avatar,
.tune-group-debug {
  display: none !important;
}

.character-entry[hidden] {
  display: none !important;
}

/* Character sequence stage with a side column for explicit selection. */
.character-entry {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  color: #fff6df;
  background:
    radial-gradient(ellipse 60% 70% at 38% 58%, #3a2e1acc, transparent 70%),
    #080a08f0;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.character-entry[data-forced-landscape="true"] {
  inset: 50% auto auto 50%;
  width: 100dvh;
  height: 100dvw;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center;
}

.character-entry-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr);
  align-items: stretch;
  gap: clamp(12px, 3vw, 32px);
  width: min(960px, 100%);
  height: min(560px, 100%);
}

.character-entry-stage {
  position: relative;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #e5dfca url('../characters/selection/guide-stage-background.webp?v=20261030-1') center bottom / cover no-repeat;
  border: 1px solid #f0cf7b55;
  box-shadow: inset 0 0 22px #715b2924;
}

.character-entry-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: default;
}


.character-entry-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #ffe2a5;
  font-size: clamp(20px, 4vw, 34px);
  font-weight: 850;
  line-height: 1.45;
  text-align: center;
  white-space: pre-line;
  background:
    radial-gradient(circle at 50% 42%, #d6a84a18, transparent 42%),
    linear-gradient(145deg, #15130d, #252014);
  border: 1px dashed #f0cf7b94;
}
.character-entry-placeholder[hidden] { display: none; }

.character-entry-arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0 0 3px;
  margin-top: -20px;
  color: #ffe2a5;
  font-size: 28px;
  line-height: 1;
  background: #181710cc;
  border: 1px solid #f0cf7b94;
  border-radius: 50%;
  cursor: pointer;
}
.character-entry-prev { left: 12px; }
.character-entry-next { right: 12px; }
.character-entry-arrow:active { transform: scale(.94); }

.character-entry-loading {
  position: absolute;
  left: 50%;
  bottom: 14%;
  margin: 0;
  padding: 5px 12px;
  color: #ffe2a5;
  font-size: 12px;
  background: #0a0b08cc;
  border: 1px solid #f0cf7b55;
  border-radius: 999px;
  transform: translateX(-50%);
  white-space: nowrap;
}
.character-entry-loading[hidden] { display: none; }

.character-entry-info {
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
}

.character-entry-kicker {
  margin: 0;
  color: #ffe2a5;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.character-entry-info h1 {
  margin: 0;
  color: #fff6df;
  font-size: clamp(18px, 2.6vw, 26px);
  line-height: 1.3;
}

.character-entry-dots {
  display: grid;
  gap: 8px;
}

.character-entry-dot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  color: #fff6dfcc;
  font-size: 14px;
  text-align: left;
  background: #fff6df0b;
  border: 1px solid #ffedbe38;
  border-radius: 12px;
  cursor: pointer;
}
.character-entry-dot[data-selected="true"] {
  color: #fff6df;
  background: linear-gradient(145deg, #16836c52, #d6a84a33);
  border-color: #f0cf7bde;
}
.character-entry-dot-mark {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: #181710;
  font-size: 13px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffe2a5, #d6a84a);
  border-radius: 7px;
}

.character-entry-confirm {
  width: 100%;
  min-height: 44px;
  color: #fff8e8;
  font-size: 15px;
  font-weight: 820;
  background: linear-gradient(135deg, #16836c, #d6a84a);
  border: 1px solid #f0cf7bde;
  border-radius: 12px;
  cursor: pointer;
}
.character-entry-confirm:disabled { opacity: .55; cursor: default; }

.character-entry-error {
  min-height: 1.2em;
  margin: 0;
  color: #ffd0a0;
  font-size: 12px;
}
.character-entry-error:empty { display: none; }

.character-entry button:focus-visible {
  outline: 3px solid #fff6df;
  outline-offset: 3px;
}

/* Phones (landscape surface, including WeChat's rotated portrait). */
@media (max-height: 520px), (max-width: 520px) {
  .character-entry-card { gap: 10px; grid-template-columns: minmax(0, 1.4fr) minmax(180px, 1fr); }
  .character-entry-stage { border-radius: 14px; }
  .character-entry-arrow { width: 34px; height: 34px; margin-top: -17px; font-size: 24px; }
  .character-entry-info { gap: 8px; }
  .character-entry-info h1 { font-size: 17px; }
  .character-entry-dots { gap: 6px; }
  .character-entry-dot { min-height: 34px; font-size: 13px; }
  .character-entry-confirm { min-height: 40px; font-size: 14px; }
}
.character-entry[data-forced-landscape="true"] .character-entry-card {
  gap: 10px;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 1fr);
}

/* Narrow portrait windows without forced rotation stack the stage on top. */
@media (max-width: 520px) and (orientation: portrait) {
  .character-entry:not([data-forced-landscape="true"]) .character-entry-card {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
}

.character-entry, .character-entry * { box-sizing: border-box; }
.character-entry-canvas { -webkit-user-select: none; user-select: none; }
