/* รีเซ็ตค่าพื้นฐาน + กันสกอลล์บาร์ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
/* สีพื้นเข้มสำรอง (กลางคืนทะเล) ใส่ที่ html อย่างเดียว (อยู่หลังสุด ไม่บังวิดีโอ) */
html { background: #061826; }

/* ── วิดีโอเต็มจอ ── */
#bg {
  position: fixed;
  inset: 0;                       /* top/right/bottom/left = 0 → ติดขอบทุกด้าน */
  width: 100%;
  height: 100%;
  object-fit: cover;              /* ขยายเต็มจอ ตัดส่วนเกินทิ้ง ไม่บีบภาพ ไม่มีขอบดำ */
  z-index: 0;                     /* อยู่หลังสุด แต่ไม่ติดลบ (กัน body bg มาทับ) */
}

/* ── เงาขอบจางๆ (optional) ── */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 38%, transparent 56%, rgba(0,0,0,.38) 100%);
}

/* ── ชั้นประกายดาว ── */
#stars {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;               /* อยู่เหนือวิดีโอ แต่ใต้ช่องค้นหา */
}

/* ประกายดาวเล็กๆ แวบๆ — จุดสว่างมีแสงฟุ้งนิดๆ กระพริบเข้า/ออกอยู่กับที่ */
.spark {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 1px rgba(255,255,255,.9), 0 0 10px 2px rgba(150,200,255,.55);
  opacity: 0;
  will-change: transform, opacity;   /* GPU ลื่น ไม่กวนวิดีโอ */
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: 0;   transform: scale(.4); }
  50%      { opacity: var(--max, .95); transform: scale(1); }
}

/* ดาวตกเล็กๆ นานๆ ที — เส้นแสงสั้นวิ่งเฉียงลงแล้วจางหาย */
.shoot {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 2px rgba(255,255,255,.9);
  opacity: 0;
  will-change: transform, opacity;
}
.shoot::after {
  content: "";
  position: absolute;
  right: 1px; top: 50%;
  width: 70px; height: 1.5px;
  transform: translateY(-50%);
  background: linear-gradient(to left, rgba(255,255,255,.85), transparent);
}
@keyframes shootMove {
  0%   { opacity: 0;   transform: translate(0,0) rotate(28deg) scale(1); }
  10%  { opacity: 1; }
  100% { opacity: 0;   transform: translate(240px,128px) rotate(28deg) scale(1); }
}

/* ── ช่องค้นหา Google ── */
.ggl {
  position: fixed;
  top: 23%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;                 /* เหนือวิดีโอ+ดาว */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  width: 90%;
}
.glogo {
  font-size: 72px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 0 3px 16px rgba(0,0,0,.55);
}
.search {
  width: min(560px, 80%);
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 40px;
  padding: 15px 26px;
  box-shadow: 0 10px 34px rgba(0,0,0,.32);
}
.search svg { width: 24px; height: 24px; flex: none; }
.search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 19px;
  color: #222;
  margin-left: 14px;
}
.search input::placeholder { color: #777; }
