/* 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;
  --red: #c0392b;
  --red-deep: #a02818;
  --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 */
.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);
  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;
  border-left: 3px 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);
  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, #8a7e72); }

/* 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);
  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);
  position: relative;
}

/* Sunset gradient strip at footer bottom */
.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);
  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, #8a7e72);
  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, #8a7e72);
  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; }
}
