@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #080812;
  --bg-soft: #101021;
  --card: rgba(20, 20, 42, 0.82);
  --text: #f7f4ff;
  --muted: #aaa6bd;
  --accent: #9f67ff;
  --accent-soft: #c6a7ff;
  --cyan: #55e6dc;
  --gold: #ffd36a;
  --line: rgba(198, 167, 255, 0.2);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: Manrope, Segoe UI, sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(111, 65, 194, 0.2), transparent 28rem),
    radial-gradient(circle at 90% 65%, rgba(33, 172, 164, 0.12), transparent 26rem),
    linear-gradient(145deg, var(--bg) 0%, #0e0b1c 55%, #070711 100%);
  color: var(--text);
  line-height: 1.65;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.7px, transparent 0.7px);
  background-size: 26px 26px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

a {
  color: var(--accent-soft);
  text-underline-offset: 0.2em;
  transition: color 180ms ease;
}

a:hover { color: #fff; }

header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 18, 0.74);
  backdrop-filter: blur(18px);
}

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0;
}

.brand {
  color: #fff;
  font-family: Cinzel, Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-shadow: 0 0 22px rgba(159, 103, 255, 0.65);
}

.brand::before {
  display: inline-grid;
  width: 1.8rem;
  height: 1.8rem;
  margin-right: 0.55rem;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  box-shadow: inset 0 0 10px rgba(159, 103, 255, 0.6);
  content: "✦";
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a {
  display: block;
  padding: 0.42rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

nav a:hover,
nav a.active {
  border-color: var(--line);
  background: rgba(159, 103, 255, 0.1);
  color: #fff;
}

main { padding: 3rem 0 5rem; }

.hero,
.card,
.game-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.15rem;
  padding: clamp(1.35rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background:
    linear-gradient(145deg, rgba(159, 103, 255, 0.12), transparent 45%),
    var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero {
  min-height: 510px;
  display: grid;
  align-items: center;
  padding: clamp(2rem, 7vw, 5.5rem);
}

.hero::after {
  position: absolute;
  top: 50%;
  right: clamp(-11rem, -7vw, -4rem);
  width: clamp(18rem, 42vw, 34rem);
  aspect-ratio: 1;
  border: 1px solid rgba(198, 167, 255, 0.25);
  border-radius: 50%;
  box-shadow:
    0 0 0 2rem rgba(159, 103, 255, 0.025),
    0 0 0 5rem rgba(159, 103, 255, 0.025),
    inset 0 0 80px rgba(85, 230, 220, 0.08);
  content: "✦";
  color: rgba(198, 167, 255, 0.7);
  font-family: Cinzel, serif;
  font-size: clamp(5rem, 16vw, 11rem);
  line-height: 1;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  animation: sigil-spin 28s linear infinite;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin-top: 0;
  font-family: Cinzel, Georgia, serif;
  line-height: 1.18;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.35rem, 7vw, 5.4rem);
  letter-spacing: -0.035em;
}

h2 { font-size: clamp(1.3rem, 3vw, 2rem); }

.hero h1 span {
  color: var(--accent-soft);
  text-shadow: 0 0 32px rgba(159, 103, 255, 0.4);
}

.hero-copy {
  max-width: 610px;
  color: #d5d1df;
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.7rem;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: 0.72rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  background: linear-gradient(135deg, var(--accent), #7042c4);
  box-shadow: 0 8px 24px rgba(112, 66, 196, 0.28);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover,
button:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(112, 66, 196, 0.42);
}

.button.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.muted { color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  transition: border-color 200ms ease, transform 200ms ease;
}

.grid .card:hover {
  border-color: rgba(198, 167, 255, 0.48);
  transform: translateY(-4px);
}

.card-icon {
  color: var(--gold);
  font-size: 1.8rem;
}

.game-panel {
  margin-top: 1.5rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 100%, rgba(85, 230, 220, 0.14), transparent 50%),
    var(--card);
}

.game-panel > p { max-width: 620px; margin-inline: auto; }

.rune-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 90px));
  justify-content: center;
  gap: 0.8rem;
  margin: 1.5rem auto;
}

.rune-tile {
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(198, 167, 255, 0.35);
  border-radius: 1rem;
  background: rgba(7, 7, 17, 0.75);
  box-shadow: inset 0 0 24px rgba(159, 103, 255, 0.12);
  color: var(--accent-soft);
  font-family: Cinzel, serif;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
}

.rune-tile.active,
.rune-tile:active {
  border-color: var(--cyan);
  background: rgba(85, 230, 220, 0.2);
  box-shadow: 0 0 30px rgba(85, 230, 220, 0.4), inset 0 0 20px rgba(85, 230, 220, 0.25);
  color: #fff;
  transform: scale(1.06);
}

.game-status {
  min-height: 1.7rem;
  color: var(--cyan);
  font-weight: 700;
}

.player-hud {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  width: 205px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(8, 8, 18, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  font-size: 0.75rem;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.hud-row strong { color: #fff; }

.xp-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.xp-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  transition: width 500ms ease;
}

.hidden-rune {
  position: fixed;
  z-index: 19;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 211, 106, 0.38);
  border-radius: 50%;
  background: rgba(15, 12, 30, 0.75);
  box-shadow: 0 0 25px rgba(255, 211, 106, 0.18);
  color: var(--gold);
  font-size: 1.3rem;
  opacity: 0.62;
  animation: rune-float 3s ease-in-out infinite;
}

.hidden-rune:hover,
.hidden-rune:focus-visible {
  opacity: 1;
  transform: scale(1.12);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 5.4rem;
  z-index: 40;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(85, 230, 220, 0.35);
  border-radius: 999px;
  background: #101021;
  color: var(--cyan);
  font-size: 0.84rem;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

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

label {
  display: block;
  margin: 0.8rem 0 0.3rem;
  font-weight: 600;
}

input, textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  outline: none;
  background: rgba(7, 7, 17, 0.75);
  color: var(--text);
  font: inherit;
}

input:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 130px; }
form button { margin-top: 1rem; }

footer {
  padding: 1.5rem 0 6rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

ul.tight li, ol li { margin-bottom: 0.55rem; }

@keyframes sigil-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

@keyframes rune-float {
  50% { translate: 0 -7px; }
}

@media (max-width: 760px) {
  .nav { align-items: flex-start; flex-direction: column; gap: 0.65rem; }
  nav ul { gap: 0.1rem; }
  nav a { padding: 0.3rem 0.5rem; font-size: 0.75rem; }
  main { padding-top: 1.5rem; }
  .hero { min-height: 480px; }
  .hero::after { right: -10rem; opacity: 0.45; }
  .rune-board { gap: 0.5rem; }
  .player-hud { right: 0.6rem; bottom: 0.6rem; width: 175px; }
}

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