/* ==========================================================
   ENG 跑酷 首頁 — 卡通風格
   依賴 /eng-parkour/game-theme.css 的色彩變數與元件（.nx-btn 等）
   ========================================================== */

.lp {
  overflow-x: hidden;
  -webkit-user-select: auto;
          user-select: auto;
}
.lp *, .lp *::before, .lp *::after { box-sizing: border-box; }
.lp a { color: inherit; }
html { scroll-behavior: smooth; }

/* ---------- 導覽列 ---------- */
.lp-header {
  position: fixed;
  inset: 12px 0 auto;
  z-index: 1000;
  padding: 0 clamp(12px, 3vw, 32px);
  pointer-events: none;
}
.lp-nav {
  pointer-events: auto;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 10px 8px 18px;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .2s;
}
.lp-header.scrolled .lp-nav { box-shadow: 0 5px 0 var(--ink), 0 12px 24px rgba(29, 35, 64, 0.2); }

.lp-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  text-decoration: none;
  transform: rotate(-2deg);
}
.lp-brand__en {
  font-family: var(--font-round);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--white);
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink),
    0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 4px 0 var(--ink);
}
.lp-brand__zh {
  padding: 3px 9px 5px;
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
  background: var(--c-sun);
  border: 3px solid var(--ink);
  border-radius: 10px;
}

.lp-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lp-menu .nav-link {
  display: block;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
  color: var(--ink);
  background: none;
  border: 3px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}
.lp-menu a.nav-link:hover,
.lp-menu a.nav-link.active { background: color-mix(in srgb, var(--c-sun) 45%, var(--white)); border-color: var(--ink); }

.lp-auth-btn { border-color: var(--ink) !important; background: var(--white) !important; box-shadow: 0 3px 0 var(--ink); }
.lp-auth-btn--primary { background: var(--c-grass) !important; }
.lp-auth-btn:active { transform: translateY(3px); box-shadow: none; }

.lp-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px 9px;
  background: var(--c-sun);
  border: 3px solid var(--ink);
  border-radius: 12px;
  cursor: pointer;
}
.lp-hamburger span { width: 20px; height: 3px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.lp-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.lp-hamburger.active span:nth-child(2) { opacity: 0; }
.lp-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 使用者按鈕（登入後由 auth-handler.js 注入） */
.lp .user-info-nav { padding: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.lp .user-info-button {
  gap: 10px;
  padding: 4px 14px 4px 4px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
}
.lp .user-info-button:hover { transform: none; box-shadow: 0 3px 0 var(--ink); background: color-mix(in srgb, var(--c-sun) 25%, var(--white)); }
.lp .user-avatar { border: 2px solid var(--ink); box-shadow: none; }
.lp .user-info-text { margin-left: 0; align-items: flex-start; }
.lp .user-name { color: var(--ink); font-size: 14px; font-weight: 900; text-shadow: none; }
.lp .user-role { font-size: 11px; font-weight: 700; color: #2f8a12; }
.lp .dropdown-arrow { color: var(--ink); }
.lp .user-dropdown-menu { position: absolute; top: calc(100% + 10px); right: 0; }

/* ---------- HERO ---------- */
.lp-hero {
  position: relative;
  min-height: 100vh;
  padding: 130px clamp(16px, 4vw, 48px) 170px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: url('/eng-parkour/img/background1.png') center bottom / cover no-repeat, #3fcdfc;
}
.lp-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 70px);
}
.lp-hero__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.lp-hero__title {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-weight: 900;
  line-height: 1.1;
  transform: rotate(-3deg);
}
.lp-hero__line {
  font-size: clamp(48px, 7.4vw, 96px);
  color: var(--white);
  text-shadow:
    -4px -4px 0 var(--ink), 4px -4px 0 var(--ink), -4px 4px 0 var(--ink), 4px 4px 0 var(--ink),
    0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink),
    0 10px 0 var(--ink);
}
.lp-hero__line--accent { margin-left: .6em; color: var(--c-sun); }
.lp-hero__lead {
  max-width: 30em;
  margin: 8px 0 0;
  padding: 14px 18px;
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 700;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 5px 0 var(--ink);
}
.lp-hero__actions, .lp-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* 遊戲畫面 */
.lp-hero__screen { position: relative; }
.lp-screen {
  overflow: hidden;
  aspect-ratio: 16 / 7.6;
  background: var(--white);
  border: 6px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 12px 0 var(--ink);
  transform: rotate(2deg);
}
.lp-screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

.lp-bubble {
  position: absolute;
  top: -26px;
  right: 8%;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 18px;
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  animation: lp-bubble 3.2s ease-in-out infinite;
}
.lp-bubble::after {
  content: "";
  position: absolute;
  left: 26px;
  bottom: -16px;
  width: 22px;
  height: 22px;
  background: var(--white);
  border-right: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  transform: rotate(45deg);
}
.lp-bubble__q { font-size: 18px; font-weight: 900; }
.lp-bubble__a { font-family: var(--font-round); font-size: 24px; font-weight: 700; color: #1d6fd6; }
@keyframes lp-bubble { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(2deg) translateY(-6px); } }

.lp-float { position: absolute; z-index: 3; pointer-events: none; filter: drop-shadow(0 6px 0 rgba(29, 35, 64, 0.25)); }
.lp-float--a { width: clamp(84px, 10vw, 132px); left: -7%; bottom: -14%; animation: lp-hop 1.6s ease-in-out infinite; }
.lp-float--b { width: clamp(44px, 5vw, 64px); left: 40%; top: -16%; animation: lp-coin 2.2s ease-in-out infinite; }
@keyframes lp-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-26px) rotate(-6deg); } }
@keyframes lp-coin { 0%, 100% { transform: translateY(0) scaleX(1); } 50% { transform: translateY(-10px) scaleX(-1); } }

/* 草地 */
.lp-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 110px;
  background:
    url('/eng-parkour/Sprites/Tiles/Double/terrain_grass_block_top.png') left top / 64px 64px repeat-x,
    url('/eng-parkour/Sprites/Tiles/Double/terrain_grass_block_center.png') left 64px / 64px 64px repeat;
}
.lp-ground__deco { position: absolute; bottom: 100%; width: 64px; margin-bottom: -6px; }
.lp-ground__deco--bush { left: 8%; width: 80px; }
.lp-ground__deco--sign { left: 46%; }
.lp-ground__deco--mush { right: 10%; width: 52px; }

/* ---------- 區塊 ---------- */
.lp-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(70px, 10vw, 120px) clamp(16px, 4vw, 48px) 0;
}
.lp-section__title {
  display: table;
  margin: 0 auto 40px;
  padding: 8px 26px 12px;
  font-size: clamp(30px, 4.6vw, 48px);
  font-weight: 900;
  color: var(--ink);
  background: var(--c-sun);
  border: 4px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 6px 0 var(--ink);
  transform: rotate(-2deg);
}
#features .lp-section__title { background: var(--c-pink); transform: rotate(1.5deg); }
#modes .lp-section__title { background: var(--c-grass); }

/* 步驟 */
.lp-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lp-step {
  --accent: var(--c-sky);
  position: relative;
  padding: 34px 22px 24px;
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 7px 0 var(--ink);
  transition: transform .15s;
}
.lp-step:nth-child(odd) { transform: rotate(-1.2deg); }
.lp-step:nth-child(even) { transform: rotate(1.2deg); }
.lp-step:hover { transform: translateY(-6px) rotate(0); }
.lp-step__no {
  position: absolute;
  top: -26px;
  left: 18px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-family: var(--font-round);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  background: var(--accent);
  border: 4px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 4px 0 var(--ink);
}
.lp-step h3 { margin: 0 0 8px; font-size: 22px; font-weight: 900; }
.lp-step p { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.75; color: var(--ink-soft); }

/* 特色 */
.lp-features { max-width: 900px; margin: 0 auto; }
.lp-features__tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: -4px; position: relative; z-index: 1; }
.lp-tab {
  padding: 12px 22px 16px;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
  background: color-mix(in srgb, var(--c-sky) 40%, var(--white));
  border: 4px solid var(--ink);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  cursor: pointer;
  transform: translateY(6px);
  transition: transform .15s, background .15s;
}
.lp-tab:hover { transform: translateY(2px); }
.lp-tab.is-active { background: var(--paper); transform: none; }
.lp-features__panels {
  padding: clamp(22px, 4vw, 38px);
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 8px 0 var(--ink);
  min-height: 300px;
}
.lp-panel { display: none; }
.lp-panel.is-active { display: block; animation: nx-pop .4s var(--nx-ease) both; }
.lp-panel h3 { margin: 0 0 10px; font-size: clamp(22px, 3vw, 28px); font-weight: 900; }
.lp-panel p { margin: 0 0 20px; font-size: 16px; font-weight: 500; line-height: 1.8; color: var(--ink-soft); }
.lp-panel ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.lp-panel li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 14px;
}
.lp-panel li::before {
  content: "✓";
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  background: var(--c-grass);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

/* 模式 */
.lp-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 22px; }
.lp-mode {
  --accent: var(--c-sky);
  position: relative;
  padding: 0 24px 26px;
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 7px 0 var(--ink);
  overflow: hidden;
  transition: transform .15s;
}
.lp-mode:hover { transform: translateY(-6px); }
.lp-mode__art {
  display: block;
  width: calc(100% + 48px);
  height: 150px;
  margin: 0 -24px 18px;
  padding: 18px 0 8px;
  object-fit: contain;
  background: var(--accent);
  border-bottom: 4px solid var(--ink);
}
.lp-mode h3 { margin: 0 0 8px; font-size: 24px; font-weight: 900; }
.lp-mode p { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.7; color: var(--ink-soft); }

/* CTA */
.lp-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin: clamp(70px, 10vw, 110px) auto 0;
  padding: clamp(32px, 6vw, 56px) 20px;
  max-width: 900px;
  text-align: center;
  background: var(--c-sun);
  border: 4px solid var(--ink);
  border-radius: 30px;
  box-shadow: 0 8px 0 var(--ink);
}
.lp-cta h2 {
  margin: 0;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  color: var(--white);
  text-shadow:
    -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 3px 3px 0 var(--ink),
    0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink), 0 7px 0 var(--ink);
}

/* 頁尾 */
.lp-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  max-width: 1240px;
  margin: 70px auto 0;
  padding: 26px clamp(16px, 4vw, 48px) 34px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
}

/* 捲動進場 */
.reveal { opacity: 0; translate: 0 26px; transition: opacity .5s ease, translate .5s var(--nx-ease); }
.reveal.is-in { opacity: 1; translate: 0 0; }

/* 登入視窗 */
.lp .auth-modal { position: fixed; inset: 0; z-index: 2000; align-items: center; justify-content: center; padding: 16px; }
.lp #authSwitchBtn { margin-left: 8px; background: none; border: 0; cursor: pointer; text-decoration: underline; }

/* ---------- 響應式 ---------- */
@media (max-width: 980px) {
  .lp-hero__inner { grid-template-columns: 1fr; }
  .lp-hero__screen { max-width: 620px; width: 100%; justify-self: center; margin-top: 30px; }
}
@media (max-width: 860px) {
  .lp-hamburger { display: flex; }
  .lp-menu {
    position: fixed;
    top: 84px;
    left: 12px;
    right: 12px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    background: var(--paper);
    border: 4px solid var(--ink);
    border-radius: 22px;
    box-shadow: 0 6px 0 var(--ink);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all .2s;
  }
  .lp-menu.active { opacity: 1; visibility: visible; transform: none; }
  .lp-menu .nav-link { padding: 12px; text-align: center; width: 100%; }
  .lp-auth-btn { margin-top: 6px; }
}
@media (max-width: 560px) {
  .lp-hero { padding-bottom: 150px; }
  .lp-actions, .lp-hero__actions { width: 100%; }
  .lp-actions .nx-btn { flex: 1 1 100%; }
  .lp-float--a { left: -2%; }
  .lp-br { display: none; }
  .lp-ground__deco--sign { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lp-float, .lp-bubble { animation: none; }
  .reveal { opacity: 1; translate: none; transition: none; }
}

/* 強調色工具類需在元件預設 --accent 之後 */
.nx-a-cyan    { --accent: var(--c-sky); }
.nx-a-magenta { --accent: var(--c-pink); }
.nx-a-lime    { --accent: var(--c-grass); }
.nx-a-amber   { --accent: var(--c-sun); }
.nx-a-red     { --accent: var(--c-red); }
.nx-a-violet  { --accent: var(--c-grape); }
.nx-a-blue    { --accent: var(--c-blue); }
