/* ==========================================================================
   mazpl.net — dark Minecraft theme
   ========================================================================== */

:root {
  --bg: #0a0d08;
  --bg2: #11170e;
  --panel: rgba(18, 26, 15, 0.82);
  --border: #2c3b22;
  --border-lit: #46603a;
  --text: #e6f0dd;
  --muted: #8fa483;
  --green: #57c94d;
  --green-bright: #7ce06f;
  --amber: #e6b93c;
  --red: #d65545;
  --font-pixel: "Press Start 2P", monospace;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: radial-gradient(1200px 700px at 50% -10%, #17220f 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Floating-blocks canvas sits behind everything */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.55;
}

main {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 5rem) 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

/* ---- Hero ---- */
.hero { text-align: center; }

.title {
  font-family: var(--font-pixel);
  font-size: clamp(2rem, 7vw, 3.4rem);
  letter-spacing: 0.06em;
  color: #d44848; /* MAZ — rich dark red */
  text-shadow:
    0 4px 0 #4e1616,
    0 8px 24px rgba(185, 55, 55, 0.45);
  animation: drop-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.title span {
  color: #2f77c2; /* SMP — rich dark blue */
  display: block;
  font-size: 0.62em;
  margin-top: 0.35em;
  text-shadow: 0 4px 0 #122e4d, 0 8px 24px rgba(55, 120, 195, 0.45);
}

.tagline {
  margin-top: 1.1rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.8rem;
  animation: fade-in 0.8s 0.25s both;
}

@keyframes drop-in {
  from { opacity: 0; transform: translateY(-26px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- Server card ---- */
.card {
  width: 100%;
  background: var(--panel);
  border: 2px solid var(--border);
  /* blocky, Minecraft-ish corner highlights */
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.03),
    0 10px 0 rgba(0, 0, 0, 0.35),
    0 22px 50px rgba(0, 0, 0, 0.5);
  padding: 1.6rem 1.5rem 1.5rem;
  backdrop-filter: blur(6px);
  animation: fade-in 0.8s 0.35s both;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  padding: 0.7rem 0.9rem 0.65rem;
  border: 2px solid var(--border-lit);
  background: rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}
.pill .dot {
  width: 10px; height: 10px;
  background: var(--muted);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
  flex: none;
}
.pill.online   { color: var(--green-bright); border-color: var(--green); }
.pill.online .dot { background: var(--green-bright); animation: pulse 1.6s ease-out infinite; }
.pill.starting { color: var(--amber); border-color: var(--amber); }
.pill.starting .dot { background: var(--amber); animation: blink 0.9s steps(2) infinite; }
.pill.offline  { color: var(--muted); }
.pill.offline .dot { background: var(--red); }
.pill.error    { color: var(--red); border-color: var(--red); }
.pill.error .dot { background: var(--red); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(124, 224, 111, 0.7); }
  70%  { box-shadow: 0 0 0 9px rgba(124, 224, 111, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 224, 111, 0); }
}
@keyframes blink { 50% { opacity: 0.25; } }

.players {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Info rows */
.info {
  margin: 1.4rem 0 1.5rem;
  display: grid;
  gap: 0.7rem;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.92rem;
}
.label {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.value { font-weight: 600; }

.copy {
  font: inherit;
  color: var(--text);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.copy:hover { border-color: var(--green); background: rgba(87, 201, 77, 0.08); }
.copy-icon { color: var(--muted); font-size: 0.8em; }

/* ---- Start button ---- */
.start-btn {
  width: 100%;
  font-family: var(--font-pixel);
  font-size: clamp(0.8rem, 2.6vw, 1rem);
  color: #0c1908;
  background: linear-gradient(180deg, var(--green-bright) 0%, var(--green) 55%, #3f9c37 100%);
  border: 2px solid #2f5c26;
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.25),
    inset 0 3px 0 rgba(255, 255, 255, 0.35),
    0 6px 0 #234a1c;
  padding: 1.05rem 1rem 0.95rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.08s, box-shadow 0.2s, filter 0.2s;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* light sweep that dashes across the button on hover */
.start-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
  transform: skewX(-20deg);
  pointer-events: none;
}

.start-btn:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-3px);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.25),
    inset 0 3px 0 rgba(255, 255, 255, 0.35),
    0 9px 0 #234a1c,
    0 10px 26px rgba(87, 201, 77, 0.45);
}
.start-btn:hover:not(:disabled)::after {
  left: 135%;
  transition: left 0.55s ease;
}

.start-btn:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.25),
    inset 0 3px 0 rgba(255, 255, 255, 0.35),
    0 1px 0 #234a1c;
}
.start-btn:disabled {
  background: linear-gradient(180deg, #55604f 0%, #424c40 55%, #353d33 100%);
  border-color: #2a3129;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), 0 6px 0 #23291f;
  color: #b7c2ae;
  cursor: wait;
}
.start-btn.busy { animation: shimmer 1.1s linear infinite; }

@keyframes shimmer {
  0%   { filter: brightness(1); }
  50%  { filter: brightness(1.25); }
  100% { filter: brightness(1); }
}

.hint {
  margin-top: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ---- Feature chips (cracked / premium) ---- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin: 0.2rem 0 1.1rem;
}
.chip {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-lit);
  background: rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}
.chip-green { color: var(--green-bright); border-color: rgba(87, 201, 77, 0.55); }
.chip-blue  { color: #6db6f5; border-color: rgba(109, 182, 245, 0.55); }
.chip-amber { color: #e6b93c; border-color: rgba(230, 185, 60, 0.55); }

/* ---- YouTube link ---- */
.socials {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
  align-items: center;
}
.yt, .discord, .study {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  padding: 0.7rem 1.1rem;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  animation: fade-in 0.8s 0.5s both;
}
.discord { animation-delay: 0.6s; }
.study { animation-delay: 0.7s; border: 2px solid #4a5b30; background: rgba(14, 22, 8, 0.55); }
.study:hover { border-color: #57c94d; background: rgba(28, 44, 16, 0.65); }
.study:active { transform: translateY(2px); }
.yt {
  border: 2px solid #5c2020;
  background: rgba(30, 10, 10, 0.55);
}
.yt:hover {
  border-color: #ff4444;
  background: rgba(60, 12, 12, 0.65);
}
.discord {
  border: 2px solid #36406e;
  background: rgba(18, 22, 44, 0.55);
}
.discord:hover {
  border-color: #5865f2;
  background: rgba(35, 40, 82, 0.65);
}
.yt:active, .discord:active { transform: translateY(2px); }
.study-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: transparent;
  font-size: 0.85rem;
  flex: none;
}
.yt-play {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: #ff0000;
  color: #fff;
  font-size: 0.65rem;
  border-radius: 6px;
  flex: none;
}
.discord-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: #5865f2;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 6px;
  flex: none;
}

/* ---- Footer ---- */
footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}
footer a { color: var(--green); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 20px);
  max-width: min(92vw, 480px);
  background: rgba(12, 18, 9, 0.95);
  border: 2px solid var(--border-lit);
  color: var(--text);
  padding: 0.85rem 1.1rem;
  font-size: 0.88rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 10;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.ok   { border-color: var(--green); }
.toast.warn { border-color: var(--amber); }
.toast.err  { border-color: var(--red); }

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Site hub: two big redirect tiles (server / study) ---- */
.hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 1.5rem;
}
.hub-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.15rem;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.02rem;
  animation: fade-in 0.8s 0.35s both;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.hub-mark { font-size: 1.5rem; line-height: 1; }
.hub-name small {
  display: block;
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.hub-mc { border: 2px solid #4a5b30; background: rgba(14, 22, 8, 0.55); }
.hub-mc:hover { border-color: var(--green); background: rgba(28, 44, 16, 0.65); transform: translateY(-2px); }
.hub-study { border: 2px solid #1f5052; background: rgba(8, 20, 20, 0.55); }
.hub-study:hover { border-color: #00a3a6; background: rgba(10, 32, 32, 0.65); transform: translateY(-2px); }
.hub-card:active { transform: translateY(2px); }
html { scroll-behavior: smooth; } /* hub anchor + all in-page anchors */

/* single-tile hub (server page only shows the Study tile) */
.hub-single { grid-template-columns: 1fr; max-width: 360px; }

/* ---- Hub destination tiles (root /) — vertical cards with glow + arrow ---- */
body > *:not(.fx-grid) { position: relative; z-index: 1; }
.hub { max-width: 620px; gap: 1.2rem; }
.hub-card {
  position: relative;
  overflow: hidden;
  flex-direction: column;
  align-items: flex-start;
  min-height: 150px;
  padding: 1.4rem 1.5rem;
  border-radius: 18px;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.18s;
}
.hub-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, transparent, rgba(var(--card-accent-rgb, 87, 201, 77), 0.9), transparent);
  opacity: 0.55;
}
.hub-mark { font-size: 2.1rem; }
.hub-name { font-size: 1.15rem; }
.hub-text small { margin-top: 0.35rem; line-height: 1.45; }
.hub-go {
  position: absolute;
  right: 1.3rem;
  bottom: 1.1rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: rgb(var(--card-accent-rgb, 87, 201, 77));
  transition: transform 0.18s ease;
}
.hub-card:hover .hub-go { transform: translateX(6px); }
.hub-mc { background: linear-gradient(180deg, rgba(28, 44, 16, 0.5), rgba(10, 14, 8, 0.62)); }
.hub-mc:hover { box-shadow: 0 12px 34px rgba(87, 201, 77, 0.16), 0 4px 14px rgba(87, 201, 77, 0.10); }
.hub-study { background: linear-gradient(180deg, rgba(10, 32, 32, 0.5), rgba(8, 12, 12, 0.62)); }
.hub-study:hover { box-shadow: 0 12px 34px rgba(0, 163, 166, 0.16), 0 4px 14px rgba(0, 163, 166, 0.10); }
main > footer {
  margin-top: 2.2rem;
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  animation: fade-in 0.8s 0.9s both;
}

/* ===================== HUB PREMIUM LAYER (v5) ===================== */
.hub { width: min(560px, 92vw); gap: 1.15rem; }

/* Rotating conic border ring (replaces the flat top edge line) */
@property --hubang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.hub-card { overflow: visible; }
.hub-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  padding: 2px;
  background: conic-gradient(from var(--hubang),
    transparent 0deg, transparent 200deg,
    rgba(var(--card-accent-rgb, 87, 201, 77), 0.55) 262deg,
    rgba(var(--card-accent-rgb, 87, 201, 77), 0.96) 288deg,
    rgba(var(--card-accent-rgb, 87, 201, 77), 0.55) 314deg,
    transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  animation: hubRingSpin 7.5s linear infinite;
  pointer-events: none;
}
@keyframes hubRingSpin { to { --hubang: 360deg; } }

/* ShinyText-style periodic sweep across tile names */
.hub-name.shiny {
  background: linear-gradient(110deg,
    var(--text) 42%,
    rgba(var(--card-accent-rgb, 87, 201, 77), 0.98) 50%,
    var(--text) 58%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  animation: hubSheen 5.5s ease-in-out infinite;
}
@keyframes hubSheen {
  0%, 55% { background-position: 115% 0; }
  75%, 100% { background-position: -35% 0; }
}

/* TrueFocus-style tagline: cycling sharp word + travelling corner brackets */
.tf {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.42ch;
  padding: 0.35rem 0.9rem;
}
.tf-word {
  filter: blur(2.6px);
  opacity: 0.55;
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.tf-word.on { filter: blur(0); opacity: 1; }
.tf-box { position: absolute; pointer-events: none; transition: left 0.32s cubic-bezier(.22,1,.36,1), top 0.32s cubic-bezier(.22,1,.36,1), width 0.32s cubic-bezier(.22,1,.36,1), height 0.32s cubic-bezier(.22,1,.36,1); }
.tf-box i {
  position: absolute;
  width: 9px; height: 9px;
  border: 2px solid var(--green-bright);
}
.tf-box i:nth-child(1) { top: -5px; left: -5px; border-right: none; border-bottom: none; border-top-left-radius: 4px; }
.tf-box i:nth-child(2) { top: -5px; right: -5px; border-left: none; border-bottom: none; border-top-right-radius: 4px; }
.tf-box i:nth-child(3) { bottom: -5px; left: -5px; border-right: none; border-top: none; border-bottom-left-radius: 4px; }
.tf-box i:nth-child(4) { bottom: -5px; right: -5px; border-left: none; border-top: none; border-bottom-right-radius: 4px; }

/* Magnetic arrow rides inside the destination tile */
.hub-go {
  position: absolute;
  right: 1.25rem;
  bottom: 1rem;
  font-weight: 800;
  font-size: 1.3rem;
  color: rgb(var(--card-accent-rgb, 87, 201, 77));
  transition: transform 0.22s cubic-bezier(.22,1,.36,1);
  text-shadow: 0 0 14px rgba(var(--card-accent-rgb, 87, 201, 77), 0.55);
  will-change: transform;
}

/* Phone: tighter tiles, fluid hero */
@media (max-width: 460px) {
  .hub-card { min-height: 118px; padding: 1.15rem 1.2rem; }
  .hub-mark { font-size: 1.7rem; }
  .hub-card .hub-go { right: 1rem; bottom: 0.85rem; font-size: 1.1rem; }
  .title { font-size: clamp(1.7rem, 9vw, 2.4rem) !important; }
  .tf { padding: 0.25rem 0.4rem; gap: 0.3ch; }
}
@media (prefers-reduced-motion: reduce) {
  .hub-card::before, .hub-name.shiny, .tf-box, .hub-go { animation: none !important; transition: none !important; }
}

/* a11y + touch feedback */
.hub-card:focus-visible { outline: 2px solid rgb(var(--card-accent-rgb, 87, 201, 77)); outline-offset: 3px; }
.hub-card:active { transform: translateY(2px) scale(0.99); }
.tf-box { opacity: 0.9; }

/* ===================== HUB HERO v7 — icon + gradient name ===================== */
.hub-hero img { margin-bottom: 1.1rem; border-radius: 16px; filter: drop-shadow(0 10px 26px rgba(0, 163, 166, 0.28)); animation: fade-in 0.8s 0.15s both; }
.hero-name {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: -0.02em;
  margin: 0;
  background: linear-gradient(100deg, #e8f5e4 0%, #7ce06f 34%, #00cfd4 66%, #7d6bff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  background-position: 88% 0;
  animation: hubSheen 9s ease-in-out infinite;
  filter: drop-shadow(0 6px 22px rgba(56, 160, 120, 0.18));
}
.hero-sub {
  margin: 0.9rem 0 0.4rem;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  animation: fade-in 0.8s 0.55s both;
}
.hero-sub .dotsep { color: #7ce06f; }
@media (prefers-reduced-motion: reduce) {
  .hero-name, .hero-mark, .hero-sub { animation: none !important; }
}
