/* DBF UP — tiktok.css */
/* ---------- TIKTOK ---------- */
.tk-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 64px;
  align-items: center
}

.tk-phones {
  display: flex;
  gap: 20px;
  justify-content: center;
  perspective: 1200px
}

.phone {
  width: 212px;
  aspect-ratio: 9/19;
  border-radius: 32px;
  flex: none;
  border: 1px solid rgba(98, 229, 161, .3);
  background: linear-gradient(165deg, #122417, #0a130d);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .65);
  overflow: hidden;
  position: relative;
}

.phone.p2 {
  transform: translateY(44px)
}

.phone .notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 62px;
  height: 15px;
  border-radius: 100px;
  background: #040a06;
  z-index: 3
}

.phone .wave {
  position: absolute;
  inset: 0
}

.phone .vid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px
}

.phone .vid::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(4, 10, 6, .85))
}

.phone .cap {
  position: relative;
  font-size: 12px;
  line-height: 1.6;
  color: #fff
}

.phone .cap b {
  color: var(--green-leaf);
  font-weight: 400;
  display: block;
  font-size: 11px;
  margin-bottom: 4px
}

.phone .stats {
  position: relative;
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, .7)
}

.tk-handle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding: 14px 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-inv)
}

.tk-handle .tk-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #000;
  border: 1px solid rgba(98, 229, 161, .35)
}

.tk-handle b {
  font-weight: 400;
  font-size: 15px;
  color: var(--green-leaf)
}

.tk-handle span {
  font-size: 12px;
  color: rgba(250, 253, 249, .55);
  display: block
}

.tk-cta {
  display: flex;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
  justify-content: center
}

.skin-dark .btn-solid {
  background: var(--green);
  box-shadow: 0 16px 40px -14px rgba(20, 168, 98, .6)
}

.skin-dark .btn-solid:hover {
  background: var(--green-leaf);
  color: var(--ink)
}


/* ---------- TikTok Showcase ---------- */
.tk-center {
  max-width: 720px;
  margin: 0 auto;
  text-align: center
}

.tk-center .lede {
  max-width: 600px
}

.tk-center .tk-handle {
  margin-top: 28px
}

.tk-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 540px;
  margin: 26px auto 0;
}

.tk-stat {
  border: 1px solid var(--line-inv);
  border-radius: 18px;
  padding: 16px 12px;
  text-align: center;
  background: rgba(255, 255, 255, .04);
  backdrop-filter: blur(8px);
  transition: .35s var(--ease);
}

.tk-stat:hover {
  transform: translateY(-3px);
  border-color: rgba(98, 229, 161, .45);
  background: rgba(98, 229, 161, .07)
}

.tk-stat b {
  font-size: 26px;
  font-weight: 300;
  color: var(--green-leaf);
  display: block;
  line-height: 1.15
}

.tk-stat span {
  font-size: 11.5px;
  color: rgba(250, 253, 249, .55)
}

.tk-stage {
  /* --tk-w = ความกว้างการ์ด (ใส่เป็นตัวเลขเปล่า ไม่ต้องมีหน่วย)
     อยากได้ใหญ่/เล็กกว่านี้ ปรับเลขนี้ค่าเดียว ทุกอย่างขยายตามหมด
     ทั้งความสูงเวที ความมนขอบ ติ่งจอ ระยะห่างการ์ด และขนาดคลิปที่ฝัง */
  --tk-w: 288;
  position: relative;
  height: calc(2.16px * var(--tk-w));
  margin-top: 44px;
  overflow: hidden;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1500px;
}

/* แท็บเล็ต/มือถือ — คงขนาดเดิมทุกอย่าง ไม่กระทบของที่ใช้อยู่ */
@media (max-width:900px) {
  .tk-stage {
    --tk-w: 236;
    height: 520px;
    perspective: 1400px
  }
}

.tk-carousel {
  position: relative;
  flex: none;
  width: min(880px, 72vw);
  height: 100%;
}

@media (max-width:900px) {
  .tk-carousel {
    width: min(720px, 64vw)
  }
}

.tk-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(1px * var(--tk-w));
  aspect-ratio: 9/17.5;
  border-radius: calc(.144px * var(--tk-w));
  overflow: hidden;
  border: 1px solid rgba(98, 229, 161, .3);
  background: linear-gradient(165deg, #122417, #0a130d);
  box-shadow: 0 46px 100px -34px rgba(0, 0, 0, .75);
  transition: transform .8s var(--ease-apple), opacity .8s, filter .8s;
  cursor: pointer;
  will-change: transform;
}

.tk-card .notch {
  position: absolute;
  top: calc(.047px * var(--tk-w));
  left: 50%;
  transform: translateX(-50%);
  width: calc(.28px * var(--tk-w));
  height: calc(.068px * var(--tk-w));
  border-radius: 100px;
  background: #040a06;
  z-index: 5
}

.tk-card .wave {
  position: absolute;
  inset: 0
}

/* ---------- คลิปจริง + ภาพหน้าปก ----------
   ชั้นล่างสุดคือกรอบคลิป (iframe) ทับด้วยภาพหน้าปก แคปชัน และป้ายมุม
   หน้าปกตั้ง pointer-events:none คลิกจึงทะลุลงไปสั่งเล่นคลิปได้ในทีเดียว
   พอกดปุ๊บ การ์ดได้คลาส .playing → หน้าปกกับแคปชันหลบ เหลือคลิปเต็มกรอบ
   iframe ของ TikTok กว้างขั้นต่ำ ~325px จึงย่อ scale ให้พอดีการ์ด 236px
   (236 / 325 = .7262  →  632 * .7262 = 459 = ความสูงการ์ดพอดี) */
.tk-card .tk-embed {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  background: transparent;
  border-radius: inherit;
}

.tk-card .tk-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 325px;
  height: 632px;
  border: 0;
  transform: scale(calc(var(--tk-w) / 325));
  transform-origin: 0 0;
}

.tk-card .tk-poster {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  animation: tkFade .5s var(--ease) both;
}

/* กดเล่นแล้ว → เหลือแต่คลิป */
.tk-card.playing .tk-poster,
.tk-card.playing .vid,
.tk-card.playing .play,
.tk-card.playing .tk-badge {
  display: none
}

/* ------------------------------------------------------------------ */

/* ---------- หน้าปกจริงจาก TikTok (เพิ่มใหม่) ---------- */
.tk-card img.tk-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: linear-gradient(165deg, #122417, #0a130d);
  animation: tkFade .5s var(--ease) both;
}

@keyframes tkFade {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@media (prefers-reduced-motion:reduce) {
  .tk-card img.tk-cover {
    animation: none
  }
}

/* ---------------------------------------------------------- */

.tk-card .vid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  z-index: 2
}

.tk-card .vid::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 35%, rgba(4, 10, 6, .9))
}

.tk-card .cap {
  position: relative;
  font-size: 12.5px;
  line-height: 1.6;
  color: #fff
}

.tk-card .cap b {
  color: var(--green-leaf);
  font-weight: 400;
  display: block;
  font-size: 11px;
  margin-bottom: 5px
}

.tk-card .stats {
  position: relative;
  display: flex;
  gap: 14px;
  margin-top: 9px;
  font-size: 11px;
  color: rgba(255, 255, 255, .75)
}

.tk-card .play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  z-index: 3;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 19, 13, .42);
  border: 1px solid rgba(255, 255, 255, .5);
  backdrop-filter: blur(8px);
  transition: .4s var(--ease);
  opacity: 0;
  color: #fff;
  font-size: 19px;
}

.tk-card.front .play {
  opacity: 1
}

.tk-card.front:hover .play {
  transform: translate(-50%, -60%) scale(1.12);
  background: var(--green)
}

.tk-card .play svg {
  width: 22px;
  height: 22px;
  color: #fff;
  margin-left: 3px
}

.tk-card .tk-badge {
  position: absolute;
  top: 18px;
  left: 16px;
  z-index: 4;
  font-size: 10px;
  letter-spacing: .08em;
  padding: 4px 11px;
  border-radius: 100px;
  background: rgba(163, 79, 214, .25);
  color: #E4CDFA;
  border: 1px solid rgba(228, 205, 250, .4);
}

.tk-arrow {
  position: relative;
  z-index: 6;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line-inv);
  color: var(--green-leaf);
  backdrop-filter: blur(10px);
  transition: .35s var(--ease);
  margin: 0 4vw;
}

.tk-arrow:hover {
  background: var(--green);
  color: #fff;
  transform: scale(1.1)
}

.tk-arrow svg {
  width: 22px;
  height: 22px
}

.tk-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 22px
}

.tk-dot {
  width: 8px;
  height: 8px;
  border-radius: 100px;
  background: rgba(98, 229, 161, .25);
  transition: .4s var(--ease);
  cursor: pointer
}

.tk-dot.on {
  width: 30px;
  background: var(--green-leaf)
}

.tk-marquee {
  overflow: hidden;
  margin: 38px 0 8px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent)
}

.tk-mtrack {
  display: inline-flex;
  gap: 16px;
  white-space: nowrap;
  animation: tick 30s linear infinite
}

.tk-mtrack span {
  font-size: 12.5px;
  padding: 8px 18px;
  border-radius: 100px;
  flex: none;
  border: 1px solid var(--line-inv);
  color: rgba(250, 253, 249, .7);
  background: rgba(255, 255, 255, .03);
}

.tk-marquee:hover .tk-mtrack {
  animation-play-state: paused
}


/* ---------- ลำดับชั้นของการ์ดที่ฝังคลิป (ต้องอยู่ท้ายไฟล์ ไม่งั้นโดนกฎด้านบนทับ) ----------
   กรอบคลิป 2 · หน้าปก 3 · แคปชัน 5 · ติ่งจอ/ป้าย/ปุ่มเล่น 6 */
.tk-card.has-embed .vid {
  z-index: 5
}

.tk-card.has-embed .notch,
.tk-card.has-embed .tk-badge,
.tk-card.has-embed .play {
  z-index: 6
}