/* The same compass grows from an engraved bronze mark to a double astrolabe. */
[data-mentor-rank] {
  --mentor-ink: #19201f;
  --mentor-metal: #ad9063;
  --mentor-glow: #6d928b;
  --mentor-wheel: 30px;
  position: relative;
  isolation: isolate;
  --mentor-background: linear-gradient(100deg, #121917 5%, var(--mentor-ink) 68%, #242824);
  background: var(--mentor-background) !important;
  box-shadow: inset 0 -1px var(--mentor-metal);
}
[data-mentor-rank="2"] { --mentor-metal: #d2b47d; --mentor-wheel: 34px; }
[data-mentor-rank="3"] { --mentor-glow: #65d1c0; --mentor-metal: #b8b590; --mentor-wheel: 39px; }
[data-mentor-rank="4"] { --mentor-glow: #77ede0; --mentor-metal: #d5c388; --mentor-wheel: 46px; --mentor-ink: #153633; }
[data-mentor-rank="5"], [data-mentor-rank="6"] {
  --mentor-glow: #63f3d6; --mentor-metal: #ffcf78; --mentor-wheel: 56px; --mentor-ink: #354039;
  --mentor-background: radial-gradient(ellipse at 92% 60%, #77633c88, transparent 38%),
    linear-gradient(110deg,#131914 8%,#123935 45%,#4b422d 74%,#142923);
  box-shadow: inset 0 1px #d1b879, inset 0 -1px #bba262;
}
[data-mentor-rank="6"] { --mentor-wheel: 65px; --mentor-metal: #ffedb4; --mentor-glow:#c2fff4; }
.mentor-compass {
  position: absolute; pointer-events: none; z-index: -1;
  right: 4%; top: 50%; translate: 0 -50%; width: var(--mentor-wheel); aspect-ratio: 1;
  border: 1px solid var(--mentor-metal); border-radius: 50%; color:var(--mentor-metal);
  background: repeating-conic-gradient(from 2deg, currentColor 0 1deg, transparent 1deg 30deg);
  opacity: .4;
}
.mentor-compass::before, .mentor-compass::after {
  content: ''; position: absolute; inset: 13%; background: currentColor;
  clip-path: polygon(50% 0,56% 39%,85% 15%,61% 44%,100% 50%,61% 56%,85% 85%,55% 61%,50% 100%,44% 61%,15% 85%,39% 56%,0 50%,39% 44%,15% 15%,44% 39%);
}
.mentor-compass::after { inset:32%; color:var(--mentor-glow); rotate:22.5deg; }
:is([data-mentor-rank="5"],[data-mentor-rank="6"]) .mentor-compass {
  opacity:.82; outline:1px dashed var(--mentor-metal); outline-offset:4px;
  box-shadow:0 0 14px #eec67360,inset 0 0 12px #72dfc048;
}
[data-mentor-rank="6"] .mentor-compass { outline-style:double; outline-width:3px; }
@media (prefers-reduced-motion:no-preference) {
  :is([data-mentor-rank="3"],[data-mentor-rank="4"],[data-mentor-rank="5"],[data-mentor-rank="6"]) .mentor-compass { animation:mentor-dial 36s linear infinite; }
  :is([data-mentor-rank="4"],[data-mentor-rank="5"],[data-mentor-rank="6"]) .mentor-compass::before { animation:mentor-dial 18s linear infinite reverse; }
  :is([data-mentor-rank="5"],[data-mentor-rank="6"]) .mentor-compass::after { animation:mentor-star 3.6s ease-in-out infinite alternate; }
  [data-mentor-rank="6"] .mentor-compass { animation:mentor-dial 30s linear infinite,mentor-corona 4.6s ease-in-out infinite alternate; }
}
@keyframes mentor-dial { to { transform:rotate(1turn); } }
@keyframes mentor-star { to { scale:1.35; opacity:.65; } }
@keyframes mentor-corona { to { box-shadow:0 0 22px #ffdb9799,inset 0 0 16px #73ddcc77; } }

.rh-program-stage[data-mentor-rank] { overflow:hidden; }
.rh-program-stage[data-mentor-rank] h4 { margin:0; width:max-content; max-width:100%; color:var(--mentor-metal); font:600 19px/1.2 Georgia,serif; }
.rh-program-stage[data-mentor-rank] p { margin:6px 0; font-size:12px; }
.rh-program-stages + .rh-section-heading { margin-top:24px; }
.rh-newcomer-bundle .rh-button { margin:8px 8px 0 0; }

.rh-program-stage > .mentor-compass { top:12px; translate:0 0; right:12px; }
[data-mentor-rank="5"] .mentor-compass,
[data-mentor-rank="6"] .mentor-compass {
  background-image: radial-gradient(circle at 50% 6%, #fff6d2 0 1px, transparent 2px),
    radial-gradient(circle at 50% 94%, #a6f8dd 0 1px, transparent 2px),
    repeating-conic-gradient(from 2deg, currentColor 0 1deg, transparent 1deg 15deg);
}
.mentor-compass > b {
  pointer-events:none; position:absolute; inset:-10px; border-radius:50%;
  background: radial-gradient(ellipse 2px 5px at 50% 4%,#fff9ca 60%,transparent),
    radial-gradient(ellipse 4px 2px at 4% 50%,#fff6a8 60%,transparent),
    radial-gradient(ellipse 2px 4px at 50% 96%,#7dfadb 60%,transparent),
    radial-gradient(ellipse 3px 2px at 96% 50%,#bdf6ed 60%,transparent);
  filter:drop-shadow(0 0 3px #f3c46f);
}
@media (prefers-reduced-motion:no-preference) {
  .mentor-compass > b { animation:mentor-dial 14s linear infinite reverse; }
}

/* Keep the actual location card legible even for ranks still being previewed. */
.player-title-card.locked:has([data-mentor-title-preview]),
.achievement-row.locked:has([data-mentor-title-preview]) { filter: none; opacity: 1; }
[data-mentor-title-preview].presence-row,
.rh-program-stage > .presence-row { width: 100%; min-width: 0; align-self: center; }
.achievement-row:has([data-mentor-title-preview]) .achievement-copy { grid-column: 1 / -1; }
.achievement-row:has([data-mentor-title-preview]) .achievement-reward { grid-column: 1 / -1; min-width: 0; }
@media (min-width:1001px) {
  .achievement-row:has([data-mentor-title-preview]) { grid-template-columns: minmax(0,1fr) minmax(150px,46%); }
  .achievement-row:has([data-mentor-title-preview]) .achievement-copy,
  .achievement-row:has([data-mentor-title-preview]) .achievement-reward { grid-column: auto; }
}

.presence-row[data-mentor-rank]:not(.power-rating-equipped) {
  overflow: hidden;
}
.presence-row[data-mentor-rank]:not(.power-rating-equipped) .mentor-compass {
  width: min(var(--mentor-wheel), 20%);
}
.presence-row[data-mentor-rank]:not(.power-rating-equipped) > .presence-main {
  padding-right: min(var(--mentor-wheel), 20%);
}
[data-mentor-rank].power-rating-equipped {
  background: transparent !important;
  box-shadow: none;
}
[data-mentor-rank].power-rating-equipped .power-rating-title-surface {
  background: var(--mentor-background) !important;
  overflow: hidden;
  isolation: isolate;
}

.referral-hub .rh-head {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(220px,320px) auto;
  align-items:start;
}
.rh-head > .rh-close { grid-column:3; }
.rh-next-rank { max-width:360px; margin-top:12px; }
.rh-head .rh-next-rank > p, .rh-current-rank .rh-field-label { color:var(--text-1); }
.rh-next-rank .rh-progress-caption { color:var(--text-2); }
.rh-program-stage[aria-current="step"] { border-color:var(--rh-accent); }
.rh-current-rank .presence-row, .rh-program-stage .presence-row { cursor:default; }
.rh-next-rank .rh-progress { margin-top:5px; }
.rh-head .rh-rank-max { color:var(--rh-success); }
.rh-current-rank { min-width:0; }
.rh-current-rank > .presence-row { width:100%; min-width:0; margin:0; }
.rh-mentor-bonuses { display:flex; gap:14px; margin-top:6px; color:var(--rh-success); font-size:12px; }
.rh-rank-plate { overflow:hidden; padding:12px 22% 12px 12px; border-radius:4px; }
.rh-rank-plate strong { position:relative; }
.rh-program-stage:has(.presence-row) { display:flex; flex-direction:column; align-items:stretch; gap:6px; }
.rh-program-stage:has(.presence-row) > p { margin:0; }
@media(max-width:700px) {
  .referral-hub .rh-head { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  .rh-head > .rh-close { grid-column:2; grid-row:1; }
  .rh-head > .rh-current-rank { grid-column:1 / -1; }
  .rh-current-rank { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:3px 10px; }
  .rh-current-rank > .rh-field-label { grid-column:1 / -1; margin:0; }
  .rh-mentor-bonuses { flex-direction:column; justify-content:center; gap:2px; margin:0; }
  .rh-next-rank { margin-top:6px; }
}
