
/* ─── NEON SIGN ───────────────────────────────────────────── */
.neon-sign {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--mp);
  text-shadow:
    0 0 8px  var(--mp),
    0 0 18px rgba(232,0,138,0.55),
    0 0 36px rgba(232,0,138,0.18);
  padding: 9px 24px;
  border: 1px solid rgba(232,0,138,0.30);
  border-radius: 4px;
  background: rgba(232,0,138,0.035);
  animation: neonFlicker 8s ease infinite;
  margin-top: 70px;
  margin-bottom: 32px;
  user-select: none;
}

.neon-sign .nd {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mp);
  box-shadow: 0 0 8px var(--mp), 0 0 14px rgba(232,0,138,0.6);
  flex-shrink: 0;
  animation: ndPulse 1.8s ease infinite;
}

@keyframes ndPulse {
  0%, 100% { box-shadow: 0 0 8px var(--mp), 0 0 14px rgba(232,0,138,0.5); }
  50%       { box-shadow: 0 0 4px var(--mp), 0 0  7px rgba(232,0,138,0.25); }
}

@keyframes neonFlicker {
  0%, 17%, 20%, 23%, 27%, 100% {
    text-shadow: 0 0 8px var(--mp), 0 0 18px rgba(232,0,138,0.55), 0 0 36px rgba(232,0,138,0.18);
    border-color: rgba(232,0,138,0.30);
    opacity: 1;
  }
  18%, 22%, 26% {
    text-shadow: none;
    border-color: rgba(232,0,138,0.08);
    opacity: 0.82;
  }
}

/* ─── COMPASS WRAP ────────────────────────────────────────── */
.compass-wrap {
  position: relative;
  width: 520px;
  height: 520px;
  flex-shrink: 0;
  /* Scale fluidly with viewport — smaller on phones, larger on big screens.
     Uses min(vw-based, vh-based) so it never overflows either axis.
     clamp floor 0.55 (phones) → natural at ~1000px → max 1.55 (4K) */
  transform: scale(clamp(0.55, min(calc(100vw / 1000), calc(82vh / 700)), 1.55));
  transform-origin: center center;
}

/* Give the scaled-up compass breathing room on large screens */
@media (min-width: 1200px) {
  .compass-wrap { margin: 32px 0; }
}
@media (min-width: 1600px) {
  .compass-wrap { margin: 72px 0; }
}
@media (min-width: 1920px) {
  .compass-wrap { margin: 110px 0; }
}

/* ─── SVG CONNECTOR LINES ─────────────────────────────────── */
.compass-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cline {
  stroke: rgba(204,0,122,0.18);
  stroke-width: 0.8;
  stroke-dasharray: 215;
  stroke-dashoffset: 215;
  transition: stroke-dashoffset 0.7s ease, stroke 0.3s ease, stroke-opacity 0.3s ease;
}

.cline.drawn { stroke-dashoffset: 0; }
.cline.lit   { stroke: rgba(232,0,138,0.6); }

/* ─── PLATE RINGS ─────────────────────────────────────────── */
.plate-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.plate-ring.r1 {
  width: 200px;
  height: 200px;
  border: 1px solid rgba(204,0,122,0.22);
  box-shadow: 0 0 30px rgba(204,0,122,0.08), inset 0 0 30px rgba(204,0,122,0.05);
  animation: ringRotate 40s linear infinite;
}

.plate-ring.r2 {
  width: 310px;
  height: 310px;
  border: 1px dashed rgba(204,0,122,0.10);
  animation: ringRotate 70s linear infinite reverse;
}

.plate-ring.r3 {
  width: 430px;
  height: 430px;
  border: 1px solid rgba(204,0,122,0.05);
  animation: ringRotate 100s linear infinite;
}

@keyframes ringRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ─── CUTLERY ─────────────────────────────────────────────── */
.plate-cutlery {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(204,0,122,0.18);
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(204,0,122,0.1));
  transition: color 0.45s ease;
}

.plate-cutlery.fork { left:  calc(50% - 295px); }
.plate-cutlery.knife { right: calc(50% - 295px); }

/* ─── PLATE CENTER ────────────────────────────────────────── */
.plate-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 148px;
  height: 148px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: radial-gradient(circle at center,
    rgba(204,0,122,0.14) 0%,
    rgba(204,0,122,0.05) 50%,
    transparent 100%);
  border: 1px solid rgba(204,0,122,0.28);
  box-shadow:
    0 0 40px rgba(204,0,122,0.15),
    0 0 80px rgba(204,0,122,0.06),
    inset 0 0 30px rgba(204,0,122,0.06);
  animation: plateBreath 5s ease-in-out infinite;
  cursor: default;
}

@keyframes plateBreath {
  0%, 100% { box-shadow: 0 0 40px rgba(204,0,122,0.15), 0 0 80px rgba(204,0,122,0.06), inset 0 0 30px rgba(204,0,122,0.06); }
  50%       { box-shadow: 0 0 55px rgba(204,0,122,0.22), 0 0 110px rgba(204,0,122,0.09), inset 0 0 40px rgba(204,0,122,0.08); }
}

.plate-coin {
  width: 72px;
  height: 72px;
  object-fit: contain;
  animation: float 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-6px); }
}

.plate-tag {
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.18em;
  color: var(--t3);
  text-transform: uppercase;
  text-align: center;
  line-height: 1.7;
  pointer-events: none;
}

/* ─── CHAPTER NODES ───────────────────────────────────────── */
.cnode {
  position: absolute;
  left: 260px;  /* center of 520px wrap */
  top:  260px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition:
    opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Children scale on hover — avoids interfering with the cnode's own
   translate transform that positions it on the compass */
.cnode-dot,
.cnode-label {
  transform: scale(1);
  transform-origin: center;
  transition: transform 0.25s ease-out;
}
.cnode:hover .cnode-dot,
.cnode:hover .cnode-label {
  transform: scale(1.18);
}
.cnode.active .cnode-dot,
.cnode.active .cnode-label {
  transform: scale(1.10);
}

.cnode.visible { opacity: 1; }

/* Radial positions — radius 210px from center (260,260) */
.cnode[data-index="0"] {
  transform: translate(-50%, -50%) translateY(-210px);
  flex-direction: column;
  align-items: center;
}
.cnode[data-index="1"] {
  transform: translate(-50%, -50%) translate(149px, -149px);
  flex-direction: row;
  align-items: center;
}
.cnode[data-index="2"] {
  transform: translate(-50%, -50%) translateX(210px);
  flex-direction: row;
  align-items: center;
}
.cnode[data-index="3"] {
  transform: translate(-50%, -50%) translate(149px, 149px);
  flex-direction: column;
  align-items: center;
}
.cnode[data-index="4"] {
  transform: translate(-50%, -50%) translateY(210px);
  flex-direction: column;
  align-items: center;
}
.cnode[data-index="5"] {
  transform: translate(-50%, -50%) translate(-149px, 149px);
  flex-direction: column;
  align-items: center;
}
.cnode[data-index="6"] {
  transform: translate(-50%, -50%) translateX(-210px);
  flex-direction: row-reverse;
  align-items: center;
}
.cnode[data-index="7"] {
  transform: translate(-50%, -50%) translate(-149px, -149px);
  flex-direction: row-reverse;
  align-items: center;
}

/* Node dot */
.cnode-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(204,0,122,0.3);
  border: 1px solid rgba(204,0,122,0.5);
  box-shadow: 0 0 10px rgba(204,0,122,0.2);
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.cnode:hover .cnode-dot,
.cnode.active .cnode-dot {
  background: var(--mp);
  border-color: var(--mlight);
  box-shadow: 0 0 16px var(--mp), 0 0 32px rgba(204,0,122,0.4);
}

/* Node label */
.cnode-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: opacity 0.3s ease;
}

/* Label alignment by quadrant */
.cnode[data-index="0"] .cnode-label,
.cnode[data-index="4"] .cnode-label { align-items: center; text-align: center; }
.cnode[data-index="1"] .cnode-label,
.cnode[data-index="2"] .cnode-label,
.cnode[data-index="3"] .cnode-label { align-items: flex-start; text-align: left; }
.cnode[data-index="5"] .cnode-label,
.cnode[data-index="6"] .cnode-label,
.cnode[data-index="7"] .cnode-label { align-items: flex-end; text-align: right; }

/* Gap between dot and label (column layout = top/bottom) */
.cnode[data-index="0"] { gap: 10px; }
.cnode[data-index="4"] { gap: 10px; }

.cnode-num {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--mp);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.cnode-name {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--t3);
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.cnode:hover .cnode-num,
.cnode.active .cnode-num  { opacity: 1; }
.cnode:hover .cnode-name  { color: var(--t2); }
.cnode.active .cnode-name { color: var(--text); }

/* ─── "CHOOSE A COURSE" HINT ──────────────────────────────── */
.compass-hint {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.28em;
  color: var(--t4);
  text-transform: uppercase;
  margin-top: 32px;
  animation: hintBlink 3s ease-in-out infinite;
  user-select: none;
}

@keyframes hintBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ─── AMBIENT FLOATING LAYER ─────────────────────────────── */
.ambient-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient-icon {
  position: absolute;
  color: var(--mp);
  opacity: 0;
  animation: ambientDrift var(--dur, 18s) ease-in-out var(--delay, 0s) infinite;
  filter: drop-shadow(0 0 6px rgba(204,0,122,0.3));
}

@keyframes ambientDrift {
  0%   { opacity: 0;                transform: translateY(50px)  rotate(var(--r0,-10deg)) scale(0.85); }
  12%  { opacity: var(--pk, 0.09); }
  50%  { opacity: var(--md, 0.06); transform: translateY(-25px) rotate(var(--r1,  5deg)) scale(1.0);  }
  88%  { opacity: var(--pk, 0.09); }
  100% { opacity: 0;                transform: translateY(-75px) rotate(var(--r2, 22deg)) scale(0.85); }
}
