/* PrimeCubes – Startseite im Minecraft-Stil (alle Grafiken selbst gezeichnet) */

@font-face {
  font-family: "Press Start 2P";
  src: url("fonts/press-start-2p-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/pixelify-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/pixelify-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --sky-top: #6fb6ff;
  --sky-bottom: #cdeaff;
  --text: #ffffff;
  --shadow: #3f3f3f;
  --mc-yellow: #ffff55;
  --mc-green: #55ff55;
  --mc-gray: #aaaaaa;
  --mc-red: #ff5555;
  --block: 64px;
  --font-pixel: "Press Start 2P", monospace;
  --font-ui: "Pixelify Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --max: 1080px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: #1f1f1f;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
b { color: var(--mc-yellow); font-weight: 700; }

:focus-visible { outline: 3px solid var(--mc-yellow); outline-offset: 3px; }

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

/* ---------- Himmel: wächst mit dem Inhalt mit ---------- */
.overworld {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, #9fd2ff 55%, var(--sky-bottom) 100%);
}
.overworld > :not(.sky) { position: relative; z-index: 1; }
.sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.sun {
  position: absolute;
  top: 9%;
  right: 12%;
  width: 84px;
  height: 84px;
  background: #fff8c4;
  box-shadow: 0 0 0 12px rgba(255, 248, 196, 0.35), 0 0 80px 30px rgba(255, 240, 160, 0.55);
}
.cloud {
  position: absolute;
  left: 0;
  width: 192px;
  height: 32px;
  background: rgba(255, 255, 255, 0.92);
  animation: drift linear infinite;
}
.cloud::before {
  content: "";
  position: absolute;
  left: 32px;
  top: -24px;
  width: 96px;
  height: 24px;
  background: inherit;
}
/* Wolken erst unterhalb der Kopfzeile, damit der Name oben lesbar bleibt */
.cloud--1 { top: max(16%, 110px); animation-duration: 95s;  animation-delay: -10s; }
.cloud--2 { top: max(34%, 220px); animation-duration: 120s; animation-delay: -70s; width: 256px; }
.cloud--3 { top: max(9%, 96px);   animation-duration: 140s; animation-delay: -40s; width: 160px; }
.cloud--4 { top: max(58%, 340px); animation-duration: 110s; animation-delay: -95s; width: 224px; opacity: 0.8; }
@keyframes drift {
  from { transform: translateX(-300px); }
  to   { transform: translateX(110vw); }
}

/* ---------- Kopfzeile ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-pixel);
  font-size: 14px;
  text-shadow: 2px 2px 0 var(--shadow);
}
.brand img { width: 32px; height: 32px; }
.topbar-nav { display: flex; align-items: center; gap: 18px; }
.topbar-nav > a:not(.mc-btn) {
  font-family: var(--font-ui);
  font-size: 18px;
  text-decoration: none;
  text-shadow: 2px 2px 0 var(--shadow);
}
.topbar-nav > a:not(.mc-btn):hover { color: var(--mc-yellow); }

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - 80px - var(--block));
  min-height: max(calc(100vh - 80px - var(--block)), 600px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 56px;
  text-align: center;
}
.logo-wrap { position: relative; display: inline-block; }
.logo {
  margin: 0;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(34px, 8.4vw, 96px);
  line-height: 1.1;
  letter-spacing: 0.02em;
}
/* 3D-Kante wie beim Spieltitel: gestapelte Schatten */
.logo-prime {
  color: #ececec;
  text-shadow:
    0 2px 0 #c4c4c4, 0 4px 0 #9a9a9a, 0 6px 0 #7a7a7a, 0 8px 0 #5c5c5c,
    0.06em 0.12em 0 #2a2a2a;
}
.logo-cubes {
  color: #86d14a;
  text-shadow:
    0 2px 0 #6fb33a, 0 4px 0 #5a962b, 0 6px 0 #457a20, 0 8px 0 #365f18,
    0.06em 0.12em 0 #1f3a0c;
}
.splash {
  position: absolute;
  right: -5%;
  bottom: -4%;
  margin: 0;
  font-family: var(--font-pixel);
  font-size: clamp(11px, 1.7vw, 20px);
  color: var(--mc-yellow);
  text-shadow: 2px 2px 0 #3f3f15;
  white-space: nowrap;
  --splash-rot: -16deg;
  transform: rotate(var(--splash-rot));
  animation: splash 0.9s ease-in-out infinite alternate;
  transform-origin: center;
}
@keyframes splash {
  from { transform: rotate(var(--splash-rot)) scale(1); }
  to   { transform: rotate(var(--splash-rot)) scale(1.1); }
}
.edition {
  margin: 44px 0 30px;
  font-family: var(--font-ui);
  font-size: clamp(18px, 2.4vw, 24px);
  letter-spacing: 0.08em;
  text-shadow: 2px 2px 0 var(--shadow);
}

/* ---------- Tooltip-Fenster wie im Spiel ---------- */
.tooltip {
  width: min(560px, 100%);
  padding: 22px 24px 20px;
  background: rgba(16, 0, 16, 0.93);
  border: 3px solid;
  border-image: linear-gradient(180deg, #5000ff, #28007f) 1;
  outline: 3px solid #100010;
  text-align: left;
}
.tooltip-title {
  margin: 0 0 8px;
  font-family: var(--font-pixel);
  font-size: clamp(12px, 1.6vw, 15px);
  line-height: 1.6;
  color: var(--mc-yellow);
  text-shadow: 2px 2px 0 #3f3f15;
}
.tooltip-text { margin: 0 0 16px; color: #d6d6d6; }
.tooltip-note {
  margin: 14px 0 0;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--mc-gray);
  text-align: center;
}

/* Erfahrungsleiste als "Baufortschritt" */
.xpbar {
  position: relative;
  height: 14px;
  background: #1c1c1c;
  border: 2px solid #000;
  overflow: hidden;
}
.xpbar span {
  position: absolute;
  inset: 0;
  width: 64%;
  background: repeating-linear-gradient(90deg, #80ff20 0 22px, #5fcf14 22px 24px);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  animation: build 6s ease-in-out infinite;
}
@keyframes build {
  0%   { width: 18%; }
  50%  { width: 72%; }
  100% { width: 18%; }
}

/* ---------- Countdown in Blöcken ---------- */
.countdown {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tile-block {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  font-family: var(--font-pixel);
  font-size: 26px;
  color: #fff;
  text-shadow: 3px 3px 0 #2a1a10;
  background: url("img/grass.svg") center / cover;
  image-rendering: pixelated;
  border: 3px solid #000;
  box-shadow: inset -6px -6px 0 rgba(0, 0, 0, 0.25), inset 6px 6px 0 rgba(255, 255, 255, 0.12);
}
.countdown:not(.is-live) .tile-block { animation: hop 1.6s ease-in-out infinite; }
.countdown:not(.is-live) .tile:nth-child(2) .tile-block { animation-delay: 0.15s; }
.countdown:not(.is-live) .tile:nth-child(3) .tile-block { animation-delay: 0.3s; }
.countdown:not(.is-live) .tile:nth-child(4) .tile-block { animation-delay: 0.45s; }
@keyframes hop {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
}
.tile-label {
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--mc-gray);
  text-transform: uppercase;
}

/* ---------- Buttons wie im Spielmenü ---------- */
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 34px; }
.mc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  padding: 14px 22px;
  font-family: var(--font-ui);
  font-size: 20px;
  color: #fff;
  text-decoration: none;
  text-shadow: 2px 2px 0 var(--shadow);
  background: url("img/stone.svg") center / 64px 64px;
  image-rendering: pixelated;
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.35), inset -3px -4px 0 rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.mc-btn:hover {
  color: var(--mc-yellow);
  border-color: #fff;
  background-color: #8a8ad0;
  background-blend-mode: multiply;
}
.mc-btn--small { min-width: 0; padding: 8px 16px; font-size: 17px; }
.mc-btn.is-done { color: var(--mc-green); }

/* ---------- Boden ---------- */
.ground {
  height: var(--block);
  background: url("img/grass.svg") 0 0 / var(--block) var(--block) repeat-x;
  image-rendering: pixelated;
  border-bottom: 3px solid #3d2617;
}

/* ---------- Unter der Erde: abgedunkelte Erde wie im Optionsmenü ---------- */
.underground {
  padding: 64px 0 80px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.7)),
    url("img/dirt.svg") 0 0 / var(--block) var(--block);
  image-rendering: pixelated;
  scroll-margin-top: 0;
}
h2 {
  margin: 0 0 22px;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(16px, 2.4vw, 22px);
  line-height: 1.5;
  text-align: center;
  text-shadow: 3px 3px 0 #000;
}
h2:not(:first-child) { margin-top: 64px; }

.serverlist {
  display: flex;
  gap: 18px;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 3px solid #808080;
}
.srv-icon { width: 64px; height: 64px; flex: none; }
.srv-main { flex: 1; min-width: 0; }
.srv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.srv-name { font-family: var(--font-pixel); font-size: 15px; text-shadow: 2px 2px 0 #000; }
.srv-ping { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.srv-ping i { width: 4px; background: #3a3a3a; }
.srv-ping i:nth-child(1) { height: 4px; }
.srv-ping i:nth-child(2) { height: 7px; }
.srv-ping i:nth-child(3) { height: 10px; }
.srv-ping i:nth-child(4) { height: 13px; }
.srv-ping i:nth-child(5) { height: 16px; }
.srv-motd { margin: 2px 0 12px; font-family: var(--font-ui); font-size: 18px; }
.c-yellow { color: var(--mc-yellow); }
.c-green { color: var(--mc-green); }
.c-gray { color: var(--mc-gray); }
.srv-addr { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.srv-addr code {
  font-family: var(--font-pixel);
  font-size: clamp(12px, 1.8vw, 15px);
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
}
.hint { max-width: 720px; margin: 16px auto 0; text-align: center; color: #cfcfcf; }

/* Inventar-Slots */
.slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.slot {
  padding: 22px;
  color: #3f3f3f;
  background: #c6c6c6;
  border: 3px solid #000;
  box-shadow: inset 4px 4px 0 #fff, inset -4px -4px 0 #555;
}
.slot-icon {
  width: 72px;
  height: 72px;
  padding: 8px;
  margin-bottom: 14px;
  background: #8b8b8b;
  box-shadow: inset 3px 3px 0 #373737, inset -3px -3px 0 #fff;
}
.slot-icon svg { width: 100%; height: 100%; display: block; }
.slot h3 { margin: 0 0 6px; font-family: var(--font-ui); font-weight: 700; font-size: 22px; color: #2a2a2a; }
.slot p { margin: 0; color: #3f3f3f; }
.slot b { color: #1f6e1f; }

/* ---------- Fußzeile: Grundgestein ---------- */
.bedrock {
  padding: 44px 0 40px;
  text-align: center;
  color: #bdbdbd;
  background:
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.7)),
    url("img/stone.svg") 0 0 / var(--block) var(--block);
  image-rendering: pixelated;
  border-top: 4px solid #000;
}
.footer-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 15px;
  color: #d6d6d6;
}
.footer-brand img { width: 180px; image-rendering: auto; }
.bedrock nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 22px; margin: 22px 0 18px; font-family: var(--font-ui); font-size: 17px; }
.bedrock nav a { text-decoration: none; }
.bedrock nav a:hover { color: var(--mc-yellow); }
.disclaimer { max-width: 620px; margin: 0 auto 6px; font-size: 13px; color: #9a9a9a; }
.copyright { margin: 0; font-size: 13px; color: #9a9a9a; }

/* ---------- Responsiv ---------- */
@media (max-width: 860px) {
  .slots { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
}
@media (max-width: 560px) {
  :root { --block: 48px; }
  .container { padding: 0 16px; }
  .topbar { padding: 14px 16px; }
  .brand { font-size: 11px; }
  .topbar-nav > a:not(.mc-btn) { display: none; }
  .hero { padding: 16px 16px 48px; }
  /* auf dem Handy unter das Logo statt darüber */
  .splash { --splash-rot: -5deg; position: static; display: block; margin: 18px auto 0; font-size: 12px; }
  .edition { margin-top: 26px; }
  .tooltip { padding: 18px 16px 16px; }
  .tile-block { width: 58px; height: 58px; font-size: 20px; }
  .countdown { gap: 10px; }
  .mc-btn:not(.mc-btn--small) { width: 100%; min-width: 0; }
  .serverlist { padding: 12px; gap: 12px; }
  .srv-icon { width: 48px; height: 48px; }
  .underground { padding: 48px 0 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
