/* ==========================================================================
   SAVIO MC — "Betritt die Welt"
   Farbwelt: Nachtgrün / Schwarzblau / Leuchtgrün / Gold / dezentes Nether-Rot
   ========================================================================== */
:root {
  --night: #030c09;
  --night-2: #061c15;
  --deep-teal: #0a2c22;
  --forest: #123626;
  --forest-light: #1c4d38;
  --glow-green: #4dffa0;
  --glow-green-dim: rgba(77, 255, 160, 0.35);
  --gold: #e8b93f;
  --gold-dim: rgba(232, 185, 63, 0.35);
  --nether-red: #c23b30;
  --nether-glow: rgba(194, 59, 48, 0.45);
  --mist: #e6f5ec;
  --muted: #8fb0a2;

  --radius: 4px;
  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-pixel: "Press Start 2P", monospace;
  --font-body: "Manrope", system-ui, sans-serif;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--mist);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
code { background: rgba(0,0,0,0.35); padding: 2px 6px; border-radius: 3px; font-size: 0.9em; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 0.5em;
  color: var(--mist);
}

h1 { font-size: clamp(2.6rem, 8vw, 5rem); }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
h3 { font-size: 1.3rem; }

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.pixel-tag {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: var(--glow-green);
  text-shadow: 0 0 8px var(--glow-green-dim);
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(3,12,9,0.85), rgba(3,12,9,0));
  transition: background 0.3s ease;
}
.nav.scrolled { background: rgba(3,12,9,0.9); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(232,185,63,0.15); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  max-width: var(--container);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--mist);
}
.brand img { width: 34px; height: 34px; filter: drop-shadow(0 0 10px var(--glow-green-dim)); }
.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  border-radius: var(--radius);
  transition: color 0.15s ease;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 3px;
  height: 2px;
  background: var(--glow-green);
  transform: scaleX(0);
  transition: transform 0.2s ease;
  box-shadow: 0 0 8px var(--glow-green);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--mist); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  color: var(--mist);
  padding: 6px 10px;
  font-size: 1.1rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(2px); }
.btn-primary {
  background: var(--glow-green);
  color: #04140d;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.3), 0 0 24px var(--glow-green-dim), 0 4px 0 #1c7a4d;
}
.btn-primary:hover { box-shadow: 0 0 0 2px rgba(0,0,0,0.3), 0 0 36px var(--glow-green-dim), 0 4px 0 #1c7a4d; }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--mist);
  border: 1px solid var(--gold-dim);
}
.btn-ghost:hover { border-color: var(--gold); background: rgba(232,185,63,0.08); }
.btn-nether {
  background: transparent;
  color: var(--nether-red);
  border: 1px solid rgba(194,59,48,0.5);
}
.btn-nether:hover { background: var(--nether-glow); color: var(--mist); }

/* ==========================================================================
   HERO — the immersive world scene
   ========================================================================== */
.world {
  position: relative;
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.world-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 15%, rgba(77,255,160,0.08), transparent 60%),
    linear-gradient(180deg, #01060a 0%, #04231a 45%, #0a2c22 100%);
}
.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 20%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 70% 10%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 40% 30%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 85% 25%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 55% 15%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 10% 40%, rgba(255,255,255,0.4), transparent);
  opacity: 0.8;
}
.clouds { position: absolute; inset: 0; }
.cloud {
  position: absolute;
  background: rgba(230,245,236,0.05);
  border-radius: 50%;
  filter: blur(6px);
}
.cloud.c1 { width: 340px; height: 70px; top: 12%; left: -10%; animation: driftCloud 70s linear infinite; }
.cloud.c2 { width: 240px; height: 50px; top: 22%; left: 50%; animation: driftCloud 90s linear infinite; animation-delay: -20s; }
.cloud.c3 { width: 200px; height: 45px; top: 8%; left: 70%; animation: driftCloud 55s linear infinite; animation-delay: -10s; }
@keyframes driftCloud {
  from { transform: translateX(0); }
  to { transform: translateX(140vw); }
}

.world-layer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  will-change: transform;
}

.mountains {
  height: 46%;
  background: linear-gradient(180deg, #0d2b22, #071c16);
  clip-path: polygon(0% 100%, 0% 55%, 8% 40%, 18% 60%, 28% 30%, 38% 58%, 48% 20%, 58% 55%, 68% 35%, 78% 62%, 88% 42%, 100% 60%, 100% 100%);
  opacity: 0.65;
}

.forest {
  height: 30%;
  background: linear-gradient(180deg, #143a29, #0a2318);
  clip-path: polygon(
    0% 100%, 0% 70%, 3% 55%, 6% 68%, 9% 50%, 12% 66%, 16% 48%, 20% 64%,
    24% 45%, 28% 62%, 33% 42%, 38% 60%, 43% 46%, 48% 58%, 53% 40%, 58% 60%,
    63% 44%, 68% 58%, 73% 42%, 78% 62%, 83% 46%, 88% 60%, 93% 48%, 97% 62%, 100% 55%, 100% 100%
  );
}

.village {
  height: 20%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding: 0 8%;
}
.village .hut {
  width: 46px;
  background: #1a2e28;
  border-top: 22px solid #24463a;
  position: relative;
}
.village .hut::after {
  content: "";
  position: absolute;
  top: -22px; left: 18px;
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 1px;
  box-shadow: 0 0 10px var(--gold-dim);
}
.village .hut.h1 { height: 60px; }
.village .hut.h2 { height: 90px; width: 60px; }
.village .hut.h3 { height: 50px; }
.village .castle {
  width: 130px;
  height: 130px;
  background: #1e3c30;
  position: relative;
  border-top: 3px solid var(--gold-dim);
}
.village .castle::before,
.village .castle::after {
  content: "";
  position: absolute;
  top: -30px;
  width: 26px; height: 34px;
  background: #1e3c30;
}
.village .castle::before { left: 0; }
.village .castle::after { right: 0; }
.torch {
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 26px;
  background: #3a2818;
}
.torch::after {
  content: "";
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 14px;
  background: radial-gradient(circle, #ffdd88, var(--gold) 60%, transparent 80%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 1.4s ease-in-out infinite alternate;
  box-shadow: 0 0 16px 4px var(--gold-dim);
}
.torch.left { left: 14px; }
.torch.right { right: 14px; }
@keyframes flicker {
  0% { transform: translateX(-50%) scale(1) rotate(-2deg); opacity: 0.9; }
  100% { transform: translateX(-50%) scale(1.15) rotate(2deg); opacity: 1; }
}

.fireflies span {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--glow-green);
  box-shadow: 0 0 8px 2px var(--glow-green);
  animation: firefly 6s ease-in-out infinite;
  opacity: 0;
}

@keyframes firefly {
  0% { opacity: 0; transform: translate(0,0); }
  20% { opacity: 0.9; }
  50% { transform: translate(20px, -30px); }
  80% { opacity: 0.6; }
  100% { opacity: 0; transform: translate(-10px, -60px); }
}

.hero-content {
  position: relative;
  z-index: 5;
  text-align: center;
  padding-top: 40px;
}
.hero-logo {
  width: 150px;
  margin: 0 auto 18px;
  animation: floatLogo 6s ease-in-out infinite;
  filter: drop-shadow(0 0 30px var(--glow-green-dim)) drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}
@keyframes floatLogo {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow:
    3px 3px 0 #0a2c22,
    6px 6px 0 rgba(0,0,0,0.4),
    0 0 40px var(--glow-green-dim);
  margin-bottom: 6px;
}
.hero-sub {
  font-family: var(--font-pixel);
  font-size: clamp(0.6rem, 1.6vw, 0.85rem);
  color: var(--gold);
  letter-spacing: 0.04em;
  text-shadow: 0 0 12px var(--gold-dim);
  margin-bottom: 32px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 30px;
  background: rgba(4,20,14,0.7);
  border: 1px solid var(--glow-green-dim);
  backdrop-filter: blur(6px);
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #6b7280;
  flex-shrink: 0;
}
.status-dot.online { background: var(--glow-green); box-shadow: 0 0 10px var(--glow-green); animation: pulse 1.6s ease-in-out infinite; }
.status-dot.offline { background: var(--nether-red); box-shadow: 0 0 10px var(--nether-red); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.status-players { color: var(--mist); }
.status-sep { color: var(--muted); }

.scroll-hint {
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: bob 2s ease-in-out infinite;
}
.scroll-hint .arrow { width: 10px; height: 10px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); }
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ==========================================================================
   Realm sections — Dorf / PvP-Arena / Bibliothek / Nether-Portal
   ========================================================================== */
.realm {
  position: relative;
  padding: 100px 0;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.realm.village-realm { background: linear-gradient(180deg, #04140d, #071e17); }
.realm.arena-realm { background: linear-gradient(180deg, #071e17, #1a0d0c); }
.realm.library-realm { background: linear-gradient(180deg, #0a1810, #07160f); }
.realm.nether-realm { background: linear-gradient(180deg, #100906, #1a0908); }

.realm-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.realm-head.in-view { opacity: 1; transform: translateY(0); }
.realm-eyebrow {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--glow-green);
  margin-bottom: 12px;
  display: block;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* Card */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.15));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 26px;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--glow-green), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.card:hover::before { opacity: 1; }
.card-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius);
  background: rgba(77,255,160,0.1);
  border: 1px solid var(--glow-green-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 14px;
}

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Rankings / Arena */
.rank-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: rgba(255,255,255,0.02);
}
.rank-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  width: 32px;
  color: var(--muted);
}
.rank-row.gold-rank .rank-number { color: var(--gold); text-shadow: 0 0 12px var(--gold-dim); }
.rank-name { flex: 1; font-weight: 700; }
.rank-value { font-family: var(--font-pixel); font-size: 0.65rem; color: var(--glow-green); }

/* Library */
.library-shelf {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.book {
  flex: 0 0 150px;
  padding: 20px 16px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--forest), var(--deep-teal));
  border: 1px solid var(--gold-dim);
}
.book h4 { font-size: 0.95rem; margin-bottom: 6px; }
.book p { font-size: 0.82rem; margin: 0; }

/* Nether portal CTA */
.portal-frame {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 56px 32px;
  border-radius: var(--radius);
  border: 1px solid rgba(194,59,48,0.4);
  background: radial-gradient(ellipse at 50% 0%, rgba(194,59,48,0.15), transparent 70%);
  position: relative;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 36px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--night);
}
footer a { color: var(--glow-green); text-decoration: none; }
footer .pixel-tag { display: block; margin-bottom: 10px; }

/* ==========================================================================
   Inner pages (Regeln / Team / Wiki / Galerie) — shared panel look
   ========================================================================== */
.page-hero {
  padding: 140px 24px 60px;
  text-align: center;
  background: linear-gradient(180deg, #04140d, var(--night) 80%);
}
.page-hero h1 { text-shadow: 3px 3px 0 rgba(0,0,0,0.4), 0 0 30px var(--glow-green-dim); }
section.content { padding: 60px 0; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px dashed rgba(255,255,255,0.12);
  aspect-ratio: 4/3;
  background: rgba(255,255,255,0.02);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); }
th { color: var(--gold); font-family: var(--font-display); font-weight: 700; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(77,255,160,0.1);
  color: var(--glow-green);
  border: 1px solid var(--glow-green-dim);
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 860px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .village .castle { width: 100px; height: 100px; }
}
@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    top: 62px; left: 0; right: 0;
    flex-direction: column;
    background: rgba(3,12,9,0.97);
    border-bottom: 1px solid var(--gold-dim);
    padding: 10px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .world { min-height: 560px; }
  .village .hut { width: 34px; }
  .village .castle { width: 80px; height: 80px; }
  .realm { padding: 64px 0; }
}
