/* Career Path — builds on style.css (page shell) and grid.css (avatars, search list, emblems, modals). */

/* ---------- Search and answer card (same as Guess the Pro) ---------- */
.gp-search { position: relative; width: 100%; max-width: 460px; margin: 0 auto 14px; }
.gp-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50;
  max-height: min(46vh, 360px); background: #0d1527; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
}
.gp-noresults { cursor: default; color: var(--text-muted); font-size: 0.85rem; }
.gp-answer, .gp-result-player { display: flex; align-items: center; justify-content: center; gap: 14px; }
.gp-answer { margin: 4px auto 14px; }
.gp-answer .avatar, .gp-result-player .avatar { width: 64px; height: 64px; border: 2px solid var(--gold); }
.gp-result-player { margin: 6px 0 10px; }
.gp-answer-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 700; }
.gp-answer-nick { font-family: 'Cinzel', serif; font-size: 1.5rem; color: var(--gold-light); line-height: 1.1; }
.gp-answer-name { font-size: 0.78rem; color: var(--text-muted); }
.gp-answer-text { text-align: left; }

/* ---------- The path: rows of circles, the last row centred; the line is an SVG behind them (path.js) ---------- */
.path-bar {
  --cols: 4; --circle: 64px;
  position: relative; display: flex; flex-direction: column; gap: 26px;
  max-width: 640px; margin: 6px auto 16px;
}
.path-row { position: relative; z-index: 1; display: flex; justify-content: center; }
.path-node {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0;
  flex: 0 0 calc(100% / var(--cols));
}
.path-links { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.path-links path { fill: none; stroke: rgba(200, 170, 110, 0.5); stroke-width: 2; stroke-linejoin: round; }
.path-circle {
  position: relative; z-index: 1; width: var(--circle); height: var(--circle); border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border: 2px dashed rgba(168, 174, 192, 0.45); background: #0d1527;
}
.path-q { font-family: 'Cinzel', serif; font-size: 1.5rem; font-weight: 800; color: var(--text-muted); }
.path-node.open .path-circle { border: 2px solid var(--gold); background: #ece6d6; padding: 9px; cursor: help; box-shadow: 0 0 0 3px rgba(5, 8, 17, 0.9); }
.path-circle > img { width: 100%; height: 100%; object-fit: contain; }
/* Set by path.js after measuring the logo: light logos that blend into the cream get a faint dark outline, dark ones a
   faint light glow. */
.path-circle > img.logo-light { filter: drop-shadow(0 0 0.6px rgba(5, 8, 17, 0.7)); }
.path-circle > img.logo-dark { filter: drop-shadow(0 0 1.55px rgba(255, 255, 255, 0.45)); }
.path-emblem { font-size: 0.72rem; font-weight: 800; color: #1a1205; text-align: center; line-height: 1; overflow-wrap: anywhere; }
/* A long name shrinks to fit (path.js fitNicks), so no "…". */
.path-name {
  min-height: 1.1em; max-width: 100%; padding: 0 2px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase;
  color: var(--gold-light); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.path-node.just-open .path-circle { animation: path-flip .5s ease-out both; }
@keyframes path-flip { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }

@media (max-width: 520px) {
  .path-bar { --circle: 58px; gap: 22px; }
  /* Five or six a row: smaller circles. */
  .path-bar[data-cols="5"] { --circle: 50px; }
  .path-bar[data-cols="6"] { --circle: 44px; }
  .path-bar[data-cols="6"] .path-name { font-size: 0.54rem; }
  .path-name { font-size: 0.62rem; }
  .gp-search {
    position: sticky; top: 0; z-index: 40; margin: 0 -2px 12px; padding: 8px 2px;
    background: #0a101c; box-shadow: 0 6px 10px -6px rgba(0, 0, 0, 0.8);
  }
}
@media (max-width: 374px) {
  .path-bar { --circle: 52px; }
  .path-bar[data-cols="5"] { --circle: 46px; }
  .path-bar[data-cols="6"] { --circle: 40px; }
}

/* Dashed stub at an end of the path (drawn by path.js): the career went on outside tier 1 before / after. */
.path-links path.dashed { stroke-dasharray: 6 4; stroke: rgba(200, 170, 110, 0.85); stroke-width: 2.5; }
/* League of a team outside tier 1 kept between tier-1 ones. */
.path-league {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%); z-index: 2; padding: 0 4px; border-radius: 3px;
  font-size: 0.52rem; font-weight: 800; letter-spacing: 0.3px; white-space: nowrap; color: #04141a; background: var(--cyan);
}

/* The full path in the result window. */
.path-bar-small { --circle: 40px; gap: 18px; margin: 0 auto 6px; width: 100%; }
.path-bar-small .path-node.open .path-circle { padding: 6px; }
.path-bar-small .path-name { font-size: 0.56rem; }
@media (max-width: 520px) { .path-bar-small { --circle: 40px; } }

/* ---------- Guesses: a card each (portrait, nick, ✗ / ✓), all five in one row, centred ---------- */
.path-guesses {
  --gap: 8px;
  list-style: none; margin: 0 auto; padding: 0; max-width: 460px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap);
}
.path-guess {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0;
  flex: 0 0 calc((100% - 4 * var(--gap)) / 5);   /* five a row; fewer stay centred */
  padding: 8px 4px 7px; border-radius: 10px; border: 1px solid rgba(255, 110, 110, 0.5);
  background: linear-gradient(180deg, rgba(116, 34, 40, 0.55), rgba(60, 18, 24, 0.55));
}
.path-guess.fresh { animation: guess-in .35s ease-out both; }
.path-guess.right { border-color: rgba(74, 224, 136, 0.75); background: linear-gradient(180deg, rgba(36, 108, 64, 0.65), rgba(20, 60, 36, 0.6)); }
.path-guess .avatar { width: 100%; max-width: 64px; height: auto; aspect-ratio: 1; border-radius: 8px; object-fit: cover; object-position: 50% 15%; }
/* A long nick shrinks to fit (path.js fitNicks), so no "…". */
.path-guess-nick {
  max-width: 100%; font-size: 0.74rem; font-weight: 800; color: var(--gold-light); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.path-guess-mark {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 800;
  color: #fff; background: #b8323c; box-shadow: 0 0 0 2px rgba(5, 8, 17, 0.85);
}
.path-guess.right .path-guess-mark { background: #2fa35c; }
.path-guess-mark svg { width: 62%; height: 62%; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes guess-in { from { opacity: 0; transform: translateY(6px) scale(0.96); } }
@media (max-width: 520px) {
  .path-guesses { --gap: 5px; }
  .path-guess { padding: 6px 3px 5px; border-radius: 8px; }
  .path-guess-nick { font-size: 0.62rem; }
  .path-guess-mark { width: 16px; height: 16px; font-size: 0.6rem; top: 3px; right: 3px; }
}

/* ---------- Guide demo (onboarding.js) ---------- */
.onb-path { gap: 0; }
.onb-node {
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden;
  border: 2px dashed rgba(168, 174, 192, 0.45); background: #0d1527; color: var(--text-muted); animation: path-flip .5s ease-out both;
}
.onb-node.open { border: 2px solid var(--gold); background: #ece6d6; padding: 7px; }
.onb-node img { width: 100%; height: 100%; object-fit: contain; }
.onb-link { width: 14px; height: 2px; background: rgba(200, 170, 110, 0.5); }

@media (prefers-reduced-motion: reduce) { .path-node.just-open .path-circle, .onb-node, .path-guess { animation: none; } }
