:root {
  --bg: #090b1f;
  --panel: rgba(17, 24, 55, 0.78);
  --panel-strong: rgba(25, 35, 79, 0.92);
  --line: rgba(161, 196, 255, 0.18);
  --text: #f8fbff;
  --muted: #b9c7e6;
  --bright: #7df9ff;
  --violet: #a78bfa;
  --gold: #ffd166;
  --pink: #ff6ec7;
  --green: #7cffb2;
  --danger: #ff7a90;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(125, 249, 255, 0.18), transparent 35%),
    radial-gradient(circle at 80% 15%, rgba(255, 110, 199, 0.16), transparent 30%),
    linear-gradient(135deg, #090b1f 0%, #101843 45%, #050713 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(125, 249, 255, 0.9) 0 1px, transparent 1px);
  background-size: 72px 72px, 143px 143px;
  background-position: 0 0, 33px 44px;
  opacity: 0.18;
  animation: starDrift 22s linear infinite;
}

@keyframes starDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-72px, 72px, 0); }
}

.background-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.5;
  pointer-events: none;
  mix-blend-mode: screen;
}

.orb-one {
  width: 260px;
  height: 260px;
  left: -70px;
  top: 160px;
  background: rgba(125, 249, 255, 0.32);
}

.orb-two {
  width: 320px;
  height: 320px;
  right: -110px;
  top: 460px;
  background: rgba(255, 110, 199, 0.28);
}

.orb-three {
  width: 220px;
  height: 220px;
  left: 48%;
  bottom: -90px;
  background: rgba(255, 209, 102, 0.2);
}

.hero {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 58px 22px 28px;
  text-align: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--bright);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 6.25rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
  text-shadow: 0 0 38px rgba(125, 249, 255, 0.32);
}

.hero-copy {
  max-width: 820px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.75;
}

.dashboard {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 22px;
  max-width: 1420px;
  margin: 0 auto;
  padding: 20px 22px 48px;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, var(--panel), rgba(10, 15, 38, 0.72));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 25%, transparent 75%, rgba(125, 249, 255, 0.08));
}

.panel-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 12px;
}

.panel-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  letter-spacing: -0.04em;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(125, 249, 255, 0.28);
  border-radius: 999px;
  color: var(--bright);
  background: rgba(125, 249, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.panel-copy {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 24px 18px;
  color: var(--muted);
  line-height: 1.65;
}

.map-panel {
  grid-row: span 2;
  min-height: 860px;
}

.circle-stage {
  position: relative;
  width: min(100%, 820px);
  aspect-ratio: 1 / 1;
  margin: 8px auto 12px;
  isolation: isolate;
}

#circleSvg,
#angleLabels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#circleSvg {
  z-index: 1;
  overflow: visible;
}

#angleLabels {
  z-index: 3;
  pointer-events: none;
}

.axis-line {
  stroke: rgba(248, 251, 255, 0.24);
  stroke-width: 2;
  stroke-dasharray: 7 9;
}

.unit-ring {
  fill: rgba(125, 249, 255, 0.025);
  stroke: rgba(125, 249, 255, 0.76);
  stroke-width: 4;
  filter: drop-shadow(0 0 18px rgba(125, 249, 255, 0.55));
}

.spoke {
  stroke: rgba(167, 139, 250, 0.27);
  stroke-width: 2;
}

.spoke.major {
  stroke: rgba(255, 209, 102, 0.43);
  stroke-width: 3;
}

.beacon-dot {
  fill: var(--gold);
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3;
  filter: drop-shadow(0 0 13px rgba(255, 209, 102, 0.85));
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
  transform-origin: center;
}

.beacon-dot:hover,
.beacon-dot.active {
  fill: var(--green);
  filter: drop-shadow(0 0 20px rgba(124, 255, 178, 0.9));
}

.quadrant-label {
  fill: rgba(248, 251, 255, 0.28);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.beacon-label {
  pointer-events: auto;
  position: absolute;
  width: 122px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 8px 8px 7px;
  border: 1px solid rgba(248, 251, 255, 0.18);
  border-radius: 14px;
  background: rgba(9, 11, 31, 0.78);
  color: var(--text);
  text-align: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28), inset 0 0 18px rgba(125, 249, 255, 0.05);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.beacon-label:hover,
.beacon-label.active {
  border-color: rgba(124, 255, 178, 0.8);
  background: rgba(20, 47, 65, 0.92);
  transform: translate(-50%, -50%) scale(1.06);
}

.beacon-label .angle-text {
  color: var(--gold);
  font-weight: 950;
  font-size: 0.95rem;
}

.beacon-label .coord-text {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.15;
}

.center-badge {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.18), rgba(9, 11, 31, 0.7));
  transform: translate(-50%, -50%);
  box-shadow: 0 0 42px rgba(255, 209, 102, 0.2);
  text-align: center;
}

.center-badge span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.center-badge strong {
  display: block;
  color: var(--gold);
  font-size: 2.2rem;
  line-height: 1;
}

.angle-inspector {
  position: relative;
  z-index: 2;
  margin: 0 24px 24px;
  padding: 16px 18px;
  border: 1px solid rgba(125, 249, 255, 0.18);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: rgba(125, 249, 255, 0.055);
  line-height: 1.6;
}

.control-panel,
.match-panel,
.identity-panel,
.reference-panel {
  min-height: 300px;
}

.stats-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 8px 24px 16px;
}

.stat-card {
  border: 1px solid rgba(248, 251, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.055);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 1.75rem;
}

.progress-wrap {
  position: relative;
  z-index: 1;
  padding: 0 24px 18px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.progress-track {
  height: 13px;
  border: 1px solid rgba(125, 249, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bright), var(--violet), var(--pink));
  box-shadow: 0 0 22px rgba(125, 249, 255, 0.7);
  transition: width 260ms ease;
}

.question-card,
.identity-riddle {
  position: relative;
  z-index: 1;
  margin: 0 24px 18px;
  padding: 20px;
  border: 1px solid rgba(255, 209, 102, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 209, 102, 0.06);
}

.question-card h3,
.identity-riddle h3 {
  margin: 0 0 15px;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1.45;
}

.answer-options {
  display: grid;
  gap: 10px;
}

.answer-btn,
.match-card,
.identity-option {
  border: 1px solid rgba(248, 251, 255, 0.16);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.answer-btn,
.identity-option {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  font-weight: 850;
  text-align: left;
}

.answer-btn:hover,
.identity-option:hover,
.match-card:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 249, 255, 0.65);
  background: rgba(125, 249, 255, 0.11);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.answer-btn.correct,
.identity-option.correct {
  border-color: rgba(124, 255, 178, 0.75);
  background: rgba(124, 255, 178, 0.13);
}

.answer-btn.wrong,
.identity-option.wrong {
  border-color: rgba(255, 122, 144, 0.72);
  background: rgba(255, 122, 144, 0.13);
}

.feedback {
  min-height: 28px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.feedback.good {
  color: var(--green);
}

.feedback.bad {
  color: var(--danger);
}

.button-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 24px 24px;
}

button {
  font: inherit;
}

.primary-btn,
.ghost-btn,
.mini-btn {
  border-radius: 999px;
  font-weight: 950;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.primary-btn {
  border: 0;
  padding: 13px 18px;
  color: #08111f;
  background: linear-gradient(135deg, var(--bright), var(--green));
  box-shadow: 0 12px 26px rgba(125, 249, 255, 0.24);
}

.ghost-btn,
.mini-btn {
  border: 1px solid rgba(248, 251, 255, 0.18);
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.ghost-btn {
  padding: 13px 18px;
}

.mini-btn {
  min-height: 36px;
  padding: 8px 12px;
  white-space: nowrap;
}

.primary-btn:hover,
.ghost-btn:hover,
.mini-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
  border-color: rgba(125, 249, 255, 0.55);
}

.match-panel,
.identity-panel,
.reference-panel {
  grid-column: span 1;
}

.match-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 24px 12px;
}

.deck-title {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.96rem;
}

.card-deck {
  display: grid;
  gap: 9px;
}

.match-card {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  color: var(--text);
  font-weight: 900;
  text-align: center;
}

.match-card.selected {
  border-color: rgba(255, 209, 102, 0.9);
  background: rgba(255, 209, 102, 0.13);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.08);
}

.match-card.matched {
  border-color: rgba(124, 255, 178, 0.72);
  color: var(--green);
  background: rgba(124, 255, 178, 0.09);
  cursor: default;
}

.match-panel .feedback {
  position: relative;
  z-index: 1;
  padding: 0 24px 22px;
}

.identity-cards {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  padding: 2px 24px 18px;
}

.identity-card {
  border: 1px solid rgba(125, 249, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: rgba(125, 249, 255, 0.055);
}

.identity-card h3 {
  margin: 0 0 8px;
  color: var(--gold);
}

.identity-formula {
  display: inline-flex;
  margin: 4px 0 10px;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--green);
  background: rgba(0, 0, 0, 0.24);
  font-size: 1.05rem;
  font-weight: 950;
}

.identity-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.reference-panel {
  grid-column: 1 / -1;
}

.table-wrap {
  position: relative;
  z-index: 1;
  margin: 0 24px 24px;
  overflow-x: auto;
  border: 1px solid rgba(248, 251, 255, 0.13);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.16);
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(248, 251, 255, 0.1);
  text-align: left;
}

th {
  color: var(--bright);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(125, 249, 255, 0.07);
}

td {
  color: var(--text);
  font-weight: 750;
}

td:nth-child(4) {
  color: var(--gold);
}

tr:last-child td {
  border-bottom: 0;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 22px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 14px 18px;
  border: 1px solid rgba(124, 255, 178, 0.4);
  border-radius: 999px;
  color: var(--text);
  background: rgba(9, 11, 31, 0.88);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.footer-note {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px 42px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .map-panel {
    grid-row: auto;
    min-height: auto;
  }

  .match-panel,
  .identity-panel,
  .reference-panel {
    grid-column: 1;
  }
}

@media (max-width: 780px) {
  .hero {
    padding-top: 36px;
  }

  .dashboard {
    padding-inline: 12px;
  }

  .panel-heading {
    flex-direction: column;
    padding: 20px 18px 10px;
  }

  .panel-copy,
  .progress-wrap,
  .stats-grid,
  .button-row {
    padding-inline: 18px;
  }

  .question-card,
  .identity-riddle,
  .angle-inspector,
  .table-wrap {
    margin-inline: 18px;
  }

  .circle-stage {
    width: 100%;
    margin-top: 18px;
  }

  .beacon-label {
    width: 92px;
    min-height: 42px;
    padding: 5px 4px;
    border-radius: 11px;
  }

  .beacon-label .angle-text {
    font-size: 0.78rem;
  }

  .beacon-label .coord-text {
    font-size: 0.56rem;
  }

  .center-badge {
    width: 78px;
    height: 78px;
  }

  .center-badge strong {
    font-size: 1.5rem;
  }

  .stats-grid,
  .match-grid {
    grid-template-columns: 1fr;
  }

  .toast {
    border-radius: 18px;
  }
}
