@font-face {
  font-family: 'Andy';
  src: url(assets/ANDYB.TTF) format('truetype');
  font-weight: bold;
  font-display: swap;
}

:root {
  --bg:          #050409;
  --bg-panel:    rgba(10, 7, 22, 0.88);
  --purple:      #7b3fff;
  --purple-glow: rgba(123, 63, 255, 0.35);
  --cyan:        #1af0ff;
  --cyan-glow:   rgba(26, 240, 255, 0.1);
  --text:        #ccc4ee;
  --text-muted:  #5e5878;
  --text-bright: #e8e0ff;
  --online:      #00e888;
  --offline:     #ff4060;
  --border:      rgba(123, 63, 255, 0.18);
  --font-display: 'Andy', 'Georgia', serif;
  --font-mono:    'IBM Plex Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: #2a2018;
  background-image: url(assets/bg_terraria.png);
  background-size: 320px 192px;
  background-repeat: repeat;
  color: var(--text);
  font-family: var(--font-display);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 9, 0.50);
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

/* ── BACKGROUND CRYSTALS ── */

.bg-crystals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-crystal {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: scale(var(--s)) rotate(var(--rot, 0deg));
  transform-origin: center bottom;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  opacity: 0.35;
  animation: crystal-float var(--d, 8s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes crystal-float {
  0%, 100% { transform: scale(var(--s)) rotate(var(--rot, 0deg)) translateY(0); }
  50%       { transform: scale(var(--s)) rotate(var(--rot, 0deg)) translateY(-18px); }
}



a, button, [role="button"] { cursor: pointer; }

/* BACKGROUND VINES */
.bg-vines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.vine {
  position: absolute;
  top: 0;
  left: var(--x);
  width: 3px;
  height: var(--h);
  background: #2a7a14;
  opacity: 0.7;
  image-rendering: pixelated;
}
.vine-leaf {
  position: absolute;
  height: 3px;
  width: 8px;
  background: #3aaa1e;
  opacity: 0.7;
  top: var(--t);
  left: var(--side);
}

/* ── HERO ── */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem 6rem;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
}

.hero-glow--purple {
  width: 700px;
  height: 600px;
  background: radial-gradient(circle, rgba(123, 63, 255, 0.28) 0%, transparent 70%);
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  animation: glow-breathe 9s ease-in-out infinite;
}

.hero-glow--cyan {
  width: 400px;
  height: 350px;
  background: radial-gradient(circle, rgba(26, 240, 255, 0.14) 0%, transparent 70%);
  bottom: 80px;
  right: -50px;
  animation: glow-breathe-r 11s ease-in-out infinite;
}

@keyframes glow-breathe {
  0%, 100% { opacity: 0.8; transform: translateX(-50%) scale(1); }
  50%       { opacity: 1;   transform: translateX(-50%) scale(1.15); }
}
@keyframes glow-breathe-r {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.12); }
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  background: rgba(5, 3, 14, 0.60);
  padding: 2.5rem 3rem;
  border: 1px solid rgba(123, 63, 255, 0.2);
}

.hero-icon {
  width: 96px;
  height: 96px;
  filter:
    drop-shadow(0 0 24px rgba(123, 63, 255, 0.9))
    drop-shadow(0 0 60px rgba(26, 240, 255, 0.4));
  animation: icon-pulse 5s ease-in-out infinite;
}

@keyframes icon-pulse {
  0%, 100% { filter: drop-shadow(0 0 24px rgba(123,63,255,0.9)) drop-shadow(0 0 60px rgba(26,240,255,0.4)); }
  50%       { filter: drop-shadow(0 0 44px rgba(123,63,255,1))   drop-shadow(0 0 90px rgba(26,240,255,0.65)); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 8rem);
  font-weight: bold;
  letter-spacing: 0.14em;
  line-height: 1;
  color: #f0eaff;
  text-shadow:
    3px 3px 0 #1a004a,
    0 0 30px rgba(123, 63, 255, 0.7),
    0 0 80px rgba(26, 240, 255, 0.25);
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text);
  letter-spacing: 0.04em;
  line-height: 1.7;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 1rem 0.4rem 0.7rem;
  background: rgba(15, 12, 29, 0.85);
  border: 2px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  transition: border-color 0.4s, color 0.4s;
}

.status-pill--online  { border-color: rgba(0, 232, 136, 0.45); color: var(--online); }
.status-pill--offline { border-color: rgba(255, 64, 96, 0.4);  color: var(--offline); }

.status-sprite {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: sprite-bob 3s ease-in-out infinite;
}

@keyframes sprite-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-3px); }
}

.btn-terraria {
  display: inline-block;
  padding: 0.65rem 1.8rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: #f0e8ff;
  background: #2a1058;
  border-width: 3px;
  border-style: solid;
  border-color: #9966ee #3311aa #3311aa #9966ee;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.9);
  box-shadow: 0 0 20px rgba(123, 63, 255, 0.45);
  cursor: pointer;
  transition: filter 0.1s, box-shadow 0.15s;
}

.btn-terraria:hover {
  filter: brightness(1.3);
  box-shadow: 0 0 36px rgba(123, 63, 255, 0.75);
}

.btn-terraria:active {
  border-color: #3311aa #9966ee #9966ee #3311aa;
  transform: translate(1px, 1px);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  z-index: 2;
}

.scroll-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scroll-drop 2.5s ease-in-out infinite;
}

@keyframes scroll-drop {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: scaleY(1); transform-origin: top; opacity: 0; }
}

/* ── DIVIDERS ── */

.gem-divider {
  height: 2px;
  max-width: 800px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent 0%, rgba(123,63,255,0.65) 28%, rgba(26,240,255,0.55) 65%, transparent 100%);
}

.gem-divider--flip {
  background: linear-gradient(90deg, transparent 0%, rgba(26,240,255,0.55) 35%, rgba(123,63,255,0.65) 72%, transparent 100%);
}

/* ── SECTIONS ── */

.section {
  padding: 5rem 2rem;
  background: rgba(5, 3, 14, 0.88);
}

.container { max-width: 860px; margin: 0 auto; }

.section-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: bold;
  letter-spacing: 0.08em;
  color: var(--text-bright);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.9), 0 0 18px rgba(123,63,255,0.5);
  margin-bottom: 2rem;
}

.heading-gem {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  height: 52px;
  width: auto;
  filter: drop-shadow(0 0 10px var(--purple-glow));
}

/* ── STAT GRID ── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2px;
  background: var(--border);
  border: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-panel);
  padding: 1.4rem 1.2rem;
  transition: background 0.2s;
}

.stat-card:hover { background: rgba(123, 63, 255, 0.07); }

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn {
  background: none;
  border: 2px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s;
}

.copy-btn:hover,
.copy-btn.copied { border-color: var(--purple); color: var(--purple); }

.players-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.players-row__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.player-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.2rem 0.7rem;
  border: 2px solid rgba(26, 240, 255, 0.3);
  color: var(--cyan);
  background: rgba(26, 240, 255, 0.04);
}

.offline-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.2rem;
  padding: 0.9rem 1.1rem;
  border: 2px solid rgba(255, 64, 96, 0.3);
  background: rgba(255, 64, 96, 0.04);
  color: rgba(255, 180, 190, 0.85);
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.offline-gem {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 32px;
  filter: grayscale(0.6) brightness(0.6);
}

/* ── STEPS ── */

.steps { display: flex; flex-direction: column; }

.step {
  background: rgba(10, 7, 22, 0.55);
  border-left: 2px solid rgba(123, 63, 255, 0.25);
  display: flex;
  gap: 1.5rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
  transition: transform 0.2s;
}

.step:last-child { border-bottom: none; }
.step:hover { transform: translateX(0.5rem); }

.step-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 44px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--purple);
  opacity: 0.85;
  padding-top: 0.1rem;
}

.step-gem {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 36px;
  height: 39px;
  filter: drop-shadow(0 0 7px rgba(123, 63, 255, 0.8));
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  color: var(--text-bright);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.8);
  margin-bottom: 0.4rem;
}

.step-desc {
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--cyan);
  background: rgba(26, 240, 255, 0.06);
  padding: 0.1em 0.35em;
  border: 1px solid rgba(26, 240, 255, 0.15);
}

/* ── SIGN PANEL ── */

.sign-panel {
  background: #0a0918;
  border: 3px solid #4e5df6;
  box-shadow:
    inset 0 0 0 2px #4248ab,
    inset 0 0 0 5px #161839,
    0 8px 40px rgba(0,0,0,0.85);
  border-radius: 4px;
  max-width: 680px;
  overflow: hidden;
}

.sign-inner {
  background: #0d0b1e;
  padding: 1.6rem 1.8rem 1rem;
}

.sign-footer {
  display: flex;
  gap: 2.5rem;
  padding: 0.75rem 1.8rem;
  background: #0e0c22;
  border-top: 2px solid #4248ab;
}

.sign-btn {
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  color: #f0e040;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.8);
}

.sign-btn--disabled {
  color: #555a88;
}

.sign-rules { list-style: none; display: flex; flex-direction: column; }

.sign-rules li {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.8);
  padding: 0.75rem 0 0.75rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  line-height: 1.5;
  position: relative;
}

.sign-rules li:last-child { border-bottom: none; }

.sign-rules li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: #FFD700;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
}

/* ── FOOTER ── */

.footer { background: rgba(5, 3, 14, 0.97); }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.footer-logo img { image-rendering: pixelated; }

.footer-link {
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--purple);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

.footer-link:hover { color: var(--text-bright); }

.footer-credit {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.45;
  letter-spacing: 0.12em;
}

/* ── RESPONSIVE ── */

@media (max-width: 640px) {
  .hero-content { padding: 1.8rem 1.4rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .step {
  background: rgba(10, 7, 22, 0.55);
  border-left: 2px solid rgba(123, 63, 255, 0.25); gap: 1rem; }
  .footer-inner { flex-direction: column; text-align: center; align-items: center; }
  .sign-panel { max-width: 100%; }
}
