/* ==========================================================================
   dm66.world — layout CSS v2 (ตรงกับ class จริงจาก build.py)
   เติมให้ครบทุก class ที่ HTML เรียกใช้ — เขียนเพิ่มจาก v1 ไม่ทับของเดิม
   ========================================================================== */

/* ---- header (.hdr .hdr-in .brand .brand-t .nav .burger) ---- */
.hdr {
  position: sticky; top: 0; z-index: 60;
  background: rgba(7, 10, 18, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hdr-in {
  display: flex; align-items: center; gap: 1rem;
  min-height: var(--head-h);
  padding-block: .5rem;
}
.hdr .brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; color: var(--text); }
.hdr .brand img { height: 42px; width: auto; }
.brand-t { color: var(--primary); letter-spacing: .04em; }
.hdr .nav { display: flex; flex-wrap: wrap; gap: .2rem; margin-left: auto; }
.hdr .nav a {
  color: var(--text-2); font-size: .95rem; font-weight: 500;
  padding: .45rem .65rem; border-radius: var(--radius-sm);
}
.hdr .nav a:hover, .hdr .nav a.hdr-act { color: var(--text); background: var(--surface); }
.burger {
  display: none; margin-left: auto;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); color: var(--text);
  width: 44px; height: 40px; font-size: 1.1rem; cursor: pointer;
}
.burger span { display: block; height: 2px; width: 20px; margin: 3px auto; background: var(--text); border-radius: 2px; }

/* ---- hero (.hero .hero-in .badge .hero-sub .hero-btns .hero-facts .hero-img) ---- */
.hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-in { position: relative; z-index: 1; padding: 2.6rem 0 3rem; }
.hero .badge {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gold);
  background: rgba(247, 183, 51, .12); border: 1px solid rgba(247, 183, 51, .35);
  border-radius: 999px; padding: .3em .9em; margin-bottom: 1rem;
}
.hero h1 { max-width: 24ch; margin-bottom: .5rem; }
.hero-sub { font-size: 1.08rem; color: var(--text-2); max-width: 60ch; margin-bottom: 1.5rem; }
.hero-btns { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.hero-facts {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  list-style: none; padding: 0; margin: 1.8rem 0 0;
}
.hero-facts li { display: flex; align-items: center; gap: .5em; font-size: .95rem; color: var(--text-2); margin: 0; }
.hero-facts li::before { content: "✔"; color: var(--accent); font-weight: 700; }
.hero-img { margin-top: 2rem; }
.hero-img img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius-lg); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ---- layout (.lay .art .side) ---- */
.lay {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2.2rem; align-items: start;
  padding-block: 2.4rem;
}
.art { min-width: 0; font-size: 1.05rem; }
.art > h2 { margin-top: 2.2em; padding-top: .5em; border-top: 1px solid var(--line); }
.art > h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.art > h3 { margin-top: 1.6em; }
.art figure { margin: 1.8rem 0; }
.art figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.art figcaption { font-size: .88rem; color: var(--text-3); text-align: center; margin-top: .6rem; }
.art a:not(.btn):not(.btn-cta) { text-decoration: underline; text-decoration-color: rgba(255,122,26,.45); text-underline-offset: 3px; }

/* ---- sidebar (.side .side-card .side-cta .side-links .side-list) ---- */
.side { position: sticky; top: calc(var(--head-h) + 1rem); display: grid; gap: 1.2rem; }
.side-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem;
}
.side-card h3 { margin-bottom: .4em; }
.side-card p { font-size: .94rem; margin-bottom: .8rem; }
.side-cta {
  border-color: rgba(255,122,26,.4);
  background:
    radial-gradient(400px 200px at 80% 0%, rgba(255,122,26,.18), transparent 65%),
    linear-gradient(180deg, var(--surface-2), var(--bg-3));
  text-align: center;
}
.side-cta h3 { color: var(--gold); }
.side-cta .btn { width: 100%; margin-bottom: .5rem; }
.side-links { list-style: none; padding: 0; margin: 0; }
.side-links li { margin-bottom: .4rem; font-size: .95rem; }
.side-links a { color: var(--text-2); }
.side-links a:hover { color: var(--primary); }
.side-list { list-style: none; padding: 0; margin: 0; font-size: .92rem; color: var(--text-2); text-align: left; }
.side-list li { padding-left: 1.4em; position: relative; margin-bottom: .5em; }
.side-list li::before { content: "•"; position: absolute; left: .2em; color: var(--primary); }

/* ---- buttons (.btn-reg .btn-play .full) ---- */
.btn-reg, .btn-play {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: inherit; font-size: 1rem; font-weight: 700;
  padding: .8em 1.5em; border-radius: 999px; border: 0; cursor: pointer;
  text-align: center;
  transition: transform .18s var(--ease), filter .2s var(--ease);
}
.btn-reg { background: linear-gradient(135deg, var(--primary), var(--gold)); color: #100800; box-shadow: var(--shadow-glow); }
.btn-reg:hover { transform: translateY(-2px); filter: brightness(1.08); color: #100800; }
.btn-play { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #04140A; box-shadow: 0 0 0 1px rgba(97,206,112,.25), 0 12px 30px rgba(97,206,112,.18); }
.btn-play:hover { transform: translateY(-2px); filter: brightness(1.06); color: #04140A; }
.btn-reg.full, .btn-play.full { width: 100%; }
.btn-reg.sm, .btn-play.sm { font-size: .9rem; padding: .55em 1.15em; }
.hero-btns .btn-reg, .hero-btns .btn-play { font-size: 1.05rem; padding: .9em 1.8em; }
.cta-btns { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: 1rem; }

/* ---- table (.tbl-wrap .tbl-cap) ---- */
.tbl-wrap { overflow-x: auto; margin: 1.6rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
.tbl-wrap .tbl { margin: 0; }
.tbl-cap { font-size: .88rem; color: var(--text-3); margin-top: .6rem; }

/* ---- steps (.step-n) ---- */
.step-n {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  color: #100800; font-weight: 800; font-size: 1rem;
  margin-right: .5em; vertical-align: middle;
}

/* ---- breadcrumb (.sep) ---- */
.crumb .sep { color: var(--text-3); margin: 0 .2em; }

/* ---- footer (.ft .ft-in .fbrand .fcol .ft-bot .ft-age) ---- */
.ft { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 3rem; padding-bottom: calc(var(--foot-h) + 1.6rem); }
.ft-in { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 1.6rem; padding: 2.6rem 0 1.6rem; }
.fbrand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.15rem; color: var(--text); margin-bottom: .8rem; }
.fbrand img { height: 36px; width: auto; }
.fbrand span { color: var(--primary); }
.ft h4 { font-size: .92rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: .9rem; }
.fcol ul { list-style: none; padding: 0; margin: 0; }
.fcol li { margin-bottom: .5rem; font-size: .95rem; }
.fcol a { color: var(--text-2); }
.fcol a:hover { color: var(--primary); }
.ft p { font-size: .94rem; color: var(--text-3); }
.ft-about p { max-width: 42ch; }
.ft-bot {
  border-top: 1px solid var(--line); padding: 1.2rem 0;
  display: flex; flex-wrap: wrap; gap: .8rem 1rem;
  justify-content: space-between; align-items: center;
  font-size: .88rem; color: var(--text-3);
}
.ft-bot p { margin: 0; }
.ft-age {
  display: inline-flex; align-items: center; gap: .5em;
  border: 1px solid rgba(255,122,26,.4); color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px; padding: .25em .8em; font-weight: 600; font-size: .85rem;
  margin: 0;
}

/* ---- footer bar (.fbar .fbar-btn .fb-ic) — ปุ่มสมัคร + ทางเข้าเล่น ---- */
.fbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; align-items: stretch; gap: .6rem;
  padding: .5rem clamp(.7rem, 3vw, 1.2rem);
  padding-bottom: max(.5rem, env(safe-area-inset-bottom, 0px));
  background: rgba(9, 13, 24, .96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,122,26,.3);
  box-shadow: 0 -8px 28px rgba(0,0,0,.55);
}
.fbar-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .5em;
  font-family: inherit; font-size: 1rem; font-weight: 800;
  padding: .8em 1em; border-radius: 999px; text-align: center;
  min-height: 46px;
  transition: filter .2s var(--ease), transform .18s var(--ease);
}
.fbar-btn:hover { transform: translateY(-1px); }
.fbar-btn.reg { background: linear-gradient(135deg, var(--primary), var(--gold)); color: #100800; }
.fbar-btn.reg:hover { filter: brightness(1.08); color: #100800; }
.fbar-btn.play { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #04140A; }
.fbar-btn.play:hover { filter: brightness(1.06); color: #04140A; }
.fb-ic { font-size: 1.1em; line-height: 1; }
/* เลื่อนถึงท้ายหน้า: ย่อ/โปร่งลง ไม่ไปกลบ footer */
.fbar.at-end { opacity: .35; transform: translateY(60%); transition: transform .25s var(--ease), opacity .25s var(--ease); }

/* ---- TOC (.toc-h) ---- */
.toc-h { font-size: 1rem; margin-bottom: .6rem; color: var(--text); }

/* ---- responsive ---- */
@media (max-width: 1024px) {
  .lay { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: 1fr 1fr; }
  .side-cta { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .hdr .nav { display: none; }
  .burger { display: block; }
  .hdr .nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--head-h); left: 0; right: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: .8rem 4vw 1.2rem; gap: .2rem;
  }
  .hdr .nav.open a { padding: .7rem .6rem; font-size: 1rem; }
  .hero-in { padding: 1.8rem 0 2.2rem; }
  .side { grid-template-columns: 1fr; }
  .ft-in { grid-template-columns: 1fr; gap: 1.2rem; }
  .fbar { padding: .4rem .6rem; padding-bottom: max(.4rem, env(safe-area-inset-bottom, 0px)); }
  .fbar-btn { font-size: .95rem; min-height: 44px; padding: .7em .8em; }
  .lay { padding-block: 1.6rem; }
}

/* ---- nav active (.on) ---- */
.hdr .nav a.on { color: var(--text); background: var(--surface); font-weight: 600; }

/* ---- CTA band text (.cta-txt) ---- */
.cta-band .cta-txt strong { display: block; font-size: 1.15rem; color: var(--text); margin-bottom: .3rem; }
.cta-band .cta-txt span { display: block; font-size: .95rem; color: var(--text-2); }
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; text-align: left; }
.cta-band .cta-txt { flex: 1 1 260px; }
