:root {
  --accent: #22c1c3;
  --accent2: #2f80ed;
  --accent-rgb: 34, 193, 195;
  --accent2-rgb: 47, 128, 237;
  --magic: #6ff7ff;
  --night: #0b1220;
  --void: #070d18;
  --glass: rgba(10, 16, 30, 0.72);
  --text-primary: #e9f1ff;
  --text-secondary: #b7c4dd;
  --online: #32d583;
  --offline: #ff5a6b;
  --ring: 0 0 0 1px rgba(111, 247, 255, 0.22), 0 10px 45px rgba(47, 128, 237, 0.25);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text-primary);
  background: radial-gradient(circle at 10% -20%, rgba(var(--accent-rgb), 0.28) 0%, transparent 40%),
    radial-gradient(circle at 85% 10%, rgba(var(--accent2-rgb), 0.25) 0%, transparent 35%),
    linear-gradient(180deg, var(--night), var(--void));
}

body {
  position: relative;
  overflow-x: hidden;
  padding-bottom: 130px;
  perspective: 900px;
}

a {
  color: inherit;
  text-decoration: none;
}

.hero-bg,
.hero-overlay,
.hero-glow,
.hero-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.hero-bg {
  background-image: url("https://images.unsplash.com/photo-1511497584788-876760111969?auto=format&fit=crop&w=2200&q=80");
  background-size: cover;
  background-position: center;
  filter: saturate(0.95) contrast(1.05) brightness(0.55);
  transform: scale(1.05);
  z-index: -4;
  animation: bgPulse 20s ease-in-out infinite alternate;
}

.hero-overlay {
  background: linear-gradient(180deg, rgba(7, 13, 24, 0.2) 0%, rgba(7, 13, 24, 0.85) 58%, #070d18 100%);
  z-index: -3;
}

.hero-glow {
  background: radial-gradient(circle at 22% 30%, rgba(var(--accent-rgb), 0.32), transparent 45%),
    radial-gradient(circle at 78% 22%, rgba(var(--accent2-rgb), 0.36), transparent 40%);
  mix-blend-mode: screen;
  z-index: -2;
}

.hero-particles {
  background-image: radial-gradient(circle, rgba(111, 247, 255, 0.3) 1px, transparent 1px);
  background-size: 170px 170px;
  opacity: 0.25;
  animation: drift 22s linear infinite;
  z-index: -1;
}

.hero-particles::before,
.hero-particles::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(47, 128, 237, 0.35) 1px, transparent 1px);
  background-size: 220px 220px;
  opacity: 0.22;
}

.hero-particles::before {
  animation: drift 30s linear infinite reverse;
}

.hero-particles::after {
  background-size: 130px 130px;
  opacity: 0.13;
  animation: drift 14s linear infinite;
}

@keyframes drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-170px);
  }
}

@keyframes bgPulse {
  0% {
    transform: scale(1.05) translateX(0);
    filter: saturate(0.9) contrast(1.03) brightness(0.52);
  }
  100% {
    transform: scale(1.1) translateX(1.2%);
    filter: saturate(1.02) contrast(1.08) brightness(0.58);
  }
}

.landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 24px 120px;
}

.hero {
  width: min(1120px, 100%);
  display: grid;
  gap: 38px;
}

.brand {
  max-width: 760px;
}

.logo-mark {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 25px rgba(var(--accent-rgb), 0.5), 0 0 50px rgba(var(--accent2-rgb), 0.28);
  margin-bottom: 18px;
  animation: floatLogo 5s ease-in-out infinite;
}

.logo-inner {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 20px;
  background: radial-gradient(circle at 30% 25%, rgba(111, 247, 255, 0.35), transparent 50%),
    linear-gradient(165deg, rgba(8, 16, 34, 0.96), rgba(4, 11, 22, 0.95));
  position: relative;
}

.logo-inner::before,
.logo-inner::after {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 12px 12px 8px 8px;
  border: 2px solid rgba(111, 247, 255, 0.35);
  transform: rotate(45deg);
}

.logo-inner::after {
  inset: 32%;
  border-color: rgba(233, 241, 255, 0.24);
}

@keyframes floatLogo {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.kicker {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--magic);
}

h1 {
  margin: 12px 0 14px;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: 0.03em;
  text-shadow: 0 0 35px rgba(111, 247, 255, 0.25);
  animation: titleArcaneGlow 4s ease-in-out infinite;
}

@keyframes titleArcaneGlow {
  0%,
  100% {
    text-shadow: 0 0 20px rgba(111, 247, 255, 0.18), 0 0 38px rgba(47, 128, 237, 0.16);
  }
  50% {
    text-shadow: 0 0 34px rgba(111, 247, 255, 0.28), 0 0 56px rgba(47, 128, 237, 0.22);
  }
}

#serverTagline {
  margin: 0;
  max-width: 60ch;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
}

.quick-links {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.link-card {
  position: relative;
  padding: 22px 20px 20px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(13, 22, 40, 0.8), rgba(8, 14, 28, 0.8));
  border: 1px solid rgba(111, 247, 255, 0.14);
  box-shadow: var(--ring);
  backdrop-filter: blur(8px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  transform-style: preserve-3d;
  overflow: hidden;
  animation: cardFloat 6.5s ease-in-out infinite;
  animation-delay: var(--card-delay, 0ms);
}

.link-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  opacity: 0;
  transition: opacity 180ms ease;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15), rgba(var(--accent2-rgb), 0.15));
}

.link-card::after {
  content: "";
  position: absolute;
  top: -130%;
  left: -20%;
  width: 65%;
  height: 320%;
  transform: rotate(18deg);
  background: linear-gradient(180deg, transparent, rgba(111, 247, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity 220ms ease;
}

.link-card:hover {
  transform: translateY(-4px);
  border-color: rgba(111, 247, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(111, 247, 255, 0.35), 0 18px 55px rgba(47, 128, 237, 0.3);
}

.link-card:hover::before {
  opacity: 1;
}

.link-card:hover::after {
  opacity: 1;
  animation: shimmer 1.1s ease;
}

@keyframes shimmer {
  from {
    transform: translateX(-30%) rotate(18deg);
  }
  to {
    transform: translateX(260%) rotate(18deg);
  }
}

@keyframes cardFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: rgba(111, 247, 255, 0.08);
  color: var(--magic);
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 0 7px rgba(111, 247, 255, 0.25));
}

body[data-icon-pack="fantasy"] .card-icon {
  background: linear-gradient(145deg, rgba(111, 247, 255, 0.16), rgba(47, 128, 237, 0.08));
  border: 1px solid rgba(111, 247, 255, 0.28);
  box-shadow: 0 0 15px rgba(111, 247, 255, 0.26);
}

body[data-icon-pack="fantasy"] .card-icon svg {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 8px rgba(111, 247, 255, 0.45));
}

body[data-icon-pack="pixel"] .card-icon {
  border-radius: 6px;
  background: rgba(5, 10, 20, 0.92);
  border: 1px solid rgba(111, 247, 255, 0.34);
  image-rendering: pixelated;
}

body[data-icon-pack="pixel"] .card-icon svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 6px rgba(111, 247, 255, 0.35));
}

body[data-icon-pack="pixel"] .card-icon img {
  image-rendering: pixelated;
  width: 24px;
  height: 24px;
}

.card-sub {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.35;
}

.link-card h3 {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0.03em;
  font-size: 1.22rem;
}

.btn {
  border: 1px solid rgba(111, 247, 255, 0.24);
  color: var(--text-primary);
  background: rgba(10, 16, 30, 0.65);
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(111, 247, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(111, 247, 255, 0.24), 0 6px 20px rgba(var(--accent2-rgb), 0.28);
}

.btn.primary,
.join-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: #07101d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.35), 0 8px 22px rgba(var(--accent2-rgb), 0.25);
  animation: joinPulse 2.6s ease-in-out infinite;
}

@keyframes joinPulse {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.25), 0 8px 18px rgba(var(--accent2-rgb), 0.2);
  }
  50% {
    box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.4), 0 12px 28px rgba(var(--accent2-rgb), 0.3);
  }
}

.join-bar {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 22px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(111, 247, 255, 0.2);
  background: var(--glass);
  box-shadow: 0 14px 55px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(5, 10, 20, 0.5);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.online {
  background: var(--online);
  box-shadow: 0 0 12px var(--online);
  animation: pulseDot 1.8s ease-in-out infinite;
}

.status-dot.offline {
  background: var(--offline);
  box-shadow: 0 0 12px var(--offline);
}

@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 8px var(--online);
  }
  50% {
    box-shadow: 0 0 16px var(--online), 0 0 22px rgba(50, 213, 131, 0.45);
  }
}

.players {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.address-btn {
  border: 1px solid rgba(111, 247, 255, 0.22);
  background: rgba(4, 10, 20, 0.72);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.address-btn:hover {
  border-color: rgba(111, 247, 255, 0.48);
}

.footer {
  width: 100%;
  text-align: center;
  padding: 0 16px 24px;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.panel-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 12px;
  border: 1px solid rgba(111, 247, 255, 0.25);
  background: rgba(9, 14, 26, 0.84);
  color: var(--text-primary);
  padding: 10px 13px;
  cursor: pointer;
}

.panel-toggle.locked {
  border-color: rgba(255, 90, 107, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 90, 107, 0.18);
}

.panel-toggle-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(111, 247, 255, 0.45));
  flex: 0 0 auto;
}

.panel-toggle.locked .panel-toggle-logo {
  filter: drop-shadow(0 0 8px rgba(255, 90, 107, 0.45));
}

.config-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  width: min(450px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  z-index: 40;
  border-radius: 16px;
  border: 1px solid rgba(111, 247, 255, 0.25);
  background: rgba(9, 14, 26, 0.94);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.6);
  padding: 14px;
  display: none;
  overflow: auto;
}

.config-panel.open {
  display: block;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  font-size: 1.3rem;
}

.icon-btn {
  border: 1px solid rgba(111, 247, 255, 0.25);
  background: rgba(4, 10, 20, 0.7);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
}

.panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  border: 1px solid rgba(111, 247, 255, 0.2);
  border-radius: 9px;
  background: rgba(4, 10, 20, 0.55);
  color: var(--text-secondary);
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
}

.tab-btn.active {
  color: var(--text-primary);
  background: rgba(34, 193, 195, 0.16);
  border-color: rgba(111, 247, 255, 0.4);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-content h3 {
  margin: 0 0 12px;
  font-family: "Cinzel", Georgia, serif;
}

.settings-section {
  margin-bottom: 14px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(111, 247, 255, 0.12);
  background: rgba(4, 10, 20, 0.35);
}

.section-title {
  margin: 0 0 10px;
  font-size: 0.98rem;
  color: var(--magic);
  letter-spacing: 0.02em;
}

.help-text {
  margin: -2px 0 10px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.35;
}

.section-toggle {
  width: 100%;
  border: 1px solid rgba(111, 247, 255, 0.2);
  border-radius: 10px;
  background: rgba(4, 10, 20, 0.5);
  color: var(--text-secondary);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  margin: 2px 0 10px;
  font-weight: 600;
}

.section-toggle:hover {
  border-color: rgba(111, 247, 255, 0.45);
  color: var(--text-primary);
}

.advanced-settings {
  display: none;
  margin-bottom: 10px;
}

.advanced-settings.open {
  display: block;
}

.status-advanced-row {
  display: none !important;
}

body.show-status-advanced .status-advanced-row {
  display: grid !important;
}

.query-diagnostics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 2px 0 2px;
}

.query-test-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.query-test-result::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8893aa;
  box-shadow: 0 0 8px rgba(136, 147, 170, 0.5);
}

.query-test-result.ok::before {
  background: var(--online);
  box-shadow: 0 0 8px rgba(50, 213, 131, 0.65);
}

.query-test-result.warn::before {
  background: #ffb547;
  box-shadow: 0 0 8px rgba(255, 181, 71, 0.65);
}

.query-test-result.error::before {
  background: var(--offline);
  box-shadow: 0 0 8px rgba(255, 90, 107, 0.65);
}

.config-panel label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.config-panel input,
.config-panel select,
.config-panel textarea {
  width: 100%;
  border: 1px solid rgba(111, 247, 255, 0.24);
  border-radius: 9px;
  background: rgba(4, 10, 20, 0.6);
  color: var(--text-primary);
  padding: 10px;
  font: inherit;
}

.config-panel textarea {
  resize: vertical;
  min-height: 165px;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.lang-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 100px;
  z-index: 60;
  display: grid;
  gap: 8px;
}

.toast {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(6, 12, 22, 0.92);
  border: 1px solid rgba(111, 247, 255, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  color: var(--text-primary);
  font-weight: 600;
  animation: fadeIn 180ms ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .quick-links {
    grid-template-columns: 1fr;
  }

  .join-bar {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .players {
    grid-column: 1 / -1;
  }

  .address-btn {
    grid-column: 1 / -1;
  }

  .link-card {
    animation: none;
  }
}

@media (max-width: 700px) {
  .landing {
    padding-top: 74px;
  }

  .panel-toggle span:last-child {
    display: none;
  }

  .lang-inputs {
    grid-template-columns: 1fr;
  }

  .join-bar {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}
