/*! © 2026 Đại lý vé số Hữu (Vé Số Hữu) – 539 Âu Cơ, phường Tân Phú, TP.HCM.
 * Mã nguồn và giao diện website thuộc bản quyền của Đại lý vé số Hữu. Không sao chép, sử dụng lại
 * khi chưa được đồng ý bằng văn bản. */
:root {
  --red: #c4161c;
  --red-dark: #9a0f14;
  --yellow: #ffd200;
  --bg: #f3f3f3;
  --line: #d9d9d9;
  --text: #222;
  --muted: #666;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 12px; }

.top { background: var(--red); color: #fff; }
.top-inner { display: flex; justify-content: space-between; align-items: center; padding: 14px 12px; flex-wrap: wrap; gap: 8px; }
/* Độ đậm 700 (bản Bold có sẵn của Arial): 800 làm trình duyệt mượn font khác cho chữ có dấu chồng (Ố, Ữ) */
.logo { font-size: 26px; font-weight: 700; letter-spacing: 1px; }
.logo span { color: var(--yellow); }
.today { font-size: 14px; opacity: .9; }
.menu { background: var(--red-dark); }
.menu .wrap { display: flex; overflow-x: auto; }
.menu a { padding: 11px 16px; font-weight: 700; white-space: nowrap; }
.menu a:hover, .menu a.active { background: var(--yellow); color: var(--red-dark); }
/* Nút "☰ Khác": chỉ hiện trên điện thoại (xem @media 760px) */
.menu-toggle { display: none; padding: 11px 16px; border: 0; border-radius: 0; background: none; color: #fff;
               font: inherit; font-weight: 700; white-space: nowrap; cursor: pointer; }
.menu-toggle:hover { background: var(--yellow); color: var(--red-dark); }

/* Trang thông tin (/lich-mo-thuong, /dia-chi): không có bảng kết quả, ẩn khung trùng nội dung */
body[data-page] #results, body.page-lich #lich, body.page-dia-chi #dia-chi { display: none; }
.page-intro h2.sub { margin: 18px 0 8px; font-size: 18px; color: var(--red-dark); }
.page-intro .note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.today-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.today-links .btn { flex: 1 1 200px; padding: 12px; font-size: 16px; text-align: center; }
/* Trang /doi-ve-so-trung: chữ to cho người lớn tuổi, 6 ô lý do, công cụ tính tiền thực nhận, câu hỏi bấm mở */
.doi-so { font-size: 16px; line-height: 1.55; }
.doi-so .lead { font-size: 18px; }
.doi-so ul, .doi-so ol { padding-left: 22px; }
.doi-so li { margin-bottom: 6px; }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.why { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fffdf2; }
.why b { color: var(--red-dark); font-size: 17px; }
.why span { font-size: 15px; }
.why .why-icon { font-size: 22px; }
.faq details { border: 1px solid var(--line); border-radius: 4px; margin-bottom: 8px; background: #fff; }
.faq summary { padding: 10px 12px; font-weight: 700; cursor: pointer; }
.faq details p { margin: 0; padding: 0 12px 12px; }
/* Nút trực tiếp từng miền (trên bảng kết quả): nút đang xem tô đỏ; miền đang xổ hiện "● Đang xổ" nhấp nháy */
.live-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.live-bar a { display: flex; flex-direction: column; align-items: center; padding: 7px 4px; border: 2px solid var(--red);
              border-radius: 6px; background: #fff; color: var(--red-dark); text-align: center; line-height: 1.25; }
.live-bar a:hover { background: #fbe9e9; }
.live-bar .lb { font-size: 13px; color: #444; }
.live-bar b { font-size: 16px; }
.live-bar .t { font-size: 13px; }
.live-bar a.current { background: var(--red); color: #fff; }
.live-bar a.current .lb { color: #fff; }
.live-bar a.on-air .t { color: var(--red); font-weight: 700; animation: on-air 1.2s infinite; }
.live-bar a.current.on-air .t { color: var(--yellow); }
@keyframes on-air { 50% { opacity: .35; } }
body[data-page] .live-bar { display: none; }
/* Mất kết nối: dòng báo trên bảng (bảng cũ vẫn giữ) */
.net-note { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #e0b4b4; border-radius: 4px; background: #fdeeee;
            color: var(--red-dark); font-size: 16px; font-weight: 700; text-align: center; }
/* Ô chờ số (đang xổ / 15 phút trước giờ xổ): mỗi chữ số một vòng xoay nhỏ, cỡ theo cỡ chữ số của bảng */
.kq .num.pend { display: flex; justify-content: center; gap: .14em; padding: .32em 0; }
.kq .num.pend .sd { width: .5em; height: .5em; border: max(2px, .08em) solid #e2e2e2; border-top-color: var(--red);
                    border-radius: 50%; animation: spin .8s linear infinite; }
/* Số vừa ra: từng chữ số bật ra trong viên bi vàng (bầu dục, hẹp để 6 chữ số giải ĐB vẫn vừa cột) */
/* Ô đang quay: chữ số chạy liên tục trên nền vàng nhạt, nhìn khác hẳn số đã xổ */
.kq .num.pend.rolling { gap: 0; padding: 0; width: fit-content; margin: 0 auto; border-radius: 4px; background: #fff3c4; }
.kq .num.rolling .rd { width: .62em; color: #b98900; font-style: normal; text-align: center; font-variant-numeric: tabular-nums; }
.kq .num.balls { display: flex; justify-content: center; gap: .04em; }
.kq .num.balls .ball { display: inline-flex; align-items: center; justify-content: center; width: .66em; height: 1.12em;
                       font-size: .92em; border-radius: 50%; background: #ffe680; color: var(--red);
                       animation: ball-in .35s ease-out both; }
@keyframes ball-in { 0% { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
/* Máy bật "giảm chuyển động": bi hiện ngay không bật nảy, vòng xoay chậm lại */
@media (prefers-reduced-motion: reduce) {
  .kq .num.balls .ball { animation: none; }
  .kq .num.pend .sd { animation-duration: 2.4s; }
}
.pending-note.soon { background: #fdeeee; border-color: #e0b4b4; color: var(--red); }
.pending-note .countdown { font-size: 1.25em; font-variant-numeric: tabular-nums; }
/* Hôm nay chưa đến giờ mở thưởng: dòng báo phía trên bảng trống */
.pending-note { margin: 0 0 10px; padding: 10px 12px; border: 1px solid #f0d36b; border-radius: 4px; background: #fff8d6;
                color: var(--red-dark); font-size: 18px; font-weight: 700; text-align: center; }
/* Ngày trước / ngày sau dưới bảng kết quả */
.day-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.day-nav a { padding: 9px 14px; border: 1px solid var(--red); border-radius: 4px; color: var(--red); font-weight: 700; font-size: 15px; }
.day-nav a:hover { background: #fbe9e9; }
.day-nav .next { margin-left: auto; }
/* Tên đài trên bảng kết quả / lịch là link sang trang đài */
.kq th a, .schedule td a { color: inherit; text-decoration: underline; text-decoration-color: rgba(0, 0, 0, .25); }
.kq th a:hover, .schedule td a:hover { color: var(--red); }
/* Trang từng đài và danh sách đài */
.station-past td, .station-past th { text-align: center; }
.station-past td.st-db { font-size: 22px; font-weight: 700; color: var(--red); letter-spacing: 1px; }
.station-past td a { color: var(--red); font-weight: 700; }
.station-list a { color: var(--red); text-decoration: underline; line-height: 1.9; }
.station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.station-grid li { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; }
.station-grid a { color: var(--red); font-weight: 700; font-size: 16px; }
.station-grid span { font-size: 14px; color: var(--muted); }
.more-link { margin: 10px 0 0; text-align: right; font-size: 15px; }
.more-link a { color: var(--red); font-weight: 700; text-decoration: underline; }

.layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; padding-top: 16px; padding-bottom: 24px; }
/* min-width 0: bảng quá rộng thì cuộn trong khung .scroll, không đẩy vỡ lưới bố cục */
.content, .side { min-width: 0; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 12px; margin-bottom: 16px; }
.box h3 { margin: 0 0 10px; font-size: 15px; color: var(--red); border-bottom: 2px solid var(--red); padding-bottom: 6px; }
.date-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 42px; padding: 8px 10px;
            border: 1px solid var(--line); border-radius: 3px; background: #fff; color: var(--text);
            font: inherit; font-size: 16px; font-weight: 700; text-align: left; }
.date-btn:hover { background: #fafafa; }
.date-btn #date-label { flex: 1; }
.date-caret { color: var(--muted); }
/* Lịch chọn ngày tự vẽ: ngày tương lai xám, gạch ngang, không bấm được */
.cal { margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 16px; }
.cal-head button { width: 38px; height: 34px; padding: 0; font-size: 20px; }
.cal-head button:disabled { background: #ddd; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-dow { font-size: 12px; font-weight: 700; text-align: center; color: var(--muted); }
.cal-day { height: 38px; padding: 0; border: 1px solid #eee; background: #fff; color: var(--text); font-size: 15px; }
.cal-day:hover { background: #fbe9e9; }
.cal-day.is-today { border: 2px solid var(--red); } /* không dùng class "today": trùng ô ngày ở đầu trang (bị ẩn ≤ 400px) */
.cal-day.sel, .cal-day.sel:hover { background: var(--red); color: #fff; }
.cal-day:disabled, .cal-day:disabled:hover { background: #f6f6f6; color: #c4c4c4; border-color: #f0f0f0;
                                             text-decoration: line-through; cursor: not-allowed; }
.quick { display: flex; gap: 6px; margin-top: 8px; }
.quick button { flex: 1; }
.quick button small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; } /* trang đài: thứ + ngày */
.quick button:disabled, .quick button:disabled:hover { background: #ddd; color: #888; cursor: default; }
button { background: var(--red); color: #fff; border: 0; padding: 8px 10px; border-radius: 3px; cursor: pointer; font-weight: 700; }
button:hover { background: var(--red-dark); }
#today-list { list-style: none; margin: 0; padding: 0; }
#today-list li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
#today-list b { color: var(--red); display: block; margin-top: 6px; }

.notice { background: #fff8d6; border: 1px solid #f0d36b; padding: 8px 12px; border-radius: 4px; margin: 0 0 16px; font-size: 14px; }
.title { margin: -12px -12px 12px; padding: 10px 12px; background: var(--red); color: #fff; font-size: 17px; border-radius: 4px 4px 0 0; }
.title small { font-weight: 400; opacity: .85; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
/* Bảng kết quả: chữ to, đậm, tương phản cao để người lớn tuổi dễ đọc */
.kq td, .kq th { border: 1px solid #c9c9c9; text-align: center; padding: 6px 4px; }
.kq th { background: #fbe9e9; color: var(--red-dark); font-size: 19px; }
.kq td.prize { width: 64px; font-size: 18px; font-weight: 700; color: #111; background: #fafafa; }
.kq tr.db td.prize { color: var(--red); } /* nhãn ĐB đỏ như số giải đặc biệt */
.kq .num { display: block; font-size: 32px; line-height: 1.25; font-weight: 700; letter-spacing: 1px; color: #111; }
.kq tr.g8 .num { color: var(--red); font-size: 48px; }
.kq tr.db .num { color: var(--red); font-size: 40px; }
.kq tr:nth-child(even) td:not(.prize) { background: #fcfcfc; }
.kq th .code { display: block; margin-top: 2px; font-size: 15px; font-weight: 700; color: #555; }
/* Bảng Miền Bắc: mỗi giải một hàng, số xếp ngang; ĐB to nhất, giải nhất nền vàng, giải bảy đỏ */
.kq.kq-mb td.prize { width: 104px; font-weight: 500; background: #f3f3f3; white-space: nowrap; }
.kq.kq-mb tr:nth-child(even) td:not(.prize) { background: #f6f6f6; }
.kq.kq-mb .mb-head td { font-size: 17px; }
.kq.kq-mb .mb-head td:not(.prize) { background: #f6f6f6; padding: 8px 12px; }
.kq.kq-mb .mb-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; font-size: 17px; }
.kq.kq-mb .mb-day { font-style: italic; }
.kq.kq-mb .mb-day a { font-style: normal; font-weight: 700; }
.kq.kq-mb .mb-sym { margin-left: auto; }
.kq.kq-mb .mb-sym b { white-space: nowrap; }
.kq.kq-mb .mb-row { display: grid; align-items: center; row-gap: 2px; }
.kq.kq-mb .mb-row.c1 { grid-template-columns: 1fr; }
.kq.kq-mb .mb-row.c2 { grid-template-columns: repeat(2, 1fr); }
.kq.kq-mb .mb-row.c3 { grid-template-columns: repeat(3, 1fr); }
.kq.kq-mb .mb-row.c4 { grid-template-columns: repeat(4, 1fr); }
.kq.kq-mb .num { font-size: 30px; }
.kq.kq-mb tr.db td.prize { color: #111; }
.kq.kq-mb tr.db .num { color: #8b0000; font-size: 60px; line-height: 1.15; }
.kq.kq-mb tr.g1 td:not(.prize) { background: #ffe9a8; }
.kq.kq-mb tr.g1 .num { font-size: 42px; }
.kq.kq-mb tr.g8 .num { font-size: 42px; color: #8b0000; }

/* Đang tải ngày / miền mới: giữ bảng cũ, làm mờ thay vì xóa trắng */
#results { transition: opacity .15s; }
#results.loading { opacity: .45; pointer-events: none; }

/* Nút xuất bản in */
.print-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 3px; background: var(--red); color: #fff; font-weight: 700; font-size: 14px; }
.btn:hover { background: var(--red-dark); }
.btn-outline { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn-outline:hover { background: #fbe9e9; }

.source { margin: 8px 0 0; font-size: 14px; color: var(--muted); text-align: right; }
.source b { color: var(--red-dark); }

/* Xổ số trực tiếp */
.live-badge { margin-left: 8px; padding: 2px 8px; border-radius: 10px; background: var(--yellow); color: var(--red-dark); font-size: 14px; font-weight: 700; animation: blink 1.2s infinite; }
.kq .num.wait { width: 26px; height: 26px; margin: 7px auto; border: 3px solid #e5e5e5; border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .4; } }

.schedule td, .schedule th { border: 1px solid var(--line); padding: 6px; font-size: 14px; vertical-align: top; }
.schedule th { background: #fbe9e9; color: var(--red-dark); }
.schedule tr.now td { background: #fff8d6; }

.foot { background: #333; color: #ccc; padding: 16px 0; text-align: center; font-size: 13px; }

/* ===== Quảng bá dịch vụ đổi số trúng (hotline 0903.839.353) ===== */
/* ① Đầu trang: logo + khẩu hiệu bên trái, ô hotline vàng bên phải */
.brand { display: flex; flex-direction: column; gap: 2px; }
.tagline { font-size: 15px; font-weight: 700; }
/* Địa chỉ ngay dưới logo: khách thấy ngay khi vào trang; bấm để chỉ đường bằng Google Maps */
.top-addr { font-size: 16px; font-weight: 700; color: var(--yellow); }
.top-addr u { margin-left: 4px; font-size: 14px; color: #fff; white-space: nowrap; }
.top-addr:hover u { color: var(--yellow); }
/* Không nhấp nháy: chỉ nút gọi (④ / ⑤) chuyển động để mắt không bị rối */
.hotline { display: flex; flex-direction: column; align-items: center; padding: 6px 18px; border-radius: 10px;
           background: var(--yellow); color: var(--red-dark); line-height: 1.2; }
.hotline-label { font-size: 13px; font-weight: 700; text-transform: uppercase; }
.hotline-number { font-size: 28px; font-weight: 700; letter-spacing: 1px; }

/* ② Ô dịch vụ ở cột bên */
.promo-box { border: 2px solid var(--red); }
.promo-list { margin: 0 0 10px; padding-left: 18px; font-size: 15px; }
.promo-list li { margin-bottom: 4px; }
.call-btn { display: block; padding: 10px; border-radius: 6px; background: var(--red); color: #fff;
            font-size: 18px; font-weight: 700; text-align: center; }
.call-btn:hover { background: var(--red-dark); }

.promo-addr { margin: 10px 0 0; font-size: 14px; color: #444; }
.promo-addr a { color: var(--red); font-weight: 700; text-decoration: underline; }

/* Khung địa chỉ + bản đồ (trên chân trang) */
.addr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.addr-info p { margin: 0 0 8px; }
.addr-main { font-size: 20px; font-weight: 700; color: #222; }
.addr-old { font-size: 14px; color: var(--muted); }
.addr-hours { font-size: 16px; }
.addr-phone { font-size: 17px; }
.addr-phone a { color: var(--red); font-weight: 700; }
.addr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.addr-actions .btn { padding: 11px 16px; font-size: 16px; }
.addr-map { width: 100%; height: 280px; border: 0; border-radius: 4px; background: #eee; }
.map-load { display: block; padding: 0; color: var(--red-dark); font-size: 18px; line-height: 1.6; cursor: pointer;
            border: 1px dashed #bbb; background: #f4f4f4; }
.map-load:hover { background: #fbe9e9; }
.foot-nap { color: #fff; }
.foot-nap a { color: var(--yellow); }
.foot-copy { display: inline-block; margin-top: 6px; font-size: 12px; color: #aaa; }

/* ③ Ngay dưới bảng kết quả */
.win-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
           margin-top: 12px; padding: 12px 14px; border: 2px dashed var(--red); border-radius: 6px; background: #fff8d6; }
.win-cta-text { font-size: 16px; color: #333; }
.win-cta-text b { display: block; font-size: 20px; color: var(--red-dark); }
.win-cta-btn { padding: 10px 18px; border-radius: 6px; background: var(--red); color: #fff; font-size: 18px; font-weight: 700; white-space: nowrap; }
.win-cta:hover .win-cta-btn { background: var(--red-dark); }

/* ④ Nút gọi tròn nổi góc phải dưới (màn hình ≥ 1229px, nằm trong lề phải nên không che bảng kết quả);
   rê chuột vào thì mở rộng hiện số hotline */
.call-float { position: fixed; right: 16px; bottom: 20px; z-index: 50; display: flex; align-items: center; gap: 10px;
              padding: 8px; border-radius: 40px; background: var(--red); color: #fff;
              box-shadow: 0 4px 14px rgba(0, 0, 0, .3); animation: call-ring 1.8s infinite; }
.call-float-icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
                   border-radius: 50%; background: var(--yellow); font-size: 24px; }
.call-float-text { display: none; flex-direction: column; padding-right: 10px; font-size: 13px; line-height: 1.2; }
.call-float-text b { font-size: 20px; color: var(--yellow); }
.call-float:hover { background: var(--red-dark); }
.call-float:hover .call-float-text { display: flex; }
@keyframes call-ring { 0%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, .3), 0 0 0 0 rgba(196, 22, 28, .5); }
                       50% { box-shadow: 0 4px 14px rgba(0, 0, 0, .3), 0 0 0 10px rgba(196, 22, 28, 0); } }

/* ⑤ Thanh gọi dính đáy màn hình: chỉ hiện khi màn hình < 1229px (xem @media 1228px) */
.call-bar { display: none; }

@media print { .call-float, .call-bar { display: none; } }

/* Máy tính (trên 900px): chữ trong bảng kết quả (đã giảm 25% so với bản 40/50px trước đó) */
@media (min-width: 901px) {
  .kq th { font-size: 18px; }
  .kq td.prize { width: 64px; font-size: 17px; }
  .kq .num { font-size: 30px; }
  .kq tr.g8 .num { font-size: 46px; }
  .kq tr.db .num { font-size: 38px; }
  .kq th .code { font-size: 14px; }
  .kq .num.wait { width: 24px; height: 24px; margin: 7px auto; }
}

/* Màn hình đến 940px: bỏ cột bên để bảng kết quả (Thứ 7 có 4 đài) đủ chỗ với chữ to - bảng 4 đài
   cỡ máy tính cần ~611px, bố cục 2 cột chỉ đủ từ ~917px;
   2 ô "Chọn ngày" và "Đài mở thưởng hôm nay" nằm cạnh nhau phía trên cho đỡ tốn chiều cao */
@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
  .side .box { margin-bottom: 0; }
  /* Trang thông tin: nội dung chính (lịch / địa chỉ) lên trước các ô ở cột bên */
  body[data-page]:not([data-page="dai"]) .content { order: -1; } /* trang đài: ô chọn ngày nằm trên như trang kết quả */
}

/* Dưới 1229px lề hai bên không đủ chỗ cho nút tròn ④ (nó sẽ che cột số bên phải của bảng)
   -> dùng thanh gọi ⑤ rộng hết đáy màn hình (laptop nhỏ, máy tính bảng, điện thoại) */
@media (max-width: 1228px) {
  .call-float { display: none; }
  .call-bar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 14px 8px;
              background: var(--red); color: var(--yellow); font-size: 20px; font-weight: 700; text-align: center;
              box-shadow: 0 -3px 10px rgba(0, 0, 0, .25); }
  body { padding-bottom: 58px; } /* chừa chỗ cho thanh gọi, không che chân trang */
}
/* Máy tính (có chuột) thu nhỏ cửa sổ: thanh gọi che bảng số mà cũng không bấm gọi được -> bỏ, hotline đầu trang vẫn còn */
@media (max-width: 1228px) and (hover: hover) and (pointer: fine) {
  .call-bar { display: none; }
  body { padding-bottom: 0; }
}
/* Điện thoại xoay ngang: màn hình thấp, thanh gọi che mất nhiều bảng số -> bỏ, hotline đầu trang vẫn bấm gọi được */
@media (max-width: 1228px) and (orientation: landscape) and (max-height: 500px) {
  .call-bar { display: none; }
  body { padding-bottom: 0; }
}

@media (max-width: 760px) {
  .side { display: block; margin-bottom: 0; }
  .side .box { margin-bottom: 16px; }
  .side .today-box { display: none; } /* giao diện cột dọc: bỏ ô "Đài mở thưởng hôm nay" cho bảng kết quả lên gần hơn */
  /* Đổi số trúng trên điện thoại: hotline gọn ở đầu trang, ô ③ dưới bảng và thanh gọi ⑤ dính đáy
     (ô ② ở cột bên ẩn để trang không quá dài) */
  .top-inner { flex-wrap: nowrap; padding: 10px 12px; }
  .logo { font-size: clamp(14px, 4.5vw, 22px); letter-spacing: 0; white-space: nowrap; } /* "ĐẠI LÝ VÉ SỐ HỮU" nằm trên một dòng */
  .tagline { font-size: 12px; font-weight: 400; }
  .top-addr { font-size: 13px; }
  .top-addr u { font-size: 14px; }
}

/* Điện thoại rất nhỏ: ẩn khẩu hiệu để địa chỉ dưới logo nổi bật, đầu trang không quá cao */
@media (max-width: 400px) {
  .tagline { display: none; }
  .today { display: none; }
  .hotline { padding: 5px 10px; flex: none; }
  .hotline-label { font-size: 10px; }
  .hotline-number { font-size: 18px; letter-spacing: 0; }
  .promo-box { display: none; }
  .hide-sm { display: none; }
  .live-bar { gap: 6px; }
  .live-bar b { font-size: 14px; }
}

/* Menu gọn: 3 miền + "☰ Khác". Bấm "Khác" -> mục phụ hiện thành danh sách dọc, chữ to,
   mỗi mục một dòng (thêm bao nhiêu mục cũng không tràn ngang). Menu đủ 7 mục cần ~810px */
@media (max-width: 860px) {
  .menu a, .menu-toggle { flex: 1 0 auto; padding: 11px 7px; font-size: 14px; text-align: center; }
  .menu .wrap { flex-wrap: wrap; overflow: visible; }
  .menu-toggle { display: block; }
  .menu .menu-more { display: none; flex: 1 1 100%; padding: 14px 16px; font-size: 17px; text-align: left;
                     border-top: 1px solid rgba(255, 255, 255, .2); }
  .menu.open .menu-more { display: block; }
  .menu.open .menu-toggle, body[data-page] .menu-toggle { background: var(--yellow); color: var(--red-dark); }
}

@media (max-width: 760px) {
  /* Nút chuyển ngày: to, cách xa nhau để người lớn tuổi bấm không trật */
  .quick { gap: 12px; margin-top: 12px; }
  .quick button { min-height: 56px; padding: 12px 8px; font-size: 18px; border-radius: 6px; touch-action: manipulation; }
  .quick button small { font-size: 15px; }
  .day-nav { gap: 12px; }
  .day-nav a { padding: 15px 12px; font-size: 17px; border-radius: 6px; touch-action: manipulation; }
  /* Địa chỉ: chữ trên, bản đồ dưới; nút chỉ đường / gọi rộng hết khung cho dễ bấm */
  .addr-grid { grid-template-columns: minmax(0, 1fr); }
  .addr-actions .btn { flex: 1 1 100%; text-align: center; }
  .addr-map { height: 240px; }
  .win-cta-btn { flex: 1 1 100%; text-align: center; }
  .call-bar { font-size: 18px; }
  /* Nút in: mỗi nút một hàng, rộng hết khung, chữ to, dễ bấm */
  .print-bar .btn { flex: 1 1 100%; padding: 12px; font-size: 16px; text-align: center; }
  /* Điện thoại: chữ co theo bề rộng màn hình (vw) để 3-4 cột số vẫn vừa, không phải kéo ngang */
  /* Cỡ chữ tính theo ô hẹp nhất: giải ĐB 6 chữ số (rộng ~3,4 lần cỡ chữ) phải vừa 1 cột,
     vd màn 320px còn ~234px cho các cột đài -> 3 đài ~78px/cột, 4 đài ~58px/cột */
  .kq td, .kq th { padding: 4px 1px; }
  .kq th { font-size: clamp(12px, 3.8vw, 18px); }
  .kq th .code { font-size: clamp(10px, 3.2vw, 15px); }
  .kq td.prize { width: 36px; font-size: clamp(14px, 3.8vw, 17px); } /* tên giải tối thiểu 14px, đậm, đen */
  .kq .num { font-size: clamp(16px, 6.6vw, 30px); letter-spacing: 0; }
  .kq tr.g8 .num { font-size: clamp(19px, 8.2vw, 43px); }
  .kq tr.db .num { font-size: clamp(16px, 6.8vw, 36px); }
  .kq.cols-4 .num, .kq.cols-4 tr.db .num { font-size: clamp(14px, 5vw, 28px); }
  .kq.cols-4 tr.g8 .num { font-size: clamp(17px, 6vw, 34px); }
  .kq.kq-mb td.prize { width: 54px; padding: 4px 2px; white-space: normal; font-size: clamp(14px, 3.8vw, 17px); }
  .kq.kq-mb .mb-head td:not(.prize) { padding: 6px; }
  .kq.kq-mb .mb-meta { font-size: clamp(14px, 3.9vw, 17px); }
  .kq.kq-mb .mb-sym { margin-left: 0; }
  .kq.kq-mb .num { font-size: clamp(19px, 6.6vw, 30px); }
  .kq.kq-mb tr.db .num { font-size: clamp(36px, 13vw, 60px); }
  .kq.kq-mb tr.g1 .num { font-size: clamp(26px, 9vw, 42px); }
  .kq.kq-mb tr.g8 .num { font-size: clamp(24px, 8.2vw, 42px); }
}

/* Điện thoại rất nhỏ: 3 miền + "☰ Khác" vẫn vừa 1 hàng trên màn 320px
   (đặt cuối file để thắng quy tắc menu của @media 760px ở trên) */
@media (max-width: 400px) {
  .menu a, .menu-toggle { padding: 11px 4px; font-size: 13px; }
  .menu .menu-more { padding: 14px 16px; font-size: 17px; }
}
