/* ============================================================
   小朋友版（國小中年級）— 活潑童趣，配色與字體對齊綠色系設計基調
   主色票與字體取自內部設計系統（green #0CB662 / 墨色階 / 淺灰底 / LINE Seed），
   但保留笑臉球員、emoji、圓角卡片、厚投影的童趣感。
   ============================================================ */

:root {
  /* 主色：綠（取代原天空藍的主視覺位置）*/
  --sky:    #0CB662;   /* 主綠 */
  --sky-d:  #059E44;   /* 深綠 */
  /* 球場綠：與主綠同家族，稍亮以利球員辨識 */
  --grass:  #16A95C;
  --grass-d:#0B8A47;
  /* 輔助色：暖橘（強調 / 標籤）、藍（對照色），維持多彩但收進統一基調 */
  --sun:    #FF9500;   /* 暖橘黃 */
  --orange: #FF7A3D;   /* 前鋒橘 */
  --pink:   #FF5D8F;   /* 活潑粉（保留一點童趣亮色）*/
  --purple: #3478F6;   /* 資訊藍（取代紫，貼近基調）*/
  /* 中性 */
  --cream:  #F7F8FA;   /* 淺灰白底 */
  --ink:    #1F1F1F;   /* 主墨色字 */
  --ink-soft:#6B6B6B;  /* 次墨色字 */
  --card:   #FFFFFF;
  --shadow: 0 8px 0 rgba(0,0,0,.08);

  --round:  "LINE Seed Sans TW", "Noto Sans TC", "PingFang TC", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* 不使用全域 scroll-behavior: smooth —— 否則每次點錨點都會長距離「咻」地自己捲動，
   小朋友亂點會覺得畫面一直亂跑。錨點改瞬間到位，只有「再看一次」按鈕自己用平滑捲。 */
body {
  font-family: var(--round);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  font-size: 18px;
  overflow-x: hidden;
}
::selection { background: var(--sun); }

/* 漂浮的小裝飾 */
.deco { position: fixed; pointer-events: none; opacity: .5; z-index: 0; font-size: 40px; animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 0%,100%{ transform: translateY(0) rotate(-8deg);} 50%{ transform: translateY(-18px) rotate(8deg);} }

/* ---------- 頂部 ---------- */
.kids-top {
  position: sticky; top: 0; z-index: 50;
  background: var(--sky); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; box-shadow: 0 4px 0 rgba(0,0,0,.12);
}
.kids-top .logo { font-weight: 800; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.kids-top a.grown {
  background: #fff; color: var(--sky-d); text-decoration: none;
  font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 999px;
  box-shadow: 0 3px 0 rgba(0,0,0,.15);
}

/* ---------- HERO ---------- */
.kids-hero {
  position: relative; z-index: 1;
  text-align: center; padding: 40px 20px 30px;
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky) 38%, var(--cream) 38%, var(--cream) 100%);
}
.kids-hero .balloon {
  background: #fff; border-radius: 30px; max-width: 560px; margin: 0 auto;
  padding: 30px 24px 34px; box-shadow: 0 12px 0 rgba(0,0,0,.1);
}
.kids-hero h1 {
  font-size: clamp(30px, 8vw, 46px); line-height: 1.15; font-weight: 800;
  margin-bottom: 12px;
}
.kids-hero h1 .hl { color: var(--orange); }
.kids-hero .lead { font-size: clamp(16px,4.4vw,19px); color: var(--ink-soft); margin-bottom: 8px; }
.kids-hero .big-emoji { font-size: 54px; margin-bottom: 6px; }
.kids-hero .go {
  display: inline-block; margin-top: 18px;
  background: var(--orange); color: #fff; text-decoration: none;
  font-weight: 800; font-size: 18px; padding: 14px 30px; border-radius: 999px;
  box-shadow: 0 6px 0 #d3641f; transition: transform .1s;
}
.kids-hero .go:active { transform: translateY(4px); box-shadow: 0 2px 0 #d3641f; }

/* ---------- 小問題引導 ---------- */
.kids-intro {
  position: relative; z-index: 1;
  max-width: 600px; margin: 10px auto 0; padding: 0 20px 20px; text-align: center;
}
.kids-intro p { font-size: clamp(17px,4.4vw,20px); margin-bottom: 12px; }
.kids-intro .arrow-down { font-size: 36px; color: var(--sky); animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(8px);} }

/* ---------- 階段卡片 ---------- */
.stages { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; padding: 10px 16px 40px; }

.stage {
  background: var(--card); border-radius: 26px; margin-bottom: 26px;
  padding: 22px 20px 24px; box-shadow: 0 10px 0 rgba(0,0,0,.07);
  border: 3px solid #fff; position: relative;
  opacity: 0; transform: translateY(30px);
  transition: opacity .5s ease, transform .5s ease;
}
.stage.show { opacity: 1; transform: translateY(0); }

/* 每張卡用不同色標 */
.stage:nth-child(7n+1) { border-top: 8px solid var(--sky); }
.stage:nth-child(7n+2) { border-top: 8px solid var(--orange); }
.stage:nth-child(7n+3) { border-top: 8px solid var(--purple); }
.stage:nth-child(7n+4) { border-top: 8px solid var(--grass); }
.stage:nth-child(7n+5) { border-top: 8px solid var(--pink); }
.stage:nth-child(7n+6) { border-top: 8px solid var(--sun); }
.stage:nth-child(7n+0) { border-top: 8px solid var(--sky-d); }

.stage .head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.stage .num-emoji {
  font-size: 30px; background: var(--cream); width: 56px; height: 56px;
  border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.05);
}
.stage .badge {
  font-size: 13px; font-weight: 700; color: #fff; background: var(--sky);
  padding: 3px 12px; border-radius: 999px; display: inline-block;
}
.stage:nth-child(7n+2) .badge { background: var(--orange); }
.stage:nth-child(7n+3) .badge { background: var(--purple); }
.stage:nth-child(7n+4) .badge { background: var(--grass); }
.stage:nth-child(7n+5) .badge { background: var(--pink); }
.stage:nth-child(7n+6) .badge { background: #E08400; }
.stage:nth-child(7n+0) .badge { background: var(--sky-d); }

.stage h2 { font-size: clamp(22px,5.6vw,28px); line-height: 1.25; margin: 10px 0 4px; }

/* 球場 */
.stage .pitch-box { margin: 14px auto; max-width: 280px; }
.stage .pitch-box svg { width: 100%; display: block; border-radius: 16px; box-shadow: 0 6px 0 rgba(0,0,0,.12); }
.stage .formation-tag {
  text-align: center; font-weight: 800; font-size: 16px; color: var(--grass-d);
  margin-top: 8px;
}
.stage .formation-tag .code {
  background: var(--grass); color: #fff; padding: 2px 12px; border-radius: 999px;
  font-size: 15px; margin-right: 6px;
}

.stage .story { font-size: clamp(16px,4.2vw,18px); margin: 14px 0; }
.stage .story b { color: var(--orange); }

.stage .fun {
  background: #E6F7EE; border-radius: 16px; padding: 12px 16px; margin: 12px 0;
  font-size: clamp(15px,4vw,17px); display: flex; gap: 10px; align-items: flex-start;
}
.stage .fun::before { content: "💡"; font-size: 22px; flex-shrink: 0; }

.stage .change {
  background: var(--ink); color: #fff; border-radius: 16px;
  padding: 12px 16px; font-size: clamp(15px,4vw,17px); font-weight: 700;
  display: flex; gap: 10px; align-items: center; margin-top: 4px;
}
.stage .change::before { content: "👉"; font-size: 20px; flex-shrink: 0; }
.stage .change b { color: var(--sun); }

/* 階段之間的連接箭頭 */
.connector { text-align: center; font-size: 34px; color: var(--sky); margin: -14px 0 12px; }

/* ---------- 結尾大對照 ---------- */
.kids-finale {
  position: relative; z-index: 1;
  background: var(--purple); color: #fff; text-align: center;
  padding: 44px 20px 50px; border-radius: 40px 40px 0 0; margin-top: 10px;
}
.kids-finale h2 { font-size: clamp(26px,7vw,38px); margin-bottom: 8px; }
.kids-finale .sub { font-size: clamp(16px,4.4vw,19px); opacity: .92; margin-bottom: 26px; }
.kids-finale .vs {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.kids-finale .vs figure {
  background: rgba(255,255,255,.12); border-radius: 24px; padding: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.kids-finale .vs svg { width: 190px; display: block; }
.kids-finale .vs figcaption { font-weight: 800; font-size: 18px; }
.kids-finale .vs .flip {
  font-size: 44px; margin: 4px 0;
  animation: spin 3s ease-in-out infinite;
}
@keyframes spin { 0%,100%{ transform: rotate(0);} 50%{ transform: rotate(180deg);} }
.kids-finale .clap { font-size: 44px; margin-top: 22px; }
.kids-finale .replay {
  display: inline-block; margin-top: 14px;
  background: var(--sun); color: var(--ink); text-decoration: none;
  font-weight: 800; padding: 12px 26px; border-radius: 999px;
  box-shadow: 0 5px 0 #CC7700;
}

/* ---------- 頁尾 ---------- */
.kids-foot {
  background: var(--ink); color: #B0B0B0; text-align: center;
  padding: 24px 20px; font-size: 13px;
}
.kids-foot a { color: var(--sun); }

/* 進度條 */
#kprogress { position: fixed; top: 0; left: 0; height: 5px; width: 0%; background: var(--orange); z-index: 100; transition: width .1s; }

/* ============================================================
   桌面 / 平板橫向（≥820px）：避免「中間一條手機版」
   卡片改成「球場在左、文字在右」的左右雙欄，整體放大、用滿空間
   ============================================================ */
@media (min-width: 820px) {
  .kids-hero .balloon { max-width: 720px; padding: 44px 48px 48px; }
  .kids-hero h1 { font-size: 54px; }
  .kids-hero .lead { font-size: 21px; }
  .kids-intro { max-width: 720px; }
  .kids-intro p { font-size: 22px; }

  .stages { max-width: 940px; padding: 20px 24px 60px; }

  /* 卡片左右雙欄：左邊球場 + 陣型標籤，右邊文字緊湊靠上 */
  .stage {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-areas:
      "head  head"
      "pitch toptpad"
      "pitch title"
      "pitch story"
      "pitch fun"
      "pitch change"
      "ftag  botpad";
    grid-template-rows: auto 1fr auto auto auto auto 1fr;
    column-gap: 34px; row-gap: 10px;
    align-items: start;
    padding: 28px 34px 32px;
  }
  .stage .head          { grid-area: head; margin-bottom: 4px; }
  .stage .pitch-box     { grid-area: pitch; max-width: 300px; margin: 0; align-self: center; }
  .stage .formation-tag { grid-area: ftag; margin: 8px 0 0; align-self: start; }
  .stage h2             { grid-area: title; font-size: 30px; margin: 0; }
  .stage .story         { grid-area: story; font-size: 19px; margin: 0; }
  .stage .fun           { grid-area: fun; font-size: 18px; margin: 6px 0 0; }
  .stage .change        { grid-area: change; font-size: 18px; margin: 6px 0 0; }

  .connector { font-size: 40px; margin: 2px 0 14px; }

  /* 結尾對照：兩球場改左右並排 */
  .kids-finale h2 { font-size: 42px; }
  .kids-finale .vs { flex-direction: row; justify-content: center; align-items: center; gap: 10px; }
  .kids-finale .vs svg { width: 230px; }
  .kids-finale .vs .flip { font-size: 52px; }
}

/* 無障礙：使用者若偏好減少動態，關閉所有動畫 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
