/* Expedition campaign panel (basecamp.js). Each world sets its own palette. */

.xc {
  --xc-bg1: #153945;
  --xc-bg2: #0f2533;
  --xc-ink: #f3f7f6;
  --xc-muted: #c3d7df;
  --xc-accent: #ffd76a;
  --xc-accent-ink: #1d1a0a;
  --xc-card: rgba(255, 255, 255, 0.07);
  --xc-line: rgba(255, 255, 255, 0.22);
  --xc-good: #8fe3b0;
  box-sizing: border-box;
  max-width: 1120px;
  margin: 20px auto;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--xc-line);
  background: linear-gradient(150deg, var(--xc-bg1), var(--xc-bg2));
  color: var(--xc-ink);
  font-size: 1rem;
  line-height: 1.5;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(5, 14, 30, 0.25);
}
.xc *,
.xc *::before,
.xc *::after {
  box-sizing: border-box;
}

/* World palettes */
.xc--caravan {
  --xc-bg1: #5a3420;
  --xc-bg2: #2e1a10;
  --xc-accent: #ffc94d;
  --xc-muted: #f1d9bf;
}
.xc--casefiles {
  --xc-bg1: #241c5a;
  --xc-bg2: #0e0f2c;
  --xc-accent: #ff7ab6;
  --xc-accent-ink: #250818;
  --xc-muted: #d5d0f2;
}
.xc--harbor {
  --xc-bg1: #1f5b6e;
  --xc-bg2: #10303f;
  --xc-accent: #ffd76a;
  --xc-muted: #cfe8ee;
}
.xc--summit {
  --xc-bg1: #2f3e78;
  --xc-bg2: #161d40;
  --xc-accent: #ffd76a;
  --xc-muted: #d8def5;
}
.xc--frontier {
  --xc-bg1: #2d2470;
  --xc-bg2: #0b0b26;
  --xc-accent: #9ff3ff;
  --xc-accent-ink: #062530;
  --xc-muted: #d6d2ff;
}
.xc--abyss {
  --xc-bg1: #0f4f6c;
  --xc-bg2: #04182b;
  --xc-accent: #7af0c8;
  --xc-accent-ink: #032a1e;
  --xc-muted: #c6e8ef;
}

/* Header */
.xc-head {
  margin-bottom: 14px;
}
.xc .xc-kicker {
  margin: 0 0 4px;
  font:
    700 0.78rem/1.3 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--xc-accent);
}
.xc .xc-title {
  margin: 0 0 6px;
  font-size: 1.85rem;
  line-height: 1.15;
  color: #fff;
}
.xc .xc-story,
.xc .xc-text {
  margin: 0;
  max-width: 72ch;
  color: var(--xc-muted);
}
.xc-es {
  display: block;
  margin-top: 2px;
  font-size: 0.92em;
  font-style: italic;
  opacity: 0.88;
}
/* Short labels keep both languages on one line: "Chapter / Capítulo". */
.xc-kicker .xc-es,
.xc-step .xc-es,
.xc-status .xc-es,
.xc-coin-label small .xc-es,
.xc-stop small .xc-es,
.xc-chip .xc-es {
  display: inline;
  margin: 0;
  font-size: 1em;
}
.xc-kicker .xc-es::before,
.xc-step .xc-es::before,
.xc-status .xc-es::before,
.xc-coin-label small .xc-es::before,
.xc-stop small .xc-es::before {
  content: " / ";
  font-style: normal;
}

.xc-head--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.xc--collapsed .xc-head {
  margin-bottom: 0;
}
.xc-toggle {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 2px solid var(--xc-line);
  background: transparent;
  color: var(--xc-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.xc-toggle:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.xc .xc-mini {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  color: var(--xc-muted);
}
.xc-chip--up {
  border-color: var(--xc-accent);
  animation: xc-pulse 1s ease 2;
}

/* Scene */
.xc-scene {
  position: relative;
  /* Match the scene's 960x230 viewBox so every landmark stays visible at any width. */
  aspect-ratio: 960 / 230;
  margin: 0 0 14px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--xc-line);
}
.xc-scene svg {
  display: block;
  width: 100%;
  height: 100%;
}
.xc-mark {
  opacity: 0.35;
  filter: grayscale(0.85);
  transition:
    opacity 0.4s ease,
    filter 0.4s ease;
}
.xc-mark .xc-glow {
  opacity: 0.15;
}
.xc-mark--on {
  opacity: 1;
  filter: none;
}
.xc-mark--on .xc-glow {
  opacity: 1;
  animation: xc-glow 2.6s ease-in-out infinite;
}
.xc-mark--new {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: xc-rise 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.xc-vehicle {
  animation: xc-bob 3s ease-in-out infinite;
}
.xc-scene--finished::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.55) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 20%, rgba(255, 230, 120, 0.7) 0 3px, transparent 4px),
    radial-gradient(circle at 45% 60%, rgba(255, 140, 190, 0.6) 0 2px, transparent 3px),
    radial-gradient(circle at 85% 55%, rgba(140, 240, 220, 0.6) 0 3px, transparent 4px);
  animation: xc-sparkle 2.4s ease-in-out infinite;
  pointer-events: none;
}

/* Wallet */
.xc-wallet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  align-items: stretch;
  margin-bottom: 14px;
}
.xc-coin {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--xc-card);
  border: 1px solid var(--xc-line);
}
.xc-coin-icon {
  font-size: 1.5rem;
}
.xc-coin-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.xc-coin-label {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  line-height: 1.2;
}
.xc-coin-label small {
  font-weight: 400;
  color: var(--xc-muted);
}
.xc-coin--up {
  border-color: var(--xc-accent);
  animation: xc-pulse 1s ease 2;
}
.xc-gain {
  position: absolute;
  top: -10px;
  right: 8px;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--xc-accent);
  color: var(--xc-accent-ink);
  font-weight: 800;
  animation: xc-float 1.6s ease both;
}
.xc .xc-earn-rule {
  grid-column: 1 / -1;
  margin: 0;
  align-self: center;
  font-size: 0.9rem;
  color: var(--xc-muted);
}

/* Route */
.xc-route {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.xc-stop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 12px;
  text-align: center;
  background: var(--xc-card);
  border: 1px solid transparent;
  min-width: 0;
}
.xc-stop-dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px dashed var(--xc-line);
  font-weight: 800;
}
.xc-stop-name {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.xc-stop small {
  font-size: 0.78rem;
  color: var(--xc-muted);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.xc-stop--done .xc-stop-dot {
  border-style: solid;
  border-color: var(--xc-good);
  background: rgba(143, 227, 176, 0.18);
}
.xc-stop--now {
  border-color: var(--xc-accent);
}
.xc-stop--now .xc-stop-dot {
  border-style: solid;
  border-color: var(--xc-accent);
  color: var(--xc-accent);
}
.xc-stop--locked {
  opacity: 0.6;
}

/* Stage cards */
.xc-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--xc-line);
}
.xc .xc-card h3 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  line-height: 1.2;
  color: #fff;
}
.xc .xc-card h4 {
  margin: 14px 0 6px;
  font-size: 1rem;
  color: #fff;
}
.xc .xc-step {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--xc-accent);
}
.xc .xc-rule {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--xc-muted);
}
.xc-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.xc-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 44px;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid var(--xc-line);
  background: var(--xc-card);
  color: var(--xc-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}
.xc-option:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}
.xc-option[aria-pressed="true"] {
  border-color: var(--xc-accent);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.xc-option--short {
  border-style: dashed;
}
.xc-option-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.xc-option strong {
  font-size: 1.1rem;
  color: #fff;
}
.xc-option-text {
  color: var(--xc-muted);
}
.xc-effect {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--xc-good);
}
.xc-option-foot,
.xc-cap-cost {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding-top: 8px;
}
.xc-cost {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.xc-chip {
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--xc-line);
  font-weight: 800;
  white-space: nowrap;
}
.xc-status {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--xc-muted);
}
.xc-commit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}
.xc-commit,
.xc-practice {
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 2px solid var(--xc-accent);
  background: var(--xc-accent);
  color: var(--xc-accent-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  max-width: 100%;
}
.xc-commit:disabled {
  background: transparent;
  color: var(--xc-muted);
  border-color: var(--xc-line);
  cursor: not-allowed;
}
.xc-practice {
  background: transparent;
  color: var(--xc-ink);
}
.xc-commit-note {
  flex: 1 1 220px;
  font-size: 0.9rem;
  color: var(--xc-muted);
}
.xc-option:focus-visible,
.xc-commit:focus-visible,
.xc-practice:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.xc-foot {
  margin-top: 12px;
}
.xc-card--cap {
  border-color: var(--xc-accent);
}
.xc-card--end {
  text-align: center;
}
.xc-card--end .xc-text {
  margin-inline: auto;
}
.xc-end-badge {
  font-size: 3.2rem;
  line-height: 1;
  margin: 6px 0;
  animation: xc-rise 1s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.xc-path,
.xc-endings {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.xc-path li,
.xc-endings li {
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--xc-card);
  border: 1px solid var(--xc-line);
}
.xc-endings .xc-found {
  border-color: var(--xc-good);
}
.xc-endings .xc-missing {
  opacity: 0.6;
}
.xc-card--end .xc-commit-row {
  justify-content: center;
}
.xc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Small in-game strip for game-specific choices (Deal Detective roles, 3.4 equipment) */
.xc-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #13213a;
  color: #eef4ff;
  border: 1px solid #3c5578;
}
.xc-strip-label {
  font-weight: 800;
}
.xc-strip-note {
  flex: 1 1 200px;
  font-size: 0.9rem;
  color: #c6d4ea;
}
.xc-strip button {
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 2px solid #4f6a92;
  background: #1c2e4d;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.xc-strip button[aria-pressed="true"] {
  border-color: #ffd76a;
  background: #2b4570;
}
.xc-strip button:focus-visible {
  outline: 3px solid #ffd76a;
  outline-offset: 2px;
}
.xc-strip button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Role picker inside a game panel */
.xc-roles {
  padding: 16px;
  border-radius: 14px;
  background: #1a1640;
  color: #f1efff;
}
.xc-roles h4 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  color: #fff;
}
.xc-roles p {
  margin: 0 0 10px;
  color: #d5d0f2;
}
.xc-roles .xc-options {
  margin-top: 8px;
}

@keyframes xc-glow {
  50% {
    opacity: 0.6;
  }
}
/* Individual transform properties compose with the SVG transform attribute instead of replacing it. */
@keyframes xc-rise {
  from {
    translate: 0 24px;
    scale: 0.6;
    opacity: 0;
  }
}
@keyframes xc-bob {
  50% {
    translate: 0 -4px;
  }
}
@keyframes xc-pulse {
  50% {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12);
  }
}
@keyframes xc-float {
  0% {
    transform: translateY(8px);
    opacity: 0;
  }
  20% {
    transform: none;
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes xc-sparkle {
  50% {
    opacity: 0.35;
  }
}

/* Pages with a high-contrast mode (Unit 3 Test Review) force dark button borders. */
body.high-contrast .xc {
  --xc-muted: #ffffff;
  --xc-line: rgba(255, 255, 255, 0.75);
}
body.high-contrast .xc button {
  border-color: #ffffff !important;
}

@media (max-width: 700px) {
  .xc {
    padding: 14px;
    border-radius: 16px;
    margin: 14px 0;
  }
  .xc .xc-title {
    font-size: 1.45rem;
  }
  .xc-head--row {
    flex-direction: column;
  }
  .xc-toggle {
    width: 100%;
  }
  .xc-wallet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .xc-coin {
    flex-wrap: wrap;
    gap: 2px 8px;
    padding: 8px 10px;
  }
  .xc-coin-label {
    flex-basis: 100%;
  }
  .xc-route {
    gap: 4px;
  }
  .xc-stop {
    padding: 6px 2px;
  }
  .xc-stop-dot {
    width: 30px;
    height: 30px;
  }
  .xc-stop-name {
    font-size: 0.78rem;
  }
  .xc-stop small {
    display: none;
  }
  .xc-options {
    grid-template-columns: 1fr;
  }
  .xc-card {
    padding: 14px;
  }
  .xc-commit,
  .xc-practice {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xc *,
  .xc *::after,
  .xc-strip * {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .xc,
  .xc-strip {
    display: none !important;
  }
}
