* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: #fff8f6;
    color: #33262a;
    font-family: "Noto Sans Lao", "Phetsarath OT", Arial, sans-serif;
    font-size: 14px;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font-family: inherit; }

.site-container {
    width: 1200px;
    max-width: calc(100% - 28px);
    margin: 0 auto;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid #eadfe0;
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-flag { width: 43px; height: 43px; }
.brand-flag svg { width: 100%; height: 100%; }

.brand-copy {
    display: flex;
    flex-direction: column;
}

.brand-copy strong {
    color: #760018;
    font-family: Arial, sans-serif;
    font-size: 18px;
}

.brand-copy small {
    margin-top: 3px;
    color: #998d90;
    font-size: 9px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #29ad6a;
    box-shadow: 0 0 0 5px rgba(41, 173, 106, .13);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    50% { box-shadow: 0 0 0 10px rgba(41, 173, 106, 0); }
}

.header-status div {
    display: flex;
    flex-direction: column;
}

.header-status strong { font-size: 12px; }
.header-status small { margin-top: 2px; color: #999; font-size: 9px; }

.main-nav { background: linear-gradient(90deg, #610013, #8a0923, #610013); }

.nav-links {
    min-height: 51px;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.nav-links a {
    min-height: 51px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.09); }

.mobile-menu-button {
    display: none;
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 0;
    background: #6b0017;
    color: #fff;
    text-align: left;
    font-weight: 700;
}

.hero-section { padding: 16px 0 28px; }

.hero-banner img {
    width: 100%;
    height: auto;
}

.main-grid {
    display: grid;
    grid-template-columns: 265px minmax(0, 560px) 270px;
    gap: 22px;
    align-items: start;
    padding-bottom: 55px;
}

.left-sidebar, .center-column, .right-sidebar { min-width: 0; }

.ad-card {
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 8px;
}

.ad-card img {
    width: 100%;
    height: auto;
}

.custom-container {
    overflow: hidden;
    border: 1px solid #eadedf;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(103, 0, 23, .07);
}

.custom-header {
    min-height: 99px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 4px solid #dc9c35;
    background: linear-gradient(110deg, #620014, #8a0a24);
    color: #fff;
}

.custom-flag {
    width: 49px;
    height: 49px;
    flex-shrink: 0;
}

.custom-title-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.custom-title-block strong {
    font-size: 15px;
    line-height: 1.4;
}

.custom-title-block span {
    color: #eadce0;
    font-size: 10px;
}

.custom-body {
    padding: 26px 22px 28px;
    background: linear-gradient(#fff8f8, #fff);
}

.custom-section-title {
    margin-bottom: 19px;
    color: #a26c78;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
}

.custom-numbers {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.custom-numbers > div {
    width: 51px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2a28f;
    border-radius: 9px;
    background: #fff;
    color: #760018;
    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(100, 0, 23, .06);
}

.result-status {
    margin-bottom: 19px;
    color: #a29398;
    text-align: center;
    font-size: 9px;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.custom-table thead th {
    height: 48px;
    padding: 9px 17px;
    background: #650016;
    color: #fff;
    font-size: 10px;
    text-align: center;
}

.custom-table tbody td {
    height: 57px;
    padding: 9px 18px;
    border-bottom: 1px solid #eee6e8;
    text-align: center;
    font-size: 11px;
}

.custom-table tbody td:first-child {
    color: #755e66;
    font-weight: 600;
}

.custom-table tbody td:last-child {
    color: #2d3443;
    font-family: Arial, sans-serif;
    font-weight: 700;
}

.highlight-prize {
    color: #d43d57 !important;
    font-size: 14px !important;
}

.info-row {
    margin: 20px 0;
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px;
}

.info-row article {
    min-height: 72px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e8dddf;
    border-radius: 10px;
    background: #fff;
}

.info-row article > span {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff0f3;
    color: #7d001c;
    font-family: Arial, sans-serif;
}

.info-row article div {
    display: flex;
    flex-direction: column;
}

.info-row small { color: #a09699; font-size: 8px; }

.info-row strong {
    margin-top: 3px;
    color: #650017;
    font-family: Arial, sans-serif;
    font-size: 11px;
}

#history-container {
    padding: 22px 23px 27px;
    border: 1px solid #eadedf;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 7px 24px rgba(78,0,18,.05);
}

.history-heading {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.history-heading span {
    color: #b5707e;
    font-family: Arial, sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
}

.history-heading h2 {
    margin: 4px 0 0;
    color: #630016;
    font-size: 15px;
}

.history-badge {
    padding: 6px 10px;
    border-radius: 50px;
    background: #fff0f3;
    color: #7a001b;
    font-size: 9px;
}

.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e1d4d7;
    border-radius: 9px;
}

#history-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    table-layout: fixed;
}

#history-table thead th {
    height: 52px;
    padding: 9px 7px;
    background: #680017;
    color: #fff;
    font-size: 10px;
}

#history-table tbody td {
    height: 54px;
    padding: 8px 6px;
    border-right: 1px solid #e8dfe1;
    border-bottom: 1px solid #eee6e8;
    color: #363e4d;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 10px;
}

#history-table tbody tr:nth-child(even) { background: #fffafb; }

#history-table tbody td:first-child {
    color: #640017;
    font-weight: 700;
}

#history-table tbody td:nth-child(2) {
    color: #df3c57;
    font-weight: 800;
}

.history-loading {
    min-height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.loader {
    width: 19px;
    height: 19px;
    border: 3px solid #eee;
    border-top-color: #7a001b;
    border-radius: 50%;
    animation: loaderSpin .8s linear infinite;
}

@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}

.schedule-card {
    margin-bottom: 20px;
    padding: 17px;
    border: 1px solid #e1c6cc;
    border-radius: 10px;
    background: #fff;
}

.schedule-card h3 {
    margin: 0 0 11px;
    color: #650016;
    font-size: 13px;
}

.schedule-card div {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee6e8;
}

.schedule-card div:last-child { border-bottom: 0; }
.schedule-card span { color: #695b60; font-size: 9px; }

.schedule-card strong {
    padding: 4px 7px;
    border-radius: 5px;
    background: #fff0f3;
    color: #78001b;
    font-family: Arial, sans-serif;
    font-size: 9px;
}

.news-section {
    padding: 48px 0;
    background: #fff;
}

.news-heading { margin-bottom: 23px; }

.news-heading span {
    color: #bc6e7d;
    font-family: Arial, sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
}

.news-heading h2 {
    margin: 4px 0 0;
    color: #630016;
    font-size: 22px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 18px;
}

.news-card {
    padding: 20px;
    border: 1px solid #eadfe1;
    border-radius: 10px;
    background: linear-gradient(#fff, #fff9fa);
}

.news-number {
    width: 39px;
    height: 39px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #6c0018;
    color: #fff;
    font-family: Arial, sans-serif;
    font-weight: 700;
}

.news-card h3 {
    margin: 14px 0 7px;
    color: #650016;
    font-size: 13px;
}

.news-card p {
    margin: 0;
    color: #8c7e82;
    font-size: 10px;
    line-height: 1.7;
}

.bottom-banner {
    padding: 28px 0;
    background: #f7eeee;
}

.bottom-banner img {
    width: 100%;
    height: auto;
}

.site-footer {
    min-height: 80px;
    background: #490010;
    color: #dbc2c8;
}

.footer-inner {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 9px;
}

@media (max-width: 1000px) {
    .main-grid { grid-template-columns: 220px minmax(0,1fr) 220px; gap: 14px; }
    .nav-links a { padding: 0 18px; }
}

@media (max-width: 820px) {
    .mobile-menu-button { display: block; }
    .nav-links { display: none; flex-direction: column; }
    .nav-links.active { display: flex; }
    .nav-links a { min-height: 44px; justify-content: flex-start; border-top: 1px solid rgba(255,255,255,.08); }
    .main-grid { grid-template-columns: 1fr 1fr; }
    .left-sidebar { display: none; }
}

@media (max-width: 650px) {
    .site-container { max-width: calc(100% - 12px); }
    .header-status { display: none; }
    .hero-section { padding: 10px 0 16px; }
    .main-grid { display: block; }
    .center-column { margin-bottom: 20px; }
    .right-sidebar { max-width: 500px; margin: auto; }
    .custom-container { border-radius: 11px; }
    .custom-header { min-height: 82px; padding: 13px; }
    .custom-flag { width: 40px; height: 40px; }
    .custom-title-block strong { font-size: 12px; }
    .custom-body { padding: 18px 10px; }
    .custom-numbers { gap: 5px; }
    .custom-numbers > div { width: 45px; height: 50px; font-size: 20px; }
    .info-row { grid-template-columns: 1fr; }
    #history-container { padding: 15px 8px; }
    .news-grid { display: block; }
    .news-card { margin-bottom: 12px; }
}