:root {
  --ink: #e9e0cd;
  --ink-dim: #a99f8a;
  --gold: #c9a35b;
  --gold-bright: #e6c884;
  --bg-0: #0b0c12;
  --bg-1: #12131c;
  --panel: rgba(20, 21, 31, 0.55);
  --border: rgba(201, 163, 91, 0.22);
  --serif: "Spectral", Georgia, serif;
  --display: "Cinzel", Georgia, serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(140, 59, 52, 0.18), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(60, 80, 140, 0.16), transparent 60%),
    radial-gradient(1000px 800px at 50% 110%, rgba(201, 163, 91, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- stage / wheel ---------- */

.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  min-height: 0;
}

.wheel {
  position: relative;
  width: min(600px, 88vmin);
  aspect-ratio: 1 / 1;
}

.wheel__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.beam {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.35;
  filter: drop-shadow(0 0 6px rgba(201, 163, 91, 0.35));
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation: drawBeam 2.2s 0.2s ease-out forwards, beamPulse 6s 2.6s ease-in-out infinite;
}

.beam--ring { opacity: 0.12; stroke-dashoffset: 1600; animation-delay: 0.9s, 2.6s; }

.beam--spoke {
  opacity: 0.1;
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation: drawBeam 2.2s 1.1s ease-out forwards;
}

@keyframes drawBeam {
  to { stroke-dashoffset: 0; }
}

@keyframes beamPulse {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.5; }
}

/* ---------- core d20 ---------- */

.core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
}

.core canvas {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 18px rgba(201, 163, 91, 0.35));
}

@keyframes coreFloat {
  0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  50% { transform: translate(-50%, -53%) scale(1.04) rotate(4deg); }
}

/* ---------- nodes ---------- */

.node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  outline: none;
}

.node--top { left: 50%; top: 10%; }
.node--right { left: 84.67%; top: 70%; }
.node--left { left: 15.33%; top: 70%; }
.node--left-up { left: 15.33%; top: 30%; }

.node__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(54px, 11vmin, 78px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(6px);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  animation: nodeIn 0.9s ease-out both;
}

.node--top .node__icon { animation-delay: 1.4s; }
.node--right .node__icon { animation-delay: 1.6s; }
.node--left .node__icon { animation-delay: 1.8s; }
.node--left-up .node__icon { animation-delay: 2s; }

.node__icon img {
  width: 58%;
  height: 58%;
  object-fit: contain;
  opacity: 0.85;
  filter: drop-shadow(0 0 8px rgba(201, 163, 91, 0.3));
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.node__icon::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(201, 163, 91, 0.12);
  transition: border-color 0.35s ease, inset 0.35s ease;
}

.node__label {
  font-family: var(--display);
  font-size: clamp(11px, 1.6vmin, 13px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
  transition: color 0.3s ease;
  animation: nodeIn 0.9s ease-out both;
  animation-delay: inherit;
}

.node:hover .node__icon,
.node:focus-visible .node__icon {
  transform: scale(1.1);
  border-color: rgba(201, 163, 91, 0.75);
  box-shadow: 0 0 30px rgba(201, 163, 91, 0.35);
}

.node:hover .node__icon img,
.node:focus-visible .node__icon img {
  opacity: 1;
  transform: scale(1.08);
}

.node:hover .node__icon::after,
.node:focus-visible .node__icon::after {
  inset: -16px;
  border-color: rgba(201, 163, 91, 0.35);
}

.node:hover .node__label,
.node:focus-visible .node__label { color: var(--gold-bright); }

.node:active .node__icon { transform: scale(0.97); }

@keyframes nodeIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- extra points ---------- */

.point {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--gold-bright);
  box-shadow: 0 0 12px rgba(201, 163, 91, 0.9), 0 0 26px rgba(201, 163, 91, 0.45);
  animation: pointIn 0.8s 1.5s ease-out both, pointGlow 4s 2.3s ease-in-out infinite;
  pointer-events: none;
}

.point::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(201, 163, 91, 0.25);
}


.point--right-up { left: 84.641%; top: 30%; animation-delay: 1.6s, 2.6s; }
.point--bottom { left: 50%; top: 90%; animation-delay: 1.7s, 2.9s; }

@keyframes pointIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes pointGlow {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* ---------- footer ---------- */

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 22px 24px 30px;
  color: var(--ink-dim);
  font-size: 13px;
}

.footer p { margin: 4px 0; }
.footer__small { font-size: 11.5px; opacity: 0.6; }

/* ---------- responsive ---------- */

@media (max-width: 520px) {
  .stage { padding: 24px 12px; }
  .node__label { font-size: 10px; letter-spacing: 0.06em; }
  .footer { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  .beam { stroke-dashoffset: 0; }
}
