/* src/styles/sdroid-fx.css */
/* src/styles/sdroid-fx.css — sDROID haze-glass layer. Everything is gated on html.fx (set by sdroid-fx.js), so the editor canvas keeps the plain look. */
html.fx {
  --fx-cyan: #00E5FF;
  --fx-magenta: #FF3DEC;
  --fx-amber: #FFB300;
  --fx-acid: #A8FF3E;
  --fx-red: #FF2E3E;
  --fx-glass: rgba(14, 18, 38, 0.42);
  --fx-glass-strong: rgba(12, 15, 32, 0.62);
  --fx-rim: rgba(160, 200, 255, 0.16);
  --fx-blur: 18px;
  --fx-header-h: 64px;
  scroll-snap-type: y proximity;
  scroll-padding-top: var(--fx-header-h);
  scroll-behavior: smooth;
  background: #05060d;
}

html.fx body {
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(61, 68, 255, 0.28), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, rgba(0, 229, 255, 0.14), transparent 60%),
    radial-gradient(700px 500px at 100% 70%, rgba(255, 61, 236, 0.10), transparent 60%),
    linear-gradient(180deg, #070913 0%, #05060d 100%);
  background-attachment: fixed;
  color-scheme: dark;
  /* reset sets body to height:100%, which caps the sticky header's containing block at one viewport */
  height: auto;
  min-height: 100%;
}

/* ---------- background deck canvas + haze overlay ---------- */
#fx-deck {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

#fx-haze {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  mix-blend-mode: normal;
}

html.fx body > *:not(#fx-deck):not(#fx-haze):not(#fx-hud):not(#fx-lift):not(#fx-burger):not(#fx-toast):not(.site-header) {
  position: relative;
  z-index: 2;
}

/* ---------- sections: transparent, snap, full height ---------- */
html.fx .game-hero,
html.fx .features,
html.fx .multiplayer,
html.fx .how,
html.fx .download {
  background: transparent;
  min-height: calc(100svh - var(--fx-header-h));
  display: grid;
  align-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

html.fx .site-footer {
  scroll-snap-align: end;
  background: linear-gradient(180deg, transparent, rgba(5, 6, 13, 0.85));
}

/* ---------- header: frosted bar ---------- */
html.fx .site-header {
  background: rgba(8, 10, 22, 0.48);
  -webkit-backdrop-filter: blur(var(--fx-blur)) saturate(160%);
  backdrop-filter: blur(var(--fx-blur)) saturate(160%);
  border-bottom-color: var(--fx-rim);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  z-index: 50;
  padding-top: 12px;
  padding-bottom: 12px;
}

html.fx .brand-accent {
  color: var(--fx-cyan);
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.55);
}

html.fx .main-nav a {
  position: relative;
}

html.fx .main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--fx-cyan);
  box-shadow: 0 0 12px var(--fx-cyan);
  transform: scaleX(0);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html.fx .main-nav a.is-current::after,
html.fx .main-nav a:hover::after {
  transform: scaleX(1);
}

html.fx .main-nav a.is-current {
  color: #fff;
}

/* ---------- hero ---------- */
html.fx .game-hero-title {
  text-shadow: 0 0 40px rgba(61, 68, 255, 0.45), 0 0 90px rgba(0, 229, 255, 0.18);
}

html.fx .title-sub {
  color: var(--fx-cyan);
}

html.fx .game-hero-stats li {
  padding: var(--space-s) var(--space-l);
  border-radius: 18px;
  background: var(--fx-glass);
  -webkit-backdrop-filter: blur(var(--fx-blur));
  backdrop-filter: blur(var(--fx-blur));
  border: 1px solid var(--fx-rim);
}

/* ---------- glass surfaces ---------- */
html.fx .feature-card,
html.fx .step,
html.fx .mp-visual,
html.fx .dl-inner,
html.fx .mp-text {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--fx-glass);
  -webkit-backdrop-filter: blur(var(--fx-blur)) saturate(150%);
  backdrop-filter: blur(var(--fx-blur)) saturate(150%);
  border: 1px solid var(--fx-rim);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.35);
}

html.fx .mp-text,
html.fx .dl-inner {
  padding: var(--space-xl);
}

/* cursor spotlight + neon rim, driven by --mx / --my from the script */
html.fx .feature-card::before,
html.fx .step::before,
html.fx .mp-visual::before,
html.fx .dl-inner::before,
html.fx .mp-text::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 229, 255, 0.16), transparent 45%);
}

html.fx .feature-card::after,
html.fx .step::after,
html.fx .mp-visual::after,
html.fx .dl-inner::after,
html.fx .mp-text::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--fx-cyan), rgba(255, 61, 236, 0.6) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

html.fx .feature-card:hover::before,
html.fx .step:hover::before,
html.fx .mp-visual:hover::before,
html.fx .dl-inner:hover::before,
html.fx .mp-text:hover::before,
html.fx .feature-card:hover::after,
html.fx .step:hover::after,
html.fx .mp-visual:hover::after,
html.fx .dl-inner:hover::after,
html.fx .mp-text:hover::after {
  opacity: 1;
}

html.fx .feature-card:hover {
  transform: translateY(-4px);
}

html.fx .feature-icon {
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.45));
}

html.fx .step-num {
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.35);
}

/* multiplayer badges become floating orbs */
html.fx .droid-badge {
  animation: fx-float 6s ease-in-out infinite;
  box-shadow: 0 0 30px currentColor;
}

html.fx .droid-badge.d2 { animation-delay: -1.5s; }
html.fx .droid-badge.d3 { animation-delay: -3s; }
html.fx .droid-badge.d4 { animation-delay: -4.5s; }

@keyframes fx-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

/* ---------- staggered tile reveal ---------- */
html.fx [data-fx] {
  opacity: 0;
  transform: translateY(28px) scale(0.97);
  filter: blur(8px);
  transition:
    opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 85ms);
}

html.fx [data-fx].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

html.fx .feature-card[data-fx].is-in:hover {
  transform: translateY(-4px);
  transition-delay: 0s;
}

/* ---------- HUD, deck-lift wipe, transfer duels ---------- */
#fx-hud {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  font: 500 11px/1.45 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.06em;
  color: rgba(220, 240, 255, 0.85);
  pointer-events: none;
}

#fx-hud .fx-panel {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(8, 10, 22, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--fx-rim);
}

#fx-hud .fx-deck-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  text-transform: uppercase;
}

#fx-hud .fx-deck-line b {
  color: var(--fx-cyan);
  font-weight: 700;
}

#fx-hud .fx-log {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 5.8em;
  overflow: hidden;
}

#fx-hud .fx-log li {
  animation: fx-log-in 0.35s ease both;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#fx-hud .fx-log .ok { color: var(--fx-acid); }
#fx-hud .fx-log .bad { color: var(--fx-red); }
#fx-hud .fx-log .warn { color: var(--fx-amber); }

@keyframes fx-log-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}

#fx-hud button {
  pointer-events: auto;
  align-self: flex-start;
  font: 700 11px/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #04121a;
  background: var(--fx-cyan);
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.45);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

#fx-hud button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 34px rgba(0, 229, 255, 0.7);
}

#fx-lift {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 229, 255, 0.0) 44%, rgba(0, 229, 255, 0.55) 50%, rgba(0, 229, 255, 0.0) 56%, transparent 100%);
  background-size: 100% 260%;
  mix-blend-mode: screen;
}

#fx-lift.run {
  animation: fx-lift 0.9s cubic-bezier(0.6, 0, 0.3, 1);
}

@keyframes fx-lift {
  0% { opacity: 1; background-position: 0 100%; }
  100% { opacity: 0; background-position: 0 0%; }
}

/* ---------- play mode: you are the 001 ---------- */
html.fx.fx-play body > *:not(#fx-deck):not(#fx-haze):not(#fx-hud):not(#fx-lift):not(#fx-burger):not(#fx-toast) {
  opacity: 0.12;
  filter: blur(2px);
  pointer-events: none;
  transition: opacity 0.5s ease, filter 0.5s ease;
}

html.fx.fx-play #fx-deck {
  pointer-events: auto;
  cursor: crosshair;
  z-index: 3;
}

html.fx.fx-play #fx-haze {
  z-index: 4;
}

html.fx.fx-play {
  scroll-snap-type: none;
  overflow: hidden;
}

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  html.fx {
    scroll-behavior: auto;
  }

  html.fx [data-fx] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  html.fx .droid-badge {
    animation: none;
  }

  #fx-lift {
    display: none;
  }
}

@media (max-width: 768px) {
  html.fx {
    scroll-snap-type: none;
  }

  #fx-hud .fx-panel {
    display: none;
  }
}

/* ---------- floating glass burger (CTA) ---------- */
#fx-burger {
  --fx-burger-bottom: 20px;
  position: fixed;
  left: 0;
  bottom: calc(var(--fx-burger-bottom) + env(safe-area-inset-bottom, 0px));
  width: 58px;
  height: 58px;
  z-index: 70;
  will-change: transform;
}

/* the menu hangs off the button, opening toward the page centre */
#fx-burger .fx-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
}

#fx-burger[data-side="left"] .fx-menu { right: auto; left: 0; }

/* dodge moves (classes set by sdroid-fx.js) */
.fx-burger-btn.boing { animation: fx-boing 0.75s cubic-bezier(0.3, 1.6, 0.5, 1); }
.fx-burger-btn.hop { animation: fx-hop 0.22s ease-out; }
.fx-burger-btn.tiptoe { animation: fx-tiptoe 0.34s ease-in-out infinite; }

@keyframes fx-hop {
  0% { transform: translateY(0) scale(1.08, 0.9); }
  45% { transform: translateY(-14px) scale(0.94, 1.08); }
  100% { transform: translateY(0) scale(1.06, 0.94); }
}

@keyframes fx-tiptoe {
  0%, 100% { transform: translateY(0) rotate(-4deg) scale(0.96, 1); }
  50% { transform: translateY(-3px) rotate(4deg) scale(0.96, 1); }
}

@keyframes fx-boing {
  0% { transform: translateY(0) scale(1, 1); }
  18% { transform: translateY(-46px) scale(0.86, 1.18); }
  38% { transform: translateY(0) scale(1.22, 0.78); }
  54% { transform: translateY(-18px) scale(0.94, 1.08); }
  72% { transform: translateY(0) scale(1.08, 0.92); }
  86% { transform: translateY(-5px) scale(0.98, 1.02); }
  100% { transform: translateY(0) scale(1, 1); }
}

.fx-burger-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-content: center;
  gap: 5px;
  cursor: pointer;
  background: rgba(10, 13, 28, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(160, 200, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 32px rgba(0, 0, 0, 0.45), 0 0 26px rgba(0, 229, 255, 0.22);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.fx-burger-btn:hover,
.fx-burger-btn:focus-visible {
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 32px rgba(0, 0, 0, 0.45), 0 0 34px rgba(0, 229, 255, 0.45);
  outline: none;
}

.fx-burger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: #00E5FF;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.8);
  transition: transform 0.3s ease, opacity 0.2s ease;
}

#fx-burger.open .fx-burger-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#fx-burger.open .fx-burger-btn span:nth-child(2) { opacity: 0; }
#fx-burger.open .fx-burger-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.fx-menu {
  min-width: 220px;
  padding: 8px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(10, 13, 28, 0.62);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(160, 200, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: fx-menu-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fx-menu[hidden] { display: none; }

@keyframes fx-menu-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.fx-menu a,
.fx-menu button {
  width: 100%;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  font: 600 14px/1.2 var(--font-body, system-ui), system-ui, sans-serif;
  color: #EAF6FF;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.fx-menu a:hover,
.fx-menu a:focus-visible,
.fx-menu button:hover,
.fx-menu button:focus-visible {
  background: rgba(0, 229, 255, 0.12);
  color: #fff;
  outline: none;
}

.fx-menu .fx-sound {
  margin-top: 4px;
  border-top: 1px solid rgba(160, 200, 255, 0.12);
  border-radius: 0 0 12px 12px;
}

.fx-menu .fx-sound[aria-pressed="false"] { color: rgba(234, 246, 255, 0.55); }

.fx-menu .ico {
  width: 22px;
  text-align: center;
  color: #00E5FF;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.7);
}

html.fx.fx-play #fx-burger { opacity: 0.35; }

@media (prefers-reduced-motion: reduce) {
  #fx-burger { transition: none !important; }
  .fx-burger-btn.boing, .fx-burger-btn.hop, .fx-burger-btn.tiptoe { animation: none; }
  .fx-menu { animation: none; }
}

/* ---------- page buttons in the burger's glass style ---------- */
html.fx .btn {
  position: relative;
  border-radius: 999px;
  background: rgba(10, 13, 28, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(160, 200, 255, 0.22);
  color: #EAF6FF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 28px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

html.fx .btn:hover,
html.fx .btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(0, 229, 255, 0.6);
  background: rgba(0, 229, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 30px rgba(0, 229, 255, 0.35);
  outline: none;
}

/* primary: same glass, lit from inside in cyan */
html.fx .btn-primary {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.24), rgba(0, 229, 255, 0.1)), rgba(10, 13, 28, 0.5);
  border-color: rgba(0, 229, 255, 0.55);
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 26px rgba(0, 229, 255, 0.3);
}

html.fx .btn-primary:hover,
html.fx .btn-primary:focus-visible {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.34), rgba(0, 229, 255, 0.16)), rgba(10, 13, 28, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 40px rgba(0, 229, 255, 0.5);
}

/* light (APK) keeps a whisper of white so it stays the second choice */
html.fx .btn-light {
  background: rgba(234, 246, 255, 0.1);
  border-color: rgba(234, 246, 255, 0.35);
  color: #fff;
}

/* ---------- "Bald verfügbar!" toast ---------- */
#fx-toast {
  position: fixed;
  z-index: 80;
  transform: translate(-50%, -100%) translateY(8px) scale(0.92);
  padding: 10px 18px;
  border-radius: 999px;
  font: 700 13px/1 var(--font-body, system-ui), system-ui, sans-serif;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 179, 0, 0.22), rgba(255, 179, 0, 0.08)), rgba(10, 13, 28, 0.6);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 179, 0, 0.55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 179, 0, 0.3);
  text-shadow: 0 0 10px rgba(255, 179, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#fx-toast.show {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(0) scale(1);
}
