/* Vonix server picker — full-bleed art with HUD overlay.
   Legally distinct: original art, CSS-drawn icons, system fonts. No Mojang/Microsoft assets. */

:root {
  --ink: #ffffff;
  --ink-dim: rgba(255, 255, 255, 0.72);
  --ink-faint: rgba(255, 255, 255, 0.45);
  --cyan: #5ce1ff;
  --violet: #a78bfa;
  --good: #4ade80;
  --bad: #fb7185;
  --warn: #fbbf24;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --edge: 44px;
}

* { box-sizing: border-box; }

/* `[hidden]` must win over component display values (.btn sets inline-flex,
   .badge sets inline-flex, .motd/.credit are blocks). Without this guard a
   hidden control still renders. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #05060f;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* Only the server picker is a fixed, non-scrolling screen. Any other page
   (detail, messenger) must scroll normally — trapping overflow on <html>
   silently clips every page below the fold. */
body.picker-body {
  height: 100vh;
  overflow: hidden;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Full-bleed art ---------- */
.art-stack { position: fixed; inset: 0; z-index: 0; }
.art-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  /* Bias art toward the right so any logo baked into the banner sits away
     from the bottom-left content column. */
  background-position: right center;
  opacity: 0;
  transition: opacity 620ms ease;
  will-change: opacity;
  transform: scale(1.02);
}
.art-layer.is-active { opacity: 1; }

.art-shade {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    /* Content column: strong enough that no baked-in art text reads through. */
    linear-gradient(100deg, rgba(3,4,10,0.97) 0%, rgba(3,4,10,0.93) 26%, rgba(3,4,10,0.72) 44%, rgba(3,4,10,0.24) 66%, rgba(3,4,10,0.4) 100%),
    linear-gradient(0deg, rgba(3,4,10,0.96) 0%, rgba(3,4,10,0.52) 26%, rgba(3,4,10,0) 54%),
    linear-gradient(180deg, rgba(3,4,10,0.8) 0%, rgba(3,4,10,0) 20%);
}

/* ---------- Floating HUD chrome ---------- */
.hud {
  position: fixed;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(8, 10, 22, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.42);
}

.hud-top {
  top: 20px; left: var(--edge); right: var(--edge);
  justify-content: space-between;
  border-radius: 18px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { position: relative; width: 26px; height: 26px; flex: 0 0 auto; }
.brand-mark i {
  position: absolute; width: 12px; height: 12px;
  border: 2px solid var(--cyan); border-radius: 3px; transform: rotate(45deg);
}
.brand-mark i:nth-child(1) { left: 0; top: 0; }
.brand-mark i:nth-child(2) { right: 0; top: 7px; width: 9px; height: 9px; border-color: var(--violet); }
.brand-mark i:nth-child(3) { left: 5px; bottom: 0; opacity: 0.55; }
.brand-name { font-weight: 800; letter-spacing: 0.18em; font-size: 0.95rem; }

.hud-actions { display: flex; align-items: center; gap: 10px; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 7px 13px;
  min-width: 210px;
}
.search input {
  background: transparent; border: 0; outline: 0;
  color: var(--ink); font: inherit; font-size: 0.85rem; width: 100%;
}
.search input::placeholder { color: var(--ink-faint); }
.search-ico {
  width: 12px; height: 12px; border: 2px solid var(--ink-faint);
  border-radius: 50%; position: relative; flex: 0 0 auto;
}
.search-ico::after {
  content: ""; position: absolute; width: 7px; height: 2px;
  background: var(--ink-faint); right: -5px; bottom: -2px;
  transform: rotate(45deg); border-radius: 2px;
}

.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.3);
  display: grid; place-items: center; cursor: pointer;
  transition: border-color 150ms ease;
}
.icon-btn:hover { border-color: var(--cyan); }
.gear {
  width: 14px; height: 14px; border: 2px solid var(--ink);
  border-radius: 50%; position: relative;
}
.gear::after {
  content: ""; position: absolute; inset: 3px;
  border-radius: 50%; background: var(--cyan);
}

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #06121f;
}

/* ---------- Carousel rails ---------- */
.rail-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 10, 22, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  transition: border-color 150ms ease, background 150ms ease, opacity 150ms ease;
}
.rail-btn:hover { border-color: var(--cyan); background: rgba(8, 10, 22, 0.72); }
.rail-btn[disabled] { opacity: 0.28; cursor: not-allowed; }
.rail-prev { left: 22px; }
.rail-next { right: 22px; }

/* ---------- Overlay content ---------- */
.overlay {
  position: fixed;
  z-index: 15;
  left: var(--edge);
  bottom: 86px;
  max-width: min(620px, calc(100vw - (var(--edge) * 2)));
}
.overlay-inner { display: flex; flex-direction: column; gap: 12px; }

.kicker {
  align-self: flex-start;
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.server-title {
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 3.9rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.9);
  max-width: 15ch;
}

.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0; padding: 0; list-style: none;
}
.tags li {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(8, 10, 22, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-dim);
}

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(8, 10, 22, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-dim);
  white-space: nowrap;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); }
.badge[data-state="online"] { color: #b7f7cc; border-color: rgba(74, 222, 128, 0.5); }
.badge[data-state="online"] .badge-dot { background: var(--good); box-shadow: 0 0 9px var(--good); }
.badge[data-state="offline"] { color: #ffc9d2; border-color: rgba(251, 113, 133, 0.5); }
.badge[data-state="offline"] .badge-dot { background: var(--bad); }
.badge[data-state="checking"] .badge-dot { background: var(--warn); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.addr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.addr {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 9px 12px;
  word-break: break-all;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.copy-btn {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background: rgba(8, 10, 22, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 150ms ease, background 150ms ease;
}
.copy-btn:hover { border-color: var(--cyan); background: rgba(8, 10, 22, 0.78); }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }

.btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 6px;
  padding: 12px 22px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: filter 150ms ease, border-color 150ms ease, background 150ms ease;
}
.btn:hover { filter: brightness(1.12); }
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #071018;
  box-shadow: 0 8px 26px rgba(92, 225, 255, 0.3);
}
.btn-ghost {
  background: rgba(8, 10, 22, 0.55);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--ink);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-ghost:hover { border-color: var(--cyan); background: rgba(8, 10, 22, 0.78); }

.credit {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 2px 14px rgba(0, 0, 0, 0.9);
}
.credit:empty { display: none; }

.motd {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 2px 16px rgba(0, 0, 0, 0.9);
  max-width: 62ch;
}
.motd[hidden] { display: none; }

/* ---------- Dots ---------- */
.dots {
  position: fixed;
  z-index: 20;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(8, 10, 22, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.dot-btn {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
}
.dot-btn[aria-selected="true"] {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(92, 225, 255, 0.85);
}

/* ---------- Bottom HUD ---------- */
.hud-bottom {
  bottom: 20px; left: var(--edge);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-dim);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: 0 0 auto; }
.status-dot.is-up { background: var(--good); box-shadow: 0 0 9px var(--good); }
.status-dot.is-down { background: var(--bad); }
.hud-sep { width: 1px; height: 14px; background: rgba(255, 255, 255, 0.2); }

/* ---------- States ---------- */
.state-wrap {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.state {
  pointer-events: auto;
  text-align: center;
  max-width: 440px;
  padding: 26px 30px;
  border-radius: 16px;
  background: rgba(8, 10, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.state p { margin: 0 0 10px; }
.state-title { font-weight: 800; font-size: 1.05rem; }
.state-msg { color: var(--ink-dim); font-size: 0.9rem; }
.skeleton { display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
.skeleton span {
  width: 58px; height: 9px; border-radius: 5px;
  background: rgba(255, 255, 255, 0.22);
  animation: blink 1.2s infinite;
}
.skeleton span:nth-child(2) { animation-delay: 0.15s; }
.skeleton span:nth-child(3) { animation-delay: 0.3s; }

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  background: rgba(8, 10, 22, 0.92);
  border: 1px solid rgba(74, 222, 128, 0.5);
  color: #b7f7cc;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --edge: 20px; }
  .search { min-width: 0; width: 148px; }
  .overlay { bottom: 96px; }
  .rail-btn { width: 42px; height: 42px; font-size: 1.4rem; }
  .rail-prev { left: 10px; }
  .rail-next { right: 10px; }
}

@media (max-width: 640px) {
  :root { --edge: 14px; }
  .hud-top { top: 12px; padding: 8px 12px; border-radius: 14px; }
  .brand-name { font-size: 0.85rem; letter-spacing: 0.14em; }
  .search { display: none; }
  .overlay { bottom: 104px; }
  .server-title { font-size: clamp(1.85rem, 9vw, 2.6rem); max-width: 100%; }
  .addr { font-size: 0.78rem; padding: 8px 10px; }
  .copy-btn { font-size: 0.76rem; padding: 8px 12px; }
  .btn { padding: 11px 18px; font-size: 0.8rem; }
  .cta-row { gap: 8px; }
  .hud-bottom { bottom: 14px; font-size: 0.68rem; }
  .dots { bottom: 52px; }
  .rail-btn { display: none; }
}

@media (max-height: 560px) {
  .overlay { bottom: 74px; }
  .server-title { font-size: clamp(1.5rem, 6vh, 2.2rem); }
  .credit { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .art-layer { transition: none; }
  .badge[data-state="checking"] .badge-dot,
  .skeleton span { animation: none; }
}
