/* ==========================================================
   MUIN777 Premium Skin  —  โหลดต่อจาก <style> เดิม
   วิธีใช้: ใส่ใน <head> หลังปิด </style>
   <link rel="stylesheet" href="muin-premium.css?v=1">
   ไม่แก้ PHP / ไม่แก้โครงสร้าง HTML
   ========================================================== */

:root {
  --gold-1: #fff3b0;
  --gold-2: #ffd35a;
  --gold-3: #e8a712;
  --gold-4: #9a6408;
  --ruby-1: #e0152b;
  --ruby-2: #a30d18;
  --ruby-3: #5c060d;
  --ruby-4: #2e0307;
}

/* ---------- พื้นหลังเว็บ: ลายประกาย + แสงเรืองด้านบน ---------- */
body {
  background:
    radial-gradient(1200px 500px at 50% -120px, #b8121f66, transparent 70%),
    radial-gradient(circle at 12% 30%, #ffd35a14 0 2px, transparent 3px) 0 0 / 90px 90px,
    radial-gradient(circle at 70% 70%, #ffd35a10 0 1.5px, transparent 2.5px) 0 0 / 130px 130px,
    linear-gradient(180deg, #4a0710, #2e0307 60%, #240205);
  background-attachment: fixed;
}

/* ---------- แถบเมนูบน ---------- */
.navbar {
  background: linear-gradient(110deg, #c98a05, #ffe98a 40%, #ffd35a 60%, #e8a712);
  border: 2px solid #fff0a8;
  box-shadow: 0 8px 30px #00000066, inset 0 1px 0 #fff9;
  position: relative;
}
.navbar::after {            /* เงาแสงวิ่งผ่าน */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 35%, #ffffff66 50%, transparent 65%);
  transform: translateX(-120%);
  animation: shine 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shine { 0%,55% { transform: translateX(-120%) } 100% { transform: translateX(120%) } }

.navlinks {
  align-items: center;       /* แก้เมนูที่ติดขอบบนในภาพหน้าจอ */
  background: linear-gradient(180deg, #4a070d, #2c0307);
  border: 1px solid #e8b93f;
  box-shadow: inset 0 0 18px #00000088;
}
.navlinks a {
  position: relative;
  padding: 6px 2px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: color .2s;
}
.navlinks a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
  transform: scaleX(0); transition: transform .25s;
}
.navlinks a:hover::after { transform: scaleX(1); }

/* ---------- ปุ่มสมัคร / เข้าสู่ระบบ ---------- */
.top-actions a {
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.top-actions a:hover { transform: translateY(-2px); filter: brightness(1.1); }
.top-register {
  animation: pulseRuby 2.2s ease-in-out infinite;
}
@keyframes pulseRuby {
  0%,100% { box-shadow: 0 0 0 0 #ff4d6a99, 0 3px 10px #3c061833 }
  50%     { box-shadow: 0 0 0 9px #ff4d6a00, 0 3px 16px #ff2d4a88 }
}

/* ---------- ticker วิ่งข่าว ---------- */
.ticker {
  background: linear-gradient(90deg, #7a000c, #c1081c 50%, #7a000c);
  border-color: #ffe27a;
  letter-spacing: .02em;
  text-shadow: 0 1px 2px #0008;
}

/* ---------- HERO ---------- */
.hero {
  min-height: 360px;
  border: 2px solid #ffe27a;
  box-shadow: 0 20px 60px #00000080, 0 0 0 4px #ffd35a22, inset 0 0 80px #0006;
}
.hero::before {              /* ประกายทองลอยในแบนเนอร์ */
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(circle at 20% 80%, #ffd35a55 0 2px, transparent 3px) 0 0 / 120px 120px,
    radial-gradient(circle at 60% 30%, #fff3b077 0 1.5px, transparent 2.5px) 0 0 / 170px 170px;
  animation: twinkle 4s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes twinkle { from { opacity: .35 } to { opacity: 1 } }

.hero .eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid #ffd35a88;
  border-radius: 99px;
  background: #00000040;
  backdrop-filter: blur(4px);
}
.hero-copy h1 {
  background: linear-gradient(180deg, var(--gold-1) 10%, var(--gold-2) 55%, var(--gold-3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 3px 0 #5c060d) drop-shadow(0 8px 18px #000a);
}
.hero-links a {
  padding: 13px 24px;
  font-size: 14px;
  border-radius: 10px;
  transition: transform .15s, filter .15s;
}
.hero-links a:hover { transform: translateY(-3px); filter: brightness(1.12); }
.hero-links .primary-link {
  animation: pulseBlue 2.4s ease-in-out infinite;
}
@keyframes pulseBlue {
  0%,100% { box-shadow: 0 0 0 0 #4aa0ff88, 0 2px 12px #09295c80 }
  50%     { box-shadow: 0 0 0 10px #4aa0ff00, 0 4px 22px #2c80e8aa }
}

/* ---------- หัวข้อ section ---------- */
.section {
  border-radius: 18px;
  box-shadow: 0 14px 40px #00000050;
}
.section-heading {
  position: relative;
  border-bottom: 0;
  padding-bottom: 18px;
}
.section-heading::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold-2), #ffd35a00 85%);
}
.section-heading h2 { font-size: 26px; letter-spacing: .01em; }
.results-section .section-heading h2 {
  background: linear-gradient(180deg, #fff, var(--gold-1));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* จุด LIVE กระพริบ */
.results-section .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: #ffe27a; font-size: 12px;
}
.results-section .eyebrow::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: #3dff8b;
  box-shadow: 0 0 0 0 #3dff8bbb;
  animation: livedot 1.6s infinite;
}
@keyframes livedot {
  0%   { box-shadow: 0 0 0 0 #3dff8bbb }
  70%  { box-shadow: 0 0 0 10px #3dff8b00 }
  100% { box-shadow: 0 0 0 0 #3dff8b00 }
}

/* ---------- ปุ่มกรองหมวด ---------- */
.results-section .filter {
  padding: 9px 16px;
  font-weight: 600;
  background: linear-gradient(180deg, #8d0c17, #5c060d);
  border: 1px solid #d9a63a;
  transition: transform .15s, box-shadow .15s;
}
.results-section .filter:hover { transform: translateY(-2px); }
.results-section .filter.active,
.results-section .filter:hover {
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 50%, var(--gold-3));
  color: #5c060d;
  border-color: #fff0a8;
  box-shadow: 0 0 14px #ffd35a88;
}

/* ---------- การ์ดผลหวยแต่ละประเภท ---------- */
.results-section .lottery-group {
  border: 1.5px solid #e8b93f;
  border-radius: 14px;
  background: linear-gradient(180deg, #7a0912, #4d060c);
  box-shadow: 0 8px 24px #00000055, inset 0 1px 0 #ffffff1a;
  transition: transform .2s, box-shadow .2s;
}
.results-section .lottery-group:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px #00000077, 0 0 0 1px #ffd35a66;
}
.results-section .group-head {
  position: relative;
  padding: 14px 18px;
  background: linear-gradient(100deg, #2c0307, #6a0a12 60%, #3d0509);
  border-bottom: 1px solid #e8b93f88;
}
.results-section .group-head::before {   /* แถบทองซ้ายมือ */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-3));
}
.results-section .group-head h3 {
  font-size: 17px;
  color: var(--gold-1);
  text-shadow: 0 1px 6px #000a;
}
.results-section .group-head > span:first-child { color: var(--gold-2); }
.results-section .date {
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  color: #5c060d;
  padding: 4px 11px;
  border-radius: 99px;
  box-shadow: 0 2px 6px #0005;
}

/* ---------- ตารางผล (โทนเข้ม อ่านง่าย) ---------- */
.results-section .table-scroll { padding: 14px; }
.results-section .results-table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #e8b93f66;
}
.results-section .results-table th {
  background: linear-gradient(180deg, #ffe8a0, #f3c86a);
  color: #5c060d;
  font-weight: 800;
  border: 0;
  border-right: 1px solid #fff6;
  padding: 11px 10px;
}
.results-section .results-table td {
  background: #fff9ec;
  color: #3a1318;
  border: 0;
  border-top: 1px solid #f0d9a0;
  border-right: 1px solid #f0d9a0;
  padding: 12px 10px;
}
.results-section .results-table tbody tr:nth-child(even) td { background: #fff1d2; }
.results-section .results-table tbody tr:hover td { background: #ffe6a8; }

/* ---------- ตัวเลข = ลูกบอลหวย ---------- */
body .results-section .number-chip {
  min-width: 46px;
  height: 46px;
  margin: 3px;
  padding: 0 8px;
  border-radius: 999px;
  border: 2px solid #fff3b0;
  background: radial-gradient(circle at 32% 28%, #fff 0, #fff6d6 35%, #ffd35a 100%);
  color: #5c060d;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  align-items: center;
  box-shadow: 0 3px 0 #b87a0a, 0 6px 10px #0004, inset 0 -3px 5px #e8a71266;
  transition: transform .15s;
}
body .results-section .number-chip:hover { transform: translateY(-3px) scale(1.06); }

/* รางวัลที่ 1 (รัฐบาล) = ลูกบอลแดงใหญ่ */
body .results-section .government .results-table td:nth-child(2) .number-chip {
  min-width: 118px;
  height: 56px;
  font-size: 26px;
  letter-spacing: .12em;
  color: #fff;
  border-color: #ffe27a;
  background: radial-gradient(circle at 30% 25%, #ff7a86 0, #e0152b 45%, #8e0a15 100%);
  text-shadow: 0 2px 4px #0008;
  box-shadow: 0 4px 0 #5c060d, 0 0 20px #ff2d4a66, inset 0 -4px 8px #0004;
}

/* ยังไม่ประกาศผล: ลูกบอลจางๆ กระพริบเบาๆ */
body .results-section .number-chip.pending {
  background: repeating-linear-gradient(45deg, #fff7e8, #fff7e8 6px, #ffecc4 6px, #ffecc4 12px);
  color: #a9792f;
  border: 2px dashed #e0b45a;
  box-shadow: none;
  animation: waiting 1.6s ease-in-out infinite;
}
@keyframes waiting { 50% { opacity: .55 } }
body .results-section .number-chip.empty {
  background: #fff3dc; color: #a98e66; font-size: 13px; font-weight: 500;
  box-shadow: none; border-style: dashed;
}

.notice {
  background: #ffe9b8;
  color: #6b4208;
  border-left: 4px solid var(--gold-3);
}

/* ---------- การ์ดเกม ---------- */
.games-section .game-card {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  border: 1.5px solid #e8b93f;
  background: linear-gradient(145deg, #fff, #fff2cf);
  transition: transform .2s, box-shadow .2s;
}
.games-section .game-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 40%, #ffffffaa 50%, transparent 60%);
  transform: translateX(-130%);
  transition: transform .6s;
}
.games-section .game-card:hover { transform: translateY(-5px); box-shadow: 0 16px 30px #5c060d44, 0 0 0 2px #ffd35a; }
.games-section .game-card:hover::after { transform: translateX(130%); }
.games-section .game-icon {
  width: 54px; height: 54px; font-size: 26px; border-radius: 14px;
  background: radial-gradient(circle at 30% 25%, #e0152b, #7a0912 70%);
  box-shadow: 0 4px 0 #4a060c, 0 0 14px #ff2d4a55;
}
.games-section .game-card b { font-size: 16px; color: #6b0a13; }

/* ---------- โปรโมชั่น + บทความ ---------- */
.promo-section .promo-row img { box-shadow: 0 8px 20px #5c060d33; }
.promo-section .promo-link,
.updates-section .promo-link {
  background: linear-gradient(180deg, #e0152b, #9a0a17);
  border: 1px solid #ffd35a;
  box-shadow: 0 3px 0 #5c060d;
  transition: transform .15s;
}
.promo-section .promo-link:hover,
.updates-section .promo-link:hover { transform: translateY(-2px); }

.updates-section .story-card {
  border-top: 3px solid var(--gold-3);
  transition: transform .2s, box-shadow .2s;
}
.updates-section .story-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px #5c060d22; }

/* ---------- มือถือ ---------- */
@media (max-width: 600px) {
  .hero { min-height: 0; }
  .section-heading h2 { font-size: 21px; }
  body .results-section .number-chip { min-width: 38px; height: 38px; font-size: 15px; }
  body .results-section .government .results-table td:nth-child(2) .number-chip {
    min-width: 96px; height: 46px; font-size: 21px;
  }
  .results-section .results-table td { padding: 8px 4px; }
  .results-section .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
  .results-section .filters::-webkit-scrollbar { display: none; }
  .results-section .filter { flex: none; }
}

/* ผู้ใช้ที่ตั้งค่าลดแอนิเมชัน */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}