@font-face {
    font-family: myfont;
    src: url('font/ff.ttf');
}
*{
    font-family: myfont;
}
 /* ————— GLOBAL STYLES ————— */
 body {
    background: radial-gradient(circle at center, #4a0000 0%, #000000 100%);
    color: #fff;
    font-family: 'Kanit', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.main-container {
    max-width: 480px; /* ขนาดเหมือนแอปมือถือ */
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* ————— ADVERTISING SPACES (พื้นที่โฆษณา) ————— */
.ad-banner {
    width: 100%;
    height: 100px; /* ปรับความสูงตามต้องการ */
    background-color: #1a1a1a;
    border: 1px dashed #444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.ad-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ————— HEADER ————— */
.header-logo {
    text-align: center;
    margin-bottom: 20px;
}
.header-logo img {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    animation: float 3s ease-in-out infinite;
}
h1 {
    font-size: 1.5rem;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin: 10px 0;
    text-align: center;
}

/* ————— LIVE BOX (รองรับ Smooth Transition) ————— */
#live-stream-area {
    background: #000;
    border-radius: 12px;
    border: 2px solid #FFD700;
    padding: 5px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    margin-bottom: 20px;
}

/* Container สำหรับ JS Smooth Transition */
#video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #000;
    overflow: hidden;
    border-radius: 8px;
}

/* Class สำหรับ JS เพื่อทำ Cross-fade */
.media-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
}
.media-item.active {
    opacity: 1;
    z-index: 2;
}

/* ————— COUNTDOWN & RESULT ————— */
.card-box {
    background: linear-gradient(145deg, #2b0a0a, #1a0505);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 215, 0, 0.2);
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.countdown {
    font-size: 2.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px #ff0000;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums; /* ตัวเลขไม่กระโดด */
}

.result-circle {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 30% 30%, #FFD700, #B8860B);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px auto;
    font-size: 4rem;
    font-weight: bold;
    color: #3e0000;
    box-shadow: inset -5px -5px 10px rgba(0,0,0,0.3), 0 0 20px rgba(255, 215, 0, 0.5);
    border: 4px solid #fff;
}

/* ————— TABLE ————— */
.history-title {
    color: #FFD700;
    border-left: 4px solid #FFD700;
    padding-left: 10px;
    margin-bottom: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    overflow: hidden;
}
th {
    background: #3e0000;
    color: #FFD700;
    padding: 12px;
    font-weight: 600;
}
td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}
tr:last-child td { border-bottom: none; }

/* Badge สำหรับผลรางวัลในตาราง */
.result-badge {
    background: #FFD700;
    color: #000;
    padding: 2px 10px;
    border-radius: 15px;
    font-weight: bold;
}

/* Helper Classes */
.hidden { display: none !important; }
.text-live { color: #ff3b3b; animation: blink 1s infinite; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes blink { 50% { opacity: 0.5; } }
/* Bottom Nav */
.bottom-nav {
    background-color: #330000;
    padding: 10px 0 15px 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    text-align: center;

    position: fixed; /* ทำให้ตำแหน่งถูกตรึงอยู่กับ Viewport */
    bottom: 0;      /* ตรึงไว้ที่ขอบล่าง */
    left: 0;        /* ตรึงไว้ที่ขอบซ้าย */
    width: 100%;    /* ขยายเต็มความกว้าง */
    z-index: 1000;  /* ให้อยู่เหนือองค์ประกอบอื่น ๆ ทั้งหมด */
    
    /* เพิ่มเงาเพื่อให้ดูแยกออกจากเนื้อหา */
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.7);
    
}
.nav-item {
    flex-direction: column;
    display: flex;
    text-decoration: none;
    color: #ccc;
    font-size: 1em;
}

.nav-item span {
    font-size: 0.7em;
}
/* ปุ่มที่ใช้งานอยู่ (Active) */
.nav-item.active { 
    color: #FFD700; /* ทองคำ */
    text-shadow: 0 0 5px #FFD700; /* เพิ่มแสงเรือง */
}
/* Effect เมื่อแตะ/วางเมาส์ */
.nav-item:hover {
    color: #f7a700; /* สีส้มทองเมื่อ Hover */
}
.nav-item.active { color: #FFD700; }