.char-select-view {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  transition: opacity 600ms ease;
}

.char-select-view.is-fading-out {
  opacity: 0;
  pointer-events: none;
}

.char-select-stage {
  position: absolute;
  inset: 0 auto auto 0;
  transform-origin: top left;
  will-change: transform;
}

.char-select-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  isolation: isolate;
}

.char-select-ui {
  position: absolute;
  top: calc(50% - 48px);
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  pointer-events: none;
  user-select: none;
  z-index: 5;
  transition: opacity 500ms ease;
}

.char-select-bg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.char-select-dim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
  opacity: 1;
  transition: opacity 600ms ease;
}

.char-select-dim.is-cleared {
  opacity: 0;
}

.char-preview {
  position: absolute;
  z-index: 10;
  transform: translateX(-50%);
  pointer-events: none;
}

.char-preview-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  display: block;
  background: transparent;
}

.char-preview-name {
  font: 700 28px/1 sans-serif;
  color: #fff;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.char-preview-actions {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.char-ready-status {
  font: 700 18px/1 sans-serif;
  color: #d5d5d5;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.char-ready-status.is-ready {
  color: #a5ff70;
}

.char-confirm-btn {
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: rgba(15, 15, 15, 0.78);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font: 700 14px/1 sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}

.char-confirm-btn.is-active-side {
  border-color: #ffd54a;
}

.char-confirm-btn:hover {
  border-color: rgba(255, 255, 255, 0.85);
}

.char-grid-wrap {
  position: absolute;
  z-index: 10;
}

.char-grid-hotspots {
  position: absolute;
  inset: 0;
}

.char-slot {
  position: absolute;
  display: block;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 2px solid transparent;
  cursor: pointer;
}

.char-slot:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.char-slot.selected-p1 {
  border-color: #41b8ff;
}

.char-slot.selected-p2 {
  border-color: #ff5b7f;
}

.char-slot.selected-p1.selected-p2 {
  border-color: #ffd54a;
}

.char-slot.is-active-side {
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.char-slot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.char-clash-cta {
  position: absolute;
  left: 50%;
  bottom: 70px;
  z-index: 20;
  padding: 22px 72px;
  border: 3px solid #ffd54a;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffb347 0%, #ff7a1a 100%);
  color: #1a0a00;
  font: 900 44px/1 "Impact", "Arial Black", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.35);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.55),
    0 0 0 4px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px) scale(0.94);
  transition: opacity 320ms ease, transform 320ms cubic-bezier(0.22, 1.4, 0.36, 1);
}

.char-clash-cta.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
  animation: clash-cta-pulse 1.4s ease-in-out infinite;
}

.char-clash-cta:hover {
  border-color: #fff2b0;
  filter: brightness(1.08);
}

.char-clash-cta:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.char-clash-cta:active {
  transform: translate(-50%, 2px) scale(0.98);
  animation: none;
}

@keyframes clash-cta-pulse {
  0%, 100% {
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.55),
      0 0 0 4px rgba(0, 0, 0, 0.4),
      0 0 0 0 rgba(255, 213, 74, 0.55),
      inset 0 2px 0 rgba(255, 255, 255, 0.45);
  }
  50% {
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.55),
      0 0 0 4px rgba(0, 0, 0, 0.4),
      0 0 0 14px rgba(255, 213, 74, 0),
      inset 0 2px 0 rgba(255, 255, 255, 0.45);
  }
}
