/* site-pixel — 像素 RPG 風 landing
   氛圍靠：硬邊實心陰影 + 零圓角 + 飽和配色 + 場景 sprite 密度 + dither 過渡
   sprite 全為 inline SVG，零圖檔 */

@font-face {
  font-family: 'Fusion Pixel';
  src: url('../fonts/fusion-pixel-zh-hant.subset.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Press Start 2P';
  src: url('../fonts/press-start-2p.subset.woff2') format('woff2');
  font-display: swap;
}

:root {
  --navy: #1b2b52;
  --parchment: #f0dca8;
  --parchment-line: #d8c088;
  --ink: #3a2f20;
  --outline: #26222e;
  --red: #d13b2a;
  --red-dark: #a02718;
  --blue: #2b6cb8;
  --purple: #7a4fb0;
  --green: #2e8b4f;
  --gold: #f7d63e;
  /* 硬邊實心陰影（無模糊、不透明）＝像素貼紙感的關鍵 */
  --hard-shadow: 6px 6px 0 var(--outline);
  --hard-shadow-sm: 4px 4px 0 var(--outline);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Fusion Pixel', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  color: var(--ink);
  /* 飽和分帶天空（硬停格） */
  background:
    linear-gradient(to bottom,
      #3f9ae6 0, #3f9ae6 130px,
      #58aeee 130px, #58aeee 300px,
      #7cc4f4 300px, #7cc4f4 62%,
      #2e8b4f 62%, #2e8b4f 100%);
  min-height: 100vh;
  image-rendering: pixelated;
}

.world {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 28px 16px 40px;
}

.en { font-family: 'Press Start 2P', 'Fusion Pixel', monospace; }
svg { image-rendering: pixelated; }

/* ── 背景場景層 ── */
.scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.scene .sprite { position: absolute; display: block; }

.castle { width: 128px; top: 14px; left: 12px; opacity: 0.9; }
.sun { width: 60px; top: 20px; right: 22px; }
.cloud { image-rendering: pixelated; }
/* 橫越全天空的連續飄行（動畫 left：-140px→100%，配合 .scene overflow:hidden 兩端都在畫面外）
   負 delay 讓載入當下三朵雲已散在不同位置；vw 進 keyframes 有解析成 0 的環境，別用 */
.c1 { width: 110px; top: 60px;  left: 30%; animation: sail 50s linear infinite; animation-delay: -18s; }
.c2 { width: 90px;  top: 130px; left: 62%; animation: sail 70s linear infinite; animation-delay: -45s; }
.c3 { width: 70px;  top: 210px; left: 12%; animation: sail 60s linear infinite; animation-delay: -30s; }
@keyframes sail {
  from { left: -140px; }
  to   { left: 100%; }
}

/* 底部森林地帶 */
.ground { position: absolute; left: 0; right: 0; bottom: 0; height: 200px; }
.dither {
  position: absolute; left: 0; right: 0; top: 0; height: 16px;
  background-image:
    linear-gradient(45deg, #2e8b4f 25%, transparent 25%),
    linear-gradient(-45deg, #2e8b4f 25%, transparent 25%);
  background-size: 8px 8px;
  background-color: transparent;
  opacity: 0.9;
}
.turf {
  position: absolute; left: 0; right: 0; bottom: 0; height: 60px;
  background: #256b3f;
  border-top: 4px solid #1d5c34;
}
.hero { }
.scene .hero { width: 60px; bottom: 40px; left: 5%; }
.tree { width: 70px; }
.t-a { bottom: 42px; left: 20%; }
.t-b { bottom: 44px; right: 24%; width: 60px; }
.bush { width: 54px; }
.b-a { bottom: 46px; left: 44%; }
.chest { width: 52px; bottom: 44px; right: 7%; }
.potion { width: 30px; bottom: 50px; right: 17%; }

@media (prefers-reduced-motion: reduce) {
  .cloud { animation: none; }
}

/* ── 像素面板：硬邊實心框 ── */
.pixel-panel {
  position: relative;
  background: var(--parchment);
  border: 4px solid var(--outline);
  padding: 20px 22px 22px;
  box-shadow: var(--hard-shadow);
  /* 內側描線＝厚重像素框 */
  outline: 4px solid var(--parchment);
  outline-offset: -8px;
}
.pixel-panel.navy { background: var(--navy); color: #f4f0e2; outline-color: var(--navy); }

/* ── 頁首 ── */
/* :not(.scene) 必要：通用版會把 .scene 的 absolute 覆寫成 relative，
   高度歸 0 + overflow:hidden = 整個場景層被裁掉（2026-07-02 實際踩過） */
.world > :not(.scene) { position: relative; z-index: 1; }
.site-header { max-width: 860px; margin: 0 auto 26px; text-align: center; }

.scroll-banner {
  position: relative;
  display: inline-block;
  background: var(--parchment);
  border: 4px solid var(--outline);
  padding: 16px 56px 14px;
  box-shadow: var(--hard-shadow);
  outline: 4px solid var(--parchment);
  outline-offset: -8px;
}
.scroll-banner h1 { font-size: 26px; letter-spacing: 2px; color: var(--ink); }
.tagline { margin-top: 10px; font-size: 16px; color: var(--ink); }
.deco-sword { position: absolute; top: 50%; transform: translateY(-50%); width: 16px; height: 48px; }
.deco-sword.left { left: 14px; }
.deco-sword.right { right: 14px; transform: translateY(-50%) scaleX(-1); }

.quest-start {
  margin-top: 20px; font-size: 13px; color: #fff;
  text-shadow: 2px 2px 0 var(--outline); letter-spacing: 1px;
}

/* ── Hero ── */
main { max-width: 860px; margin: 0 auto; }
.hero.pixel-panel { text-align: center; margin-bottom: 26px; }
.hero-icon { width: 56px; height: 56px; margin-bottom: 12px; }
.hero-title {
  font-size: 30px; color: var(--gold);
  text-shadow: 3px 3px 0 var(--outline); letter-spacing: 2px; margin-bottom: 14px;
}
.hero-sub { font-size: 18px; line-height: 1.8; }
.press-start {
  margin-top: 18px; font-size: 12px; color: var(--gold);
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .press-start { animation: none; } }

/* ── 面板網格 ── */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid .pixel-panel { padding-top: 10px; }

.ribbon {
  display: inline-flex; align-items: center; gap: 8px;
  position: relative; top: -22px; margin-bottom: -8px;
  background: var(--red); color: #fff;
  font-size: 17px; font-weight: normal;
  padding: 8px 22px 8px 12px;
  box-shadow: var(--hard-shadow-sm);
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%);
}
.ribbon.blue { background: var(--blue); }
.ribbon.purple { background: var(--purple); }
.ribbon.green { background: var(--green); }
.ribbon .icon { width: 20px; height: 20px; }

.pixel-panel ul { list-style: none; }
.pixel-panel li { font-size: 16px; line-height: 1.7; padding: 5px 0 5px 20px; position: relative; }
.pixel-panel li::before {
  content: ""; position: absolute; left: 2px; top: 13px;
  width: 8px; height: 8px; background: var(--red-dark);
}
.quest-list li::before { display: none; }
.quest-list li { padding-left: 0; }
.stat-list .k {
  display: inline-block; min-width: 3.2em; color: var(--red-dark); margin-right: 6px;
}
.q {
  display: inline-block; min-width: 3em; margin-right: 8px;
  font-size: 12px; color: #fff; text-align: center;
  padding: 2px 4px; box-shadow: 2px 2px 0 var(--outline);
}
.q.main { background: var(--red); }
.q.side { background: var(--blue); }
.q.daily { background: var(--green); }
.coming { font-size: 13px; color: var(--green); margin: 8px 0 10px; }
.pixel-panel p { font-size: 16px; line-height: 1.7; }

/* ── 頁尾 ── */
.site-footer { max-width: 860px; margin: 40px auto 0; text-align: center; }
.pixel-btn {
  display: inline-block; background: var(--gold); color: var(--outline);
  text-decoration: none; font-size: 13px; padding: 12px 22px;
  border: 4px solid var(--outline); box-shadow: var(--hard-shadow-sm);
}
.pixel-btn:hover, .pixel-btn:focus-visible {
  transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--outline);
}
.copyright {
  margin-top: 20px; font-size: 10px; color: #eaf6ff;
  text-shadow: 2px 2px 0 var(--outline);
}

/* ── 手機 ── */
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .scroll-banner h1 { font-size: 16px; }
  .scroll-banner { padding: 16px 40px 14px; }
  .hero-title { font-size: 20px; }
  .castle { width: 84px; }
  .c1 { width: 80px; } .c2 { width: 64px; } .c3 { display: none; }
  .world { padding: 20px 10px 30px; }
}
