/* =========================================================
   Design tokeny
   ========================================================= */
:root {
  --bg: #0b0e14;
  --bg-soft: #11151f;
  --card: #151b27;
  --card-2: #1a2130;
  --border: #232c3d;
  --text: #e7ecf3;
  --text-dim: #9aa6b8;
  --text-faint: #66748b;

  --accent: #5ad469;
  --accent-2: #38b6ff;
  --accent-grad: linear-gradient(135deg, #5ad469, #38b6ff);

  --online: #5ad469;
  --offline: #ff5a6a;
  --loading: #f5b94d;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);

  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-pixel: "Silkscreen", "Space Grotesk", monospace;

  --maxw: 1012px;
}

/* =========================================================
   Reset / základ
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Dekorativní pozadí */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.12;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  z-index: 0;
}
.bg-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 500px;
  background: radial-gradient(circle, rgba(90, 212, 105, 0.18), transparent 65%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) clamp(18px, 4vw, 28px) 48px;
}

h2 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-bottom: 16px;
  color: var(--text);
}

/* =========================================================
   Minecraft textury (pixel-perfect rendering)
   ========================================================= */
.block-icon {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  -webkit-user-select: none;
  user-select: none;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  text-align: center;
  margin-bottom: clamp(32px, 6vw, 56px);
}

.hero-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.hero-logo .block-icon {
  width: clamp(56px, 12vw, 72px);
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.55));
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.hero-badge .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--loading);
  box-shadow: 0 0 0 0 currentColor;
}
.hero-badge[data-state="online"] { color: var(--online); border-color: rgba(90,212,105,0.4); }
.hero-badge[data-state="online"] .dot { background: var(--online); animation: pulse 2s infinite; }
.hero-badge[data-state="offline"] { color: var(--offline); border-color: rgba(255,90,106,0.4); }
.hero-badge[data-state="offline"] .dot { background: var(--offline); }
.hero-badge[data-state="loading"] { color: var(--loading); }
.hero-badge[data-state="loading"] .dot { background: var(--loading); animation: pulse 1.2s infinite; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(90,212,105,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(90,212,105,0); }
  100% { box-shadow: 0 0 0 0 rgba(90,212,105,0); }
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  font-weight: 700;
  line-height: 1.08;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}
.tagline {
  color: var(--text-dim);
  font-size: clamp(0.98rem, 2.5vw, 1.12rem);
  margin-bottom: 28px;
}

/* Address bar */
.address-bar {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.address-label {
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
}
.address-copy {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.18s, transform 0.12s, background 0.18s;
}
.address-copy:hover { border-color: var(--accent); background: var(--card-2); }
.address-copy:active { transform: scale(0.98); }
.address-copy code {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}
.copy-icon { color: var(--text-dim); font-size: 1.1rem; }
.copy-done {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #06210c;
  font-weight: 700;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.address-copy.copied .copy-done { opacity: 1; }

/* =========================================================
   Karty statistik
   ========================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: clamp(36px, 7vw, 56px);
}
.card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 26px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-grad);
  opacity: 0.7;
}
.card-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  opacity: 0.95;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
  transition: transform 0.18s ease;
}
.card:hover .card-icon { transform: scale(1.12) rotate(-4deg); }
.card-label {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding-right: 48px;
  line-height: 1.5;
}
.card-value {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.card-sub { font-size: 0.92rem; color: var(--text-dim); }

/* =========================================================
   Hráči online
   ========================================================= */
.players-section { margin-bottom: clamp(36px, 7vw, 56px); }
.players {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.players li.player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 500;
}
.players li.player img {
  width: 28px; height: 28px;
  border-radius: 6px;
  image-rendering: pixelated;
  background: var(--card-2);
}
.players-empty {
  color: var(--text-dim);
  font-style: italic;
  list-style: none;
}

/* =========================================================
   Mapa
   ========================================================= */
.map-section { margin-bottom: clamp(36px, 7vw, 56px); }

/* hlavička sekce: nadpis vlevo, tlačítko vpravo */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.section-head h2 { margin-bottom: 0; }

.map-open {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.18s, background 0.18s, transform 0.12s;
}
.map-open:hover { border-color: var(--accent); background: var(--card-2); }
.map-open:active { transform: scale(0.97); }
.map-open-icon { font-size: 1rem; line-height: 1; color: var(--accent); }

.map-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
  position: relative;
}
.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--text-dim);
  padding: 24px;
}
.map-placeholder .map-icon { font-size: 2.4rem; }
.map-placeholder p { font-family: var(--font-head); font-weight: 600; color: var(--text); }
.map-placeholder small { color: var(--text-faint); max-width: 320px; }

/* =========================================================
   Footer
   ========================================================= */
.footer {
  position: relative;
  text-align: center;
  color: #d6c7ab;
  font-size: 0.85rem;
  padding: 22px 18px;
  margin-top: 8px;
  border-radius: var(--radius);
  border-top: 4px solid var(--accent);
  background-image:
    linear-gradient(rgba(12, 9, 6, 0.82), rgba(12, 9, 6, 0.82)),
    url("https://cdn.jsdelivr.net/gh/PrismarineJS/minecraft-assets@master/data/1.21.4/blocks/dirt.png");
  background-size: auto, 48px 48px;
  image-rendering: pixelated;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-sub { font-size: 0.78rem; color: #b3a488; }

/* =========================================================
   Responzivita
   ========================================================= */
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .card { padding-left: 70px; min-height: 70px; justify-content: center; }
  .card-icon { top: 50%; right: auto; left: 18px; transform: translateY(-50%); width: 38px; height: 38px; }
  .card:hover .card-icon { transform: translateY(-50%) scale(1.12) rotate(-4deg); }
  .card-label { padding-right: 0; }
  .card-value { font-size: 1.7rem; }
}

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