/* Minecraft-Look: Pixel-Schrift, eckige Kanten, Knöpfe und Slots mit Lichtkante oben
   und Schattenkante unten – wie im Spiel. Farben kommen aus der Season (per JS). */

@font-face {
  font-family: 'Monocraft';
  src: url('/fonts/monocraft.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Monocraft';
  src: url('/fonts/monocraft-bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@property --primary { syntax: '<color>'; inherits: true; initial-value: #f97316; }
@property --secondary { syntax: '<color>'; inherits: true; initial-value: #dc2626; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #facc15; }
@property --bg { syntax: '<color>'; inherits: true; initial-value: #150b05; }
@property --surface { syntax: '<color>'; inherits: true; initial-value: #24140a; }
@property --text { syntax: '<color>'; inherits: true; initial-value: #fff3e0; }

:root {
  --muted: color-mix(in srgb, var(--text) 66%, var(--bg));
  --line: color-mix(in srgb, var(--text) 14%, transparent);
  --panel: color-mix(in srgb, var(--surface) 88%, transparent);
  --light-edge: color-mix(in srgb, #fff 16%, transparent);
  --dark-edge: rgba(0, 0, 0, .45);
  --mc: 'Monocraft', ui-monospace, 'Courier New', monospace;
  --shadow-text: 2px 2px 0 rgba(0, 0, 0, .55);
  transition: --primary .8s steps(8), --secondary .8s steps(8), --accent .8s steps(8),
    --bg .8s steps(8), --surface .8s steps(8), --text .8s steps(8);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: var(--mc);
  font-size: 15px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  /* Block-Raster im Hintergrund */
  background-color: var(--bg);
  background-image:
    linear-gradient(color-mix(in srgb, var(--text) 3%, transparent) 2px, transparent 2px),
    linear-gradient(90deg, color-mix(in srgb, var(--text) 3%, transparent) 2px, transparent 2px);
  background-size: 64px 64px;
}
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; image-rendering: pixelated; }
h1, h2, h3 { font-weight: 700; text-shadow: var(--shadow-text); line-height: 1.3; }
code {
  font-family: var(--mc);
  background: rgba(0, 0, 0, .4);
  border: 2px solid rgba(0, 0, 0, .5);
  padding: 0 .4em;
  font-size: .92em;
}
::selection { background: var(--primary); color: #fff; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; position: relative; z-index: 1; }

#particles { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; image-rendering: pixelated; }
.glow {
  position: fixed; width: 60vmax; height: 60vmax;
  filter: blur(120px); opacity: .18; pointer-events: none; z-index: 0;
}
.glow-a { background: var(--primary); top: -30vmax; left: -20vmax; }
.glow-b { background: var(--secondary); bottom: -35vmax; right: -25vmax; }

/* ------------------------------------------------------------ Bausteine */

/* Panel wie ein Minecraft-Menü: schwarzer Rand, helle Kante oben links, dunkle unten rechts */
.card {
  position: relative;
  background: var(--panel);
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 var(--light-edge), inset -3px -3px 0 var(--dark-edge);
  padding: 22px;
}

/* Knopf wie im Spiel */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; line-height: 1.2;
  padding: 13px 22px;
  color: #fff; text-shadow: var(--shadow-text);
  background: color-mix(in srgb, var(--surface) 60%, #6b6b6b);
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, .28), inset -3px -4px 0 rgba(0, 0, 0, .4);
  image-rendering: pixelated;
  transition: none;
}
.btn:hover { outline: 3px solid #fff; outline-offset: -3px; color: #ffffa0; }
.btn:active { box-shadow: inset 3px 4px 0 rgba(0, 0, 0, .4), inset -3px -3px 0 rgba(255, 255, 255, .15); }
.btn.primary { background: var(--primary); }
.btn.ip { font-size: 16px; }
.btn.ip small { font-size: 12px; opacity: .85; font-weight: 400; }
.btn[aria-disabled="true"] { pointer-events: none; background: #3a3a3a; color: #a0a0a0; }

/* Inventar-Slot */
.slot {
  display: grid; place-items: center; flex: none;
  width: 54px; height: 54px; font-size: 28px; line-height: 1;
  background: rgba(0, 0, 0, .35);
  border: 3px solid;
  border-color: rgba(0, 0, 0, .7) color-mix(in srgb, #fff 22%, transparent) color-mix(in srgb, #fff 22%, transparent) rgba(0, 0, 0, .7);
}

/* Tooltip wie beim Hovern über ein Item */
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .5px;
  padding: 6px 12px;
  background: rgba(16, 0, 16, .92);
  border: 3px solid rgba(16, 0, 16, .92);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 70%, #000);
  color: var(--accent); text-shadow: var(--shadow-text);
}
.badge .pulse { width: 10px; height: 10px; background: #55ff55; animation: blink 1.2s steps(2) infinite; }
.badge.ended .pulse { background: #aaaaaa; animation: none; }
.badge.upcoming .pulse { background: #ffff55; }
@keyframes blink { 50% { opacity: .25; } }

/* ------------------------------------------------------------ Kopfzeile */
.announcement {
  position: relative; z-index: 3;
  background: var(--primary);
  border-bottom: 3px solid #000;
  color: #fff; text-align: center; font-weight: 700; font-size: 13px; text-shadow: var(--shadow-text);
  padding: 8px 20px;
}
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, #000);
  border-bottom: 3px solid #000;
  box-shadow: inset 0 -3px 0 var(--light-edge);
}
.topbar-inner { display: flex; align-items: center; gap: 22px; height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-cube {
  width: 32px; height: 32px; flex: none;
  background: var(--primary);
  border: 3px solid #000;
  box-shadow: inset 4px 4px 0 rgba(255, 255, 255, .3), inset -4px -4px 0 rgba(0, 0, 0, .35);
}
.brand-name { font-weight: 700; font-size: 17px; text-shadow: var(--shadow-text); }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 14px;
  padding: 7px 11px; border: 3px solid transparent;
}
.nav a:hover { color: #ffffa0; }
.nav a.active { color: #fff; background: rgba(0, 0, 0, .35); border-color: rgba(0, 0, 0, .6); text-shadow: var(--shadow-text); }

.switcher { display: flex; gap: 6px; }
.switcher button {
  font: inherit; font-weight: 700; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 8px 12px; color: #d0d0d0; text-shadow: var(--shadow-text);
  background: #3c3c3c;
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, .2), inset -3px -3px 0 rgba(0, 0, 0, .4);
}
.switcher button:hover { outline: 3px solid #fff; outline-offset: -3px; }
.switcher button .dot { width: 12px; height: 12px; border: 2px solid #000; }
.switcher button[aria-selected="true"] { color: #fff; background: var(--primary); }
.switcher .label-short { display: none; }
.menu-btn { display: none; }

/* ------------------------------------------------------------ Hero */
.hero { padding: 80px 0 60px; text-align: center; position: relative; }
.hero h1 {
  position: relative; display: inline-block;
  font-size: clamp(2.4rem, 8vw, 5.4rem); margin: 26px 0 0; letter-spacing: -2px; line-height: 1.05;
  text-shadow: none;
}
.hero h1 .grad {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 70%, #fff) 0%, var(--primary) 55%, var(--secondary) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(4px 4px 0 #000) drop-shadow(0 0 0 #000);
}
/* Gelber Splash-Text wie im Titelbildschirm */
.splash {
  position: absolute; right: -40px; bottom: -12px;
  font-size: clamp(.8rem, 1.8vw, 1.15rem); font-weight: 700; letter-spacing: 0;
  color: #ffff55; text-shadow: 2px 2px 0 #3f3f15; white-space: nowrap;
  transform: rotate(-18deg); transform-origin: center;
  animation: splash .5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes splash { from { scale: 1; } to { scale: 1.09; } }
.hero .subtitle { font-size: 15px; color: var(--muted); margin: 26px 0 6px; text-shadow: var(--shadow-text); }
.hero p.lead { color: var(--text); max-width: 640px; margin: 0 auto 32px; font-size: 16px; text-shadow: var(--shadow-text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ------------------------------------------------------------ Abschnitte */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.section h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0; }
.section h2 small { display: block; font-size: 12px; color: var(--accent); letter-spacing: 2px; margin-bottom: 6px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stat .label { color: var(--muted); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 4px; text-shadow: var(--shadow-text); }
.stat .value.on { color: #55ff55; }
.stat .value.off { color: #ff5555; }
.players { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.players img { width: 28px; height: 28px; border: 2px solid #000; }

.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 2px dashed var(--line); }
.info-list li:last-child { border: 0; }
.info-list span:first-child { color: var(--muted); }
.info-list span:last-child { font-weight: 700; text-align: right; }

.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.feature .slot { margin-bottom: 14px; }
.feature:hover { outline: 3px solid color-mix(in srgb, var(--accent) 80%, #fff); outline-offset: -3px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; color: var(--accent); }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

.downloads { display: grid; gap: 12px; }
.download { display: flex; align-items: center; gap: 18px; }
.download .meta { flex: 1; min-width: 0; }
.download h3 { margin: 0; font-size: 16px; }
.download p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.download .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; }
.download .tags span { background: rgba(0, 0, 0, .4); border: 2px solid rgba(0, 0, 0, .6); padding: 1px 8px; color: var(--muted); }
.download .tags .good { color: #55ff55; }
.download .tags .new { color: #ffff55; border-color: #3f3f15; animation: blink 1.2s steps(2) infinite; }
.empty { color: var(--muted); text-align: center; padding: 40px; }
.lock-notice { text-align: center; margin-bottom: 12px; color: #ffff55; text-shadow: var(--shadow-text); }
.lock-notice .maint-count { margin: 8px 0 0; }

.page { padding: 60px 0; max-width: 860px; margin: 0 auto; }
.page h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0 0 20px; }
.prose h2 { margin-top: 1.6em; font-size: 1.35rem; color: var(--accent); }
.prose h3 { color: var(--accent); }
.prose blockquote {
  margin: 1.2em 0; padding: 12px 18px;
  background: rgba(16, 0, 16, .7); border: 3px solid #000;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 70%, #000);
}
.prose blockquote p { margin: 0; }
.prose img { border: 3px solid #000; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--line); }
.prose pre { background: rgba(0, 0, 0, .5); border: 3px solid #000; padding: 12px; overflow-x: auto; }
.prose pre code { border: 0; background: none; padding: 0; }
.prose li { margin: 4px 0; }

.cta { text-align: center; padding: 48px 24px; margin: 30px 0 60px; background: color-mix(in srgb, var(--primary) 22%, var(--surface)); }
.cta h2 { margin: 0 0 8px; }
.cta p { color: var(--muted); margin: 0 0 24px; }

.footer { position: relative; z-index: 1; border-top: 3px solid #000; background: rgba(0, 0, 0, .3); padding: 24px 0; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-admin { color: var(--muted); text-decoration: none; opacity: .5; }
.footer-admin:hover { opacity: 1; }

/* Erfolgs-Meldung wie "Fortschritt erzielt!" oben rechts */
.toast {
  position: fixed; top: 18px; right: 18px; z-index: 50;
  display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: calc(100vw - 36px);
  padding: 10px 16px 10px 10px;
  background: #212121; border: 3px solid #000;
  box-shadow: inset 3px 3px 0 #555, inset -3px -3px 0 #111;
  transform: translateX(calc(100% + 40px)); transition: transform .35s steps(6);
  pointer-events: none;
}
.toast.show { transform: none; }
.toast .t-icon { width: 40px; height: 40px; font-size: 22px; }
.toast .t-title { color: #ffff55; font-weight: 700; font-size: 13px; text-shadow: var(--shadow-text); }
.toast .t-text { color: #fff; font-size: 13px; text-shadow: var(--shadow-text); line-height: 1.4; }
.loading { padding: 120px 0; text-align: center; color: var(--muted); }

.fade-in { animation: fadeIn .4s steps(5) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ Sponsor */
.sponsor { display: flex; align-items: center; gap: 22px; }
.sponsor-logo { width: 84px; height: 84px; flex: none; border: 3px solid #000; image-rendering: auto; }
.sponsor-text { flex: 1; min-width: 0; }
.sponsor-label { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); }
.sponsor h2 { margin: 2px 0 6px; font-size: 1.5rem; }
.sponsor p { margin: 0; color: var(--muted); font-size: 14px; }
.sponsor-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-sponsor { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; }
.footer-sponsor img { width: 20px; height: 20px; image-rendering: auto; }
.footer-sponsor b { color: var(--accent); }
.footer-sponsor:hover b { text-decoration: underline; }

/* ------------------------------------------------------------ Wartung */
.maint-banner { background: #3a2a00; color: #ffff55; border-bottom-color: #000; }
.maint-banner b { color: #fff; }
body.maintenance .menu-btn, body.maintenance .announcement:not(.maint-banner) { display: none !important; }
.maint { min-height: 70vh; display: grid; place-items: center; padding: 60px 0; }
.maint-card { max-width: 620px; width: 100%; text-align: center; padding: 40px 28px; }
.maint-icon { margin: 0 auto 18px; width: 72px; height: 72px; font-size: 36px; }
.maint h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); margin: 0 0 12px; color: var(--accent); }
.maint p { color: var(--text); margin: 0 auto 26px; max-width: 480px; }
/* Ladebalken wie "Welt wird geladen" */
.maint-bar {
  height: 18px; margin: 0 auto 18px; max-width: 360px; position: relative; overflow: hidden;
  background: #000; border: 3px solid #000; box-shadow: inset 0 0 0 2px #555;
}
.maint-bar span {
  position: absolute; top: 2px; bottom: 2px; left: 2px; width: 30%;
  background: repeating-linear-gradient(90deg, var(--primary) 0 12px, color-mix(in srgb, var(--primary) 70%, #000) 12px 16px);
  animation: load 2.4s steps(24) infinite;
}
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.maint-count { color: var(--muted); margin-bottom: 26px; }
.maint-count b { color: #fff; font-size: 1.2em; }

/* ------------------------------------------------------------ Mobil */
@media (max-width: 960px) {
  .about { grid-template-columns: 1fr; }
  .menu-btn {
    display: flex; flex-direction: column; justify-content: center; gap: 5px; order: 3;
    width: 44px; height: 44px; padding: 0 10px; cursor: pointer;
    background: #3c3c3c; border: 3px solid #000;
    box-shadow: inset 3px 3px 0 rgba(255, 255, 255, .2), inset -3px -3px 0 rgba(0, 0, 0, .4);
  }
  .menu-btn span { height: 3px; background: #fff; }
  .topbar-inner { gap: 12px; }
  .brand { flex: 1; }
  .nav {
    display: none; position: absolute; top: 70px; left: 0; right: 0; flex-direction: column;
    padding: 12px 20px 20px; background: color-mix(in srgb, var(--bg) 95%, #000); border-bottom: 3px solid #000;
  }
  .nav.open { display: flex; }
  .switcher button .label-long { display: none; }
  .switcher button .label-short { display: inline; }
  .splash { right: -6px; bottom: -26px; }
  .sponsor { flex-wrap: wrap; align-items: flex-start; gap: 16px; }
  .sponsor-logo { width: 56px; height: 56px; }
  .sponsor-actions { width: 100%; }
  .hero .subtitle { margin-top: 40px; }
}
@media (max-width: 520px) {
  .brand-name { display: none; }
  .download { flex-wrap: wrap; }
  .download .btn { width: 100%; }
  .hero { padding-top: 56px; }
  .hero h1 { letter-spacing: -1px; }
  body { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { transition: none; }
  .fade-in, .badge .pulse, .splash { animation: none; }
}
