:root {
  --jf-cw-cyan: rgba(0, 224, 255, 0.94);
  --jf-cw-blue: rgba(75, 123, 255, 0.86);
  --jf-cw-purple: rgba(162, 89, 255, 0.9);
  --jf-cw-green: rgba(0, 255, 163, 0.88);
  --jf-cw-gold: rgba(255, 214, 102, 0.9);
  --jf-cw-glass: rgba(6, 16, 30, 0.62);
  --jf-cw-line: rgba(210, 244, 255, 0.24);
}

.jf-world-shell::before,
.jf-world-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.jf-world-shell::before {
  z-index: 0;
  background:
    radial-gradient(circle at 50% 22%, rgba(0, 224, 255, 0.16), transparent 28%),
    radial-gradient(circle at 86% 34%, rgba(162, 89, 255, 0.16), transparent 25%),
    radial-gradient(circle at 16% 76%, rgba(75, 123, 255, 0.15), transparent 29%),
    linear-gradient(135deg, #030713 0%, #071527 45%, #030713 100%);
}

.jf-world-shell::after {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(0, 224, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 224, 255, 0.025) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 100%, rgba(0, 224, 255, 0.11), transparent 44%);
  background-size: 76px 76px, 76px 76px, 100% 100%;
  mix-blend-mode: screen;
  opacity: 0.75;
}

.jf-world-game {
  z-index: 1;
}

.jf-world-topbar,
.jf-world-nav,
.jf-world-room-title,
.jf-world-panel,
.jf-dialog,
.jf-world-mobile-controls,
.jf-world-entrance,
.jf-candidate-world-shell {
  z-index: 10;
}

/* Candidate World v1 uses one navigation surface. The old world map duplicated the top nav. */
.jf-world-map {
  display: none !important;
}

.jf-world-nav {
  left: auto;
  right: 20px;
  top: 82px;
  max-width: min(760px, calc(100vw - 40px));
  justify-content: flex-end;
}

.jf-world-nav button,
.jf-world-nav a {
  min-height: 40px;
  border-color: rgba(210, 244, 255, 0.2);
  background: rgba(6, 16, 30, 0.46);
}

.jf-candidate-world-shell {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

body:not([data-jf-room="candidate"]) .jf-candidate-world-shell {
  display: none;
}

.jf-candidate-journey,
.jf-candidate-mentor {
  position: absolute;
  pointer-events: auto;
  border: 1px solid var(--jf-cw-line);
  background: linear-gradient(145deg, rgba(5, 11, 22, 0.74), rgba(8, 24, 45, 0.52));
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.jf-candidate-journey {
  left: 20px;
  top: 150px;
  width: min(310px, calc(100vw - 40px));
  max-height: calc(100vh - 190px);
  overflow: auto;
  border-radius: 28px;
  padding: 16px;
}

.jf-candidate-panel-head span,
.jf-mentor-meta {
  display: block;
  color: var(--jf-cw-cyan);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.jf-candidate-panel-head strong,
.jf-mentor-card strong {
  display: block;
  margin-top: 7px;
  color: rgba(246, 251, 255, 0.96);
  font-size: 17px;
  line-height: 1.16;
}

.jf-candidate-panel-head small {
  display: block;
  margin-top: 7px;
  color: rgba(226, 240, 255, 0.66);
  font-size: 12px;
}

.jf-candidate-progress {
  height: 8px;
  margin: 14px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.jf-candidate-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--jf-cw-cyan), var(--jf-cw-purple));
  box-shadow: 0 0 24px rgba(0, 224, 255, 0.36);
}

.jf-candidate-steps {
  display: grid;
  gap: 9px;
}

.jf-candidate-step {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  min-height: 68px;
  border: 1px solid rgba(210, 244, 255, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(244, 251, 255, 0.92);
  cursor: pointer;
  font: inherit;
  padding: 10px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.jf-candidate-step:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 224, 255, 0.56);
  background: rgba(0, 224, 255, 0.07);
}

.jf-candidate-step[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.72;
}

.jf-candidate-step-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(210, 244, 255, 0.26);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(244, 251, 255, 0.92);
  font-size: 13px;
  font-weight: 900;
}

.jf-candidate-step-copy strong,
.jf-candidate-step-copy em,
.jf-candidate-step-copy small {
  display: block;
  font-style: normal;
}

.jf-candidate-step-copy strong {
  color: rgba(127, 218, 255, 0.86);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.jf-candidate-step-copy em {
  margin-top: 3px;
  color: rgba(246, 251, 255, 0.96);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.18;
}

.jf-candidate-step-copy small {
  margin-top: 4px;
  color: rgba(226, 240, 255, 0.58);
  font-size: 11px;
  line-height: 1.25;
}

.jf-candidate-step-status {
  grid-column: 2;
  justify-self: start;
  margin-top: 3px;
  border: 1px solid rgba(210, 244, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(226, 240, 255, 0.72);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 4px 7px;
  text-transform: uppercase;
}

.jf-candidate-step.is-completed {
  border-color: rgba(0, 255, 163, 0.38);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 163, 0.05);
}
.jf-candidate-step.is-completed .jf-candidate-step-index { border-color: rgba(0, 255, 163, 0.62); color: #07111e; background: var(--jf-cw-green); }
.jf-candidate-step.is-active,
.jf-candidate-step.is-in_progress {
  border-color: rgba(0, 224, 255, 0.56);
  background: linear-gradient(135deg, rgba(0, 224, 255, 0.11), rgba(162, 89, 255, 0.08));
  box-shadow: 0 0 28px rgba(0, 224, 255, 0.1);
}
.jf-candidate-step.is-active .jf-candidate-step-index,
.jf-candidate-step.is-in_progress .jf-candidate-step-index { border-color: rgba(0, 224, 255, 0.72); background: rgba(0, 224, 255, 0.13); }
.jf-candidate-step.is-locked { filter: grayscale(0.1); }
.jf-candidate-step.is-retry_paid_required { border-color: rgba(255, 214, 102, 0.38); }
.jf-candidate-step.is-final_review { border-color: rgba(162, 89, 255, 0.48); }

.jf-candidate-credit-note {
  margin-top: 12px;
  border: 1px solid rgba(255, 214, 102, 0.22);
  border-radius: 18px;
  background: rgba(255, 214, 102, 0.065);
  padding: 11px;
}

.jf-candidate-credit-note strong,
.jf-candidate-credit-note span {
  display: block;
}

.jf-candidate-credit-note strong {
  color: rgba(255, 236, 178, 0.96);
  font-size: 12px;
}

.jf-candidate-credit-note span {
  margin-top: 4px;
  color: rgba(255, 246, 218, 0.62);
  font-size: 11px;
  line-height: 1.35;
}

.jf-candidate-mentor {
  right: 20px;
  top: 150px;
  width: min(310px, calc(100vw - 40px));
  border-radius: 28px;
  padding: 16px;
}

.jf-mentor-hologram {
  position: relative;
  display: grid;
  min-height: 128px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(0, 224, 255, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 18%, rgba(0, 224, 255, 0.22), transparent 30%),
    linear-gradient(160deg, rgba(0, 224, 255, 0.07), rgba(162, 89, 255, 0.1));
}

.jf-mentor-face {
  position: relative;
  z-index: 2;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(0, 224, 255, 0.46);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 252, 255, 0.26), rgba(0, 224, 255, 0.09));
  color: rgba(245, 253, 255, 0.96);
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 0 0 42px rgba(0, 224, 255, 0.24);
}

.jf-mentor-ring {
  position: absolute;
  bottom: 18px;
  width: 128px;
  height: 28px;
  border: 1px solid rgba(0, 224, 255, 0.34);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(0, 224, 255, 0.22);
}

.jf-mentor-card {
  margin-top: 12px;
}

.jf-mentor-meta {
  display: flex;
  align-items: center;
  gap: 7px;
}

.jf-mentor-meta span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--jf-cw-green);
  box-shadow: 0 0 18px rgba(0, 255, 163, 0.7);
}

.jf-mentor-card p {
  margin: 9px 0 0;
  color: rgba(226, 240, 255, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

.jf-mentor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.jf-mentor-actions button {
  min-height: 36px;
  border: 1px solid rgba(210, 244, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(246, 251, 255, 0.92);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 0 11px;
}

.jf-mentor-actions button:hover {
  border-color: rgba(0, 224, 255, 0.7);
  background: rgba(0, 224, 255, 0.11);
}

body[data-jf-room="candidate"] .jf-world-panel {
  left: calc(20px + min(310px, calc(100vw - 40px)) + 18px);
  right: calc(20px + min(310px, calc(100vw - 40px)) + 18px);
  top: auto;
  bottom: 24px;
  width: auto;
  min-width: 0;
  max-height: min(46vh, 420px);
  border-radius: 28px;
}

body[data-jf-room="candidate"] .jf-dialog {
  display: none;
}

body[data-jf-room="candidate"].jf-candidate-dialog-open .jf-dialog {
  display: grid;
}

body[data-jf-room="candidate"] .jf-world-room-title {
  top: 88px;
}

@media (max-width: 1199px) {
  .jf-candidate-journey {
    width: 280px;
  }
  .jf-candidate-mentor {
    width: 280px;
  }
  body[data-jf-room="candidate"] .jf-world-panel {
    left: 310px;
    right: 310px;
  }
}

@media (max-width: 980px) {
  .jf-world-nav {
    top: 74px;
    left: 12px;
    right: 12px;
    justify-content: center;
  }
  .jf-candidate-journey {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 34vh;
    border-radius: 22px;
  }
  .jf-candidate-mentor {
    display: none;
  }
  body[data-jf-room="candidate"] .jf-world-panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-height: 52vh;
    z-index: 18;
  }
}

@media (max-width: 760px) {
  body[data-jf-room="candidate"] .jf-world-nav {
    display: none;
  }
  .jf-world-mobile-controls #jf-mobile-map-toggle {
    font-size: 0;
  }
  .jf-world-mobile-controls #jf-mobile-map-toggle::after {
    content: "Journey";
    font-size: 13px;
  }
  .jf-candidate-world-shell {
    z-index: 16;
  }
  .jf-candidate-journey {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    max-height: min(62svh, 510px);
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
    transition: transform 190ms ease, opacity 190ms ease;
  }
  .jf-mobile-map-open .jf-candidate-journey {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  body[data-jf-room="candidate"] .jf-world-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    max-height: 66svh;
    z-index: 20;
  }
  body[data-jf-room="candidate"] .jf-dialog {
    display: grid;
  }
  body[data-jf-room="candidate"].jf-mobile-map-open .jf-dialog,
  body[data-jf-room="candidate"] .jf-dialog.is-hidden {
    display: none;
  }
}
