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

:root {
  --surface-glass: rgba(16, 20, 30, 0.56);
  --surface-elevated: rgba(255, 255, 255, 0.08);
  --surface-hover: rgba(255, 255, 255, 0.14);
  --border-subtle: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.28);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.55);
  --text-primary: #f8fafc;
  --text-secondary: rgba(248, 250, 252, 0.72);
  --text-muted: rgba(248, 250, 252, 0.48);
  --accent-emerald: #10b981;
  --accent-discord: #5865f2;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-primary);
  text-align: center;
  overflow-x: hidden;
  position: relative;
  padding: calc(20px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  background: #07090e;
}

#bg-video {
  position: fixed;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: -3;
}

video::-webkit-media-controls {
  display: none !important;
}

#overlay-dark {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 25%, rgba(20, 27, 45, 0.42) 0%, rgba(7, 9, 14, 0.86) 100%),
    linear-gradient(180deg, rgba(7, 9, 14, 0.45) 0%, rgba(7, 9, 14, 0.78) 100%);
  z-index: -2;
}

.ambient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  z-index: -1;
  opacity: 0.24;
  pointer-events: none;
  will-change: transform;
}

.orb-1 {
  width: 340px;
  height: 340px;
  background: #3b82f6;
  top: 12%;
  left: 16%;
  animation: driftOne 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 320px;
  height: 320px;
  background: #10b981;
  bottom: 12%;
  right: 16%;
  animation: driftTwo 20s ease-in-out infinite alternate;
}

@keyframes driftOne {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(28px, -22px, 0); }
}

@keyframes driftTwo {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-26px, -18px, 0); }
}

.liquid-card {
  position: relative;
  width: 100%;
  max-width: 404px;
  padding: 34px 26px 24px;
  border-radius: 28px;
  background: var(--surface-glass);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card), var(--inner-light);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.25s var(--ease-out), border-color 0.25s ease;
  animation: cardReveal 0.7s var(--ease-out) both;
}

.liquid-sheen {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    360px circle at var(--mouse-x, 50%) var(--mouse-y, 15%),
    rgba(255, 255, 255, 0.1),
    transparent 65%
  );
  pointer-events: none;
  z-index: 0;
}

.liquid-card > *:not(.liquid-sheen) {
  position: relative;
  z-index: 1;
}

@keyframes cardReveal {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 14px;
}

.logo img {
  width: clamp(96px, 22vw, 114px);
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45));
  transition: transform 0.3s var(--ease-out);
}

.logo:hover img {
  transform: scale(1.03);
}

.server-title {
  margin-bottom: 20px;
}

.server-title h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
  margin-bottom: 7px;
}

.tagline {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.glass-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-radius: 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--inner-light);
  margin-bottom: 14px;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.copy-ip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.copy-ip-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.copy-ip-btn:active {
  transform: scale(0.97);
}

.copy-ip-btn.copied {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
}

.dot, .pulse-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.65);
  flex-shrink: 0;
}

.pulse-dot {
  background: #fb7185;
  box-shadow: 0 0 8px rgba(251, 113, 133, 0.65);
}

.buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.glass-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 16px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.2px;
  color: #ffffff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32), var(--inner-light);
  transition: transform 0.2s var(--ease-out), filter 0.2s ease, border-color 0.2s ease;
  user-select: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.glass-btn img {
  width: 20px;
  height: 20px;
  transition: transform 0.2s var(--ease-out);
}

.btn-play {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.88) 0%, rgba(5, 150, 105, 0.78) 100%);
}

.btn-discord {
  background: linear-gradient(180deg, rgba(88, 101, 242, 0.86) 0%, rgba(71, 82, 196, 0.76) 100%);
}

.glass-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  border-color: rgba(255, 255, 255, 0.35);
}

.glass-btn:hover img {
  transform: scale(1.06);
}

.glass-btn:active {
  transform: translateY(0) scale(0.98);
}

.discord-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.footer {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--inner-light);
}

.social-glass {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease-out), background 0.2s ease, border-color 0.2s ease;
}

.social-glass img {
  width: 20px;
  height: 20px;
  opacity: 0.92;
}

.social-glass:hover {
  transform: translateY(-2px);
  background: var(--surface-hover);
  border-color: var(--border-subtle);
}

.social-glass:active {
  transform: scale(0.96);
}

.credits {
  margin-top: 18px;
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.5;
  letter-spacing: 0.3px;
}

.glass-surface {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), var(--inner-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: transform 0.2s var(--ease-out), background 0.2s ease, border-color 0.2s ease;
}

.glass-surface:hover {
  background: rgba(26, 32, 48, 0.72);
  border-color: var(--border-strong);
  transform: scale(1.04);
}

.glass-surface:active {
  transform: scale(0.96);
}

#preloader {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 14, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.45s ease;
}

.glass-pill {
  padding: 26px 34px;
  border-radius: 24px;
  background: var(--surface-glass);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card), var(--inner-light);
  text-align: center;
}

.glass-pill img {
  width: 68px;
  opacity: 0.95;
}

.loading-bar {
  width: 128px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  margin: 14px auto 10px;
  overflow: hidden;
}

.loading-progress {
  width: 50%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  animation: slideLoad 1.3s ease-in-out infinite;
}

.glass-pill p {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

@keyframes slideLoad {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(220%); }
}

.toast-glass {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(16, 20, 30, 0.88);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), var(--inner-light);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s var(--ease-out), opacity 0.22s ease;
  z-index: 400;
}

.toast-glass.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
}

.modal-glass {
  width: 100%;
  max-width: 356px;
  padding: 24px 22px;
  border-radius: 24px;
  background: rgba(16, 20, 30, 0.86);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card), var(--inner-light);
  text-align: center;
  transform: translateY(10px);
  transition: transform 0.28s var(--ease-out);
}

.modal-backdrop.open .modal-glass {
  transform: translateY(0);
}

.modal-glass h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-glass p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.modal-steps {
  text-align: left;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.modal-ip-box {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.4px;
  color: #34d399;
  user-select: all;
}

@media (max-width: 480px) {
  .liquid-card {
    padding: 28px 20px 20px;
    border-radius: 24px;
  }
  .server-title h1 {
    font-size: 22px;
  }
  .glass-btn {
    min-height: 48px;
    font-size: 14.5px;
  }
}

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