:root {
  --bg: #1a1a2e;
  --bg-dark: #151528;
  --accent: #c8a45a;
  --accent-hover: #b8943a;
  --text: #f0f0f0;
  --muted: #9ca3af;
  --navbar-h: 64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--navbar-h);
  background: rgba(21, 21, 40, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.5px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #e74c3c;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #fff;
}

.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-outline {
  padding: 9px 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s;
  background: transparent;
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
}

.btn-solid {
  padding: 9px 24px;
  border: none;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  transition: all 0.2s;
}

.btn-solid:hover {
  background: var(--accent-hover);
}

/* Mobile menu button */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 12px;
  position: fixed;
  top: var(--navbar-h);
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(21, 21, 40, 0.97);
  backdrop-filter: blur(12px);
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s ease;
}

.mobile-nav.open {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav a {
  text-align: center;
}

/* ===== Hero ===== */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--navbar-h) + 40px) 24px 60px;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.hero-inner {
  max-width: 560px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Players online */
.players-online {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 6px 18px 6px 8px;
  margin-bottom: 24px;
}

.players-avatars {
  display: flex;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c8a45a, #e0c070);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  margin-left: -6px;
  color: #1a1a2e;
}

.avatar:first-child {
  margin-left: 0;
}

.avatar svg {
  width: 14px;
  height: 14px;
}

.players-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.players-text strong {
  color: #fbbf24;
  font-weight: 900;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Hero text */
.hero-inner h1 {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* CTA Button */
.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 18px 40px;
  background: var(--accent);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s ease;
  letter-spacing: 0.5px;
}

.cta-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(200, 164, 90, 0.3);
}

.cta-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Signup Form */
.signup-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input::placeholder {
  color: var(--muted);
}

.form-group input:focus {
  border-color: var(--accent);
}

/* Password rules checklist */
.pw-rules {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding: 0;
}

.pw-rules.hidden {
  display: none;
}

.pw-rules li {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.pw-rules li.valid {
  color: #4ade80;
}

.rule-icon {
  font-size: 0.7rem;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 4px 0;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.form-msg {
  font-size: 0.875rem;
  text-align: center;
  min-height: 20px;
  padding: 0 4px;
}

.form-msg.success {
  color: #4ade80;
}

.form-msg.error {
  color: #f87171;
}

/* Success overlay */
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.success-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.success-card {
  background: var(--bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.success-overlay.show .success-card {
  transform: scale(1);
}

.success-thumb {
  font-size: 4rem;
  margin-bottom: 12px;
  line-height: 1;
}

.success-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #4ade80;
  margin-bottom: 8px;
}

.success-card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.success-card .cta-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* Redirect overlay */
.redirect-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.redirect-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.redirect-card {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  max-width: 360px;
  width: 90%;
}

.redirect-icon {
  margin-bottom: 16px;
}

.redirect-card h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.redirect-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.redirect-url {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--accent);
  word-break: break-all;
  margin-bottom: 20px;
  font-family: monospace;
}

.redirect-copy {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.redirect-copy:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.redirect-hint {
  margin-top: 16px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

/* Features row */
.features {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 28px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.feature svg {
  color: var(--muted);
  flex-shrink: 0;
}

/* ===== Floating Cards Background ===== */
.floating-cards {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.fcard {
  position: absolute;
  width: 100px;
  height: 140px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  opacity: 0.12;
  animation: floatCard 12s ease-in-out infinite;
}

.fcard-inner {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.fcard-back {
  background: #c0392b;
  border: 2px solid #a93226;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fcard-diamond {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(45deg);
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.22);
}

.fcard-front {
  background: #fff;
  border: 2px solid #e5e7eb;
}

.fc-corner {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  color: #1a1a2e;
}

.fc-corner.fc-top {
  top: 6px;
  left: 8px;
}

.fc-corner.fc-bottom {
  bottom: 6px;
  right: 8px;
  transform: rotate(180deg);
}

.fc-suit {
  font-style: normal;
}

.fc-suit.hearts {
  color: #dc2626;
}

.fc-suit.diamonds {
  color: #dc2626;
}

.fc-suit.spades {
  color: #1a1a2e;
}

.fc-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.2rem;
}

/* Card positions & animations */
.fcard-1 {
  top: 8%;
  left: 5%;
  transform: rotate(-18deg);
  animation-delay: 0s;
  opacity: 0.1;
}

.fcard-2 {
  top: 15%;
  right: 8%;
  transform: rotate(12deg);
  animation-delay: -2s;
  opacity: 0.08;
}

.fcard-3 {
  bottom: 25%;
  left: 3%;
  transform: rotate(22deg);
  animation-delay: -4s;
  opacity: 0.1;
}

.fcard-4 {
  bottom: 10%;
  right: 5%;
  transform: rotate(-10deg);
  animation-delay: -6s;
  opacity: 0.09;
}

.fcard-5 {
  top: 50%;
  right: 15%;
  transform: rotate(30deg);
  animation-delay: -8s;
  opacity: 0.07;
}

.fcard-6 {
  top: 40%;
  left: 10%;
  transform: rotate(-25deg);
  animation-delay: -10s;
  opacity: 0.08;
}

@keyframes floatCard {
  0%, 100% {
    transform: translateY(0) rotate(var(--r, -15deg));
  }
  25% {
    transform: translateY(-18px) rotate(calc(var(--r, -15deg) + 3deg));
  }
  50% {
    transform: translateY(-8px) rotate(calc(var(--r, -15deg) - 2deg));
  }
  75% {
    transform: translateY(-22px) rotate(calc(var(--r, -15deg) + 4deg));
  }
}

.fcard-1 { --r: -18deg; }
.fcard-2 { --r: 12deg; }
.fcard-3 { --r: 22deg; }
.fcard-4 { --r: -10deg; }
.fcard-5 { --r: 30deg; }
.fcard-6 { --r: -25deg; }

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 48px 24px 36px;
  background: rgba(21, 21, 40, 0.6);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 40px;
}

.footer h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-about p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .nav-actions {
    display: none;
  }

  .mobile-menu {
    display: flex;
  }

  .mobile-nav {
    display: flex;
  }

  .hero-inner h1 {
    font-size: 2rem;
  }

  .hero {
    padding: calc(var(--navbar-h) + 24px) 20px 40px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .features {
    gap: 14px;
  }
}
