/* Phase 4 character system and outfit locker. */
.character-card {
  width: min(470px, 96vw);
}
.character-copy,
.character-summary {
  text-align: center;
  font-size: 0.6rem;
  line-height: 1.5;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.72);
}
.character-summary {
  color: var(--neon);
  margin: 8px 0 12px;
}
.character-outfit-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0 16px;
}
.character-outfit {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  border: 1px solid rgba(0,255,157,0.24);
  border-radius: 12px;
  padding: 9px;
  color: #fff;
  background: linear-gradient(145deg, rgba(0,255,157,0.06), rgba(0,183,255,0.03));
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.character-outfit:hover:not(:disabled),
.character-outfit.selected {
  border-color: rgba(0,255,157,0.72);
  box-shadow: 0 0 18px rgba(0,255,157,0.18);
}
.character-outfit.locked {
  opacity: 0.42;
  cursor: not-allowed;
}
.character-outfit strong,
.character-outfit small {
  display: block;
}
.character-outfit strong {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.character-outfit small {
  margin-top: 4px;
  color: rgba(255,255,255,0.58);
  font-size: 0.52rem;
}
.character-outfit-swatch {
  position: relative;
  width: 34px;
  height: 47px;
  flex: 0 0 auto;
  border-radius: 14px 14px 9px 9px;
  background:
    linear-gradient(90deg, transparent 0 22%, var(--hoodie) 22% 78%, transparent 78%),
    linear-gradient(90deg, var(--pants) 0 43%, transparent 43% 57%, var(--pants) 57% 100%);
  background-size: 100% 29px, 100% 17px;
  background-position: 0 4px, 0 30px;
  background-repeat: no-repeat;
}
.character-outfit-swatch::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8f6f5f;
}
.character-outfit-swatch::after {
  content: "DOD";
  position: absolute;
  top: 17px;
  left: 8px;
  width: 18px;
  text-align: center;
  font-size: 5px;
  font-weight: 700;
  color: var(--accent);
}
.ctrl.dash {
  width: 72px;
  border-color: rgba(0,183,255,0.45);
}
.ctrl.dash:active {
  background: rgba(0,183,255,0.22);
}
@media (max-width: 480px) {
  .character-outfit-list { grid-template-columns: 1fr; }
  body.touch-ui .ctrl.dash { width: 82px; }
}

/* Phase 5 character form selector and scrolling fixes. */
.locker-card,
.character-card,
.missions-card {
  max-height: min(88vh, 720px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.character-option-section h4 {
  margin: 12px 0 7px;
  color: var(--neon);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.character-color-note {
  margin: -2px 0 8px;
  color: rgba(255,255,255,0.56);
  font-size: 0.52rem;
  line-height: 1.4;
}
.character-form-grid {
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:8px;
}
.character-form {
  border:1px solid rgba(0,255,157,0.25);
  border-radius:11px;
  padding:9px 6px;
  color:#fff;
  background:rgba(0,0,0,0.38);
  font-family:inherit;
  cursor:pointer;
  text-align:center;
}
.character-form.selected {
  border-color:var(--neon);
  background:rgba(0,255,157,0.12);
  box-shadow:0 0 16px rgba(0,255,157,0.14);
}
.character-form-icon {
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  margin:0 auto 6px;
  border-radius:50%;
  background:linear-gradient(135deg, rgba(0,255,157,0.25), rgba(0,183,255,0.15));
  color:#fff;
  font-weight:700;
}
.character-form strong { font-size:0.5rem; text-transform:uppercase; letter-spacing:0.04em; }
@media (max-width:480px) {
  .character-form-grid { grid-template-columns:1fr; }
}


/* Illustrated character pack */
.character-section-title { margin: 14px 0 8px; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--neon); }
.character-avatar-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; max-height:360px; overflow-y:auto; padding-right:4px; }
.character-avatar-card { border:1px solid rgba(0,255,157,.22); background:rgba(255,255,255,.035); color:#fff; border-radius:12px; padding:8px; display:flex; align-items:center; gap:8px; text-align:left; cursor:pointer; min-height:104px; }
.character-avatar-card:hover,.character-avatar-card.selected { border-color:var(--neon); box-shadow:0 0 18px rgba(0,255,157,.18); background:rgba(0,255,157,.08); }
.character-avatar-card img { width:56px; height:88px; object-fit:contain; object-position:center bottom; flex:0 0 auto; filter:drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.character-avatar-card span { min-width:0; display:flex; flex-direction:column; gap:4px; }
.character-avatar-card strong { font-size:.6rem; letter-spacing:.06em; text-transform:uppercase; }
.character-avatar-card small { font-size:.5rem; color:#9ca3af; line-height:1.25; }
@media (max-width:480px){ .character-avatar-grid{grid-template-columns:1fr;} .character-avatar-card{min-height:96px;} }

/* Character Pack v2: animated avatar previews. */
.character-avatar-preview {
  position: relative;
  width: 64px;
  height: 92px;
  flex: 0 0 auto;
  display: grid;
  place-items: end center;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 78%, rgba(0,255,157,.14), transparent 48%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.2));
}
.character-avatar-preview img {
  width: 58px;
  height: 90px;
  object-fit: contain;
  object-position: center bottom;
  transform-origin: 50% 100%;
  animation: dodAvatarPreviewIdle 2.4s ease-in-out infinite;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.38));
}
.character-avatar-card:nth-child(2n) .character-avatar-preview img { animation-delay: -.45s; }
.character-avatar-card:nth-child(3n) .character-avatar-preview img { animation-delay: -.9s; }
.character-avatar-card:hover .character-avatar-preview img,
.character-avatar-card.selected .character-avatar-preview img {
  animation: dodAvatarPreviewRun .54s ease-in-out infinite alternate;
}
.character-avatar-status {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 2px 4px;
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  border: 1px solid rgba(0,255,157,.45);
  color: var(--neon);
  font-size: .36rem;
  font-style: normal;
  letter-spacing: .08em;
  line-height: 1;
}
@keyframes dodAvatarPreviewIdle {
  0%, 100% { transform: translateY(0) rotate(-.6deg) scaleY(1); }
  45% { transform: translateY(-2px) rotate(.8deg) scaleY(1.012); }
  70% { transform: translateY(-1px) rotate(-.2deg) scaleY(.995); }
}
@keyframes dodAvatarPreviewRun {
  from { transform: translate(-2px, 0) rotate(-2deg) scale(.99, 1.015); }
  to { transform: translate(2px, -4px) rotate(2deg) scale(1.015, .985); }
}
body.reduced-motion .character-avatar-preview img { animation: none !important; }
