/* Claim search: the "Search claims by player" box, its list, the phone button
   and chip (js/claims.js). Colours come from the Explore theme tokens in
   explore.css (<body data-xp-theme>); positions are set by the script. */

body[data-xp-theme="cosmos"] {
  --xc-pin: #4aa8ff;
  --xc-mark: rgba(74, 168, 255, 0.3);
}

body[data-xp-theme="chill"] {
  --xc-pin: #1a90d4;
  --xc-mark: #cfe8f8;
}

.xc-bar,
.xc-fab,
.xc-chip,
.xc-results {
  position: fixed;
  z-index: 9600;
  box-sizing: border-box;
  font-family: "Nunito", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.xc *,
.xc *::before,
.xc *::after {
  box-sizing: border-box;
}

.xc [hidden],
.xc[hidden],
.xc-bar[hidden],
.xc-fab[hidden],
.xc-chip[hidden],
.xc-results[hidden] {
  display: none !important;
}

/* ---- The box ---- */

.xc-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 46px;
  padding: 0 5px 0 14px;
  border-radius: 999px;
  background: var(--xp-toggle-bg);
  border: 1px solid var(--xp-edge);
  box-shadow: var(--xp-shadow);
  color: var(--xp-muted);
}

.xc-bar:focus-within {
  border-color: var(--xp-brand);
}

.xc-lens {
  display: flex;
  flex-shrink: 0;
  margin-right: 4px;
}

.xc-input {
  flex-grow: 1;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--xp-text);
  font: inherit;
  /* 16px keeps phones from zooming in when the box gets focus. */
  font-size: 16px;
  font-weight: 800;
  -webkit-appearance: none;
  appearance: none;
}

.xc-input::placeholder {
  color: var(--xp-muted);
  opacity: 1;
  font-weight: 700;
}

.xc-input::-webkit-search-cancel-button,
.xc-input::-webkit-search-decoration {
  -webkit-appearance: none;
  display: none;
}

.xc-count {
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--xp-brand);
  color: var(--xp-on-brand);
  font-size: 12.5px;
  font-weight: 900;
}

.xc-kbd {
  flex-shrink: 0;
  margin-right: 8px;
  padding: 0 7px;
  border: 1px solid var(--xp-edge);
  border-radius: 6px;
  color: var(--xp-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
}

.xc-clear,
.xc-back,
.xc-up,
.xc-chip-x {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--xp-muted);
  cursor: pointer;
}

.xc-clear:hover,
.xc-back:hover,
.xc-up:hover,
.xc-chip-x:hover {
  background: var(--xp-card-hover);
  color: var(--xp-text);
}

.xc-back {
  display: none;
  color: var(--xp-ink);
}

/* On phones the box is a bar that opens over the switch, with a way back. */
.xc[data-mode="compact"] .xc-bar {
  padding-left: 4px;
  background: var(--xp-bg);
}

.xc[data-mode="compact"] .xc-back {
  display: flex;
}

.xc[data-mode="compact"] .xc-lens,
.xc[data-mode="compact"] .xc-kbd {
  display: none;
}

/* ---- The phone button and chip ---- */

.xc-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  background: var(--xp-toggle-bg);
  border: 1px solid var(--xp-edge);
  box-shadow: var(--xp-shadow);
  color: var(--xp-text);
  cursor: pointer;
}

.xc-chip {
  display: flex;
  align-items: center;
  height: 40px;
  padding-right: 3px;
  border-radius: 999px;
  background: var(--xp-toggle-bg);
  border: 1px solid var(--xp-brand);
  box-shadow: var(--xp-shadow);
}

.xc-chip-main {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 100%;
  padding: 0 6px 0 13px;
  border: 0;
  background: transparent;
  color: var(--xp-text);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.xc-chip-main svg {
  flex-shrink: 0;
  color: var(--xp-brand);
}

.xc-chip-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xc-chip-text b {
  color: var(--xp-ink);
  font-weight: 900;
}

.xc-chip-x {
  width: 32px;
  height: 32px;
}

/* ---- The list ---- */

.xc-results {
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  border-radius: 16px;
  background: var(--xp-bg);
  color: var(--xp-text);
  border: 1px solid var(--xp-edge);
  box-shadow: var(--xp-shadow);
  overflow: hidden;
}

.xc-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  min-height: 50px;
  padding: 8px 10px 6px 16px;
  font-size: 13px;
  font-weight: 800;
  color: var(--xp-muted);
}

.xc-sum-text {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.xc-sum.xc-picked {
  padding-left: 6px;
}

.xc-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.xc-who strong {
  font-family: "Lilita One", "Nunito", sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.1;
  color: var(--xp-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xc-who span {
  font-size: 12.5px;
  font-weight: 800;
}

.xc-fit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--xp-edge);
  background: transparent;
  color: var(--xp-text);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.xc-fit:hover {
  border-color: var(--xp-brand);
}

.xc-list {
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 2px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.xc-list li {
  display: block;
}

.xc-list li.xc-row {
  display: flex;
}

.xc-row {
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.xc-row:hover {
  background: var(--xp-card-hover);
}

.xc-row[aria-selected="true"] {
  background: var(--xp-card-sel);
  border-color: var(--xp-brand);
}

.xc-row[aria-current="true"] {
  background: var(--xp-card-sel);
}

.xc-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--xp-card);
  color: var(--xp-muted);
  font-family: "Lilita One", "Nunito", sans-serif;
  font-size: 16px;
}

.xc-head img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.xc-swatch {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--xp-card);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.18);
}

.xc-main {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.xc-name {
  font-family: "Lilita One", "Nunito", sans-serif;
  font-size: 18px;
  line-height: 1.2;
  color: var(--xp-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xc-name mark {
  border-radius: 3px;
  padding: 0 1px;
  background: var(--xc-mark);
  color: inherit;
}

.xc-name.xc-unnamed {
  color: var(--xp-muted);
}

.xc-sub {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--xp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xc-sub.xc-muted {
  font-weight: 700;
  color: var(--xp-muted);
}

.xc-side {
  display: flex;
  flex-shrink: 0;
  color: var(--xp-muted);
}

.xc-empty,
.xc-tip {
  margin: 2px 2px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--xp-card);
  color: var(--xp-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.xc-empty b {
  color: var(--xp-ink);
}

.xc-label {
  padding: 12px 10px 4px;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--xp-muted);
}

.xc-more {
  flex-shrink: 0;
  margin: 0 8px 10px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--xp-edge);
  background: var(--xp-card);
  color: var(--xp-text);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.xc button:focus-visible,
.xc-fab:focus-visible {
  outline: 3px solid var(--xp-brand);
  outline-offset: 2px;
}

/* The claim card reuses Explore's card (explore.css). */
.xp-pop-kick.xc-kick {
  color: var(--xp-blue);
}

/* Phones and tablets have no "/" key to hint at. */
@media (hover: none), (pointer: coarse) {
  .xc-kbd {
    display: none;
  }
}

/* Explore's one-time hint sits where the chip and the open list go. */
body.xc-chip-on .xp-hint,
body.xc-open .xp-hint {
  display: none !important;
}

/* Narrow phones: a slimmer switch leaves room for the search button. */
@media (max-width: 374px) {
  .xp-seg {
    gap: 5px;
    padding: 0 10px;
  }
}

@media (max-width: 340px) {
  .xp-seg svg {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .xc-results {
    animation: xc-in 0.12s ease-out;
  }

  @keyframes xc-in {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }
  }
}
