/* Parrotraiders Paradise - main stylesheet */
/* Cache-bust: ?v=20260621b */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #15110f;
  --panel: #1c1714;
  --stone: #6b6258;
  --stone-light: #8a7e72;
  /* Text-only variants. --stone/--stone-light are structural (borders, fills) and
     must not move; these hit WCAG AA 4.5:1 on --ink and --panel for body copy. */
  --stone-text: #8a7f72;
  --stone-light-text: #a09488;
  --red: #c0392b;
  --red-deep: #a02818;
  /* Text-only variant: --red is 3.5:1 on --ink, below AA. Borders/fills keep --red. */
  --red-text: #d55042;
  --gold: #f4b62c;
  --gold-warm: #e8a317;
  --green: #4a9e3c;
  --green-deep: #2c5e26;
  --sunset: #e8743b;
  --diamond: #5fc9d6;
  --diamond-glow: #5fc9d680;
  --purple: #7b52c4;
  --accent: var(--gold);
  --text: #f3ece2;
  --text-muted: #c9b99a;
}

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

body {
  background: var(--ink);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  margin: 0;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, .display {
  font-family: "Press Start 2P", "Inter", monospace;
  line-height: 1.4;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- Pixel stone panel border utility ---- */
/* Simulates a chunky Minecraft stone-block border */
.stone-panel {
  background: var(--panel);
  border: 3px solid var(--stone);
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.4),
    0 4px 16px rgba(0,0,0,0.5);
}

/* ---- Site header ---- */

.site-header {
  background: var(--panel);
  border-bottom: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  position: relative;
}

/* Sunset gradient accent strip along top edge */
/* Full-bleed brand stripe across the top of the page header, not an accent stripe on
   the side of a card. Deliberate. */
/* impeccable-disable-next-line side-tab */
.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--sunset) 40%, var(--gold) 70%, var(--green) 100%);
}

.site-header .logo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  image-rendering: pixelated;
  border: 2px solid var(--stone);
  box-shadow: 0 0 0 1px rgba(244,182,44,0.3), 2px 2px 0 rgba(0,0,0,0.5);
}

.site-header .brand {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.site-header .brand h1 {
  font-size: 0.7rem;
  color: var(--accent);
  margin: 0;
  text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 rgba(232,116,59,0.4);
  letter-spacing: 0.02em;
}

.site-header .brand .tagline {
  font-size: 0.7rem;
  color: var(--stone-light-text);
  margin: 0;
  font-family: Inter, sans-serif;
  font-weight: 400;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.visitor-count {
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 0.72rem;
  color: var(--diamond);
  background: var(--ink);
  border: 1px solid var(--stone);
  border-radius: 3px;
  padding: 0.3em 0.6em;
  white-space: nowrap;
}
.visitor-count:empty {
  display: none;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header nav a {
  font-size: 0.7rem;
  font-family: "Press Start 2P", monospace;
  color: var(--text);
  background: var(--ink);
  border: 2px solid var(--stone);
  border-radius: 4px;
  padding: 0.4em 0.75em;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.site-header nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(244,182,44,0.07);
  text-decoration: none;
}

/* ---- Hero ---- */

.hero {
  background: linear-gradient(180deg, rgba(28,23,20,0.9) 0%, var(--ink) 100%);
  border-bottom: 2px solid var(--panel);
  padding: 2.5rem 1.5rem 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.hero #blurb {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-style: italic;
  padding-left: 0.75rem;
  /* Hairline, not a 3px slab: a thick single-side accent stripe is the classic
     side-tab tell. Keeps the sunset brand colour, loses the slab. */
  border-left: 1px solid var(--sunset);
  line-height: 1.7;
}

/* ---- Featured video ---- */

#featured {
  background: var(--panel);
  border: 3px solid var(--stone);
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 6px 24px rgba(0,0,0,0.6);
  position: relative;
}

/* Gold pixel-corner accents on featured video */
#featured::before,
#featured::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--accent);
  border-style: solid;
  z-index: 1;
}

#featured::before {
  top: 6px;
  left: 6px;
  border-width: 2px 0 0 2px;
}

#featured::after {
  bottom: 6px;
  right: 6px;
  border-width: 0 2px 2px 0;
}

#featured iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

#featured .no-video {
  color: var(--stone-text);
  font-size: 0.65rem;
  font-family: "Press Start 2P", monospace;
  text-align: center;
  padding: 1rem;
  line-height: 1.8;
}

/* ---- Server status widget ---- */

.status-section {
  padding: 0 1.5rem 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.status-section h2 {
  font-size: 0.6rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 1px 1px 0 var(--ink);
}

#status {
  background: var(--panel);
  border: 3px solid var(--stone);
  border-radius: 4px;
  padding: 0.875rem 1.125rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  font-size: 0.875rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* One row per server inside the status panel */
.srv {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.srv + .srv {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 0.7rem;
}

.srv-name {
  font-weight: 700;
  color: var(--gold);
  min-width: 6.5rem;
}

.srv.off { color: var(--stone-light-text, #a09488); }

/* Diamond-cyan glow when server is online */
#status.is-online {
  border-color: var(--diamond);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 0 12px var(--diamond-glow),
    0 0 2px var(--diamond);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.on {
  background: var(--diamond);
  box-shadow: 0 0 8px var(--diamond), 0 0 2px var(--diamond);
  animation: dot-pulse 2s ease-in-out infinite;
}

.dot.off {
  background: var(--stone);
  box-shadow: none;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

#status code {
  background: var(--ink);
  border: 1px solid var(--stone);
  border-radius: 3px;
  padding: 0.15em 0.5em;
  font-size: 0.8rem;
  color: var(--diamond);
  font-family: "JetBrains Mono", "Courier New", monospace;
  user-select: all;
}

.faces {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  width: 100%;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(107,98,88,0.4);
}

.faces img {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  border: 2px solid var(--stone);
  image-rendering: pixelated;
  transition: border-color 0.15s, transform 0.15s;
}

.faces img:hover {
  border-color: var(--diamond);
  transform: scale(1.15);
}

/* ---- Video grid ---- */

.videos-section {
  padding: 0 1.5rem 2.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.videos-section h2 {
  font-size: 0.6rem;
  color: var(--accent);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 1px 1px 0 var(--ink);
}

#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 3px solid var(--stone);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 6px 20px rgba(244,182,44,0.15),
    0 2px 6px rgba(0,0,0,0.4);
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-bottom: 2px solid var(--stone);
  transition: border-color 0.15s;
}

.card:hover img {
  border-color: var(--accent);
}

.card span {
  padding: 0.625rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
}

/* Loading / empty state */
.grid-placeholder {
  color: var(--stone-text);
  font-size: 0.65rem;
  font-family: "Press Start 2P", monospace;
  padding: 2.5rem 0;
  grid-column: 1 / -1;
  text-align: center;
  line-height: 1.8;
}

/* ---- Footer ---- */

.site-footer {
  background: var(--panel);
  border-top: 4px solid var(--accent);
  padding: 1.75rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--stone-light-text);
  position: relative;
}

/* Sunset gradient strip at footer bottom */
/* Full-bleed brand stripe across the bottom of the page footer, not an accent stripe
   on the side of a card. Deliberate. */
/* impeccable-disable-next-line side-tab */
.site-footer::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green) 0%, var(--gold) 30%, var(--sunset) 60%, var(--red) 100%);
}

.site-footer .footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.site-footer .footer-links a {
  color: var(--text-muted);
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  transition: color 0.15s;
}

.site-footer .footer-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-footer .join-address {
  display: inline-block;
  background: var(--ink);
  border: 1px solid var(--stone);
  border-radius: 3px;
  padding: 0.2em 0.6em;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 0.75rem;
  color: var(--diamond);
  margin: 0.25rem 0;
  user-select: all;
}

.site-footer .footer-meta {
  margin: 0.5rem 0 0;
  font-size: 0.7rem;
  color: var(--stone-text);
  line-height: 1.5;
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  .site-header {
    gap: 0.75rem;
    padding: 0.875rem 1rem;
  }

  .site-header .brand h1 {
    font-size: 0.55rem;
  }

  .site-header .brand .tagline {
    font-size: 0.65rem;
  }

  .site-header nav a {
    font-size: 0.55rem;
    padding: 0.35em 0.6em;
  }

  .hero {
    padding: 1.5rem 1rem 1.25rem;
  }

  .status-section,
  .videos-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .card span {
    font-size: 0.72rem;
  }

  .site-footer {
    padding: 1.25rem 1rem;
  }

  .site-footer .footer-links {
    gap: 1rem;
  }
}

@media (max-width: 440px) {
  #grid {
    grid-template-columns: 1fr;
  }

  .site-header .logo {
    width: 44px;
    height: 44px;
  }
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  .card,
  .card img,
  .faces img {
    transition: none;
  }

  .dot.on {
    animation: none;
  }
}

/* ============================================================
   v2 features: stats strip, sparkline, copy button, achievements,
   floating-blocks background, confetti, Konami parrot
   ============================================================ */

/* Keep real content above the floating-blocks background */
.site-header,
.stats-strip,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Floating Minecraft blocks behind everything */
#blocks-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
#blocks-bg .block {
  position: absolute;
  bottom: -60px;
  opacity: 0.12;
  border-radius: 2px;
  image-rendering: pixelated;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4);
  animation-name: block-float;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes block-float {
  0%   { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-115vh) rotate(220deg); }
}

/* Live stats strip */
.stats-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem 0;
  max-width: 1100px;
  margin: 0 auto;
}
.stats-strip .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 110px;
  padding: 0.7rem 1rem;
  background: var(--panel);
  border: 2px solid var(--stone);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.stats-strip .stat-num {
  font-family: "Press Start 2P", monospace;
  font-size: 1.05rem;
  color: var(--accent);
  text-shadow: 2px 2px 0 var(--ink);
  line-height: 1.1;
}
.stats-strip .stat-label {
  font-size: 0.62rem;
  color: var(--stone-light-text, #a09488);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stats-strip .stat-spark {
  min-width: 150px;
}
#sparkline {
  width: 130px;
  height: 32px;
}

/* Copy-IP button */
.copy-ip {
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 0.78rem;
  color: var(--diamond);
  background: var(--ink);
  border: 1px solid var(--stone);
  border-radius: 3px;
  padding: 0.18em 0.55em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.copy-ip:hover { border-color: var(--diamond); }
.copy-ip .copy-tag {
  font-family: Inter, sans-serif;
  font-size: 0.62rem;
  color: var(--stone-light-text, #a09488);
  margin-left: 0.35em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.copy-ip.copied { border-color: var(--green); color: var(--green); }
.copy-ip.copied .copy-tag { color: var(--green); }

/* Achievement toasts (Minecraft style) */
#achievements {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}
.achievement {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--panel);
  border: 3px solid var(--stone);
  border-radius: 4px;
  padding: 0.7rem 0.95rem;
  min-width: 230px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
  transform: translateX(120%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.achievement.show { transform: translateX(0); }
.achievement.gold { border-color: var(--gold); box-shadow: 0 0 12px rgba(244,182,44,0.4), 4px 4px 0 rgba(0,0,0,0.5); }
.achievement .ach-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 2px;
  image-rendering: pixelated;
  background:
    linear-gradient(135deg, var(--green) 0 50%, #8a6240 50% 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.5);
}
.achievement.gold .ach-icon {
  background: linear-gradient(135deg, var(--gold) 0 50%, var(--gold-warm) 50% 100%);
}
.achievement .ach-text {
  font-size: 0.72rem;
  color: var(--white, #f3ece2);
  line-height: 1.35;
  font-family: Inter, sans-serif;
}
.achievement .ach-text b {
  color: var(--accent);
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
}

/* Confetti overlay */
#confetti {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

/* Konami parrot fly-by */
.fly-parrot {
  position: fixed;
  left: -70px;
  z-index: 9997;
  pointer-events: none;
  animation: parrot-fly 4s linear forwards;
}
@keyframes parrot-fly {
  0%   { transform: translateX(0) translateY(0) rotate(-8deg); }
  50%  { transform: translateX(55vw) translateY(-30px) rotate(8deg); }
  100% { transform: translateX(115vw) translateY(10px) rotate(-6deg); }
}

@media (prefers-reduced-motion: reduce) {
  #blocks-bg .block { animation: none; }
  .achievement { transition: none; }
}

@media (max-width: 600px) {
  .stats-strip .stat { min-width: 88px; padding: 0.55rem 0.7rem; }
  .stats-strip .stat-num { font-size: 0.85rem; }
  #achievements { left: 1rem; right: 1rem; }
  .achievement { min-width: 0; }
}

/* ============================================================
   v3: server feed, the fallen (death wall), server features, 3D skins
   ============================================================ */

.feed-section, .fallen-section, .features-section {
  padding: 0 1.5rem 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}
.feed-section h2, .fallen-section h2, .features-section h2 {
  font-size: 0.6rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 1px 1px 0 var(--ink);
}
.fallen-sub {
  color: var(--stone-light-text, #a09488);
  font-size: 0.5rem;
  letter-spacing: 0.05em;
}

/* Live feed */
#feed {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.75rem;
  background: var(--panel);
  border: 3px solid var(--stone);
  border-radius: 4px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.feed-item {
  font-size: 0.82rem;
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: Inter, sans-serif;
}
.feed-item:last-child { border-bottom: none; }
.feed-item b { color: var(--diamond); }
.feed-item i { color: var(--gold); font-style: normal; }
.feed-icon { flex-shrink: 0; }
.feed-death b { color: var(--red); }
.feed-advancement b { color: var(--gold); }
.feed-srv {
  margin-left: auto;
  font-size: 0.6rem;
  color: var(--stone-light-text, #a09488);
  background: var(--ink);
  border: 1px solid var(--stone);
  border-radius: 3px;
  padding: 0.1em 0.4em;
}

/* The Fallen - graveyard */
#fallen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}
.grave {
  width: 92px;
  background: linear-gradient(180deg, #2a2622 0%, #1c1714 100%);
  border: 2px solid var(--stone);
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  border-radius: 40px 40px 4px 4px;
  padding: 0.7rem 0.4rem 0.6rem;
  text-align: center;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
}
.grave-top {
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  color: var(--stone-light-text, #a09488);
  margin-bottom: 0.4rem;
}
.grave-face {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  border-radius: 3px;
  filter: grayscale(0.85) brightness(0.8);
  border: 1px solid var(--stone);
}
.grave-name {
  font-size: 0.7rem;
  color: var(--text);
  margin-top: 0.35rem;
  word-break: break-word;
  font-weight: 600;
}
.grave-date {
  font-size: 0.6rem;
  color: var(--stone-light-text, #a09488);
  font-family: "JetBrains Mono", monospace;
}

/* Server features */
#features {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.feature-card {
  flex: 1 1 280px;
  background: var(--panel);
  border: 3px solid var(--stone);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.feature-name {
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.feature-info { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.info-chip {
  font-size: 0.62rem;
  color: var(--diamond);
  background: var(--ink);
  border: 1px solid var(--stone);
  border-radius: 3px;
  padding: 0.15em 0.45em;
  font-family: "JetBrains Mono", monospace;
}
.plugin-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.plugin-badge {
  font-size: 0.68rem;
  color: var(--text);
  background: linear-gradient(180deg, #2c5e26 0%, #234a1f 100%);
  border: 1px solid var(--green);
  border-radius: 3px;
  padding: 0.2em 0.55em;
}

/* 3D skin viewers (upgrade of flat faces) */
.faces .face { display: inline-flex; }
.face.is-3d .skin-canvas {
  display: block;
  cursor: grab;
}
.face.is-3d {
  background: radial-gradient(ellipse at bottom, rgba(95,201,214,0.12), transparent 70%);
  border-radius: 4px;
}

@media (max-width: 600px) {
  .feature-card { flex-basis: 100%; }
  .grave { width: 78px; }
}

/* Live world map (BlueMap embed) */
.map-section {
  padding: 0 1.5rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.map-section h2 {
  font-size: 0.6rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 1px 1px 0 var(--ink);
}
.map-sub {
  color: var(--diamond);
  font-size: 0.5rem;
  letter-spacing: 0.05em;
}
.map-frame {
  position: relative;
  width: 100%;
  height: 65vh;
  min-height: 360px;
  border: 3px solid var(--stone);
  border-radius: 4px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 6px 24px rgba(0,0,0,0.6);
}
.map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.map-open {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.7rem;
  font-family: "Press Start 2P", monospace;
  color: var(--text);
  background: var(--ink);
  border: 2px solid var(--stone);
  border-radius: 4px;
  padding: 0.45em 0.8em;
}
.map-open:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Map server-picker tabs */
.map-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.map-tab {
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  color: var(--stone-light-text, #a09488);
  background: var(--panel);
  border: 2px solid var(--stone);
  border-radius: 4px;
  padding: 0.45em 0.8em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.map-tab:hover { color: var(--accent); border-color: var(--accent); }
.map-tab.active {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   v4 layout: sticky nav, dashboard, consolidated servers panel, map modal
   ============================================================ */

html { scroll-behavior: smooth; }
body.modal-open { overflow: hidden; }

/* Sticky header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.6rem 1.25rem;
  gap: 0.9rem;
}
.site-header .logo { width: 42px; height: 42px; }
.site-header .brand h1 { font-size: 0.62rem; }
.site-header .brand .tagline { font-size: 0.62rem; }

.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.main-nav a, .main-nav .nav-map {
  font-size: 0.6rem;
  font-family: "Press Start 2P", monospace;
  color: var(--text);
  background: var(--ink);
  border: 2px solid var(--stone);
  border-radius: 4px;
  padding: 0.4em 0.65em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav .nav-map:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(244,182,44,0.07); text-decoration: none;
}
.main-nav .nav-map { color: var(--diamond); border-color: var(--diamond); }
.main-nav .nav-map:hover { color: var(--ink); background: var(--diamond); }

/* sections clear the sticky header when jumped to */
#home, #servers, #videos { scroll-margin-top: 80px; }

/* Dashboard: featured + live sidebar */
.dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1rem;
}
@media (min-width: 880px) {
  .dashboard { grid-template-columns: 1.7fr 1fr; align-items: start; }
}
.dash-main #blurb {
  font-size: 0.85rem; color: var(--text-muted); margin: 0.9rem 0 0;
  font-style: italic; padding-left: 0.75rem; border-left: 1px solid var(--sunset);
}
.dash-side { display: flex; flex-direction: column; gap: 0.9rem; }

/* Days since last death sign */
.death-sign {
  text-align: center;
  background: linear-gradient(180deg, #241c12 0%, var(--panel) 100%);
  border: 3px solid var(--gold);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4), 0 4px 14px rgba(0,0,0,0.5);
}
.death-sign .death-days {
  display: block;
  font-family: "Press Start 2P", monospace;
  font-size: 2.4rem;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--ink);
  line-height: 1;
}
.death-sign .death-label {
  display: block; margin-top: 0.4rem;
  font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--stone-light-text, #a09488);
}
.death-sign.danger { border-color: var(--red); }
.death-sign.danger .death-days { color: var(--red); animation: dot-pulse 1.4s ease-in-out infinite; }

/* Stats grid (sidebar) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}
.stats-grid .stat {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  background: var(--panel); border: 2px solid var(--stone); border-radius: 4px;
  padding: 0.55rem 0.4rem;
}
.stats-grid .stat-num {
  font-family: "Press Start 2P", monospace; font-size: 0.85rem; color: var(--accent);
  text-shadow: 1px 1px 0 var(--ink);
}
.stats-grid .stat-label {
  font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--stone-light-text, #a09488);
}
.spark-box {
  background: var(--panel); border: 2px solid var(--stone); border-radius: 4px;
  padding: 0.5rem 0.7rem; display: flex; flex-direction: column; gap: 0.2rem; align-items: center;
}
.spark-box #sparkline { width: 100%; height: 30px; }
.spark-box .stat-label { font-size: 0.55rem; text-transform: uppercase; color: var(--stone-light-text, #a09488); }

/* Server quick-pills */
.server-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pill {
  font-size: 0.66rem; color: var(--text); cursor: pointer;
  background: var(--ink); border: 1px solid var(--stone); border-radius: 3px;
  padding: 0.3em 0.55em; display: inline-flex; align-items: center; gap: 0.35em;
}
.pill:hover { border-color: var(--accent); }
.tab-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.tab-dot.on { background: var(--diamond); box-shadow: 0 0 6px var(--diamond); }
.tab-dot.off { background: var(--stone); }

/* Servers section */
.servers-section, .videos-section {
  max-width: 1100px; margin: 0 auto; padding: 0.5rem 1.5rem 1.5rem;
}
.servers-section h2, .videos-section h2 {
  font-size: 0.6rem; color: var(--accent); margin: 0 0 0.75rem;
  text-transform: uppercase; letter-spacing: 0.1em; text-shadow: 1px 1px 0 var(--ink);
}
.server-tabs { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.server-tab {
  font-family: "Press Start 2P", monospace; font-size: 0.6rem;
  color: var(--stone-light-text, #a09488); background: var(--panel);
  border: 2px solid var(--stone); border-radius: 4px; padding: 0.5em 0.8em;
  cursor: pointer; display: inline-flex; align-items: center; gap: 0.4em;
  transition: color 0.15s, border-color 0.15s;
}
.server-tab:hover { color: var(--accent); border-color: var(--accent); }
.server-tab.active { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.server-tab.active .tab-dot.on { box-shadow: 0 0 6px var(--ink); }

.server-panel {
  background: var(--panel); border: 3px solid var(--stone); border-radius: 6px;
  padding: 1rem 1.1rem; box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.server-panel.is-online { border-color: var(--diamond); box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 12px var(--diamond-glow); }
.srv-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.9rem; }
.srv-online strong { color: var(--diamond); }
.srv-death {
  font-size: 0.7rem; color: var(--gold); background: var(--ink);
  border: 1px solid var(--stone); border-radius: 3px; padding: 0.15em 0.5em;
}
.srv-map-btn {
  margin-left: auto; cursor: pointer; font-size: 0.68rem;
  font-family: "Press Start 2P", monospace; color: var(--diamond);
  background: var(--ink); border: 2px solid var(--diamond); border-radius: 4px; padding: 0.4em 0.7em;
}
.srv-map-btn:hover { color: var(--ink); background: var(--diamond); }
.panel-block { margin-top: 1rem; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 0.8rem; }
.panel-block h4 {
  font-size: 0.62rem; color: var(--accent); margin: 0 0 0.5rem;
  text-transform: uppercase; letter-spacing: 0.05em; font-family: "Press Start 2P", monospace;
}
.fallen-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.feed {
  list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto;
}

/* Map modal (full-screen) */
.map-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,8,6,0.86); display: flex; align-items: center; justify-content: center;
  padding: 2vh 2vw;
}
.map-modal[hidden] { display: none; }
.map-modal-inner {
  width: 100%; max-width: 1200px; height: 92vh;
  display: flex; flex-direction: column;
  background: var(--panel); border: 3px solid var(--stone); border-radius: 6px; overflow: hidden;
}
.map-modal-bar {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.75rem;
  border-bottom: 2px solid var(--stone); flex-wrap: wrap;
}
.map-close {
  margin-left: auto; cursor: pointer; font-size: 0.6rem;
  font-family: "Press Start 2P", monospace; color: var(--text);
  background: var(--ink); border: 2px solid var(--stone); border-radius: 4px; padding: 0.45em 0.7em;
}
.map-close:hover { border-color: var(--red); color: var(--red-text); }
.map-modal .map-frame { flex: 1; border: none; border-radius: 0; box-shadow: none; min-height: 0; }
.map-modal .map-frame iframe { width: 100%; height: 100%; border: none; display: block; }

/* Multi-page nav: current page + logo link */
.main-nav a.active { color: var(--accent); border-color: var(--accent); background: rgba(244,182,44,0.08); }
.site-header a:has(.logo) { display: inline-flex; line-height: 0; }
.site-header a:has(.logo):hover { text-decoration: none; }
.servers-page { padding-top: 1.5rem; }
