.character-selector {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 300px;
  padding: 16px;
  background: rgba(32, 32, 36, 0.95);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #E60012; /* Nintendo Red Accent */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-family: 'Inter', system-ui, sans-serif;
  color: #fff;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

/* Play item HUD anchored to the right side of the character selector panel. */
.play-item-hud {
  position: absolute;
  left: calc(100% + 12px);
  bottom: 0;
  width: 208px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(24, 24, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px) saturate(150%);
}

.play-item-hud__title {
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(173, 229, 255, 0.95);
  margin-bottom: 8px;
}

.play-item-hud__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 26px;
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.play-item-hud__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.play-item-hud__icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.play-item-hud__icon-fallback {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.play-item-hud__label {
  font-size: 0.67rem;
  font-weight: 700;
  color: rgba(244, 248, 255, 0.96);
}

.play-item-hud__count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 900;
  color: #9fe4ff;
}

.character-selector:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  border-top-color: #ff1a2d;
}

.selector-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selector-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.character-selector__layout-toggle {
  flex-shrink: 0;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.character-selector__layout-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.character-selector__layout-toggle[aria-pressed="true"] {
  border-color: rgba(230, 0, 18, 0.45);
  background: rgba(230, 0, 18, 0.12);
}

/* Super-minimal: one dot toggles “shell + panel chrome” off; “+” restores. */
.character-selector__immersive-toggle {
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.character-selector__immersive-toggle:hover {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.character-selector__immersive-toggle[aria-pressed="true"] {
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(230, 0, 18, 0.4);
  background: rgba(230, 0, 18, 0.14);
  font-size: 0.78rem;
}

/* Immersive: hide every direct .app child except selector + map; inside map-wrap keep #map + #minimap-panel only. */
.app--play-immersive > :not(#character-selector-container):not(.map-wrap) {
  display: none !important;
}

.app--play-immersive .map-wrap > :not(#map):not(#minimap-panel):not(#play-fps):not(#play-bgm-toast):not(#play-immersive-hint) {
  display: none !important;
}

.app--play-immersive #character-selector-container .character-selector .player-alt-compact,
.app--play-immersive #character-selector-container .character-selector .play-pointer-mode-bar,
.app--play-immersive #character-selector-container .character-selector #character-social-numpad,
.app--play-immersive #character-selector-container .character-selector .search-container,
.app--play-immersive #character-selector-container .character-selector .character-selector__layout-toggle {
  display: none !important;
}

.app--play-immersive #character-selector-container .character-selector {
  width: auto;
  min-width: 0;
  max-width: min(280px, 92vw);
  padding: 8px 10px;
  gap: 0;
}

.app--play-immersive #character-selector-container .character-selector .selector-header {
  gap: 8px;
}

/* In immersive mode, keep move slots visible right under the header in a compact row. */
.app--play-immersive #character-selector-container .character-selector #player-moves-box {
  display: flex;
  gap: 4px;
  padding-top: 6px;
  border-top: none;
}

.app--play-immersive #character-selector-container .character-selector #player-moves-box .player-moves-title {
  display: none;
}

.app--play-immersive #character-selector-container .character-selector #player-moves-box .player-moves-list--slots {
  min-height: 0;
}

.player-preview-pill {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: radial-gradient(circle at top left, #5a5a6a, #2a2a32);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.player-preview-pill--no-portrait {
  opacity: 0.8;
}

.player-preview-pill .player-preview-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  image-rendering: auto;
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

.player-preview-pill:hover .player-preview-portrait {
  transform: scale(1.2);
}

.player-preview-pill .player-preview-portrait--hidden {
  visibility: hidden;
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.player-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.player-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.player-types {
  display: flex;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 2px;
}

.result-types {
  display: flex;
  gap: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Pokemon Type overrides for Character Selector context */
.character-selector .type-icon {
  width: auto;
  min-width: 44px;
  padding: 0 6px;
  margin-bottom: 0;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  text-shadow: 0 1px 1px rgba(0,0,0,0.8);
  font-size: 0.62rem;
  line-height: 1.4;
}

/* Altitude */
.player-alt-compact {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 20, 24, 0.6), rgba(10, 10, 14, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  flex-wrap: nowrap;
}

.player-alt-compact__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
}

.player-alt-compact__item--sea {
  flex: 1 1 0;
  flex-shrink: 0;
  min-width: 3.5rem;
}

.player-alt-compact__label {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.player-alt-compact__label--sea {
  color: #39f; /* Nintendo UI blue accent */
  letter-spacing: 0.14em;
}

.player-alt-compact__v {
  font-size: 0.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.player-alt-compact__v--sea {
  color: #cce4ff;
}

.player-alt-compact__dot {
  align-self: center;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

/* Right-click: field move vs debug */
.play-pointer-mode-bar {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

body.play-mode-active .character-selector .play-pointer-mode-bar {
  display: flex;
}

body.play-mode-active .character-selector.character-selector--minimal .play-pointer-mode-bar {
  display: none;
}

/* Minimal layout: hide species search and right-click mode bar */
.character-selector--minimal .search-container {
  display: none;
}

.play-pointer-mode-bar__label {
  opacity: 0.6;
  margin-right: 2px;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}

.play-pointer-mode-bar__opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.play-pointer-mode-bar__opt:hover {
  background: rgba(255, 255, 255, 0.1);
}

.play-pointer-mode-bar__opt input {
  accent-color: #E60012; /* Nintendo Red */
  transform: scale(1.1);
}

.player-moves-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.player-moves-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.player-field-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(127, 187, 255, 0.36);
  background: rgba(24, 44, 68, 0.42);
  color: rgba(221, 238, 255, 0.9);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#player-field-skill-label {
  color: #fff4bb;
}

.player-field-charge {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.player-field-charge__bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
}

.player-field-charge__segment {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.player-field-charge__segment.player-field-charge__segment--full {
  overflow: visible;
  z-index: 2;
}

.player-field-charge__fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(120, 210, 255, 0.95), rgba(255, 239, 155, 0.95));
  box-shadow: 0 0 8px rgba(130, 210, 255, 0.5);
}

/* Easing matches play-charge-levels.js (bar 1 ease-out, bars 2–3 ease-in). */
.player-field-charge__fill--1 {
  background: linear-gradient(90deg, rgba(120, 210, 255, 0.95), rgba(160, 230, 255, 0.95));
  box-shadow: 0 0 8px rgba(130, 210, 255, 0.5);
  transition: width 0.08s cubic-bezier(0.16, 1, 0.3, 1);
}

.player-field-charge__fill--2 {
  background: linear-gradient(90deg, rgba(255, 197, 116, 0.96), rgba(255, 225, 146, 0.96));
  box-shadow: 0 0 8px rgba(255, 203, 112, 0.48);
  transition: width 0.08s cubic-bezier(0.45, 0, 0.75, 1);
}

.player-field-charge__fill--3 {
  background: linear-gradient(90deg, rgba(255, 116, 116, 0.96), rgba(255, 165, 126, 0.96));
  box-shadow: 0 0 8px rgba(255, 120, 120, 0.5);
  transition: width 0.08s cubic-bezier(0.45, 0, 0.75, 1);
}

/* Completed segment: pulse + gleam until charge is released (HUD hidden). */
@keyframes player-field-charge-shine-1 {
  0%,
  100% {
    filter: brightness(1.06);
    box-shadow:
      0 0 6px rgba(160, 230, 255, 0.85),
      0 0 16px rgba(100, 190, 255, 0.55),
      0 0 26px rgba(80, 170, 255, 0.35);
  }
  50% {
    filter: brightness(1.28);
    box-shadow:
      0 0 10px rgba(220, 248, 255, 0.95),
      0 0 22px rgba(130, 210, 255, 0.72),
      0 0 36px rgba(90, 180, 255, 0.45);
  }
}

@keyframes player-field-charge-shine-2 {
  0%,
  100% {
    filter: brightness(1.05);
    box-shadow:
      0 0 6px rgba(255, 215, 140, 0.82),
      0 0 14px rgba(255, 180, 90, 0.48);
  }
  50% {
    filter: brightness(1.26);
    box-shadow:
      0 0 10px rgba(255, 236, 190, 0.95),
      0 0 22px rgba(255, 200, 110, 0.62);
  }
}

@keyframes player-field-charge-shine-3 {
  0%,
  100% {
    filter: brightness(1.05);
    box-shadow:
      0 0 6px rgba(255, 150, 130, 0.82),
      0 0 14px rgba(255, 100, 100, 0.45);
  }
  50% {
    filter: brightness(1.26);
    box-shadow:
      0 0 10px rgba(255, 200, 180, 0.92),
      0 0 22px rgba(255, 120, 110, 0.58);
  }
}

.player-field-charge__fill--1.player-field-charge__fill--full {
  animation: player-field-charge-shine-1 1.15s ease-in-out infinite;
}

.player-field-charge__fill--2.player-field-charge__fill--full {
  animation: player-field-charge-shine-2 1.15s ease-in-out infinite;
}

.player-field-charge__fill--3.player-field-charge__fill--full {
  animation: player-field-charge-shine-3 1.15s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .player-field-charge__fill.player-field-charge__fill--full {
    animation: none;
    filter: brightness(1.12);
  }
}

.player-field-charge__label {
  font-size: 0.58rem;
  color: rgba(225, 240, 255, 0.92);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 700;
}

.player-moves-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* League-style skill row: fixed slot size so cooldown text never reflows the panel */
.player-moves-list--slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px 4px;
  min-height: 76px;
  align-items: start;
}

.move-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  cursor: default;
}

.move-slot--ultimate .move-slot__icon-wrap {
  border-color: rgba(200, 160, 255, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 10px rgba(160, 100, 255, 0.25);
}

.move-slot--ultimate.move-slot--on-cd .move-slot__icon-wrap {
  border-color: rgba(255, 184, 108, 0.55);
}

.move-slot__icon-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 9px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(155deg, #424250, #1c1c24);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.move-slot__icon-wrap::before {
  content: attr(data-abbrev);
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  z-index: 0;
}

.move-slot__icon-wrap:has(.move-slot__icon--missing)::before {
  display: flex;
}

.move-slot__icon {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.move-slot__icon--missing {
  display: none;
}

/* --cd-p = remaining cd / max (0–1); dark wedge shrinks as cooldown expires */
.move-slot__sweep {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: conic-gradient(
    from -90deg at 50% 50%,
    rgba(0, 0, 0, 0.78) 0deg,
    rgba(0, 0, 0, 0.78) calc(var(--cd-p, 0) * 360deg),
    transparent calc(var(--cd-p, 0) * 360deg)
  );
}

.move-slot__timer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #f5f8ff;
  text-shadow: 0 0 3px #000, 0 1px 2px #000;
  pointer-events: none;
  min-height: 1.2em;
}

.move-slot__key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.52rem;
  font-weight: 800;
  color: #9fd4ff;
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  word-break: break-word;
}

.move-slot__name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.56rem;
  font-weight: 700;
  color: rgba(235, 244, 255, 0.92);
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  word-break: break-word;
  text-wrap: balance;
}

/* Social numpad panel (integrated in character selector) */
.character-selector .play-social-overlay--panel.social-numpad-box {
  display: none;
  position: static;
  width: 100%;
  margin-top: 2px;
  padding: 10px 10px 9px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 10% -15%, rgba(120, 180, 255, 0.2), transparent 55%),
    rgba(10, 12, 20, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 6px 18px rgba(0, 0, 0, 0.32);
  pointer-events: none;
  opacity: 1;
  z-index: auto;
}

body.play-mode-active .character-selector .play-social-overlay--panel.social-numpad-box {
  display: block;
}

.character-selector .play-social-overlay-title {
  margin-bottom: 7px;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: rgba(194, 228, 255, 0.94);
}

.character-selector .play-social-overlay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.character-selector .play-social-overlay-item {
  position: relative;
  display: grid;
  grid-template-columns: 14px 30px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.character-selector .play-social-overlay-item.is-active {
  border-color: rgba(255, 92, 110, 0.85);
  background: linear-gradient(180deg, rgba(255, 80, 110, 0.28), rgba(255, 80, 110, 0.15));
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(255, 84, 110, 0.36);
}

.character-selector .play-social-overlay-item.is-active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.character-selector .play-social-overlay-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  font-weight: 900;
  color: rgba(162, 206, 255, 0.95);
}

.character-selector .play-social-overlay-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: rgba(244, 248, 255, 0.96);
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-selector .play-social-overlay-figure {
  position: relative;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-selector .play-social-overlay-portrait {
  width: 26px;
  height: 26px;
  object-fit: contain;
  image-rendering: auto;
}

.character-selector .play-social-overlay-emoji-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  line-height: 1;
  filter: saturate(1.05) brightness(1.04);
  pointer-events: none;
}

.character-selector .play-social-overlay-emoji-fallback.is-hidden {
  display: none;
}

.character-selector .play-social-overlay-last {
  margin-top: 7px;
  min-height: 1.2em;
  font-size: 0.58rem;
  font-weight: 700;
  color: rgba(195, 241, 205, 0.95);
  letter-spacing: 0.02em;
}

.search-container {
  position: relative;
  margin-top: 4px;
}

.selector-search {
  width: 100%;
  padding: 10px 12px 10px 34px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.selector-search::placeholder {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 500;
}

.selector-search:focus {
  background: rgba(0, 0, 0, 0.5);
  border-color: #E60012;
  box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  opacity: 0.6;
  pointer-events: none;
}

.results-list {
  max-height: 250px;
  overflow-y: auto;
  border-radius: 10px;
  display: none;
  background: rgba(20, 20, 24, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.results-list.active {
  display: block;
  animation: slideDown 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
  transform-origin: top;
}

@keyframes slideDown {
  from { opacity: 0; transform: scaleY(0.95); }
  to { opacity: 1; transform: scaleY(1); }
}

.result-item {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.result-item.selected {
  background: linear-gradient(90deg, rgba(230, 0, 18, 0.15), rgba(230, 0, 18, 0.02));
  border-left: 4px solid #E60012;
}

.result-portrait-mask {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: radial-gradient(circle at center, #3a3a44, #1a1a20);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.result-icon-portrait {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 22%;
  image-rendering: auto;
  transform: scale(1.1);
}

.result-icon-portrait--pending {
  opacity: 0.35;
  transform: scale(1);
}

.result-icon-portrait--missing {
  opacity: 0;
  pointer-events: none;
}

.result-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.result-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.result-id {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.3);
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 10px;
}

/* Custom Scrollbar */
.results-list::-webkit-scrollbar {
  width: 8px;
}
.results-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 10px 10px 0;
}
.results-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  border: 2px solid rgba(20, 20, 24, 0.98);
}
.results-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}


/* ------------------ */

.type-icon {
	display: inline-block;
	width: 66px;
	margin-bottom: 4px;
	background: #dbdbdb;
	border: 1px solid #a3a3a3;
	border-radius: 4px;
	border: 1px solid rgba(0, 0, 0, .2);
	color: #fff;
	font-size: .75rem;
	font-weight: normal;
	line-height: 1.5rem;
	text-align: center;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, .7);
	text-transform: uppercase;
	transition: opacity .4s
}

.type-icon:hover,
.type-icon:active,
.type-icon:focus {
	color: #fff;
	text-decoration: none
}

.type-icon:link:hover,
.type-icon:link:active,
.type-icon:link:focus {
	opacity: .85
}

.type-normal {
	background-color: #aa9
}

.type-fire {
	background-color: #f42
}

.type-water {
	background-color: #39f
}

.type-electric {
	background-color: #fc3
}

.type-grass {
	background-color: #7c5
}

.type-ice {
	background-color: #6cf
}

.type-fighting {
	background-color: #b54
}

.type-poison {
	background-color: #a59
}

.type-ground {
	background-color: #db5
}

.type-flying {
	background-color: #89f
}

.type-psychic {
	background-color: #f59
}

.type-bug {
	background-color: #ab2
}

.type-rock {
	background-color: #ba6
}

.type-ghost {
	background-color: #66b
}

.type-dragon {
	background-color: #76e
}

.type-dark {
	background-color: #754
}

.type-steel {
	background-color: #aab
}

.type-fairy {
	background-color: #e9e
}

.type-curse {
	background-color: #698
}

.data-table .type-icon,
.vitals-table .type-icon {
	margin: 1px 0
}

.itype {
	color: #737373
}

.itype.normal {
	color: #797964
}

.itype.fire {
	color: #d52100
}

.itype.water {
	color: #0080ff
}

.itype.electric {
	color: #c90
}

.itype.grass {
	color: #5cb737
}

.itype.ice {
	color: #0af
}

.itype.fighting {
	color: #a84d3d
}

.itype.poison {
	color: #88447a
}

.itype.ground {
	color: #bf9926
}

.itype.flying {
	color: #556dff
}

.itype.psychic {
	color: #ff227a
}

.itype.bug {
	color: #83901a
}

.itype.rock {
	color: #a59249
}

.itype.ghost {
	color: #5454b3
}

.itype.dragon {
	color: #4e38e9
}

.itype.dark {
	color: #573e31
}

.itype.steel {
	color: #8e8ea4
}

.itype.fairy {
	color: #e76de7
}

.igame.red,
.igame.ruby,
.igame.firered,
.igame.y,
.igame.omega-ruby,
.igame.shield {
	color: #c03028
}

.igame.blue,
.igame.sapphire,
.igame.x,
.igame.alpha-sapphire,
.igame.sword {
	color: #5d81d6
}

.igame.yellow,
.igame.lets-go-pikachu {
	color: #d6b11f
}

.igame.gold,
.igame.heartgold {
	color: #ad9551
}

.igame.silver,
.igame.platinum,
.igame.soulsilver,
.igame.white,
.igame.white-2 {
	color: #9797ab
}

.igame.crystal {
	color: #87bfbf
}

.igame.leafgreen,
.igame.legends-arceus {
	color: #65a843
}

.igame.emerald {
	color: #909e1b
}

.igame.diamond,
.igame.brilliant-diamond {
	color: #8471bd
}

.igame.pearl,
.igame.shining-pearl {
	color: #de4f7a
}

.igame.black,
.igame.black-2 {
	color: #574438
}

.igame.sun,
.igame.ultra-sun {
	color: #db8624
}

.igame.moon,
.igame.ultra-moon {
	color: #7038f8
}

.igame.lets-go-eevee {
	color: #ac8639
}

.igame.scarlet {
	color: #a12721
}

.igame.violet {
	color: #9621a1
}