/* Public landing page. Game screens keep using css/app.css. */
.landing-page {
  overflow: auto;
}

.lp {
  position: relative;
  z-index: 1;
  color: var(--ink);
}

.lp-header {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 12px;
  padding:
    max(10px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    10px
    max(16px, env(safe-area-inset-left));
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2px solid transparent;
}

.lp-header.is-scrolled {
  box-shadow: 0 10px 28px rgba(40, 70, 100, 0.12);
  border-bottom-color: rgba(28, 25, 23, 0.06);
}

.lp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.35rem;
  flex: 0 0 auto;
}

.lp-brand .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.lp-chip-ico {
  display: inline-block;
  font-size: 1.05em;
  line-height: 1;
}

.lp-nav-title {
  display: none;
}

.lp-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  flex: 1 1 auto;
}

.lp-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fffdf8;
  border: 2.5px solid var(--ink);
  padding: 7px 12px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(28, 25, 23, 0.12);
}

.lp-nav > a.lp-nav-link:nth-of-type(1) { background: #c8efff; }
.lp-nav > a.lp-nav-link:nth-of-type(2) { background: #ffe6f4; }
.lp-nav > a.lp-nav-link:nth-of-type(3) { background: #fff4b8; }
.lp-nav > a.lp-nav-link:nth-of-type(4) { background: #e4d7ff; }
.lp-nav > a.lp-nav-link:nth-of-type(5) { background: #d4f5b8; }
.lp-nav > .lp-nav-settings { background: #ffe0a3; }

.lp-nav-link:hover,
.lp-nav-link:focus-visible {
  transform: translateY(-1px);
}

.lp-nav-link:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(28, 25, 23, 0.12);
}

.lp-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.lp-nav-settings { display: none; }

.lp-settings-btn {
  width: 48px;
  height: 48px;
  background: #ffd4e8;
  border-width: 3px;
  box-shadow: 0 4px 0 rgba(28, 25, 23, 0.14);
}

.lp-settings-btn svg {
  width: 22px;
  height: 22px;
  display: block;
  margin: 0 auto;
}

.lp-play,
.lp-flow-btn,
.lp-ghost {
  border-width: 3px;
  font-weight: 800;
  gap: 8px;
}

.lp-play { background: #6ed24a; box-shadow: 0 4px 0 #3f9a28; }
.lp-flow-btn { background: #c9b6ff; box-shadow: 0 4px 0 #7b63c9; }
.lp-ghost { background: #fffdf8; box-shadow: 0 4px 0 rgba(28, 25, 23, 0.16); }
.lp-play-lg { min-height: 56px; padding: 10px 22px; font-size: 1.1rem; }

.lp-play:active,
.lp-flow-btn:active,
.lp-ghost:active,
.lp-settings-btn:active,
.lp-menu-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(28, 25, 23, 0.16);
}

.lp-header-actions .wide-btn,
.lp-hero-actions .wide-btn,
.lp-flow .wide-btn,
.lp-cta .wide-btn,
.lp-more {
  width: auto;
  max-width: 100%;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lp-header-actions .wide-btn {
  min-height: 44px;
  margin-top: 0;
  padding: 8px 16px;
}

.lp-hero-actions .wide-btn { margin: 0; }

.lp-menu-btn {
  display: none;
  width: 48px;
  height: 48px;
  padding: 0;
  margin-left: 0;
  background: #ffd23f;
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 4px 0 rgba(28, 25, 23, 0.16);
  place-items: center;
}

.lp-burger {
  display: grid;
  gap: 5px;
  width: 18px;
}

.lp-burger span {
  display: block;
  height: 4px;
  border-radius: 99px;
  background: var(--ink);
  transform-origin: center;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.lp-header.is-open .lp-menu-btn {
  background: #ff8ec8;
}

.lp-header.is-open .lp-burger {
  display: none;
}

.lp-header.is-open .lp-menu-btn::after {
  content: "×";
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
}

.lp-main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 12px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}

.lp-hero {
  display: grid;
  gap: 28px;
  align-items: center;
  padding: 18px 0 36px;
}

.lp-kicker {
  margin: 0 0 8px;
  font-weight: 800;
  color: #3558c8;
  letter-spacing: 0.02em;
}

.lp-hero h1,
.lp-section h2,
.lp-cta h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4.4vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.lp-lede, .lp-sub, .lp-note, .lp-card p, .lp-faq-item p {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.lp-lede { margin: 12px 0 0; font-size: 1.05rem; max-width: 38rem; }
.lp-sub { margin: 8px 0 0; }
.lp-note { margin: 14px 0 0; font-size: 0.98rem; }

.lp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.lp-collage {
  position: relative;
  min-height: 320px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(2, minmax(140px, 1fr));
  gap: 12px;
}

.lp-collage-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.lp-art-card {
  margin: 0;
  background: var(--tint, #d9f4ff);
  border: 3px solid var(--ink);
  border-radius: 24px;
  padding: 8px;
  box-shadow: 0 12px 24px rgba(40, 70, 100, 0.12);
}

.lp-art-card:nth-child(n+4) { grid-column: span 2; }
.lp-float-1 { grid-column: 1 / 4; grid-row: 1; transform: rotate(-4deg); }
.lp-float-2 { grid-column: 4 / 7; grid-row: 1; transform: rotate(3deg); }
.lp-float-3 { grid-column: 1 / 3; grid-row: 2; transform: rotate(2deg); }
.lp-float-4 { grid-column: 3 / 5; grid-row: 2; transform: rotate(-3deg); }
.lp-float-5 { grid-column: 5 / 7; grid-row: 2; transform: rotate(4deg); }

.lp-art-frame {
  display: block;
  height: 140px;
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
}

.lp-art-frame svg,
.lp-world-frame svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lp-art-card figcaption {
  margin-top: 6px;
  text-align: center;
  font-weight: 800;
  font-size: 0.88rem;
}

.lp-deco {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}

.lp-star, .lp-spark {
  width: 18px;
  height: 18px;
  background: #ffd23f;
  box-shadow: 0 0 0 6px rgba(255, 210, 63, 0.28);
}

.lp-star { top: 8px; left: 12px; }
.lp-spark { right: 18px; bottom: 24px; background: #ff6bb5; box-shadow: 0 0 0 6px rgba(255, 107, 181, 0.22); }

.lp-cloud {
  width: 54px;
  height: 22px;
  background: #fff;
  border-radius: 999px;
  top: 18px;
  right: 40px;
  box-shadow: 16px 8px 0 #fff;
}

.lp-section {
  padding: 36px 0;
}

.lp-section h2 { text-align: center; }
.lp-section > .lp-sub { text-align: center; margin-bottom: 22px; }

.lp-cards {
  display: grid;
  gap: 14px;
}

.lp-cards-3 { grid-template-columns: 1fr; }
.lp-cards-4 { grid-template-columns: 1fr; }

.lp-card {
  background: var(--tint, #fffdf8);
  border: 3px solid var(--ink);
  border-radius: 24px;
  padding: 20px 18px;
  box-shadow: 0 10px 22px rgba(40, 70, 100, 0.08);
}

.lp-card h3, .lp-world-name {
  margin: 10px 0 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.lp-card p { margin: 8px 0 0; }

.lp-card-icon {
  width: 64px;
  height: 64px;
}

.lp-card-icon svg { width: 64px; height: 64px; display: block; }

.lp-worlds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lp-world {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--tint, #d9f4ff);
  border: 3px solid var(--ink);
  border-radius: 24px;
  text-align: left;
  box-shadow: 0 10px 22px rgba(40, 70, 100, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.lp-world:hover,
.lp-world:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 16px 28px rgba(40, 70, 100, 0.14);
}

.lp-world-frame {
  display: block;
  height: 120px;
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
}

.lp-more { display: block; margin: 22px auto 0; }

.lp-flow {
  display: grid;
  gap: 22px;
  background: #efe8ff;
  border: 3px solid var(--ink);
  border-radius: 28px;
  padding: 22px;
}

.lp-flow-preview {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px;
  padding: 12px;
}

.lp-flow-preview svg { width: 100%; height: auto; display: block; }

.lp-flow-tools {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: center;
}

.lp-flow-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.lp-ticks {
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.lp-ticks li {
  position: relative;
  padding: 6px 0 6px 28px;
  font-weight: 700;
}

.lp-ticks li::before {
  content: "★";
  position: absolute;
  left: 0;
  color: #e8a838;
}

.lp-about {
  display: grid;
  gap: 18px;
  align-items: center;
}

.lp-about-art svg { width: min(100%, 280px); height: auto; display: block; margin: 0 auto; }

.lp-faq {
  display: grid;
  gap: 10px;
  max-width: 720px;
  margin: 18px auto 0;
}

.lp-faq-item {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  padding: 4px 16px 8px;
}

.lp-faq-item summary {
  cursor: pointer;
  font-weight: 800;
  padding: 12px 0;
  list-style: none;
}

.lp-faq-item summary::-webkit-details-marker { display: none; }

.lp-faq-item summary::after {
  content: "+";
  float: right;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffd23f;
  border: 2.5px solid var(--ink);
  font-size: 1.15rem;
  line-height: 24px;
  text-align: center;
}

.lp-faq-item[open] summary::after {
  content: "–";
  background: #ff8ec8;
}

.lp-cta {
  position: relative;
  overflow: hidden;
  margin: 12px 0 28px;
  padding: 32px 20px;
  text-align: center;
  border-radius: 28px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #8fd8ff 0%, #d9f4ff 48%, #fff6d8 100%);
}

.lp-cta p { margin: 10px 0 18px; font-weight: 700; color: var(--muted); }
.lp-cta .lp-play { margin: 0 auto; }
.lp-cta .lp-star { left: 24px; top: 24px; }
.lp-cta .lp-cloud { right: 28px; top: 28px; }

.lp-footer {
  display: grid;
  gap: 22px;
  padding:
    28px max(16px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  background: rgba(255, 253, 248, 0.86);
  border-top: 3px solid var(--ink);
}

.lp-foot-brand strong { font-size: 1.3rem; }
.lp-foot-brand p { margin: 6px 0 0; font-weight: 600; color: var(--muted); }

.lp-footer h3 { margin: 0 0 8px; font-size: 0.95rem; }

.lp-foot-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.lp-foot-links .lp-nav-link {
  background: #fffdf8;
  border: 2.5px solid var(--ink);
  box-shadow: 0 3px 0 rgba(28, 25, 23, 0.1);
  padding: 6px 12px;
  color: var(--ink);
}

.lp-copy {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  font-weight: 700;
  color: var(--muted);
}

@media (min-width: 800px) {
  .lp-nav .lp-chip-ico { display: none; }
}

@media (min-width: 700px) {
  .lp-hero { grid-template-columns: 1.05fr 0.95fr; }
  .lp-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lp-cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-worlds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lp-flow { grid-template-columns: 1fr 1fr; align-items: center; }
  .lp-about { grid-template-columns: 1.2fr 0.8fr; }
  .lp-footer { grid-template-columns: 1.2fr 1fr 1fr; width: min(1120px, 100%); margin: 0 auto; }
  .lp-art-frame { height: 150px; }
}

@media (min-width: 980px) {
  .lp-cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 799px) {
  .lp-brand { order: 1; }
  .lp-header-actions { order: 2; margin-left: auto; }
  .lp-menu-btn { display: grid; order: 3; margin-left: 8px; }
  .lp-nav { order: 4; }
  .lp-nav {
    display: none;
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 8px);
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 16px;
    background: #fffdf8;
    border: 3px solid var(--ink);
    border-radius: 28px;
    box-shadow:
      0 8px 0 rgba(28, 25, 23, 0.12),
      0 18px 32px rgba(40, 70, 100, 0.18);
  }
  .lp-nav-title {
    display: block;
    margin: 0 4px 4px;
    font-weight: 800;
    font-size: 1.15rem;
  }
  .lp-header { flex-wrap: wrap; }
  .lp-header.is-open .lp-nav,
  .lp-nav.is-open { display: flex; }
  .lp-nav .lp-nav-link {
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
    font-size: 1.05rem;
    border-width: 3px;
  }
  .lp-header-actions .lp-settings-btn { display: none; }
  .lp-nav-settings { display: inline-flex; }
  .lp-hero h1 { font-size: clamp(1.55rem, 8vw, 2.1rem); }
  .lp-collage { min-height: 0; grid-template-columns: repeat(2, 1fr); grid-template-rows: none; }
  .lp-art-card,
  .lp-float-1, .lp-float-2, .lp-float-3, .lp-float-4, .lp-float-5 {
    grid-column: auto;
    grid-row: auto;
    transform: none;
  }
  .lp-art-card:nth-child(n+7) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-world { transition: none; }
  .lp-world:hover { transform: none; }
}

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

@media (prefers-reduced-motion: no-preference) {
  .lp-float-1 { animation: lp-float 5s ease-in-out infinite; }
  .lp-float-3 { animation: lp-float 6s ease-in-out infinite 0.4s; }
  .lp-float-5 { animation: lp-float 5.5s ease-in-out infinite 0.8s; }
}
