/* Aperity landing page CSS.
   Keep this file small: index.html should not load the full app/game styles. */

:root {
  --font-display: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg-primary: #0a0a0f;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.5);
  --accent-primary: #8b5cf6;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 50%, #ec4899 100%);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --radius-sm: 8px;
  --radius-full: 9999px;
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.3);
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-primary);
}

body.modern-theme {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text-primary);
  background: var(--bg-primary);
  font-family: var(--font-body);
}

button,
input {
  font: inherit;
}

.animated-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.16) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(6, 182, 212, 0.14) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(236, 72, 153, 0.09) 0%, transparent 50%),
    var(--bg-primary);
}

.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  animation: particleFloat 22s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 25s; }
.particle:nth-child(2) { left: 20%; animation-delay: -5s; animation-duration: 20s; }
.particle:nth-child(3) { left: 30%; animation-delay: -10s; animation-duration: 28s; }
.particle:nth-child(4) { left: 40%; animation-delay: -15s; animation-duration: 22s; }
.particle:nth-child(5) { left: 50%; animation-delay: -2s; animation-duration: 26s; }
.particle:nth-child(6) { left: 60%; animation-delay: -8s; animation-duration: 24s; }
.particle:nth-child(7) { left: 70%; animation-delay: -12s; animation-duration: 21s; }
.particle:nth-child(8) { left: 80%; animation-delay: -6s; animation-duration: 27s; }
.particle:nth-child(9) { left: 90%; animation-delay: -18s; animation-duration: 23s; }

@keyframes particleFloat {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10%, 90% { opacity: 0.55; }
  100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

.landing-page {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  padding: 2rem 1.5rem;
}

.landing-topbar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.landing-topbar-link {
  padding: 0.45rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.landing-topbar-link:hover,
.landing-topbar-link:focus-visible {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.landing-exit {
  animation: landingExit 0.4s ease-in forwards;
}

@keyframes landingExit {
  to { opacity: 0; transform: translateY(-40px) scale(0.97); }
}

.landing-content {
  width: 100%;
  max-width: 660px;
  text-align: center;
  animation: landingEnter 0.65s ease-out;
}

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

.landing-logo {
  margin-bottom: 1rem;
}

.landing-logo-icon {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 4rem;
  animation: logoBounce 2.2s ease-in-out infinite;
}

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

.landing-title {
  margin: 0;
  color: #8b5cf6;
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  background: var(--accent-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-kicker {
  margin: 0.4rem auto 0;
  color: var(--accent-secondary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-tagline {
  max-width: 460px;
  margin: 0.75rem auto 1rem;
  color: var(--text-secondary);
  font-size: clamp(1rem, 3vw, 1.25rem);
  line-height: 1.5;
}

.landing-value-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto 1.6rem;
}

.landing-value-pill {
  padding: 0.4rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}

.landing-game-ribbon {
  width: 100%;
  min-height: 42px;
  margin: 0 auto 1.75rem;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.landing-ribbon-track {
  display: flex;
  width: max-content;
  gap: 1rem;
  animation: ribbonScroll 40s linear infinite;
}

.landing-ribbon-item {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2rem;
}

.landing-ribbon-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.landing-ribbon-name {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

@keyframes ribbonScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.landing-seo-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: -0.35rem auto 1.25rem;
}

.landing-seo-card {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.85rem;
  color: var(--text-primary);
  text-align: left;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.landing-seo-card:hover,
.landing-seo-card:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.landing-seo-card span {
  font-size: 1.35rem;
  line-height: 1;
}

.landing-seo-card strong {
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.landing-seo-card small {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

.landing-form {
  width: 100%;
}

.landing-input-wrap {
  display: flex;
  padding: 0.35rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.landing-input-wrap:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.landing-input-wrap.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.landing-input {
  min-width: 0;
  flex: 1;
  padding: 0.9rem 1.25rem;
  color: var(--text-primary);
  font-size: 1rem;
  background: transparent;
  border: 0;
  outline: 0;
}

.landing-input::placeholder {
  color: var(--text-muted);
}

.landing-submit {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  color: white;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  background: var(--accent-gradient);
  border: 0;
  border-radius: var(--radius-full);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.landing-submit:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-glow);
}

.landing-submit:active {
  transform: scale(0.98);
}

.landing-submit-arrow {
  transition: transform 0.2s;
}

.landing-submit:hover .landing-submit-arrow {
  transform: translateX(3px);
}

.landing-secondary-action {
  display: inline-block;
  margin: 0.75rem auto 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.35);
  transition: color 0.15s, border-color 0.15s;
}

.landing-secondary-action:hover,
.landing-secondary-action:focus-visible {
  color: var(--text-primary);
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

.landing-identity-row {
  display: flex;
  justify-content: center;
  margin: 0.85rem auto 0;
}

.landing-emoji-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.38rem 0.8rem 0.38rem 0.38rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-full);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.landing-emoji-toggle:hover,
.landing-emoji-toggle:focus-visible,
.landing-emoji-toggle[aria-expanded="true"] {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.landing-emoji-preview {
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 50%;
}

.landing-emoji-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.landing-emoji-section[hidden] {
  display: none;
}

.landing-emoji-grid {
  display: grid;
  width: min(100%, 420px);
  max-width: 420px;
  gap: 0.55rem;
  min-height: 68px;
}

.emoji-picker-group {
  display: grid;
  gap: 0.3rem;
}

.emoji-picker-title {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.emoji-picker-grid {
  display: grid;
  justify-content: center;
  gap: 4px;
}

.emoji-picker-grid-compact {
  grid-template-columns: repeat(auto-fill, 32px);
}

.emoji-picker-grid-detail {
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
}

.emoji-picker-empty {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.landing-emoji-btn {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid transparent;
  border-radius: 6px;
  transition: transform 0.15s, background 0.15s;
}

.landing-emoji-btn:not(:disabled):hover {
  transform: scale(1.15);
  background: rgba(255, 255, 255, 0.12);
}

.landing-emoji-active {
  background: rgba(251, 191, 36, 0.15);
  border-color: #fbbf24;
}

.landing-emoji-secret {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.5);
}

.emoji-picker-grid-detail .landing-emoji-btn {
  width: 100%;
  min-height: 54px;
  height: auto;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.35rem 0.25rem;
}

.emoji-picker-symbol {
  line-height: 1;
}

.emoji-picker-condition {
  max-width: 100%;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-align: center;
}

.emoji-picker-locked {
  cursor: default;
  opacity: 0.48;
  filter: grayscale(0.85);
}

.emoji-picker-premium {
  border-color: rgba(96, 165, 250, 0.38);
  background: rgba(96, 165, 250, 0.08);
}

.emoji-picker-reward:not(.emoji-picker-locked) {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.08);
}

.landing-hint {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.landing-floating-icons {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.landing-float-icon {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: 2rem;
  opacity: 0.12;
  animation: floatIcon 6s ease-in-out infinite;
  animation-delay: var(--delay);
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(10deg); }
}

.secret-toast {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  color: #fbbf24;
  font-size: 0.95rem;
  white-space: nowrap;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 12px;
  opacity: 0;
  transform: translateX(-50%) translateY(-100px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

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

.secret-toast-emoji {
  margin-right: 0.3rem;
  font-size: 1.3rem;
}

.hub-legal-footer {
  max-width: 960px;
  margin: 2rem auto 1rem;
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.8rem;
}

.hub-legal-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.25);
}

.hub-legal-footer a:hover,
.hub-legal-footer a:focus-visible {
  color: var(--text-secondary);
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.hub-legal-footer .sep {
  margin: 0 0.6rem;
  opacity: 0.4;
}

:focus {
  outline: none;
}

:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18);
}

@media (max-width: 640px) {
  .particles,
  .landing-floating-icons {
    display: none;
  }

  .landing-page {
    justify-content: flex-start;
    padding-top: 5.5rem;
  }

  .landing-topbar {
    right: 1rem;
    left: 1rem;
    justify-content: center;
    flex-wrap: wrap;
  }

  .landing-seo-links {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .landing-seo-card {
    min-height: 0;
    flex-direction: row;
    align-items: center;
  }

  .landing-seo-card small {
    display: none;
  }

  .landing-ribbon-item {
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
  }

  .landing-ribbon-icon {
    font-size: 1.1rem;
  }

  .landing-ribbon-name {
    font-size: 0.7rem;
  }

  .landing-submit {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .landing-submit-text {
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .landing-emoji-grid {
    max-width: 320px;
  }

  .landing-emoji-btn {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .emoji-picker-grid-compact {
    grid-template-columns: repeat(auto-fill, 28px);
  }

  .emoji-picker-grid-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .emoji-picker-grid-detail .landing-emoji-btn {
    min-height: 50px;
  }

  .landing-emoji-preview {
    width: 32px;
    height: 32px;
    font-size: 1.35rem;
  }
}

@media (max-width: 380px) {
  .landing-input-wrap {
    flex-direction: column;
    align-items: stretch;
    border-radius: 24px;
  }

  .landing-submit {
    justify-content: center;
  }

  .landing-submit-text {
    max-width: none;
  }
}

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

  .particle,
  .landing-ribbon-track,
  .landing-logo-icon,
  .landing-float-icon {
    animation: none !important;
  }
}
