
  html { scrollbar-gutter: stable; }
:root {
    --gold: #8B6310; --gold-bright: #C8973A; --gold-light: #F3E4C2; --gold-deep: #5a3e0a;
    --ink: #1C1C1C; --ink-soft: #333333; --ink-muted: #666666;
    --white: #FFFFFF; --off-white: #F5F0E8; --border: rgba(139,99,16,0.18);
    --card-bg: #F5F0E8; --nav-h: 60px;
    --cream: #FBF5E7; --cream-soft: #F9F6F0; --warm-line: rgba(139,99,16,0.30);
    /* difficulty ramp — easy→hard, light→dark */
    --d1:#A07820; --d1-bg:#FDF4DC; --d2:#8B6310; --d2-bg:#F8EAC0;
    --d3:#7A5510; --d3-bg:#F4E0A8; --d4:#5A3C08; --d4-bg:#EDD898;
  }
  * { margin:0; padding:0; box-sizing:border-box; scroll-behavior:smooth; }
  a:visited { color: currentColor; }
  body { background:#F5F0E8; color:var(--ink); font-family:'Noto Serif TC',serif; overflow-x:hidden; padding-top:var(--nav-h); }

  /* NAV */
  /* 2026-08-10: padding ไหลลื่น (clamp) แทนค่าคงที่ 32px — ยิ่งจอแคบยิ่งลด padding ลงเอง
     ก่อนจะถึงจุดที่ต้องสลับเป็นโหมดมือถือ (ดู .nav-compact / @media ท้ายบล็อกนี้) */
  nav { position:fixed; top:0; left:0; right:0; height:var(--nav-h); background:rgba(17,17,17,0.97); backdrop-filter:blur(8px); display:flex; align-items:center; justify-content:space-between; padding:0 clamp(16px,3vw,32px); z-index:999; border-bottom:1px solid rgba(200,151,58,0.2); }
  .nav-logo { font-family:'Noto Serif TC',serif; font-size:15px; font-weight:900; letter-spacing:1px; cursor:pointer; flex-shrink:0; }
  .nav-logo .logo-main { color:var(--white); }
  .nav-logo .logo-accent { color:var(--gold-bright); }
  .nav-logo .logo-dim { color:var(--gold-bright); font-weight:900; }

  /* top-level nav items — flex-shrink:0 กันข้อความถูกบีบเบี้ยวระหว่างที่ JS กำลังวัดความกว้างจริง
     (ดู __navFit() ใน js/core/shared.js) ถ้าพอดี = แถวเดียวไม่ตัดคำ ถ้าไม่พอดี JS จะสลับเป็นโหมดมือถือให้เอง */
  .nav-links { display:flex; flex-shrink:0; gap:clamp(2px,0.6vw,4px); list-style:none; align-items:center; }
  .nav-links > li { position:relative; }
  .nav-links > li > a {
    font-family:'Noto Sans TC',sans-serif; font-size:12px; font-weight:500;
    color:rgba(255,255,255,0.72); text-decoration:none; letter-spacing:0.5px;
    transition:color 0.2s; white-space:nowrap; padding:6px clamp(6px,1vw,10px); display:block;
  }
  .nav-links > li > a:hover { color:var(--gold-bright); }
  .nav-links > li > a.has-drop::after { content:'▾'; font-size:9px; margin-left:4px; opacity:0.5; }

  /* dropdown panel */
  .nav-drop {
    display:none; position:absolute; top:calc(100% + 1px); left:0;
    background:rgba(17,17,17,0.98); border:1px solid rgba(200,151,58,0.25);
    border-top:2px solid var(--gold-bright); min-width:160px; z-index:1000;
    padding:8px 0;
  }
  .nav-links > li:hover .nav-drop { display:block; }
  .nav-drop a {
    font-family:'Noto Sans TC',sans-serif; font-size:12px; font-weight:400;
    color:rgba(255,255,255,0.65); text-decoration:none; display:block;
    padding:9px 18px; white-space:nowrap; transition:all 0.15s; letter-spacing:0.3px;
  }
  .nav-drop a:hover { color:var(--gold-bright); background:rgba(200,151,58,0.08); padding-left:22px; }
  .nav-drop-label {
    font-family:'Noto Sans TC',sans-serif; font-size:9px; letter-spacing:3px;
    text-transform:uppercase; color:rgba(200,151,58,0.5); font-weight:700;
    padding:10px 18px 4px; display:block;
  }
  .nav-drop-divider { height:1px; background:rgba(255,255,255,0.06); margin:6px 0; }
  .nav-links > li > a.nav-current { color:var(--gold-bright); font-weight:700; }
  .nav-drop a.nav-current { color:var(--gold-bright); background:rgba(200,151,58,0.08); }

  .nav-cta { background:var(--gold-bright) !important; color:var(--ink) !important; font-weight:700 !important; padding:8px clamp(10px,1.6vw,18px) !important; font-size:12px !important; }
  .nav-cta:hover { background:#b07820 !important; color:var(--ink) !important; }
  /* 2026-08-10: 遊戲 = secondary CTA — เด่นกว่าลิงก์ธรรมดาแต่ไม่แย่งซีน 免費試聽 (primary CTA ทึบทอง) */
  .nav-cta-secondary { border:1px solid var(--gold-bright) !important; color:var(--gold-bright) !important; font-weight:700 !important; padding:6px clamp(8px,1.3vw,14px) !important; border-radius:4px; }
  .nav-cta-secondary:hover { background:rgba(200,151,58,0.12) !important; color:var(--gold-bright) !important; }
  .hamburger { display:none; flex-direction:column; gap:5px; cursor:pointer; padding:4px; }
  .hamburger span { display:block; width:22px; height:2px; background:rgba(255,255,255,0.8); }
  .nav-mobile-actions { display:none; }
  .nav-mobile-cta, .nav-mobile-game { display:none; }

  /* 2026-08-10: RESPONSIVE NAV — แก้บั๊ก "เมนู desktop หายเร็วเกินไปตอนย่อหน้าต่าง"
     เดิม breakpoint ตายตัวที่ 900px กว้างเกินความจำเป็นจริงมาก (คำนวณจากความกว้างจริงของ
     ตัวอักษร/ปุ่มแล้ว 4 รายการบนสุด 🎮遊戲/學習資源/更多/免費試聽 พอดีได้ตั้งแต่ ~500-520px)
     ตอนนี้ตัวตัดสินใจหลักคือ JS: __navFit() (ฝัง inline ทันทีหลัง <nav> ทุกหน้า โดย
     scripts/generate-nav.js กันกระพริบตอนโหลดหน้าแรก + ผูก resize ซ้ำใน shared.js)
     วัดความกว้างจริงของ logo+เมนู เทียบกับพื้นที่จริงของ <nav> ทุกครั้ง ไม่เดา breakpoint —
     พอดี = อยู่โหมด desktop ต่อ ไม่พอดี = เติม class "nav-compact" ให้ nav ทันที
     @media ด้านล่างนี้เป็นแค่ "ตาข่ายนิรภัย" เผื่อ JS ไม่ทำงาน (ปิด JS ในเบราว์เซอร์) เท่านั้น —
     ⚠️ ต้องตั้งให้ "ต่ำกว่า" ความกว้างที่เนื้อหาจริงต้องการ (~500-520px) เสมอ ไม่งั้น
     @media จะไปกันไม่ให้ JS ขยายโหมด desktop ลงไปถึงจุดที่พื้นที่ยังพอจริงๆ (480px มีระยะกันชน
     ประมาณ 20-40px ต่ำกว่าจุดที่เนื้อหาต้องการจริง + สูงกว่าจุดทดสอบมือถือจริง 390px) ห้ามลบทิ้ง */
  @media(max-width:480px){ .nav-links{display:none;} .nav-links>li:first-child,.nav-links>li:last-child{display:none;} .hamburger{display:flex;} nav{padding:0 12px;gap:6px;} .nav-mobile-actions{display:flex;margin-left:auto;gap:5px;align-items:center;} .nav-mobile-cta,.nav-mobile-game{display:inline-flex;align-items:center;justify-content:center;background:var(--gold-bright);color:var(--ink);font-family:'Noto Sans TC',sans-serif;font-weight:900;font-size:11px;width:72px;height:36px;padding:0 6px;letter-spacing:0;text-decoration:none;cursor:pointer;border:1px solid var(--gold-bright);white-space:nowrap;} .nav-mobile-game{background:transparent;color:var(--gold-bright);} }
  /* class เดียวกับที่ __navFit() เติม/ถอดจริง ตามผลวัดความกว้างจริง (ใช้ declaration ชุดเดียวกับ media query ข้างบน) */
  nav.nav-compact .nav-links { display:none; }
  nav.nav-compact .hamburger { display:flex; }
  nav.nav-compact { padding:0 12px; gap:6px; }
  nav.nav-compact .nav-logo { font-size:13px; letter-spacing:0.4px; }
  nav.nav-compact .nav-mobile-actions { display:flex; margin-left:auto; gap:5px; align-items:center; }
  nav.nav-compact .nav-mobile-cta,
  nav.nav-compact .nav-mobile-game { display:inline-flex; align-items:center; justify-content:center; background:var(--gold-bright); color:var(--ink); font-family:'Noto Sans TC',sans-serif; font-weight:900; font-size:11px; width:72px; height:36px; padding:0 6px; letter-spacing:0; text-decoration:none; cursor:pointer; border:1px solid var(--gold-bright); white-space:nowrap; }
  nav.nav-compact .nav-mobile-game { background:transparent; color:var(--gold-bright); }
  nav.nav-compact .nav-links > li:first-child,
  nav.nav-compact .nav-links > li:last-child { display:none; }
  nav .nav-links[style*="display: flex"] {
    height:calc(100dvh - 60px) !important;
    max-height:calc(100dvh - 60px) !important;
    padding-bottom:calc(104px + env(safe-area-inset-bottom)) !important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }

  /* SHARED */
  .section-wrap { max-width:1080px; margin:0 auto; padding:96px 32px; }
  .eyebrow { font-family:'Noto Sans TC',sans-serif; font-size:11px; letter-spacing:4px; text-transform:uppercase; color:var(--gold); font-weight:700; margin-bottom:14px; display:block; }
  .section-heading { font-family:'Noto Serif TC',serif; font-size:clamp(30px,4.5vw,52px); font-weight:900; line-height:1.2; color:var(--ink); margin-bottom:56px; }
  .section-heading-white { color:var(--ink); }

  /* MODAL OVERLAY */
  .modal-overlay { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.65); z-index:2000; align-items:center; justify-content:center; padding:20px; }
  .modal-overlay.open { display:flex; }
  .modal-box { background:var(--white); max-width:560px; width:100%; max-height:90vh; overflow-y:auto; position:relative; border:2px solid var(--ink); }
  .modal-box.dark { background:var(--ink); color:var(--white); border-color:rgba(200,151,58,0.3); }
  .modal-header { padding:32px 36px 24px; border-bottom:2px solid var(--border); display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
  .modal-box.dark .modal-header { border-bottom-color:rgba(255,255,255,0.12); }
  .modal-close { background:none; border:none; font-size:24px; cursor:pointer; color:var(--ink-muted); line-height:1; padding:0; flex-shrink:0; }
  .modal-box.dark .modal-close { color:rgba(255,255,255,0.5); }
  .modal-close:hover { color:var(--ink); }
  .modal-box.dark .modal-close:hover { color:var(--white); }
  .modal-title { font-family:'Noto Serif TC',serif; font-size:22px; font-weight:900; line-height:1.2; }
  .modal-body { padding:28px 36px 36px; }

  /* COMING SOON inside modal */
  .coming-soon-wrap { text-align:center; padding:48px 24px; }
  .coming-soon-icon { font-size:52px; margin-bottom:20px; display:block; }
  .coming-soon-title { font-family:'Noto Serif TC',serif; font-size:24px; font-weight:900; margin-bottom:12px; }
  .modal-box.dark .coming-soon-title { color:var(--white); }
  .coming-soon-sub { font-family:'Noto Sans TC',sans-serif; font-size:15px; line-height:1.8; color:var(--ink-muted); }
  .modal-box.dark .coming-soon-sub { color:rgba(255,255,255,0.5); }
  .coming-soon-badge { display:inline-block; margin-top:20px; background:var(--gold-light); color:var(--gold); font-family:'Noto Sans TC',sans-serif; font-size:11px; font-weight:700; letter-spacing:3px; text-transform:uppercase; padding:8px 20px; border:1px solid var(--gold); }

  /* CONTACT MODAL */
  .contact-grid { display:grid; gap:0; border:1px solid var(--border); }
  .contact-row { display:flex; align-items:center; gap:16px; padding:18px 20px; border-bottom:1px solid var(--border); font-family:'Noto Sans TC',sans-serif; font-size:15px; color:var(--ink-soft); }
  .contact-row:last-child { border-bottom:none; }
  .contact-icon { font-size:22px; flex-shrink:0; width:32px; text-align:center; }
  .contact-label { font-size:11px; letter-spacing:2px; text-transform:uppercase; color:var(--gold); font-weight:700; display:block; margin-bottom:2px; }
  .contact-val { font-size:15px; color:var(--ink-soft); }
  .contact-link { color:var(--ink); text-decoration:none; font-weight:700; }
  .contact-link:hover { color:var(--gold); text-decoration:underline; }
  .contact-cta { margin-top:24px; width:100%; background:var(--gold-bright); color:var(--ink); font-family:'Noto Sans TC',sans-serif; font-weight:900; font-size:15px; padding:16px; border:none; cursor:pointer; letter-spacing:1px; transition:background 0.2s; }
  .contact-cta:hover { background:#b07820; }

  /* HERO */
  #home { min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; position:relative; padding:80px 32px 100px; background:linear-gradient(180deg,#FBF5E7 0%,#F5F0E8 60%,#EFE3CB 100%); text-align:center; overflow:hidden; }
  .hero-bg { font-family:'Sarabun',sans-serif; font-size:clamp(90px,20vw,220px); font-weight:800; color:rgba(139,99,16,0.05); position:absolute; top:50%; left:50%; transform:translate(-50%,-80%); white-space:nowrap; user-select:none; }
  .badge { display:inline-block; border:1.5px solid var(--gold); color:var(--gold); font-family:'Noto Sans TC',sans-serif; font-size:11px; letter-spacing:3px; text-transform:uppercase; padding:7px 20px; margin-bottom:32px; opacity:0; animation:fadeUp 0.5s 0.2s forwards; }
  .hero-title { font-family:'Noto Serif TC',serif; font-size:clamp(44px,9vw,96px); font-weight:900; color:var(--ink); line-height:1.08; letter-spacing:-1px; margin-bottom:20px; opacity:0; animation:fadeUp 0.6s 0.35s forwards; }
  .hero-title .accent { color:var(--gold); }
  .hero-slogan { font-family:'Noto Sans TC',sans-serif; font-size:clamp(14px,1.8vw,18px); color:var(--ink-muted); letter-spacing:2px; margin-bottom:14px; opacity:0; animation:fadeUp 0.5s 0.5s forwards; }
  .hero-slogan .slogan-accent { background:linear-gradient(90deg,var(--gold),#C8973A); -webkit-background-clip:text; background-clip:text; color:transparent; font-weight:700; letter-spacing:3px; }
  .hero-sub { font-family:'Noto Sans TC',sans-serif; font-size:clamp(16px,2.2vw,20px); color:var(--ink-soft); line-height:1.85; max-width:480px; margin-bottom:48px; opacity:0; animation:fadeUp 0.6s 0.6s forwards; }
  .hero-cta { background:var(--gold); color:#fff; font-family:'Noto Sans TC',sans-serif; font-weight:900; font-size:19px; padding:22px 64px; border:none; cursor:pointer; letter-spacing:1.5px; transition:all 0.25s; opacity:0; animation:fadeUp 0.6s 0.95s forwards, heroPulse 2.4s 1.6s ease-in-out infinite; box-shadow:0 6px 32px rgba(139,99,16,0.40); border-radius:4px; margin-top:20px; }
  .hero-cta:hover { background:#7a5510; transform:translateY(-3px); box-shadow:0 14px 36px rgba(139,99,16,0.50); }
  @keyframes heroPulse { 0%,100%{box-shadow:0 6px 32px rgba(139,99,16,0.40);} 50%{box-shadow:0 6px 42px rgba(139,99,16,0.65);} }
  .scroll-hint { position:absolute; bottom:36px; left:0; right:0; display:flex; flex-direction:column; align-items:center; gap:8px; opacity:0; animation:fadeUp 0.5s 1.2s forwards; }
  .scroll-hint span { font-family:'Noto Sans TC',sans-serif; font-size:10px; letter-spacing:3px; text-transform:uppercase; color:rgba(139,99,16,0.45); }
  .scroll-hint .line { width:1px; height:40px; background:linear-gradient(to bottom,rgba(139,99,16,0.4),transparent); animation:pulse 2s infinite; }
  /* Search ต้องเห็นทันทีในจอมือถือทั่วไปโดยไม่ต้อง scroll — ลดช่องว่างของ Hero เฉพาะบนมือถือ (2026-08-10) */
  @media(max-width:600px){
    #home { padding:56px 20px 80px; }
    .badge { margin-bottom:16px; }
    .hero-title { margin-bottom:12px; }
    .hero-slogan { margin-bottom:10px; }
    .hero-sub { margin-bottom:20px; }
    .hero-cta { padding:16px 40px; font-size:16px; margin-top:16px; }
  }

  /* PROBLEMS */
  #problems { background:var(--off-white); border-top:3px solid var(--ink); border-bottom:3px solid var(--ink); }
  .problems-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:0; border:2px solid var(--ink); }
  .problem-card { padding:32px 24px; border-right:2px solid var(--ink); background:var(--white); transition:background 0.25s; }
  .problem-card:last-child { border-right:none; }
  .problem-card:hover { background:var(--gold-light); }
  .card-icon { font-size:32px; margin-bottom:10px; display:block; }
  .card-cat { font-family:'Noto Sans TC',sans-serif; font-size:10px; letter-spacing:3px; text-transform:uppercase; color:var(--gold); font-weight:700; margin-bottom:4px; }
  .card-title { font-family:'Noto Serif TC',serif; font-size:17px; font-weight:900; color:var(--ink); margin-bottom:16px; line-height:1.3; border-bottom:2px solid var(--ink); padding-bottom:12px; }
  .problem-list { list-style:none; }
  .problem-list li { font-family:'Noto Sans TC',sans-serif; font-size:14px; line-height:1.65; color:var(--ink-soft); padding:8px 0; border-bottom:1px solid var(--border); display:flex; align-items:flex-start; gap:8px; }
  .problem-list li:last-child { border-bottom:none; }
  .problem-list li::before { content:'▸'; color:var(--gold); font-size:11px; flex-shrink:0; margin-top:3px; }

  /* TEACHER */
  #teacher { background:linear-gradient(180deg,#FBF5E7 0%,#F5F0E8 100%); text-align:center; border-top:3px solid var(--ink); border-bottom:3px solid var(--ink); }
  .answer-eyebrow { color:var(--gold); font-family:'Noto Sans TC',sans-serif; font-size:11px; letter-spacing:4px; text-transform:uppercase; font-weight:700; margin-bottom:14px; display:block; }
  .answer-quote { font-family:'Noto Serif TC',serif; font-size:clamp(30px,5.5vw,60px); font-weight:900; line-height:1.18; margin-bottom:28px; color:var(--ink); }
  .answer-quote em { font-style:italic; color:var(--gold); }
  .answer-body { font-family:'Noto Sans TC',sans-serif; font-size:18px; line-height:2.1; color:var(--ink-soft); max-width:580px; margin:0 auto 20px; }
  .slogan-big { font-family:'Noto Serif TC',serif; font-size:clamp(16px,2.2vw,22px); color:var(--gold); font-weight:700; margin:28px auto 40px; max-width:620px; line-height:1.75; }
  .slogan-big .zh { font-size:0.88em; color:var(--ink-muted); font-weight:400; display:block; margin-top:8px; font-family:'Noto Sans TC',sans-serif; }
  .answer-cta { background:var(--gold); color:#fff; font-family:'Noto Sans TC',sans-serif; font-weight:900; font-size:17px; padding:20px 52px; border:none; cursor:pointer; letter-spacing:1.2px; transition:all 0.25s; display:inline-block; box-shadow:0 4px 20px rgba(139,99,16,0.38); border-radius:4px; }
  .answer-cta:hover { background:#7a5510; transform:translateY(-2px); box-shadow:0 8px 28px rgba(139,99,16,0.52); }

  /* STATS */
  .stats-band { background:var(--gold-light); border-top:3px solid var(--ink); border-bottom:3px solid var(--ink); padding:0 32px; }
  .stats-inner { display:flex; justify-content:center; max-width:900px; margin:0 auto; border-left:2px solid var(--ink); border-right:2px solid var(--ink); }
  .stat { text-align:center; padding:52px 40px; flex:1; border-right:2px solid var(--ink); }
  .stat:last-child { border-right:none; }
  .stat-num { font-family:'Noto Serif TC',serif; font-size:clamp(36px,5.5vw,64px); font-weight:900; color:var(--ink); line-height:1; margin-bottom:10px; }
  .stat-label { font-family:'Noto Sans TC',sans-serif; font-size:12px; letter-spacing:2px; text-transform:uppercase; color:var(--ink-muted); font-weight:700; }

  /* HOW */
  #how { background:var(--white); border-bottom:3px solid var(--ink); }
  .how-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:0; border:2px solid var(--ink); }
  .how-card { padding:36px 28px; border-right:2px solid var(--ink); transition:background 0.25s; }
  .how-card:last-child { border-right:none; }
  .how-card:nth-child(even) { background:var(--card-bg); }
  .how-card:hover { background:var(--gold-light); }
  .how-num { font-family:'Playfair Display',serif; font-size:52px; font-weight:900; color:rgba(0,0,0,0.07); line-height:1; margin-bottom:-6px; }
  .how-title { font-family:'Noto Serif TC',serif; font-size:18px; font-weight:900; color:var(--ink); margin-bottom:12px; border-bottom:2px solid var(--gold); padding-bottom:10px; }
  .how-desc { font-family:'Noto Sans TC',sans-serif; font-size:14px; line-height:1.9; color:var(--ink-soft); }

  /* PRICING */
  #pricing { background:var(--off-white); border-bottom:3px solid var(--ink); }
  .pricing-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:0; border:2px solid var(--ink); align-items:stretch; }
  .plan-card { display:flex; flex-direction:column; padding:40px 32px; border-right:2px solid var(--ink); background:#FBF5E7; position:relative; transition:background 0.25s, box-shadow 0.25s; }
  .plan-card:last-child { border-right:none; }
  .plan-card:not(.featured):hover, .plan-card:not(.featured):active { background:linear-gradient(180deg,#F3E4C2 0%,#EAD09A 100%); box-shadow:0 12px 28px rgba(139,99,16,0.15); }
  .plan-card.featured { background:linear-gradient(180deg,#FBF5E7 0%,#F3E4C2 100%); color:var(--ink); }
  /* กล่อง Standard (featured) แตะ/hover แล้วต้องเน้นด้วย — เดิมถูก :not(.featured) ตัดออก (Lin 2026-07-02) */
  .plan-card.featured:hover, .plan-card.featured:active { background:linear-gradient(180deg,#F3E4C2 0%,#E2C27C 100%); box-shadow:0 12px 28px rgba(139,99,16,0.22); }
  .plan-card.pair-card { background:#FBF5E7; }
  .plan-tag { font-family:'Noto Sans TC',sans-serif; font-size:10px; letter-spacing:3px; text-transform:uppercase; color:var(--gold); font-weight:700; margin-bottom:6px; }
  .plan-card.featured .plan-tag { color:var(--gold); }
  .plan-name { font-family:'Noto Serif TC',serif; font-size:28px; font-weight:900; margin-bottom:4px; }
  .plan-card.featured .plan-name { color:var(--gold-deep); }
  .plan-price { font-family:'Playfair Display',serif; font-size:48px; font-weight:900; color:var(--gold); line-height:1; margin-bottom:0; }
  .plan-card.featured .plan-price { color:var(--gold); }
  .plan-unit { font-family:'Noto Sans TC',sans-serif; font-size:13px; color:var(--ink-muted); margin-bottom:0; }
  .plan-card.featured .plan-unit { color:var(--ink-muted); }
  .plan-divider { height:2px; background:var(--border); margin-bottom:20px; }
  .plan-card.featured .plan-divider { background:rgba(139,99,16,0.25); }
  .plan-features { list-style:none; margin-bottom:24px; }
  .plan-features li { font-family:'Noto Sans TC',sans-serif; font-size:14px; line-height:1.7; color:var(--ink-soft); padding:7px 0; border-bottom:1px solid var(--border); display:flex; gap:8px; align-items:flex-start; }
  .plan-card.featured .plan-features li { color:var(--ink-soft); border-bottom-color:rgba(139,99,16,0.18); }
  .plan-features li:last-child { border-bottom:none; }
  .plan-features li::before { content:'✓'; color:var(--gold); font-weight:700; flex-shrink:0; }
  .plan-card.featured .plan-features li::before { color:var(--gold); }
  .plan-note { font-family:'Noto Sans TC',sans-serif; font-size:12px; color:var(--ink-muted); line-height:1.75; background:var(--off-white); padding:12px 14px; border-left:3px solid var(--gold); margin-bottom:20px; }
  .plan-card.featured .plan-note { background:rgba(139,99,16,0.08); color:var(--ink-muted); border-left-color:var(--gold); }
  .plan-courses { margin-bottom:24px; min-height:120px; }
  .plan-courses-title { font-family:'Noto Sans TC',sans-serif; font-size:11px; letter-spacing:2px; text-transform:uppercase; color:var(--gold); font-weight:700; margin-bottom:10px; }
  .plan-card.featured .plan-courses-title { color:var(--gold); }
  .course-row { display:flex; justify-content:space-between; align-items:center; padding:9px 0; border-bottom:1px solid var(--border); font-family:'Noto Sans TC',sans-serif; font-size:14px; }
  .plan-card.featured .course-row { border-bottom-color:rgba(139,99,16,0.18); color:var(--ink-soft); }
  .course-row:last-child { border-bottom:none; }
  .bonus { font-size:11px; color:var(--gold); font-weight:700; background:var(--gold-light); padding:2px 8px; }
  .plan-card.featured .bonus { background:rgba(139,99,16,0.15); color:var(--gold-deep); }
  .plan-payment { font-family:'Noto Sans TC',sans-serif; font-size:13px; color:var(--ink-muted); line-height:1.75; margin-top:auto; padding-top:16px; border-top:1px solid var(--border); }
  .plan-card.featured .plan-payment { color:var(--ink-muted); border-top-color:rgba(139,99,16,0.18); }
  .free-trial-row { display:flex; justify-content:space-between; align-items:center; padding:11px 14px; background:var(--gold-light); border:1px solid var(--gold); margin-bottom:20px; }
  .plan-card.featured .free-trial-row { background:rgba(139,99,16,0.12); border-color:rgba(139,99,16,0.4); }
  .free-trial-label { font-family:'Noto Sans TC',sans-serif; font-size:13px; color:var(--ink-soft); }
  .plan-card.featured .free-trial-label { color:var(--ink-soft); }
  .free-trial-val { font-family:'Noto Sans TC',sans-serif; font-size:13px; font-weight:900; color:var(--gold); }
  .plan-card.featured .free-trial-val { color:var(--gold); }
  .pair-price-row { display:flex; justify-content:space-between; align-items:baseline; padding:10px 0; border-bottom:1px solid var(--border); }
  .pair-price-row:last-child { border-bottom:none; }
  .pair-price-label { font-family:'Noto Sans TC',sans-serif; font-size:14px; color:var(--ink-soft); }
  .pair-price-val { font-family:'Playfair Display',serif; font-size:26px; font-weight:900; color:var(--gold); }
  .pair-price-unit { font-family:'Noto Sans TC',sans-serif; font-size:12px; color:var(--ink-muted); }

  .plan-price-block { margin-top:auto; padding-top:20px; border-top:2px solid var(--border); }
  .plan-cta { margin-top:16px; }
  .plan-card.featured .plan-price-block { border-top-color:rgba(139,99,16,0.25); }
  .plan-cta { width:100%; margin-top:16px; background:var(--gold-bright); color:var(--ink); font-family:'Noto Sans TC',sans-serif; font-weight:900; font-size:14px; padding:14px; border:none; cursor:pointer; letter-spacing:1px; transition:background 0.2s; }
  .plan-cta:hover { background:#b07820; }
  .plan-card.featured .plan-cta { background:var(--gold-bright); color:var(--ink); }
  .plan-card.featured .plan-cta:hover { background:#7a5510; }
  .pair-prices-inline { margin-bottom:4px; }

  /* plan-payment and plan-price-block spacing */

  /* AVAILABILITY BAND */

  body:not([data-gsh-game]) > .avail-band { background:var(--gold-light); border-top:3px solid var(--gold); border-bottom:3px solid var(--gold); padding:10px 16px; display:flex; flex-direction:column; gap:8px; }
  /* 🔴 2026-08-10: แถบประกาศเป็น static HTML แล้ว (มาพร้อมหน้าตั้งแต่แรก ไม่ต้องรอ JS)
     คนที่เคยกดปิดประกาศไปแล้วในเซสชันนี้ ต้องไม่เห็นมันแวบขึ้นมาอีกก่อน JS จะมาลบทิ้ง
     → มี <script> เล็กๆ อยู่ก่อนแถบใน HTML ทุกหน้า คอยเช็ค sessionStorage แล้วติดคลาสนี้ให้ทันทีตอน parse
     (เขียนโดย scripts/generate-nav.js · ต้นฉบับอยู่ใน data/nav-template.js → renderAnnBandBlockHTML) */
  html.ann-off body:not([data-gsh-game]) > #ann-band { display:none; }
  body:not([data-gsh-game]) > #ann-band .avail-row { display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:nowrap; overflow:hidden; }
  body:not([data-gsh-game]) > #ann-band .avail-row + .avail-row { padding-top:8px; border-top:1px solid rgba(139,99,16,0.18); }
  body:not([data-gsh-game]) > #ann-band a.avail-row { text-decoration:none; cursor:pointer; transition:opacity 0.2s; }
  body:not([data-gsh-game]) > #ann-band a.avail-row:hover { opacity:0.78; }
  @media(max-width:600px){ body:not([data-gsh-game]) > .avail-band { gap:6px; padding:8px 12px; } body:not([data-gsh-game]) > #ann-band .avail-row + .avail-row { padding-top:6px; } body:not([data-gsh-game]) > #ann-band .avail-text { font-size:11px; letter-spacing:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } body:not([data-gsh-game]) > #ann-band .avail-cta { font-size:11px; padding:7px 12px; flex-shrink:0; } }
  body:not([data-gsh-game]) > #ann-band .avail-dot { width:10px; height:10px; background:#4CAF50; border-radius:50%; animation:blink 1.8s infinite; flex-shrink:0; }
  @keyframes blink { 0%,100%{opacity:1;}50%{opacity:0.3;} }
  body:not([data-gsh-game]) > #ann-band .avail-text { font-family:'Noto Sans TC',sans-serif; font-size:14px; color:var(--ink); letter-spacing:1px; }
  body:not([data-gsh-game]) > #ann-band .avail-text strong { color:var(--gold); }
  body:not([data-gsh-game]) > #ann-band .avail-cta { background:var(--gold-bright); color:var(--ink); font-family:'Noto Sans TC',sans-serif; font-weight:900; font-size:12px; padding:8px 18px; border:none; cursor:pointer; letter-spacing:1px; white-space:nowrap; transition:background 0.2s; text-decoration:none; display:inline-block; flex-shrink:0; }
  body:not([data-gsh-game]) > #ann-band .avail-cta:hover { background:#b07820; }

  /* QUIZ MODAL */
  .quiz-wrap { padding:8px 0; }
  .quiz-step { display:none; }
  .quiz-step.active { display:block; }
  .quiz-q-text { font-family:'Noto Serif TC',serif; font-size:18px; font-weight:900; color:var(--ink); margin-bottom:20px; line-height:1.5; }
  .quiz-progress { display:flex; gap:6px; margin-bottom:28px; }
  .quiz-prog-dot { width:8px; height:8px; border-radius:50%; background:var(--border); flex:1; height:4px; border-radius:2px; }
  .quiz-prog-dot.done { background:var(--gold-bright); }
  .quiz-options { display:grid; gap:10px; }
  .quiz-opt { padding:14px 18px; border:2px solid var(--border); background:var(--white); font-family:'Noto Sans TC',sans-serif; font-size:14px; text-align:left; cursor:pointer; color:var(--ink-soft); transition:all 0.2s; line-height:1.5; }
  .quiz-opt:hover { border-color:var(--gold-bright); background:var(--gold-light); color:var(--ink); }
  .quiz-result { text-align:center; padding:20px 0; display:none; }
  .quiz-result.active { display:block; }
  .quiz-result-badge { display:inline-block; padding:6px 20px; font-family:'Noto Sans TC',sans-serif; font-size:11px; letter-spacing:3px; font-weight:700; text-transform:uppercase; margin-bottom:16px; }
  .quiz-result-title { font-family:'Noto Serif TC',serif; font-size:26px; font-weight:900; color:var(--ink); margin-bottom:12px; }
  .quiz-result-desc { font-family:'Noto Sans TC',sans-serif; font-size:15px; color:var(--ink-soft); line-height:1.85; margin-bottom:24px; }
  .quiz-restart { background:none; border:1.5px solid var(--border); font-family:'Noto Sans TC',sans-serif; font-size:13px; color:var(--ink-muted); padding:8px 18px; cursor:pointer; margin-right:10px; }

  /* TEACHER STORY */
  .teacher-story { background:var(--card-bg); border-top:3px solid var(--ink); border-bottom:3px solid var(--ink); }
  .teacher-story-inner { max-width:1080px; margin:0 auto; padding:96px 32px; display:grid; grid-template-columns:1fr 2fr; gap:64px; align-items:start; }
  .teacher-photo-wrap { position:relative; }
  .teacher-photo-placeholder { width:100%; aspect-ratio:3/4; background:var(--off-white); border:2px solid var(--ink); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; }
  .teacher-photo-img { width:100%; aspect-ratio:3/4; object-fit:cover; object-position:center top; border:2px solid var(--ink); display:block; }
  .teacher-photo-placeholder span { font-size:48px; }
  .teacher-photo-placeholder p { font-family:'Noto Sans TC',sans-serif; font-size:11px; letter-spacing:2px; color:var(--ink-muted); text-align:center; }
  .teacher-photo-badge { position:absolute; bottom:-16px; right:-16px; background:var(--gold-bright); color:var(--ink); font-family:'Noto Sans TC',sans-serif; font-size:11px; font-weight:900; letter-spacing:1px; padding:10px 16px; border:2px solid var(--ink); }
  .teacher-story-content { }
  .teacher-story-eyebrow { font-family:'Noto Sans TC',sans-serif; font-size:16px; letter-spacing:3px; text-transform:uppercase; color:var(--gold); font-weight:700; margin-bottom:14px; display:block; }
  .teacher-story-title { font-family:'Noto Serif TC',serif; font-size:clamp(26px,3.5vw,40px); font-weight:900; color:var(--ink); line-height:1.2; margin-bottom:28px; }
  .teacher-story-title em { color:var(--gold); font-style:normal; }
  .teacher-facts { display:grid; grid-template-columns:1fr 1fr; gap:0; border:2px solid var(--ink); margin-bottom:28px; }
  .teacher-fact { padding:20px 22px; border-right:2px solid var(--ink); border-bottom:2px solid var(--ink); }
  .teacher-fact:nth-child(2n) { border-right:none; }
  .teacher-fact:nth-last-child(-n+2) { border-bottom:none; }
  .teacher-fact-label { font-family:'Noto Sans TC',sans-serif; font-size:10px; letter-spacing:2px; text-transform:uppercase; color:var(--gold); font-weight:700; margin-bottom:4px; }
  .teacher-fact-val { font-family:'Noto Serif TC',serif; font-size:16px; font-weight:900; color:var(--ink); line-height:1.4; }
  .teacher-story-text { font-family:'Noto Sans TC',sans-serif; font-size:15px; line-height:2; color:var(--ink-soft); }
  @media(max-width:780px){ .teacher-story-inner{grid-template-columns:1fr;gap:40px;} .teacher-photo-wrap{max-width:240px;} }

  /* PROGRESS TIMELINE */
  .progress-section { background:var(--off-white); border-top:3px solid var(--ink); border-bottom:3px solid var(--ink); }
  .progress-section .section-wrap { padding-bottom:80px; }
  .progress-timeline { display:grid; grid-template-columns:repeat(4,1fr); gap:0; border:2px solid var(--ink); margin-top:48px; position:relative; background:var(--white); }
  .prog-step { padding:32px 24px 28px; border-right:2px solid var(--ink); text-align:center; position:relative; z-index:1; transition:background 0.25s, box-shadow 0.25s; }
  .prog-step:hover { background:var(--gold-light); }

  .prog-step:last-child { border-right:none; }
  .prog-circle { width:52px; height:52px; border-radius:50%; background:var(--gold); border:3px solid var(--gold); margin:0 auto 16px; display:flex; align-items:center; justify-content:center; font-family:'Playfair Display',serif; font-size:20px; font-weight:900; color:#fff; }
  .prog-hours { font-family:'Noto Serif TC',serif; font-size:22px; font-weight:900; color:var(--gold); margin-bottom:6px; }
  .prog-title { font-family:'Noto Sans TC',sans-serif; font-size:15px; font-weight:700; color:var(--ink); margin-bottom:10px; letter-spacing:0.5px; }
  .prog-desc { font-family:'Noto Sans TC',sans-serif; font-size:14px; color:var(--ink-soft); line-height:1.85; }
  @media(max-width:700px){ .progress-timeline{grid-template-columns:1fr 1fr;} .prog-step{border-bottom:2px solid var(--ink);} }

  /* LESSON PREVIEW */
  .lesson-preview { background:var(--white); border-bottom:3px solid var(--ink); }
  .lesson-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:0; border:2px solid var(--ink); margin-top:48px; }
  .lesson-card { padding:32px 28px; border-right:2px solid var(--ink); transition:background 0.25s; }
  .lesson-card:last-child { border-right:none; }
  .lesson-card:hover { background:var(--gold-light); }
  .lesson-card-tag { font-family:'Noto Sans TC',sans-serif; font-size:10px; letter-spacing:3px; text-transform:uppercase; color:var(--gold); font-weight:700; margin-bottom:8px; }
  .lesson-card-title { font-family:'Noto Serif TC',serif; font-size:17px; font-weight:900; color:var(--ink); margin-bottom:16px; padding-bottom:12px; border-bottom:2px solid var(--ink); }
  .lesson-sample { background:var(--card-bg); padding:16px 18px; border-left:3px solid var(--gold-bright); margin-bottom:14px; }
  .lesson-thai { font-family:'Sarabun',sans-serif; font-size:22px; font-weight:700; color:var(--ink); margin-bottom:4px; }
  .lesson-phonetic { font-family:'Noto Sans TC',sans-serif; font-size:13px; color:var(--gold); font-weight:700; margin-bottom:2px; }
  .lesson-meaning { font-family:'Noto Sans TC',sans-serif; font-size:13px; color:var(--ink-muted); }
  .lesson-note { font-family:'Noto Sans TC',sans-serif; font-size:13px; color:var(--ink-soft); line-height:1.75; }
  .lesson-coming { text-align:center; padding:48px 24px; display:flex; flex-direction:column; align-items:center; gap:10px; }
  .lesson-coming-icon { font-size:36px; }
  .lesson-coming-text { font-family:'Noto Sans TC',sans-serif; font-size:13px; color:var(--ink-muted); line-height:1.75; }
  @media(max-width:700px){ .lesson-grid{grid-template-columns:1fr;} .lesson-card{border-right:none;border-bottom:2px solid var(--ink);} .lesson-card:last-child{border-bottom:none;} }

  /* LINE QR STRIP */
  .line-strip { background:var(--gold-light); border-top:3px solid var(--ink); border-bottom:3px solid var(--ink); padding:64px 32px; text-align:center; }
  .line-strip-inner { max-width:480px; margin:0 auto; display:flex; flex-direction:column; align-items:center; gap:28px; }
  .line-qr-box { width:140px; height:140px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; flex-shrink:0; }
  .line-qr-box svg { width:96px; height:96px; }
  .line-qr-label { font-family:'Noto Sans TC',sans-serif; font-size:10px; letter-spacing:2px; color:var(--ink-muted); }
  .line-strip-text { display:flex; flex-direction:column; align-items:center; }
  .line-strip-title { font-family:'Noto Serif TC',serif; font-size:clamp(22px,3vw,30px); font-weight:900; color:var(--ink); margin-bottom:8px; line-height:1.3; }
  .line-strip-sub { font-family:'Noto Sans TC',sans-serif; font-size:15px; color:var(--ink-soft); line-height:1.85; margin-bottom:20px; }
  .line-strip-btn { display:inline-block; background:var(--ink); color:var(--white); font-family:'Noto Sans TC',sans-serif; font-weight:900; font-size:14px; padding:14px 28px; border:none; cursor:pointer; letter-spacing:1px; text-decoration:none; transition:background 0.2s; }
  .line-strip-btn:hover { background:#333; }

  /* FAQ */
  #faq { background:var(--white); }
  .faq-list { border:2px solid var(--ink); }
  .faq-item { border-bottom:2px solid var(--ink); overflow:hidden; }
  .faq-item:last-child { border-bottom:none; }
  .faq-q { width:100%; text-align:left; padding:22px 28px; background:none; border:none; cursor:pointer; display:flex; justify-content:space-between; align-items:center; gap:16px; font-family:'Noto Serif TC',serif; font-size:16px; font-weight:700; color:var(--ink); transition:background 0.2s; }
  .faq-q:hover,.faq-q.open { background:var(--gold-light); }
  .faq-icon { font-size:20px; color:var(--gold); flex-shrink:0; transition:transform 0.3s; font-style:normal; }
  .faq-q.open .faq-icon { transform:rotate(45deg); }
  .faq-a { max-height:0; overflow:hidden; transition:max-height 0.4s ease,padding 0.3s; padding:0 28px; font-family:'Noto Sans TC',sans-serif; font-size:15px; line-height:1.95; color:var(--ink-soft); }
  .faq-a.open { max-height:500px; padding:20px 28px 24px; border-top:1px solid var(--border); }

  /* RULES */
  #rules { background:var(--white); }
  .rules-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:0; border:2px solid var(--ink); margin-top:48px; }
  .rule-card { padding:32px 28px; border-right:2px solid var(--ink); border-bottom:2px solid var(--ink); }
  .rule-card:last-child { border-right:none; }
  .rule-icon { font-size:28px; margin-bottom:12px; display:block; }
  .rule-title { font-family:'Noto Serif TC',serif; font-size:16px; font-weight:900; color:var(--ink); margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--gold); }
  .rule-list { list-style:none; }
  .rule-list li { font-family:'Noto Sans TC',sans-serif; font-size:14px; line-height:1.8; color:var(--ink-soft); padding:6px 0; display:flex; gap:8px; align-items:flex-start; }
  .rule-list li::before { content:'—'; color:var(--gold); flex-shrink:0; }

  /* CTA */
  #cta { background:var(--gold-light); border-top:3px solid var(--ink); text-align:center; padding:100px 32px 120px; }
  .cta-thai { font-family:'Sarabun',sans-serif; font-size:clamp(18px,2.5vw,26px); font-weight:300; letter-spacing:6px; color:var(--gold); margin-bottom:16px; display:block; }
  .cta-title { font-family:'Noto Serif TC',serif; font-size:clamp(36px,6vw,72px); font-weight:900; color:var(--ink); line-height:1.12; margin-bottom:20px; }
  .cta-reasons { font-family:'Noto Sans TC',sans-serif; font-size:clamp(14px,1.8vw,17px); color:var(--ink-soft); line-height:2.1; margin-bottom:24px; }
  .cta-question { font-family:'Noto Serif TC',serif; font-size:clamp(20px,3vw,30px); font-weight:900; color:var(--ink); margin-bottom:48px; line-height:1.4; }
  .cta-question span { color:var(--gold); display:block; }
  .cta-btn { background:var(--gold-bright); color:var(--ink); font-family:'Noto Sans TC',sans-serif; font-weight:900; font-size:16px; padding:20px 64px; border:none; cursor:pointer; letter-spacing:1px; transition:all 0.25s; }
  .cta-btn:hover { background:#b07820; transform:translateY(-3px); box-shadow:0 10px 28px rgba(0,0,0,0.2); }
  .cta-accompany { margin-top:28px; font-family:'Noto Sans TC',sans-serif; font-size:15px; color:var(--ink-muted); line-height:1.8; }

  /* FOOTER */
  footer { text-align:center; padding:28px 24px 72px; font-family:'Noto Sans TC',sans-serif; font-size:12px; letter-spacing:2px; color:var(--ink-muted); background:var(--off-white); border-top:1px solid var(--border); }
  footer .footer-copyright { display:inline-block; margin-top:3px; }

  @keyframes fadeUp { from{opacity:0;transform:translateY(20px);}to{opacity:1;transform:translateY(0);} }
  @keyframes pulse { 0%,100%{opacity:0.3;}50%{opacity:0.8;} }
  /* === REVEAL ANIMATION SYSTEM === */
  .reveal, .reveal-left, .reveal-right { opacity:0; }
  .reveal        { transform:translateY(48px); transition:opacity 0.7s ease, transform 0.7s ease; }
  .reveal-left   { transform:translateY(64px); transition:opacity 1.6s ease, transform 1.6s cubic-bezier(0.22,1,0.36,1); }
  .reveal-right  { transform:translateY(64px); transition:opacity 1.6s ease, transform 1.6s cubic-bezier(0.22,1,0.36,1); }
  .reveal.visible, .reveal-left.visible, .reveal-right.visible { opacity:1; transform:none; }

  /* Speed overrides */
  .reveal.reveal-slow  { transition:opacity 1.6s ease, transform 1.6s cubic-bezier(0.22,1,0.36,1); transform:translateY(64px); }
  .reveal.reveal-fast  { transition:opacity 0.35s ease, transform 0.35s ease; transform:translateY(28px); }
  .reveal.reveal-slow.visible  { opacity:1; transform:none; }
  .reveal.reveal-fast.visible  { opacity:1; transform:none; }

  /* Stagger delays */
  .reveal-delay-1 { transition-delay:0s; }
  .reveal-delay-2 { transition-delay:0.13s; }
  .reveal-delay-3 { transition-delay:0.26s; }
  .reveal-delay-4 { transition-delay:0.39s; }

  @media(max-width:900px){
    .problems-grid{grid-template-columns:repeat(2,1fr);}
    .problem-card:nth-child(2){border-right:none;}
    .problem-card:nth-child(1),.problem-card:nth-child(2){border-bottom:2px solid var(--ink);}
    .pricing-grid{grid-template-columns:1fr;}
    .plan-card{border-right:none;border-bottom:2px solid var(--ink);}
    .plan-card.featured{border-bottom-color:var(--ink);}
    .plan-card:last-child{border-bottom:none;}
  }
  @media(max-width:600px){
    .problems-grid,.how-grid,.rules-grid{grid-template-columns:1fr;}
    .problem-card,.how-card,.rule-card{border-right:none;border-bottom:2px solid var(--ink);}
    .stats-inner{flex-direction:column;}
    .stat{border-right:none;border-bottom:2px solid var(--ink);}
    .stat:last-child{border-bottom:none;}
    .section-wrap{padding:72px 20px;}
    #interpreter .section-wrap > div[style*="grid-template-columns:1fr 1fr"]{grid-template-columns:1fr!important;}
    #interpreter .section-wrap > div[style*="grid-template-columns:1fr 1fr"] > div:first-child{border-right:none!important;border-bottom:2px solid rgba(255,255,255,0.12);}
  }
  /* ── BOTTOM PAGE NAV STRIP ── */
  /* กันแถบล่างทับเนื้อหา: เพิ่ม padding-bottom เฉพาะหน้าที่มี .page-strip (หน้าอื่นไม่มีช่องว่าง) */
  body:has(.page-strip){padding-bottom:calc(44px + env(safe-area-inset-bottom,0));}
  .page-strip{position:fixed;bottom:0;left:0;right:0;z-index:990;background:rgba(17,17,17,0.97);border-top:1px solid rgba(200,151,58,0.3);display:flex;justify-content:center;align-items:center;height:44px;padding-bottom:env(safe-area-inset-bottom,0);}
  .page-strip-label{font-family:'Noto Sans TC',sans-serif;font-size:11px;letter-spacing:2px;color:rgba(255,255,255,0.4);margin-right:16px;text-transform:uppercase;}
  .page-strip a{font-family:'Noto Sans TC',sans-serif;font-size:12px;font-weight:500;color:rgba(255,255,255,0.7);text-decoration:none;padding:6px 18px;border:1px solid rgba(255,255,255,0.3);border-bottom:2px solid transparent;margin:0 4px;white-space:nowrap;transition:color 0.2s ease,border-color 0.2s ease;}
  .page-strip a:hover{color:var(--white);border-color:rgba(255,255,255,0.6);border-bottom-color:rgba(200,151,58,0.5);}
  .page-strip a.active{font-weight:900;color:#C8973A;border-color:rgba(200,151,58,0.5);border-bottom:2px solid #C8973A;background:rgba(200,151,58,0.1);}
  @media(max-width:600px){
    body:has(.page-strip){padding-bottom:calc(48px + env(safe-area-inset-bottom,0));}
    .page-strip{display:grid;grid-template-columns:repeat(6,1fr);gap:3px;padding:0 5px env(safe-area-inset-bottom,0);height:48px;align-content:center;}
    .page-strip-label{display:none;}
    .page-strip a{margin:0;padding:8px 1px;text-align:center;font-size:clamp(9px,2.6vw,11px);letter-spacing:0;}
  }
  /* 🔴 2026-08-10 (Lin อนุมัติ): บนมือถือ ซ่อน .page-strip ทิ้ง — แถบ #bottom-nav (4 ไอคอน) ทำหน้าที่แทนแล้ว
     เหตุผล: .page-strip เขียนใน HTML ตรงๆ เบราว์เซอร์วาดทันทีที่เริ่มโหลด แต่ #bottom-nav ต้องรอ shared.min.js
     โหลดเสร็จก่อนถึงถูกสร้าง → ช่วงรอยต่อจะเห็นแถบ 6 ปุ่มเก่าแว้บขึ้นมาก่อนทุกครั้งที่เปลี่ยนหน้า (Lin เจอจริงบนมือถือ)
     บนมือถือแถบนี้ถูก #bottom-nav บังมิดอยู่แล้ว (60px ทับ 48px · z-index 998 ทับ 990) = ซ่อนไปไม่มีอะไรหายไปจากสายตา
     ⚠️ breakpoint ต้องตรงกับ `@media(max-width:768px){#bottom-nav{display:flex}}` ใน js/core/shared.js เสมอ
        ถ้าวันหลังแก้ตัวใดตัวหนึ่ง ต้องแก้อีกตัวให้ตรงกันด้วย ไม่งั้นจะมีช่วงจอที่ไม่มีแถบล่างเลย หรือมี 2 แถบซ้อน
     คอม (>768px) ไม่กระทบ — .page-strip ยังอยู่ครบเหมือนเดิม เพราะ #bottom-nav ไม่โชว์บนคอม */
  @media(max-width:768px){
    .page-strip{display:none;}
    /* เผื่อที่ว่างให้ #bottom-nav (60px) แทนที่ของเดิมที่เผื่อให้ .page-strip (48px)
       ต้องเขียน selector `body:has(.page-strip)` ซ้ำตรงนี้ด้วย เพราะกฎเดิมในบล็อก 600px
       มี specificity สูงกว่า `body{}` เฉยๆ ถ้าไม่ทับตรงนี้ หน้าที่มี .page-strip จะได้ 48px
       แล้วเนื้อหาท้ายหน้าจะถูกแถบล่างบังไป 12px */
    body:has(.page-strip){padding-bottom:60px;}
  }

  /* ═══════════════════════════════════════════
     BOTTOM NAV (มือถือ) — แถบ 4 ไอคอน 首頁/試聽/遊戲/我的
     ═══════════════════════════════════════════
     🔴 2026-08-10 (Lin อนุมัติ): ย้ายกฎชุดนี้มาจาก js/core/shared.js มาไว้ที่นี่
     เหตุผล: ตัวแถบเองถูกเขียนลง HTML ทุกหน้าเป็น static แล้ว (scripts/generate-nav.js)
     ถ้าปล่อยให้ CSS ยังมาจาก JS เหมือนเดิม แถบจะโผล่มาแบบ "ไม่มีสไตล์" ก่อนแป๊บนึง
     (เป็นก้อนลิงก์ธรรมดาต่อท้ายหน้า) แล้วค่อยกระโดดไปอยู่ขอบล่าง = กระพริบหนักกว่าเดิม
     ตอนนี้ HTML + CSS มาพร้อมกันตั้งแต่วินาทีแรก ไม่ต้องรอ JS เลย
     ⚠️ กฎทุกบรรทัดคัดลอกมาจาก shared.js แบบตรงตัวทุกอักขระ เพื่อให้หน้าตาเหมือนเดิมเป๊ะ ไม่เปลี่ยนอะไร
     ⚠️ `top:auto` ห้ามลบ — กัน `nav{top:0}` (บรรทัด 18) หลุดมาทับ แล้วแถบจะเด้งไปขอบบนจอ (บั๊กจริง 2026-08-10) */
  #bottom-nav{display:none;position:fixed;top:auto;bottom:0;left:0;right:0;background:rgba(17,17,17,0.97);border-top:1px solid rgba(200,151,58,0.3);z-index:998;padding:0;padding-bottom:env(safe-area-inset-bottom);}
  #bottom-nav .bn-item{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;padding:8px 4px;text-decoration:none;color:rgba(255,255,255,0.6);gap:3px;}
  #bottom-nav .bn-item.bn-cta{color:var(--gold);}
  #bottom-nav .bn-icon{font-size:20px;line-height:1;}
  #bottom-nav .bn-label{font-family:'Noto Sans TC',sans-serif;font-size:10px;letter-spacing:0.5px;}
  #bottom-nav .bn-item:hover,.bn-item:active{color:var(--gold);}
  @media(max-width:768px){#bottom-nav{display:flex;}body{padding-bottom:60px;}}
  /* 🔑 2026-08-10 (Lin สั่ง: "ทำทุกหน้าให้เป็น 4 ไปเลย") — หน้าเกมก็มีแถบ 4 ไอคอนเหมือนหน้าอื่นทั้งเว็บ
     ยกเลิกกฎเดิม 2026-07-12 ที่ซ่อนแถบล่างถาวรบนหน้าเกม (ตอนนั้นแถบล่างยังเป็นชุดเก่า 5-6 ปุ่มข้อความ กินที่เยอะ)
     แถบชุดใหม่ 4 ไอคอนเล็กกว่า/สะอาดกว่า จึงไม่ต้องซ่อนอีก
     ⚠️ ที่ยังซ่อนอยู่คือตอน "โหมดเต็มจอ" (body.rg-fake-fullscreen) เท่านั้น — กฎนั้นอยู่ใน js/core/shared.js ห้ามลบ */

  /* ═══════════════════════════════════════════
     COLOR HIGHLIGHTS & SUBTLE GRADIENTS
     ═══════════════════════════════════════════ */

  /* Warm gold gradient for accent words, prices, stats & slogans.
     (Body text & emoji-bearing headings stay solid for legibility.) */
  .hero-title .accent,
  .cta-question span,
  .answer-quote em,
  .teacher-story-title em,
  .section-heading em,
  .cta-thai,
  .slogan-big,
  .stat-num,
  .plan-price,
  .plan-card.featured .plan-price,
  .pair-price-val,
  .prog-hours {
    background:linear-gradient(120deg,#A8780F 0%,#8B6310 48%,#5A3E0A 100%);
    -webkit-background-clip:text; background-clip:text;
    -webkit-text-fill-color:transparent; color:transparent;
  }
  /* keep the secondary Chinese line inside the slogan solid & readable */
  .slogan-big .zh { -webkit-text-fill-color:var(--ink-muted); color:var(--ink-muted); background:none; }

  /* Soft brighter gradient for the hero accent (large display text) */
  .hero-title .accent {
    background:linear-gradient(120deg,#C8973A 0%,#8B6310 55%,#5A3E0A 100%);
    -webkit-background-clip:text; background-clip:text;
    -webkit-text-fill-color:transparent;
  }

  /* Cream → gold feature-card gradients (echoes the 字母練習區 entry card) */
  .problem-card { background:linear-gradient(180deg,#FFFFFF 0%,#FBF5E7 100%); transition:background 0.25s, box-shadow 0.25s; }
  .problem-card:hover { background:linear-gradient(180deg,#FBF5E7 0%,#F3E4C2 100%); box-shadow:0 12px 28px rgba(139,99,16,0.12); }
  .how-card, .how-card:nth-child(even) { background:#FBF5E7; transition:background 0.25s, box-shadow 0.25s; }
  .how-card:hover { background:linear-gradient(180deg,#F3E4C2 0%,#EAD09A 100%); box-shadow:0 12px 28px rgba(139,99,16,0.15); }
  .prog-step { background:#FBF5E7; }
  .prog-step:hover { background:linear-gradient(180deg,#F3E4C2 0%,#EAD09A 100%); box-shadow:0 12px 28px rgba(139,99,16,0.15); }
  .lesson-card { background:#FBF5E7; transition:background 0.25s, box-shadow 0.25s; }
  .lesson-card:hover { background:linear-gradient(180deg,#F3E4C2 0%,#EAD09A 100%); box-shadow:0 12px 28px rgba(139,99,16,0.15); }
  .rule-card { background:linear-gradient(180deg,#FFFFFF 0%,#FBF5E7 100%); transition:background 0.25s, box-shadow 0.25s; }
  .rule-card:hover { background:linear-gradient(180deg,#FBF5E7 0%,#F3E4C2 100%); box-shadow:0 12px 28px rgba(139,99,16,0.10); }
  .plan-card { background:#FBF5E7; transition:background 0.25s, box-shadow 0.25s; }
  .plan-card:not(.featured):hover, .plan-card:not(.featured):active { background:linear-gradient(180deg,#F3E4C2 0%,#EAD09A 100%); box-shadow:0 12px 28px rgba(139,99,16,0.15); }
  .plan-card.featured:hover, .plan-card.featured:active { background:linear-gradient(180deg,#F3E4C2 0%,#E2C27C 100%); box-shadow:0 12px 28px rgba(139,99,16,0.22); }

  /* Subtle gradient depth on the warm bands */
  .stats-band { background:linear-gradient(180deg,#F8EFD6 0%,#F1E0BA 100%); }
  #cta { background:linear-gradient(180deg,#FBF5E7 0%,#F1E0BA 100%); }
  .line-strip { background:linear-gradient(180deg,#FBF5E7 0%,#F3E4C2 100%); }
  body:not([data-gsh-game]) > .avail-band { background:linear-gradient(180deg,#FBF5E7 0%,#F3E4C2 100%); }

  /* Gold accent bar under section headings for a refined highlight */
  .eyebrow { background:linear-gradient(90deg,#A8780F,#8B6310); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; color:transparent; }

  /* ═══════════════════════════════════════════
     DIFFICULTY COLOUR-GRADING  (easy→hard, light→dark)
     Unified with the tone-finder level cards.
     ═══════════════════════════════════════════ */

  /* — Learning progress timeline: stage 1→4 green→amber→coral→deep — */
  .prog-step:nth-child(1) { background:linear-gradient(180deg,#FFFFFF 0%,var(--d1-bg) 100%); }
  .prog-step:nth-child(2) { background:linear-gradient(180deg,#FFFFFF 0%,var(--d2-bg) 100%); }
  .prog-step:nth-child(3) { background:linear-gradient(180deg,#FFFFFF 0%,var(--d3-bg) 100%); }
  .prog-step:nth-child(4) { background:linear-gradient(180deg,#FFFFFF 0%,var(--d4-bg) 100%); }
  .prog-step:nth-child(1) .prog-circle { background:var(--d1); border-color:var(--d1); color:#fff; }
  .prog-step:nth-child(2) .prog-circle { background:var(--d2); border-color:var(--d2); color:#fff; }
  .prog-step:nth-child(3) .prog-circle { background:var(--d3); border-color:var(--d3); color:#fff; }
  .prog-step:nth-child(4) .prog-circle { background:var(--d4); border-color:var(--d4); color:#fff; }
  .prog-step:nth-child(1) .prog-title, .prog-step:nth-child(1) .prog-hours { color:var(--d1); -webkit-text-fill-color:var(--d1); }
  .prog-step:nth-child(2) .prog-title, .prog-step:nth-child(2) .prog-hours { color:var(--d2); -webkit-text-fill-color:var(--d2); }
  .prog-step:nth-child(3) .prog-title, .prog-step:nth-child(3) .prog-hours { color:var(--d3); -webkit-text-fill-color:var(--d3); }
  .prog-step:nth-child(4) .prog-title, .prog-step:nth-child(4) .prog-hours { color:var(--d4); -webkit-text-fill-color:var(--d4); }

  /* — Progress hover (must come after nth-child rules to win) — */
  .prog-step:nth-child(1):hover,
  .prog-step:nth-child(2):hover,
  .prog-step:nth-child(3):hover,
  .prog-step:nth-child(4):hover { background:linear-gradient(180deg,#F3E4C2 0%,#EAD09A 100%); box-shadow:0 12px 28px rgba(139,99,16,0.15); }

  /* — Lesson preview cards: 1→3 green→amber→coral — */
  .lesson-card:nth-child(1) { background:linear-gradient(180deg,#FFFFFF 0%,var(--d1-bg) 100%); }
  .lesson-card:nth-child(2) { background:linear-gradient(180deg,#FFFFFF 0%,var(--d2-bg) 100%); }
  .lesson-card:nth-child(3) { background:linear-gradient(180deg,#FFFFFF 0%,var(--d3-bg) 100%); }
  /* — Lesson hover (must come after nth-child rules to win) — */
  .lesson-card:nth-child(1):hover,
  .lesson-card:nth-child(2):hover,
  .lesson-card:nth-child(3):hover { background:linear-gradient(180deg,#F3E4C2 0%,#EAD09A 100%); box-shadow:0 12px 28px rgba(139,99,16,0.15); }

  .lesson-card:nth-child(1) .lesson-card-tag { color:var(--d1); }
  .lesson-card:nth-child(2) .lesson-card-tag { color:var(--d2); }
  .lesson-card:nth-child(3) .lesson-card-tag { color:var(--d3); }
  .lesson-card:nth-child(1) .lesson-sample { border-left-color:var(--d1); }
  .lesson-card:nth-child(2) .lesson-sample { border-left-color:var(--d2); }
  .lesson-card:nth-child(3) .lesson-sample { border-left-color:var(--d3); }

  /* — Pricing tiers: Basic (beginner) green → Standard (higher) coral — */
  .pricing-grid .plan-card:nth-child(1) .plan-tag { color:var(--d1); }
  .pricing-grid .plan-card:nth-child(2) .plan-tag { color:var(--d3); }

  /* ============================================================
     ⚡ โหมดเบา (lite) — มีผลเฉพาะ in-app browser LINE/FB/IG เท่านั้น
        (class "lite" ถูกใส่ที่ <html> โดย shared.js)
        Safari / Chrome / desktop ไม่โดน → เอฟเฟกต์ครบเหมือนเดิม
     ============================================================ */
  /* ปิด backdrop-filter ที่ nav (ตัวการกระตุกหลักตอนเลื่อนจอ) — พื้นหลังทึบแทน */
  html.lite nav { -webkit-backdrop-filter:none !important; backdrop-filter:none !important; background:rgba(17,17,17,0.98) !important; }
  /* หยุด animation ที่วิ่งวนตลอดเวลา */
  html.lite .avail-dot,
  html.lite .scroll-hint .line,
  html.lite .tf-float-cta { animation:none !important; }


/* Lin 2026-07-12: footer มือถือ = ตัดเป็น 2 บรรทัดตรงกลาง (หลัง 設計的泰文課) · คอม = บรรทัดเดียวมี · คั่นเหมือนเดิม */
.foot-mbr{display:none;}
@media(max-width:768px){ footer .foot-sep{display:none;} footer .foot-mbr{display:inline !important;} }

/* ===================================================================
   🎮 SHARED GAME SHELL — Phase A (Shared Game UI, Lin 2026-08-10)
   โครงกลาง 4 ชั้นที่ 5 เกมฝึก (聲調/拼讀/聽力/打字/語序) ใช้ร่วมกัน:
     Utility(.rg-ctl-wrap เดิมจาก shared.js — ไม่แตะ) → Player Status → Session Header → Gameplay
   หลักการ: เป็น "ชุด class เสริม" (.gsh-*) แปะเข้า container ที่มีอยู่แล้วของแต่ละเกม
   ไม่มีการย้าย/รื้อ DOM เดิม ไม่แตะ id เดิม ไม่ชนกับ selector อื่นในเว็บ (prefix .gsh- ไม่ซ้ำใคร)
   อ้างอิง: Audit 2026-08-10 (2026-08-10_Audit_5เกม_ปุ่มUtility_ก่อนShared-Game-UI.md) หัวข้อ §6 Shared Page Structure
   ระวัง: ไฟล์นี้โหลดทุกหน้าของเว็บ (ไม่ใช่แค่หน้าเกม) — กฎ prefix .gsh- ต้องรักษาไว้เสมอกันกระทบหน้าอื่น
   =================================================================== */

/* กรอบกว้างของพื้นที่เกม — desktop โฟกัสตรงกลาง ไม่ยืดเต็มจอ, mobile margin ~16px ไม่ overflow */
.gsh-shell { max-width:688px; margin:0 auto; padding-inline:24px; width:100%; box-sizing:border-box; }
body .gsh-shell.tf-page { padding-top:8px; }

.gsh-page-header { width:100%; max-width:640px; margin:0 auto 10px; text-align:center; }
.gsh-page-header > h1 { font-size:clamp(20px,4vw,28px); }

/* Player Status — compact, กลางจอ, ไม่แย่ง Gameplay */
.gsh-player-status {
  display:flex; align-items:center; justify-content:center; flex-wrap:wrap;
  gap:6px 14px; padding:6px 0; width:100%; max-width:640px; margin-inline:auto; box-sizing:border-box;
  font-family:'Noto Sans TC',sans-serif; font-size:12.5px; color:var(--ink-muted);
}
.gsh-player-status [role="button"] { cursor:pointer; }

/* Session Header — compact 1-2 แถว บน desktop, wrap ได้บน mobile แต่ลำดับข้อมูลต้องเหมือน desktop
   ลำดับที่แนะนำ (ตาม §10): game title → difficulty/category → progress → score */
.gsh-session-header {
  display:flex; align-items:center; justify-content:center; flex-wrap:wrap;
  gap:6px 16px; padding:4px 0 10px; width:100%; max-width:640px; margin-inline:auto; box-sizing:border-box;
  font-family:'Noto Sans TC',sans-serif; font-size:13px; color:var(--ink-muted);
  text-align:center;
}
.gsh-session-header .gsh-title { font-family:'Noto Serif TC',serif; font-weight:900; color:var(--ink); font-size:15px; }
.gsh-session-header .gsh-sep { opacity:0.4; }

/* Gameplay — เด่นที่สุดเสมอ ไม่มีการ์ดซ้อนการ์ด ไม่มี sidebar/leaderboard/promotion ข้างๆ */
.gsh-gameplay { margin:4px auto 0; width:100%; max-width:640px; box-sizing:border-box; }

/* Tone/Reading/Typing share one compact selector without inventing levels for the other games. */
.gsh-level-selector {
  display:grid !important; grid-template-columns:repeat(3,minmax(70px,1fr)); flex:1 1 280px;
  width:min(100%,300px) !important; max-width:300px !important; gap:8px !important; margin:0 !important;
}
.gsh-level-selector > button {
  min-height:36px; padding:7px 12px !important; border-radius:999px !important;
  font-family:'Noto Sans TC',sans-serif; font-size:13px !important; font-weight:800;
}

/* D4: optional Hint-off action belongs to ordinary Desktop question feedback only. */
.gsh-desktop-hint-off { display:none !important; }

/* Ordinary Desktop: games with Level always keep Level and round status on two separate rows. */
@media (min-width:769px) and (min-height:601px){
  body[data-gsh-game="tone"] .gsh-session-header,
  body[data-gsh-game="reading"] .gsh-session-header,
  body[data-gsh-game="typing"] .gsh-session-header {
    flex-direction:column; flex-wrap:nowrap; gap:6px;
  }
  body[data-gsh-game="reading"] .gsh-session-header,
  body[data-gsh-game="typing"] .gsh-session-header {
    gap:8px;
    padding-bottom:8px;
  }
  body[data-gsh-game="tone"] .gsh-session-header > .gsh-level-selector,
  body[data-gsh-game="reading"] .gsh-session-header > .gsh-level-selector,
  body[data-gsh-game="typing"] .gsh-session-header > .gsh-level-selector {
    flex:none;
  }

  /* D3: active ordinary-Desktop cards keep the approved Tone border and one shared tool order. */
  body[data-gsh-game="tone"] .gsh-gameplay,
  body[data-gsh-game="reading"] .gsh-gameplay,
  body[data-gsh-game="typing"] .gsh-gameplay,
  body[data-gsh-game="word-order"] .gsh-gameplay {
    border:1.5px solid rgba(139,99,16,0.15);
  }
  body[data-gsh-game] .gsh-shell:has(> .gsh-resume-banner:not([style*="display:none"]):not([style*="display: none"])) > .gsh-session-header,
  body[data-gsh-game] .gsh-shell:has(> .gsh-resume-banner:not([style*="display:none"]):not([style*="display: none"])) > .gsh-gameplay {
    display:none !important;
  }
  body[data-gsh-game] .gsh-learning-tools > #rg-sound-toggle { order:1; }
  body[data-gsh-game] .gsh-learning-tools > #rg-pron-toggle { order:2; }
  body[data-gsh-game] .gsh-learning-tools > #rg-en-toggle { order:3; }
  body[data-gsh-game] .gsh-learning-tools > #zh-toggle-slot,
  body[data-gsh-game] .gsh-learning-tools > #wo-zh-word-toggle { order:4; }
  body[data-gsh-game] .gsh-learning-tools > #font-toggle-slot { order:5; }
  body[data-gsh-game] .gsh-learning-tools > #tf-guide-toggle,
  body[data-gsh-game] .gsh-learning-tools > #rg-guide-toggle,
  body[data-gsh-game] .gsh-learning-tools > #guide-toggle { order:6; }
  body[data-gsh-game] .gsh-learning-tools > #tf-particle-toggle,
  body[data-gsh-game] .gsh-learning-tools > #rg-particle-toggle { order:7; }
  body[data-gsh-game] .gsh-learning-tools > #tf-vault-btn-slot,
  body[data-gsh-game] .gsh-learning-tools > #rg-vault-btn-slot { order:8; }
  body[data-gsh-game] .gsh-desktop-hint-off[data-visible="true"] { display:inline-flex !important; }
}

@media (max-width:768px) and (orientation:portrait) {
  body[data-gsh-game="typing"] .gsh-session-header {
    gap:6.5px;
    padding-bottom:6.5px;
  }
}

.gsh-progress { width:100%; max-width:640px; margin:0 0 12px; }

/* Learning helpers remain beside the active content instead of becoming a fourth floating control. */
.gsh-learning-tools {
  width:100%; max-width:640px; margin:6px auto 2px; display:flex; align-items:center;
  justify-content:center; flex-wrap:wrap; gap:8px;
}
.gsh-learning-tools .gsh-learning-tool button,
.gsh-learning-tools button.gsh-learning-tool { min-width:40px; min-height:40px; }

@media(max-width:600px){
  .gsh-shell { padding-inline:16px; }
  .gsh-player-status { font-size:12px; gap:5px 10px; }
  .gsh-session-header { font-size:12px; gap:3px 10px; }
  .gsh-session-header .gsh-title { font-size:14px; }
  .gsh-level-selector { flex-basis:100%; width:min(100%,288px) !important; }
}
@media(max-width:390px){
  .gsh-shell { padding-inline:14px; }
}

/* Feedback inline — reserve พื้นที่กันจอกระโดดแรง (§12) ใช้แปะเสริม container feedback เดิมของแต่ละเกม
   ไม่ได้แทนที่ banner/class เดิม แค่กำหนด min-height เผื่อไว้ + transition นุ่มๆ */
.gsh-feedback-slot { min-height:1.6em; transition:opacity 200ms ease, transform 200ms ease; }

/* Locked game flow 2026-08-14: short feedback → 3/2/1 → automatic next.
   Existing next buttons remain available for immediate progress; pause cancels only the countdown. */
.gsh-next-countdown {
  display:inline-flex; align-items:center; justify-content:center; min-width:2.25rem; min-height:2.25rem;
  border-radius:999px; background:var(--gold-light); color:var(--gold-deep); font-weight:900;
  font-family:'Noto Sans TC',sans-serif; font-size:15px;
}
.gsh-next-countdown:empty { display:none; }
.gsh-pause-btn[hidden] { display:none !important; }
.gsh-shared-result { width:100%; }
.gsh-result-meta { display:flex; flex-direction:column; align-items:center; gap:6px; width:100%; margin:10px auto 4px; font-family:'Noto Sans TC',sans-serif; text-align:center; }
.gsh-result-correct { font-size:18px; font-weight:900; color:var(--gold-deep); }
.gsh-result-srs { font-size:13px; color:var(--ink-soft); }
.gsh-result-feedback { font-size:15px; font-weight:800; color:var(--ink); }
.gsh-result-highlight { display:inline-flex; padding:5px 11px; border-radius:999px; background:var(--gold-light); color:var(--gold-deep); font-size:12px; font-weight:800; }
.gsh-result-countdown { min-height:1.4em; font-size:13px; font-weight:800; color:var(--gold-deep); }
@media(max-width:600px){
  .gsh-next-countdown { order:-1; flex-basis:2.25rem; }
  .gsh-pause-btn { min-width:88px; }
}

/* 查看詳細解說 — ปุ่ม/กล่องรายละเอียดที่ผู้เล่นเลือกเปิดเอง (§13) ใช้เป็น visual มาตรฐานร่วมกัน 5 เกม */
.gsh-detail-toggle {
  font-family:'Noto Sans TC',sans-serif; font-size:12.5px; font-weight:700; color:var(--gold-deep);
  background:none; border:1px solid var(--warm-line); border-radius:20px; padding:5px 14px; cursor:pointer;
}
.gsh-detail-toggle:hover { background:rgba(139,99,16,0.08); }
.gsh-detail-box { margin-top:8px; }

/* End Game — visual hierarchy มาตรฐานร่วมกัน 5 เกม (§18) */
.gsh-end-title { font-family:'Noto Serif TC',serif; font-weight:900; font-size:clamp(20px,4vw,26px); text-align:center; }
.gsh-end-score { text-align:center; font-family:'Noto Serif TC',serif; font-weight:900; font-size:clamp(28px,6vw,40px); color:var(--gold-deep); }
.gsh-end-actions { display:flex; flex-direction:column; gap:10px; align-items:stretch; max-width:320px; margin:16px auto 0; }
@media(min-width:600px){ .gsh-end-actions { flex-direction:row; flex-wrap:wrap; justify-content:center; max-width:none; } }
.gsh-result-actions { display:flex; flex-direction:column; gap:10px; align-items:stretch; max-width:320px; margin:16px auto 0; }
@media(min-width:600px){ .gsh-result-actions { flex-direction:row; flex-wrap:wrap; justify-content:center; max-width:none; } }
.gsh-game-exit-overlay{position:fixed;inset:0;z-index:100100;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.48);font-family:'Noto Sans TC',sans-serif;}
.gsh-game-exit-box{width:min(360px,100%);padding:26px 22px;background:#fff;border:1.5px solid rgba(139,99,16,.25);border-radius:18px;box-shadow:0 18px 56px rgba(0,0,0,.28);text-align:center;}
.gsh-game-exit-title{font-family:'Noto Serif TC',serif;font-size:21px;font-weight:900;color:#5a3e0a;margin-bottom:18px;}
.gsh-game-exit-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;}
.gsh-game-exit-actions button{min-height:42px;padding:9px 18px;border-radius:999px;border:1.5px solid #C8973A;background:#fff;color:#8B6310;font:700 14px 'Noto Sans TC',sans-serif;cursor:pointer;}
.gsh-game-exit-actions [data-game-exit-leave]{background:#8B6310;color:#fff;}

/* ═══════════════════════════════════════════════════════════
   Phase D/E/F (2026-08-10) — เพิ่มชุด class ใหม่ 3 กลุ่ม ใช้ prefix .gsh- ต่อจากชุดเดิมด้านบน
   หลักการเดิม: แปะเข้า container ที่มีอยู่แล้วของแต่ละเกม ไม่รื้อ DOM ไม่ชน id เดิม
   ═══════════════════════════════════════════════════════════ */

/* Restart confirmation overlay — ใช้ร่วมกัน 5 เกม (§15, Phase E2) ข้อความจริงกำหนดจาก JS ของแต่ละเกม */
.gsh-confirm-overlay {
  position:fixed; inset:0; background:rgba(28,20,6,0.55); z-index:10050;
  display:flex; align-items:center; justify-content:center; padding:20px;
}
.gsh-confirm-box {
  background:var(--cream); border-radius:16px; padding:24px 22px; max-width:340px; width:100%;
  text-align:center; font-family:'Noto Sans TC',sans-serif; box-shadow:0 12px 40px rgba(0,0,0,0.25);
}
.gsh-confirm-title { font-family:'Noto Serif TC',serif; font-weight:900; font-size:17px; color:var(--ink); margin-bottom:8px; }
.gsh-confirm-sub { font-size:13px; color:var(--ink-muted); margin-bottom:18px; line-height:1.6; }
.gsh-confirm-actions { display:flex; gap:10px; }
.gsh-confirm-actions button { flex:1; padding:10px 12px; border-radius:10px; font-weight:700; font-size:14px; cursor:pointer; font-family:'Noto Sans TC',sans-serif; border:none; }
.gsh-confirm-cancel { background:#fff; border:1.5px solid var(--border) !important; color:var(--ink-soft); }
.gsh-confirm-ok { background:linear-gradient(135deg,var(--gold-bright),var(--gold-deep)); color:#fff; }

/* Guest resume banner — ใช้ร่วมกัน 5 เกม (§16, Phase E3) โชว์เฉพาะเมื่อมี session ค้างจริงใน localStorage */
.gsh-resume-banner {
  width:100%; max-width:640px; margin:0 auto 14px; box-sizing:border-box;
  background:linear-gradient(180deg,#FFF6E6,#FDEBC8); border:1.5px solid var(--gold-bright); border-radius:14px;
  padding:14px 16px; font-family:'Noto Sans TC',sans-serif; text-align:center;
}
.gsh-resume-title { font-weight:800; font-size:14px; color:var(--gold-deep); margin-bottom:4px; }
.gsh-resume-detail { font-size:13px; color:var(--ink-soft); margin-bottom:12px; }
.gsh-resume-actions { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.gsh-resume-actions button { padding:9px 18px; border-radius:999px; font-weight:700; font-size:13.5px; cursor:pointer; font-family:'Noto Sans TC',sans-serif; border:none; }
.gsh-resume-continue { background:linear-gradient(135deg,var(--gold-bright),var(--gold-deep)); color:#fff; }
.gsh-resume-restart { background:#fff; border:1.5px solid var(--border) !important; color:var(--ink-soft); }
.gsh-resume-new { background:transparent; border:1.5px solid var(--gold-bright) !important; color:var(--gold-deep); }
@media(max-width:600px){ .gsh-resume-actions button{ flex:1 1 30%; } }
@media(max-width:480px){
  .gsh-resume-banner { padding:11px 10px; text-align:left; }
  .gsh-resume-title { display:none; }
  .gsh-resume-detail { margin-bottom:8px; font-size:12.5px; line-height:1.4; }
  .gsh-resume-actions { flex-direction:row; flex-wrap:nowrap; gap:4px; }
  .gsh-resume-actions button { flex:1 1 0; width:auto; min-width:0; min-height:36px; padding:6px 3px; font-size:11px; white-space:nowrap; }
}

/* 查看錯題 mistake review — ใช้ร่วมกัน 5 เกม (§21, Phase F2) read-only แสดงจาก roundLog/state จริงเท่านั้น */
.gsh-mistake-list { display:flex; flex-direction:column; gap:10px; width:100%; max-width:640px; margin:0 auto; }
.gsh-mistake-item { background:#fff; border:1.5px solid var(--border); border-radius:12px; padding:12px 14px; text-align:left; font-family:'Noto Sans TC',sans-serif; }
.gsh-mistake-q { font-family:'Sarabun',sans-serif; font-size:16px; font-weight:700; color:var(--ink); margin-bottom:4px; }
.gsh-mistake-row { font-size:12.5px; color:var(--ink-muted); margin-top:2px; }
.gsh-mistake-row b { color:var(--ink-soft); }
.gsh-mistake-item.gsh-mistake-wrong { border-color:#e0a0a0; background:#fdf5f5; }
.gsh-mistake-back { margin:14px auto 0; display:block; }

/* ===================================================================
   SHARED PAGE POSITIONING — Tone-authoritative Desktop + Portrait
   Lin 2026-08-28: reuse the original Tone dimensions. This layer changes
   axis/order/anchoring only; it must not resize cards, copy, buttons or rows.
   Lego lower gameplay and Mobile Landscape remain outside this packet.
   =================================================================== */
@media (min-width:1025px),
       (min-width:769px) and (min-height:601px),
       (max-width:768px) and (orientation:portrait) {
  body[data-gsh-game]:not([data-gsh-game="lego"]) .gsh-page-header,
  body[data-gsh-game]:not([data-gsh-game="lego"]) .mrt-login-surface,
  body[data-gsh-game]:not([data-gsh-game="lego"]) .gsh-session-header,
  body[data-gsh-game]:not([data-gsh-game="lego"]) .gsh-resume-banner,
  body[data-gsh-game]:not([data-gsh-game="lego"]) .gsh-gameplay {
    margin-inline:auto;
    box-sizing:border-box;
  }
  body[data-gsh-game]:not([data-gsh-game="lego"]) .gsh-page-header { text-align:center; }
  body[data-gsh-game]:not([data-gsh-game="lego"]) .mrt-login-surface,
  body[data-gsh-game]:not([data-gsh-game="lego"]) .gsh-gameplay { margin-top:0; }

  /* Lin 2026-08-29: all six games keep the original right-side vertical
     control stack on Desktop and Portrait. Mobile Landscape overrides this
     below with its separate two-control play layout. */
  body[data-gsh-game] .rg-ctl-wrap {
    right:12px !important;
    bottom:calc(60px + env(safe-area-inset-bottom,0px)) !important;
    z-index:100000 !important;
    left:auto !important;
    width:max-content !important;
    transform:none !important;
    flex-direction:column !important;
    align-items:flex-end !important;
    justify-content:flex-end !important;
    gap:10px !important;
  }
  body[data-gsh-game] .rg-ctl-wrap > #game-switcher,
  body[data-gsh-game] .rg-ctl-wrap > .grw-menu {
    position:absolute !important; right:0 !important;
    bottom:calc(100% + 8px) !important; top:auto !important; left:auto !important;
    margin:0 !important; transform:none !important;
  }
}

@media (max-width:768px) and (orientation:portrait) {
  /* Keep all three game controls visible in the same right-side vertical
     order as Desktop. Vault owns a separate page-local two-control layout. */
  html body[data-gsh-game] .rg-ctl-wrap {
    left:auto !important;
    right:12px !important;
    width:max-content !important;
    transform:none !important;
    flex-direction:column !important;
    align-items:flex-end !important;
    justify-content:flex-end !important;
    gap:10px !important;
  }
  body[data-gsh-game] .rg-ctl-wrap {
    bottom:calc(68px + env(safe-area-inset-bottom,0px)) !important;
  }
  body[data-gsh-game].rg-fake-fullscreen .rg-ctl-wrap,
  body[data-gsh-game] .rg-ctl-wrap.rg-ctl-fs {
    bottom:calc(6px + env(safe-area-inset-bottom,0px)) !important;
  }
}

/* Locked Phase 1.2 playability: six-game two-hand layout on short landscape screens only. */
@media (orientation:landscape) and (max-width:1024px) and (max-height:600px) {
  html:has(body[data-gsh-game]),
  body[data-gsh-game] { width:100%; height:100%; overflow:hidden; }
  body[data-gsh-game] {
    --gsh-safe-l:max(12px,env(safe-area-inset-left));
    --gsh-safe-r:max(12px,env(safe-area-inset-right));
    --gsh-safe-t:max(8px,env(safe-area-inset-top));
    --gsh-safe-b:max(8px,env(safe-area-inset-bottom));
    position:fixed; inset:0; min-height:0; padding:0 !important;
  }
  body[data-gsh-game] > .site-nav,
  body[data-gsh-game] > .page-strip,
  body[data-gsh-game] > #bottom-nav,
  body[data-gsh-game] > footer,
  body[data-gsh-game] .gsh-page-header,
  body[data-gsh-game] .tf-tools-row,
  body[data-gsh-game] .head,
  body[data-gsh-game] .bp-title,
  body[data-gsh-game] .bp-hint { display:none !important; }
  body[data-gsh-game] .gsh-shell,
  body[data-gsh-game] .page {
    position:fixed; inset:0; width:auto; max-width:none; height:100dvh;
    min-height:0; margin:0; padding:0 !important; overflow:hidden;
  }
  body[data-gsh-game] .gsh-gameplay {
    position:fixed; inset:0; width:auto; max-width:none; min-height:0;
    margin:0; padding:0; border:0; border-radius:0; box-shadow:none;
    overflow:visible;
  }
  body[data-gsh-game] .bars-wrap,
  body[data-gsh-game] .gsh-progress,
  body[data-gsh-game] #mina-toast,
  body[data-gsh-game] #tf-mina-toast { display:none !important; }
  /* Existing rare shell controls stay in one top-centre row. */
  body[data-gsh-game] .rg-ctl-wrap {
    position:fixed !important; z-index:90; top:var(--gsh-safe-t); left:50%;
    right:auto !important; bottom:auto !important; width:auto !important; max-width:38%;
    height:42px !important; margin:0 !important; transform:translateX(-50%);
    display:flex !important; flex-direction:row !important; flex-wrap:nowrap !important;
    align-items:center !important; justify-content:center !important; gap:7px !important;
  }
  body[data-gsh-game] .rg-ctl-wrap > button { flex:0 0 auto; }
  body[data-gsh-game] .rg-ctl-wrap .grw-menu,
  body[data-gsh-game] .rg-ctl-wrap .wm-menu {
    position:fixed !important; top:calc(var(--gsh-safe-t) + 48px) !important;
    right:var(--gsh-safe-r) !important; bottom:auto !important; left:auto !important;
    transform:none !important; max-height:calc(100dvh - 64px); overflow:auto;
  }

  /* Help and session controls occupy the top-left thumb zone. */
  body[data-gsh-game] .rg-tools-row,
  body[data-gsh-game] .gsh-session-header,
  body[data-gsh-game="lego"] > .rg-stat-row,
  body[data-gsh-game] > .gsh-level-selector,
  body[data-gsh-game] .gsh-shell > .level-tabs,
  body[data-gsh-game] .gsh-shell > .mode-tabs {
    position:fixed !important; z-index:50; top:var(--gsh-safe-t); left:var(--gsh-safe-l);
    width:auto !important; max-width:29% !important; margin:0 !important;
  }
  body[data-gsh-game] .rg-tools-row {
    height:40px; max-height:40px; align-items:center; overflow:visible;
  }
  body[data-gsh-game="lego"] > .rg-stat-row {
    height:40px; max-height:40px; align-items:center; overflow:visible;
  }
  body[data-gsh-game] .rg-tools-row #rg-cta-login > div > div:first-child > span,
  body[data-gsh-game] .rg-tools-row #rg-cta-login > div > div:first-child > button:last-child,
  body[data-gsh-game] .rg-tools-row #rg-cta-detail,
  body[data-gsh-game] .rg-tools-row #tf-cta-detail { display:none !important; }
  body[data-gsh-game] .rg-tools-row #rg-cta-login,
  body[data-gsh-game] .rg-tools-row #rg-cta-login > div,
  body[data-gsh-game] .rg-tools-row #rg-cta-login > div > div:first-child {
    min-width:0 !important; width:auto !important; height:40px; margin:0 !important;
    display:flex; align-items:center; flex-wrap:nowrap !important;
  }
  body[data-gsh-game] .gsh-shell > .mode-tabs { top:calc(var(--gsh-safe-t) + 42px); }
  body[data-gsh-game] .gsh-shell > .level-tabs { top:calc(var(--gsh-safe-t) + 82px); }
  body[data-gsh-game] .gsh-session-header { padding:0; }
  body[data-gsh-game] .gsh-player-status { padding:4px 6px !important; gap:4px !important; }
  body[data-gsh-game] .gsh-player-status > :first-child { display:none; }
  body[data-gsh-game="tone"] .gsh-session-header,
  body[data-gsh-game="reading"] .gsh-session-header,
  body[data-gsh-game="typing"] .gsh-session-header,
  body[data-gsh-game="word-order"] .gsh-session-header { top:calc(var(--gsh-safe-t) + 44px); }
  body[data-gsh-game="listening"] .gsh-session-header { top:calc(var(--gsh-safe-t) + 124px); }

  /* Resume is an exclusive centred state, never an overlay on active game content. */
  body[data-gsh-game] .gsh-resume-banner {
    position:fixed !important; z-index:120; top:50%; left:24%; right:24%;
    width:auto !important; max-width:none !important; max-height:72dvh; margin:0 !important;
    padding:12px !important; transform:translateY(-50%); overflow:auto;
    background:#fffdf7; box-shadow:0 8px 30px rgba(58,42,10,.22);
  }
  body[data-gsh-game] .gsh-resume-detail { margin-bottom:8px; }
  body[data-gsh-game] .gsh-resume-actions { flex-wrap:nowrap; gap:5px; }
  body[data-gsh-game] .gsh-resume-actions button {
    flex:1 1 0; min-width:0; min-height:36px; padding:6px 5px; white-space:nowrap;
  }

  /* Result content remains centred; real secondary/back and primary/continue actions split left/right. */
  body[data-gsh-game] [data-shared-result-ui="v1"] {
    position:fixed !important; z-index:60; inset:10% 30% 18%; width:auto !important;
    max-width:none !important; max-height:72%; margin:0 !important; padding:10px !important;
    justify-content:center; overflow:auto;
  }
  body[data-gsh-game] [data-shared-result-ui="v1"] .gsh-result-primary-actions {
    position:fixed; right:var(--gsh-safe-r); bottom:var(--gsh-safe-b);
    width:28%; max-width:28%; justify-content:flex-end;
  }
  body[data-gsh-game] [data-shared-result-ui="v1"] .gsh-result-utility-actions,
  body[data-gsh-game] [data-shared-result-ui="v1"] .gsh-result-home-actions {
    position:fixed; left:var(--gsh-safe-l); bottom:var(--gsh-safe-b);
    width:28%; max-width:28%; justify-content:flex-start;
  }
  body[data-gsh-game] [data-shared-result-ui="v1"] .gsh-result-home-actions {
    bottom:calc(var(--gsh-safe-b) + 46px);
  }

  /* Listening: four choices become two per side; typed input spans the lower centre. */
  body[data-gsh-game="listening"] .lg-word-area {
    position:fixed; z-index:20; top:72px; left:31%; right:31%; max-height:112px;
    margin:0; overflow:hidden;
  }
  body[data-gsh-game="listening"] #lg-mc-wrap {
    position:fixed; z-index:20; left:var(--gsh-safe-l); right:var(--gsh-safe-r); bottom:var(--gsh-safe-b);
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 38%; width:auto; margin:0;
  }
  body[data-gsh-game="listening"] #lg-type-wrap {
    position:fixed; z-index:20; left:29%; right:29%; bottom:var(--gsh-safe-b); width:auto; margin:0;
  }
  body[data-gsh-game="listening"] #lg-type-submit,
  body[data-gsh-game="listening"] #lg-skip-btn,
  body[data-gsh-game="listening"] #lg-next-btn {
    position:fixed; z-index:55; right:var(--gsh-safe-r); top:var(--gsh-safe-t);
  }

  /* Lego: category selector left, sentence centre, vocabulary dropdown right. */
  body[data-gsh-game="lego"] #buildPanel { position:fixed; inset:0; }
  body[data-gsh-game="lego"] .out { position:static; margin:0; box-shadow:none; }
  body[data-gsh-game="lego"] .out-banner {
    position:fixed; z-index:20; top:76px; left:31%; right:31%; max-height:55%;
    padding:8px; background:transparent; overflow:auto;
  }
  body[data-gsh-game="lego"] .out-actions {
    position:fixed; z-index:55; top:var(--gsh-safe-t); right:var(--gsh-safe-r); width:29%;
    padding:0; justify-content:flex-end;
  }
  body[data-gsh-game="lego"] #baseplate {
    position:fixed; z-index:30; top:calc(var(--gsh-safe-t) + 48px); bottom:var(--gsh-safe-b);
    left:var(--gsh-safe-l); width:28%; padding:6px; display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; align-content:center; overflow:auto;
  }
  body[data-gsh-game="lego"] #baseplate .slot-btn { min-width:0; min-height:42px; padding:4px; }
  body[data-gsh-game="lego"] #baseplate .slot-menu {
    position:fixed; z-index:80; top:calc(var(--gsh-safe-t) + 48px); right:var(--gsh-safe-r);
    bottom:var(--gsh-safe-b); left:auto; width:28%; min-width:0; max-height:none;
    margin:0; transform:none;
  }
  body[data-gsh-game="lego"] #lego-reveal,
  body[data-gsh-game="lego"] [data-shared-result-ui="v1"] {
    position:fixed !important; z-index:60; inset:20% 31%; width:auto !important; margin:0 !important;
  }
}
