/* Reivery — The Reiver Wheel, court emblems, the ring of 72. */

.court-sub--gold { color: var(--gold); }
.court-line--gold::before { background: var(--gold); }

/* ---------- the full wheel ---------- */

.wheel-wrap {
  position: relative;
  width: min(100% - 2rem, 46rem);
  margin: 0 auto;
}
.wheel-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--display);
}
.wheel-wrap .wheel-svg { animation: wheel-in 2.4s var(--ease) both; }

.w-glyph { font-family: "Segoe UI Symbol", "Noto Sans Symbols", "Apple Symbols", var(--display); }
.w-king  { font-family: var(--display); }
.w-num   { font-family: var(--display); transition: fill .4s var(--ease); }
@media (max-width: 40rem) { .w-num { font-size: 21px; fill: #C9BBA0; } .w-king { font-size: 22px; } .w-star { font-size: 15px; } }

.w-spoke { cursor: default; outline: none; }
.w-spoke.has-art { cursor: pointer; }
.w-spoke .w-dot, .w-spoke .w-metal, .w-spoke .w-ray { transition: opacity .4s var(--ease), stroke-width .4s var(--ease); }

/* when reading, everything quiets except the spoke under the hand */
.wheel-wrap.is-reading .w-spoke { opacity: .38; transition: opacity .5s var(--ease); }
.wheel-wrap.is-reading .w-spoke.is-on { opacity: 1; }
.w-spoke.is-on .w-ray   { stroke-opacity: 1; stroke-width: 2; }
.w-spoke.is-on .w-num   { fill: var(--ink); }
.w-spoke.is-on .w-metal { stroke-width: 2.4; }
.w-spoke:focus-visible .w-hit { stroke: var(--gold); stroke-width: 1; }

/* Fire spokes carry art: a faint breath of light */
.w-spoke.has-art .w-dot { filter: drop-shadow(0 0 4px rgba(232, 163, 94, .55)); }

.w-lamp { animation: lamp 7s ease-in-out infinite; transform-origin: 500px 500px; }

.wheel-readout {
  min-height: 5.5rem;
  margin: 1.25rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: .2rem .8rem;
  text-align: center;
}
.wheel-readout span { display: inline-block; }
.r-hint  { font-style: italic; color: var(--muted); }
.r-num   { font-family: var(--display); font-size: .85rem; letter-spacing: .3em; }
.r-name  { font-family: var(--display); font-size: 1.7rem; }
.r-rank  { font-family: var(--display); font-size: .8rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.r-place { flex-basis: 100%; font-style: italic; color: var(--muted); }
.r-open  { flex-basis: 100%; font-family: var(--display); font-size: .8rem; letter-spacing: .28em; text-transform: uppercase; color: var(--fire); }

/* ---------- ghost wheel (behind headings) ---------- */

.ghost {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(140vw, 62rem);
  transform: translate(-50%, -50%);
  opacity: .07;
  pointer-events: none;
  z-index: 0;
}
.ghost .wheel-rot { animation: turn 600s linear infinite; transform-origin: 500px 500px; }

/* ---------- legend ---------- */

.legend {
  display: grid;
  gap: 2rem;
  max-width: 60rem;
  margin: clamp(2.5rem, 7vh, 4rem) auto 0;
  padding: 0 1rem;
}
@media (min-width: 46rem) { .legend { grid-template-columns: repeat(3, 1fr); } }

.legend h2 {
  margin: 0 0 .9rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: .8rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
}
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.legend li { display: flex; align-items: center; gap: .7rem; font-size: 1rem; color: var(--ink); }
.metals-note { font-style: italic; color: var(--muted) !important; font-size: .92rem !important; }

.sw { width: 1.6rem; height: .55rem; border-radius: 1px; }
.sw--fire  { background: #C9782E; }
.sw--earth { background: #5E7A4C; }
.sw--air   { background: #D9B44A; }
.sw--water { background: #3F6B8C; }

.dot { width: .7rem; height: .7rem; border-radius: 50%; border: 1.5px solid var(--ink); margin: 0 .45rem; }
.dot--day { background: var(--ink); }
.gate-star { width: 1.6rem; text-align: center; color: var(--ink); }
.ring { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--m); margin: 0 .25rem; }

/* ---------- ring of 72 ---------- */

.ring72 {
  width: min(100% - 2rem, 52rem);
  margin: clamp(2.5rem, 8vh, 4.5rem) auto 0;
  opacity: 0;
  animation: rise 2s var(--ease) .4s forwards;
}
.ring72-svg { display: block; width: 100%; height: auto; }

/* ---------- court emblem ---------- */

.emblem { display: inline-block; width: 3.2rem; height: 3.2rem; }
.emblem-svg { display: block; width: 100%; height: 100%; }

/* ---------- motion ---------- */

@keyframes turn { to { transform: rotate(-360deg); } }
@keyframes lamp { 0%, 100% { opacity: .92; } 50% { opacity: 1; } }
@keyframes wheel-in {
  from { opacity: 0; transform: rotate(-8deg) scale(.97); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-wrap .wheel-svg, .ghost .wheel-rot, .w-lamp, .ring72 { animation: none; opacity: 1; }
  .ghost { opacity: .07; }
}
