/* ============================================
   TheGoodWin — The Constellation
   ============================================ */

:root {
  --bg-deep: #0d0d14;
  --bg-surface: #14141e;
  --node-dormant: #8ba4b8;
  --node-active: #d4a574;
  --node-glow: rgba(212, 165, 116, 0.4);
  --connection: rgba(139, 164, 184, 0.18);
  --connection-hover: rgba(139, 164, 184, 0.35);
  --text-primary: #e8e4df;
  --text-secondary: #9a9590;
  --text-muted: rgba(160, 180, 200, 0.6);
  --grain-opacity: 0.03;
  --vignette-strength: 0.3;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: default;
}

/* ---- Grain Overlay ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
  mix-blend-mode: overlay;
}

/* ---- Vignette ---- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, var(--vignette-strength)) 100%);
}

/* ---- Star Canvas ---- */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---- Connection Canvas ---- */
#connections {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---- Constellation Container ---- */
#constellation {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ---- Belief Nodes ---- */
.node {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--node-dormant);
  border: none;
  padding: 0;
  appearance: none;
  cursor: pointer;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(0);
  transition: background 0.5s ease, box-shadow 0.5s ease, transform 0.3s ease;
  box-shadow: 0 0 8px rgba(139, 164, 184, 0.3), 0 0 20px rgba(139, 164, 184, 0.1);
  z-index: 3;
}

.node::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 164, 184, 0.15) 0%, transparent 70%);
  transition: opacity 0.5s ease;
}

.node.visible {
  transform: translate(-50%, -50%) scale(1);
}

.node:hover {
  background: var(--node-active);
  box-shadow: 0 0 12px var(--node-glow), 0 0 35px rgba(212, 165, 116, 0.2);
  transform: translate(-50%, -50%) scale(1.4);
}

.node:hover::before {
  background: radial-gradient(circle, rgba(212, 165, 116, 0.2) 0%, transparent 70%);
}

.node:focus-visible {
  outline: none;
  background: var(--node-active);
  box-shadow: 0 0 0 2px rgba(212, 165, 116, 0.6), 0 0 18px var(--node-glow), 0 0 40px rgba(212, 165, 116, 0.2);
  transform: translate(-50%, -50%) scale(1.4);
}

.node:focus-visible .node-label {
  opacity: 1;
}

/* Node breathing animation */
@keyframes breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.node.visible {
  animation: breathe 4s ease-in-out infinite;
}

/* Stagger breathing so nodes don't sync */
.node:nth-child(3n) { animation-delay: 0s; animation-duration: 3.5s; }
.node:nth-child(3n+1) { animation-delay: 1.2s; animation-duration: 4.2s; }
.node:nth-child(3n+2) { animation-delay: 2.4s; animation-duration: 5s; }
.node:nth-child(5n) { animation-delay: 0.7s; animation-duration: 3.8s; }
.node:nth-child(7n) { animation-delay: 1.8s; animation-duration: 4.6s; }

/* ---- Node Tooltip (belief title on hover) ---- */
.node-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  font-weight: 400;
  font-style: italic;
  color: var(--node-active);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node:hover .node-label {
  opacity: 1;
}

/* ---- Belief Detail Overlay ---- */
#belief-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0);
  backdrop-filter: blur(0px);
  pointer-events: none;
  transition: background 0.6s ease, backdrop-filter 0.6s ease;
}

#belief-overlay.active {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  pointer-events: all;
}

.belief-card {
  max-width: 580px;
  width: 90%;
  text-align: center;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}

#belief-overlay.active .belief-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.belief-card-image {
  width: 280px;
  max-width: 70%;
  margin: 0 auto 2rem;
  display: block;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, white 50%, transparent 80%);
  mask-image: radial-gradient(circle, white 50%, transparent 80%);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

#belief-overlay.active .belief-card-image {
  opacity: 1;
  transform: scale(1);
}

.belief-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--node-active);
  margin-bottom: 1.2rem;
  letter-spacing: 0.01em;
}

.belief-card-detail {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 4px;
}

.belief-card-detail::-webkit-scrollbar {
  width: 3px;
}

.belief-card-detail::-webkit-scrollbar-thumb {
  background: rgba(139, 164, 184, 0.2);
  border-radius: 3px;
}

.belief-card-close {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s ease 0.3s, color 0.3s ease;
  line-height: 1;
}

#belief-overlay.active .belief-card-close {
  opacity: 1;
}

.belief-card-close:hover {
  color: var(--node-active);
}

/* ---- Navigation / Footer ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 2rem;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.site-header > * {
  pointer-events: all;
}

.site-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--node-active);
  text-decoration: none;
  transition: color 0.3s ease, opacity 0.3s ease;
  opacity: 0.85;
}

.site-title:hover {
  color: var(--node-active);
  opacity: 1;
}

.site-subtitle {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(212, 165, 116, 0.45);
  margin-top: 2px;
}

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.2rem 2rem;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

.site-footer > * {
  pointer-events: all;
}

.footer-left {
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.7;
  line-height: 1.5;
}

.footer-left a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-left a:hover {
  color: var(--node-active);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-link {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-link img {
  width: 22px;
  opacity: 0.4;
  transition: opacity 0.3s ease;
  filter: grayscale(100%) brightness(0.8);
}

.footer-link:hover img {
  opacity: 0.8;
  filter: grayscale(0%) brightness(1);
}

/* ---- Game Button ---- */
.game-btn {
  background: rgba(139, 164, 184, 0.04);
  border: 1px solid rgba(139, 164, 184, 0.2);
  color: rgba(200, 210, 225, 0.55);
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}

.game-btn:hover {
  border-color: var(--node-active);
  color: var(--node-active);
  background: rgba(212, 165, 116, 0.08);
}

.ambient-btn.active {
  border-color: var(--node-active);
  color: var(--node-active);
  background: rgba(212, 165, 116, 0.12);
}

/* ---- Game Modal ---- */
#game-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0);
  backdrop-filter: blur(0px);
  pointer-events: none;
  opacity: 0;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, opacity 0.4s ease;
}

#game-modal.active {
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  pointer-events: all;
  opacity: 1;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(800px, 90vw);
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.game-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--node-active);
  letter-spacing: 0.05em;
}

.game-score {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
}

.game-status {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.game-sound-btn {
  background: rgba(139, 164, 184, 0.04);
  border: 1px solid rgba(139, 164, 184, 0.2);
  color: rgba(200, 210, 225, 0.55);
  font-family: 'Outfit', sans-serif;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}

.game-sound-btn:hover,
.game-sound-btn.active {
  border-color: var(--node-active);
  color: var(--node-active);
  background: rgba(212, 165, 116, 0.08);
}

.game-arsenal {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.arsenal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid rgba(139, 164, 184, 0.2);
  background: rgba(139, 164, 184, 0.04);
  color: rgba(200, 210, 225, 0.6);
  font-family: 'Outfit', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, background 0.3s, transform 0.2s;
}

.arsenal-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.arsenal-count {
  font-size: 0.55rem;
  opacity: 0.7;
}

.arsenal-btn:hover {
  border-color: rgba(212, 165, 116, 0.6);
  color: var(--node-active);
}

.arsenal-btn.active {
  border-color: var(--node-active);
  color: var(--node-active);
  background: rgba(212, 165, 116, 0.1);
  transform: translateY(-1px);
}

.arsenal-icon {
  width: 12px;
  height: 12px;
  display: inline-block;
  position: relative;
}

.arsenal-icon.normal {
  background: #e8b87a;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(232, 184, 122, 0.4);
}

.arsenal-icon.heavy {
  background: #d7a166;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(215, 161, 102, 0.5);
}

.arsenal-icon.split {
  background: #e8b87a;
  border-radius: 50%;
  box-shadow: 6px 0 0 #e8b87a, -6px 0 0 #e8b87a;
}

.arsenal-icon.boom {
  background: #f1b778;
  clip-path: polygon(50% 0%, 62% 38%, 100% 38%, 70% 60%, 82% 100%, 50% 75%, 18% 100%, 30% 60%, 0% 38%, 38% 38%);
  box-shadow: 0 0 6px rgba(241, 183, 120, 0.5);
}

.arsenal-icon.slow::before,
.arsenal-icon.slow::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

.arsenal-icon.slow::before {
  top: 0;
  border-bottom: 6px solid #a9c5e8;
}

.arsenal-icon.slow::after {
  bottom: 0;
  border-top: 6px solid #a9c5e8;
}

.game-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
  z-index: 210;
}

.game-close:hover {
  color: var(--node-active);
}

#game-canvas {
  border-radius: 6px;
  background: #161625;
  border: 1px solid rgba(139, 164, 184, 0.12);
}

.game-instructions {
  margin-top: 0.8rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.2rem;
}

.legend-icon {
  width: 12px;
  height: 12px;
  display: inline-block;
  position: relative;
}

.legend-icon.heavy {
  background: #d7a166;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(215, 161, 102, 0.5);
}

.legend-icon.split {
  background: #e8b87a;
  border-radius: 50%;
  box-shadow: 6px 0 0 #e8b87a, -6px 0 0 #e8b87a;
}

.legend-icon.boom {
  background: #f1b778;
  clip-path: polygon(50% 0%, 62% 38%, 100% 38%, 70% 60%, 82% 100%, 50% 75%, 18% 100%, 30% 60%, 0% 38%, 38% 38%);
  box-shadow: 0 0 6px rgba(241, 183, 120, 0.5);
}

.legend-icon.slow::before,
.legend-icon.slow::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

.legend-icon.slow::before {
  top: 0;
  border-bottom: 6px solid #a9c5e8;
}

.legend-icon.slow::after {
  bottom: 0;
  border-top: 6px solid #a9c5e8;
}

/* ---- Level Complete Overlay ---- */
.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.game-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.game-overlay-card {
  background: rgba(15, 15, 25, 0.9);
  border: 1px solid rgba(139, 164, 184, 0.2);
  padding: 1.2rem 1.6rem;
  border-radius: 8px;
  text-align: center;
  min-width: min(300px, 90vw);
}

.game-overlay-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  color: var(--node-active);
  margin-bottom: 0.6rem;
}

.game-overlay-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.game-overlay-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Finale Overlay ---- */
.game-overlay.finale {
  background: radial-gradient(circle at 50% 20%, rgba(255, 210, 160, 0.12), rgba(10, 10, 15, 0.85));
  overflow: hidden;
}

.game-overlay.finale .game-overlay-card {
  position: relative;
  z-index: 6;
  background: rgba(12, 12, 20, 0.72);
  border: 1px solid rgba(241, 183, 120, 0.4);
  box-shadow: 0 0 30px rgba(241, 183, 120, 0.25);
  transform: translateY(8px);
  backdrop-filter: blur(6px);
}

.game-overlay.finale .game-overlay-title {
  font-size: 1.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.finale-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.finale-bg {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 50% 20%, rgba(247, 214, 165, 0.25), transparent 55%),
    radial-gradient(circle at 20% 70%, rgba(123, 171, 219, 0.22), transparent 60%),
    radial-gradient(circle at 80% 75%, rgba(241, 183, 120, 0.18), transparent 55%);
  animation: finale-glow 8s ease-in-out infinite;
}

.finale-rays {
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 90deg, rgba(241, 183, 120, 0.3), rgba(139, 164, 184, 0.05), rgba(241, 183, 120, 0.25));
  mix-blend-mode: screen;
  opacity: 0.6;
  animation: finale-spin 22s linear infinite;
}

.finale-shockwaves span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20vmin;
  height: 20vmin;
  border-radius: 50%;
  border: 2px solid rgba(241, 183, 120, 0.4);
  transform: translate(-50%, -50%);
  animation: finale-wave 4.2s ease-out infinite;
}

.finale-shockwaves span:nth-child(2) {
  animation-delay: 0.7s;
  border-color: rgba(160, 190, 255, 0.35);
}

.finale-shockwaves span:nth-child(3) {
  animation-delay: 1.4s;
  border-color: rgba(241, 183, 120, 0.25);
}

.finale-title {
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  text-align: center;
  color: #f7d6a5;
  text-shadow: 0 0 30px rgba(241, 183, 120, 0.4);
  z-index: 4;
  animation: finale-title-pop 1.2s ease-out forwards;
}

.finale-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.8rem;
  color: rgba(247, 214, 165, 0.7);
}

.finale-main {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 6vw, 4.8rem);
  letter-spacing: 0.18em;
  margin-top: 0.4rem;
  text-transform: uppercase;
}

.finale-sub {
  margin-top: 0.5rem;
  color: rgba(215, 161, 102, 0.9);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.finale-fireworks {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

@keyframes finale-glow {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes finale-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes finale-wave {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(4); opacity: 0; }
}

@keyframes finale-title-pop {
  0% { transform: translateX(-50%) translateY(20px); opacity: 0; }
  60% { transform: translateX(-50%) translateY(-6px); opacity: 1; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .finale-bg,
  .finale-rays,
  .finale-shockwaves span,
  .finale-title {
    animation: none;
  }
}

/* ---- Level Select ---- */
.level-select {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.level-select.active {
  opacity: 1;
  pointer-events: all;
}

.level-select-card {
  background: rgba(15, 15, 25, 0.95);
  border: 1px solid rgba(139, 164, 184, 0.2);
  padding: 1rem 1.2rem;
  border-radius: 10px;
  width: min(420px, 92vw);
}

.level-select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  color: var(--node-active);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
}

.level-select-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.level-btn {
  background: rgba(139, 164, 184, 0.08);
  border: 1px solid rgba(139, 164, 184, 0.2);
  color: rgba(200, 210, 225, 0.7);
  border-radius: 6px;
  padding: 0.5rem 0.4rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  position: relative;
}

.level-btn.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.level-btn.active {
  border-color: var(--node-active);
  color: var(--node-active);
}

.level-stars {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 4px;
}

.level-star {
  width: 8px;
  height: 8px;
  background: rgba(212, 165, 116, 0.25);
  clip-path: polygon(50% 0%, 62% 38%, 100% 38%, 70% 60%, 82% 100%, 50% 75%, 18% 100%, 30% 60%, 0% 38%, 38% 38%);
}

.level-star.filled {
  background: rgba(212, 165, 116, 0.9);
}

.game-restart-btn {
  background: none;
  border: 1px solid rgba(212, 165, 116, 0.3);
  color: var(--node-active);
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 3px;
  cursor: pointer;
  margin-top: 0.8rem;
  transition: background 0.3s, border-color 0.3s;
}

.game-restart-btn:hover {
  background: rgba(212, 165, 116, 0.1);
  border-color: var(--node-active);
}

.game-restart-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Onboarding Hint ---- */
.onboarding-hint {
  position: fixed;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  animation: hintFadeIn 1.5s ease 3s forwards;
}

.onboarding-hint.hidden {
  animation: hintFadeOut 0.8s ease forwards !important;
}

.onboarding-hint-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 400;
  font-style: italic;
  color: rgba(212, 165, 116, 0.6);
  letter-spacing: 0.04em;
}

.onboarding-hint-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(139, 164, 184, 0.35);
  margin-top: 0.5rem;
}

@keyframes hintFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes hintFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ---- Node Beckoning Pulse ---- */
@keyframes beckon {
  0% { background: var(--node-dormant); box-shadow: 0 0 8px rgba(139, 164, 184, 0.3), 0 0 20px rgba(139, 164, 184, 0.1); }
  50% { background: var(--node-active); box-shadow: 0 0 16px var(--node-glow), 0 0 40px rgba(212, 165, 116, 0.25); }
  100% { background: var(--node-dormant); box-shadow: 0 0 8px rgba(139, 164, 184, 0.3), 0 0 20px rgba(139, 164, 184, 0.1); }
}

.node.beckoning {
  animation: beckon 2s ease-in-out !important;
}

/* ---- UFO Targeting ---- */
@keyframes ufoPing {
  0% { box-shadow: 0 0 10px rgba(212, 165, 116, 0.25); transform: translate(-50%, -50%) scale(1); }
  50% { box-shadow: 0 0 24px rgba(212, 165, 116, 0.4); transform: translate(-50%, -50%) scale(1.6); }
  100% { box-shadow: 0 0 12px rgba(212, 165, 116, 0.25); transform: translate(-50%, -50%) scale(1.1); }
}

.node.ufo-target {
  box-shadow: 0 0 12px rgba(212, 165, 116, 0.22), 0 0 28px rgba(212, 165, 116, 0.14);
}

.node.ufo-ping {
  animation: ufoPing 0.9s ease-out;
}

/* ---- Game Modal (prevent close on drag) ---- */
.game-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

#game-modal.active .game-content {
  pointer-events: all;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .node-label {
    display: none;
  }

  .belief-card-title {
    font-size: 1.3rem;
  }

  .belief-card-image {
    width: 200px;
  }

  .belief-card-detail {
    font-size: 0.85rem;
  }

  .site-header {
    padding: 1rem 1.2rem;
  }

  .site-footer {
    padding: 0.8rem 1.2rem;
  }

  .belief-card-close {
    top: 1rem;
    right: 1rem;
  }
}

@media (max-width: 480px) {
  .belief-card-title {
    font-size: 1.1rem;
  }

  .belief-card-image {
    width: 160px;
    margin-bottom: 1.2rem;
  }

  .site-subtitle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .node.visible {
    animation: none !important;
  }

  .onboarding-hint {
    animation: none !important;
    opacity: 1;
  }

  .onboarding-hint.hidden {
    opacity: 0;
  }
}

/* ---- Utility ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
