/* =========================================
   KetQua.One - Lottery Results Website
   ========================================= */

/* ---------- DESIGN TOKENS (LIGHT) ---------- */
:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-alt: #f9fafb;
    --surface-warm: #fff7e6;
    --text: #2c2c2c;
    --text-soft: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-soft: #f3f4f6;
    --red: #c20000;
    --red-dark: #a00000;
    --gold: #ffd700;
    --shadow: rgba(0,0,0,.06);
    --shadow-strong: rgba(0,0,0,.1);
}

/* ---------- DARK MODE ---------- */
html[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-alt: #334155;
    --surface-warm: #422a0d;
    --text: #e5e7eb;
    --text-soft: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-soft: #1e293b;
    --shadow: rgba(0,0,0,.3);
    --shadow-strong: rgba(0,0,0,.5);
}
html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] .topbar { background: #1e293b; border-bottom-color: #334155; color: var(--text-soft); }
html[data-theme="dark"] .result-box,
html[data-theme="dark"] .sub-box,
html[data-theme="dark"] .news-section,
html[data-theme="dark"] .schedule-section,
html[data-theme="dark"] .top-loto-section,
html[data-theme="dark"] .faq-section,
html[data-theme="dark"] .side-box,
html[data-theme="dark"] .news-card,
html[data-theme="dark"] .faq-item {
    background: var(--surface);
    color: var(--text);
}
html[data-theme="dark"] .news-card { border-color: var(--border); }
html[data-theme="dark"] .news-card h3 { color: var(--text); }
html[data-theme="dark"] .faq-item { background: var(--surface-alt); border-color: var(--border); }
html[data-theme="dark"] .faq-item[open] { background: var(--surface); }
html[data-theme="dark"] .faq-item summary { color: var(--text); }
html[data-theme="dark"] .faq-content { color: var(--text-soft); }
html[data-theme="dark"] .result-date { background: var(--surface-warm); border-bottom-color: #5a3a10; color: var(--text); }
html[data-theme="dark"] .result-table td { border-bottom-color: var(--border); }
html[data-theme="dark"] .result-table .prize { background: var(--surface-warm); }
html[data-theme="dark"] .result-table .number { color: var(--text); }
html[data-theme="dark"] .num-cell:hover { background: var(--surface-warm); }
html[data-theme="dark"] .loto-box { background: var(--surface-alt); }
html[data-theme="dark"] .loto-table td { border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .loto-table td:nth-child(1),
html[data-theme="dark"] .loto-table td:nth-child(3) { background: var(--surface-warm); }
html[data-theme="dark"] .sub-list li,
html[data-theme="dark"] .side-list li,
html[data-theme="dark"] .quick-stat li,
html[data-theme="dark"] .yesterday-list li,
html[data-theme="dark"] .schedule-day { border-bottom-color: var(--border); color: var(--text); }
html[data-theme="dark"] .side-list a,
html[data-theme="dark"] .quick-stat a { color: var(--text); }
html[data-theme="dark"] .view-more { background: var(--surface-alt); border-top-color: var(--border); }
html[data-theme="dark"] .date-pick { background: var(--surface-alt); }
html[data-theme="dark"] .date-pick select { background: var(--surface); color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .checker-section { background: linear-gradient(180deg, #1e293b, #0f172a); border-color: #5a3a10; }
html[data-theme="dark"] .checker-form select,
html[data-theme="dark"] .checker-form input { background: var(--surface-alt); color: var(--text); border-color: #5a3a10; }
html[data-theme="dark"] .checker-left i { background: var(--surface); }
html[data-theme="dark"] .loto-rank { background: var(--surface-alt); color: var(--text); }
html[data-theme="dark"] .rank-info strong { color: var(--text); }
html[data-theme="dark"] .schedule-day.today { background: linear-gradient(90deg, var(--surface-warm), transparent); }
html[data-theme="dark"] .search-mini input { background: var(--surface-alt); color: var(--text); }
html[data-theme="dark"] .search-mini { border-color: var(--border); }

/* ---------- RESET & BASE ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    transition: background .25s, color .25s;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ---------- TOP BAR ---------- */
.topbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    font-size: 12px;
    color: #6b7280;
}
.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 36px;
}
.topbar-left i { margin-right: 5px; color: #d10000; }
.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}
.topbar-right a {
    color: #6b7280;
    transition: color .2s;
}
.topbar-right a:hover { color: #d10000; }
.topbar-right a i { margin-right: 4px; }
.dark-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-soft);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    font-size: 12px;
}
.dark-toggle:hover {
    background: var(--red);
    color: white;
    border-color: var(--red);
    transform: rotate(15deg);
}
html[data-theme="dark"] .dark-toggle { color: #ffd700; }
html[data-theme="dark"] .dark-toggle:hover { background: #ffd700; color: #1e293b; }

.search-mini {
    display: flex;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    overflow: hidden;
}
.search-mini input {
    border: 0;
    padding: 4px 8px;
    font-size: 12px;
    width: 150px;
    outline: none;
}
.search-mini button {
    background: #d10000;
    color: white;
    border: 0;
    padding: 0 10px;
    cursor: pointer;
}

/* ---------- HEADER (STICKY) ---------- */
.site-header {
    background: linear-gradient(180deg, #e60012 0%, #c20000 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all .25s ease;
}
.site-header.scrolled .header-inner { height: 56px; }
.site-header.scrolled .logo-text { font-size: 22px; }
.site-header.scrolled .logo small { display: none; }
.site-header.scrolled .main-nav a { padding: 7px 12px; }
.header-inner {
    display: flex;
    align-items: center;
    height: 80px;
    gap: 30px;
}
.logo a { display: block; }
.logo-text {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -1px;
    color: white;
}
.logo-dot { color: #ffd700; }
.logo small {
    display: block;
    font-size: 11px;
    opacity: .85;
    margin-top: -3px;
}
.main-nav { flex: 1; }
.main-nav ul {
    display: flex;
    gap: 5px;
}
.main-nav a {
    display: block;
    padding: 10px 14px;
    color: white;
    font-weight: 700;
    font-size: 13px;
    border-radius: 4px;
    transition: background .2s;
}
.main-nav a:hover,
.main-nav a.active {
    background: rgba(0,0,0,.25);
}
.main-nav a i { margin-right: 4px; }
.btn-dudoan {
    background: #ffd700;
    color: #c20000 !important;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    transition: transform .2s;
}
.btn-dudoan:hover { transform: translateY(-2px); }

/* ---------- HERO BANNER ---------- */
.hero {
    background: linear-gradient(135deg, #e60012 0%, #a00000 100%);
    color: white;
    padding: 25px 0;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -50px; right: -50px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,.1), transparent);
    border-radius: 50%;
}
.hero-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}
.hero-text h1 {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.hero-text p {
    font-size: 16px;
    opacity: .95;
    margin-bottom: 12px;
}
.hero-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
}
.hero-meta i { color: #ffd700; margin-right: 4px; }

.hero-balls {
    display: flex;
    gap: 8px;
    align-items: center;
}
.ball {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 20px;
    color: white;
    box-shadow: inset -8px -8px 15px rgba(0,0,0,.25), 0 4px 10px rgba(0,0,0,.3);
    animation: bounce 2s ease-in-out infinite;
}
.ball-1 { background: linear-gradient(135deg, #ffb84d, #e67e00); animation-delay: 0s; }
.ball-2 { background: linear-gradient(135deg, #6dd5ed, #2193b0); animation-delay: .2s; }
.ball-3 { background: linear-gradient(135deg, #11998e, #38ef7d); animation-delay: .4s; }
.ball-4 { background: linear-gradient(135deg, #ff6b6b, #c92a2a); animation-delay: .6s; }
.ball-5 { background: linear-gradient(135deg, #f7b733, #fc4a1a); animation-delay: .8s; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ---------- COUNTDOWN ---------- */
.countdown-box {
    margin-top: 18px;
    background: rgba(0,0,0,.25);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px;
    padding: 12px 18px;
    display: inline-block;
    min-width: 380px;
}
.countdown-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 8px;
    opacity: .9;
}
.countdown-label i { color: #ffd700; font-size: 14px; }
.countdown-timer {
    display: flex;
    align-items: center;
    gap: 4px;
}
.time-unit {
    background: linear-gradient(180deg, #fff7e6, #ffe9b3);
    color: #c20000;
    padding: 6px 12px;
    border-radius: 6px;
    text-align: center;
    min-width: 56px;
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.time-unit span {
    display: block;
    font-size: 22px;
    font-weight: 900;
    font-family: 'Roboto Mono', monospace;
    line-height: 1;
}
.time-unit small {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    margin-top: 2px;
    color: #6b2c2c;
    font-weight: 700;
}
.time-sep {
    font-size: 22px;
    font-weight: 900;
    color: #ffd700;
    animation: blink 1s infinite;
}
@keyframes blink {
    50% { opacity: .3; }
}

/* ---------- CHECKER WIDGET ---------- */
.checker-section {
    background: linear-gradient(180deg, #fff7e6 0%, #fde4b3 100%);
    border-top: 3px solid #ffd700;
    border-bottom: 3px solid #ffd700;
    padding: 20px 0;
}
.checker-box {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
}
.checker-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.checker-left i {
    font-size: 36px;
    color: #c20000;
    background: white;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(194,0,0,.25);
}
.checker-left h2 {
    font-size: 17px;
    color: #c20000;
    margin-bottom: 2px;
}
.checker-left p {
    font-size: 12px;
    color: #6b7280;
}
.checker-form {
    display: flex;
    gap: 6px;
    grid-column: 2 / 4;
}
.checker-form select,
.checker-form input {
    padding: 10px 12px;
    border: 2px solid #ffd700;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    outline: none;
    transition: border-color .2s;
}
.checker-form select { width: 130px; cursor: pointer; }
.checker-form input { flex: 1; font-family: 'Roboto Mono', monospace; font-weight: 700; letter-spacing: 2px; }
.checker-form input:focus { border-color: #c20000; }
.btn-check {
    background: linear-gradient(180deg, #d10000, #a00000);
    color: white;
    border: 0;
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    transition: transform .15s;
    box-shadow: 0 3px 8px rgba(194,0,0,.3);
}
.btn-check:hover { transform: translateY(-1px); }
.btn-check:active { transform: translateY(0); }
.btn-check i { margin-right: 4px; color: #ffd700; }

.checker-result {
    grid-column: 1 / -1;
    display: none;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    animation: slideDown .3s ease;
}
.checker-result.show { display: block; }
.checker-result.win {
    background: linear-gradient(90deg, #d10000, #f59e0b);
    color: white;
}
.checker-result.lose {
    background: #e5e7eb;
    color: #6b7280;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- CHECKER HISTORY ---------- */
.checker-history {
    grid-column: 1 / -1;
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,.6);
    border: 1px dashed #ffd700;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.history-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--red);
    white-space: nowrap;
}
.history-label i { margin-right: 4px; }
.history-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}
.history-chip {
    background: white;
    color: var(--red);
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
    border: 1px solid #ffd700;
    transition: all .15s;
}
.history-chip:hover {
    background: var(--red);
    color: white;
    transform: scale(1.05);
}
.history-chip.win {
    background: linear-gradient(90deg, #d10000, #f59e0b);
    color: white;
}
.history-clear {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    transition: color .2s;
}
.history-clear:hover { color: var(--red); }

/* ---------- MAIN GRID ---------- */
.main-content { padding: 25px 0; }
.main-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

/* ---------- RESULT BOX ---------- */
.result-box {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    margin-bottom: 20px;
}
.result-head {
    background: linear-gradient(180deg, #d10000, #a00000);
    color: white;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.result-head h2 {
    font-size: 16px;
    font-weight: 700;
}
.result-head h2 i { margin-right: 6px; color: #ffd700; }
.result-tabs { display: flex; gap: 5px; }
.result-tabs .tab {
    background: rgba(255,255,255,.15);
    color: white;
    border: 0;
    padding: 5px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}
.result-tabs .tab.active {
    background: white;
    color: #c20000;
}

.result-date {
    text-align: center;
    padding: 12px;
    background: #fff7e6;
    border-bottom: 1px solid #fde4b3;
}
.result-date strong { font-size: 15px; color: #c20000; }
.result-date span { display: block; font-size: 12px; color: #6b7280; }

.result-table {
    width: 100%;
    border-collapse: collapse;
}
.result-table td {
    padding: 10px 14px;
    border-bottom: 1px dashed #e5e7eb;
    text-align: center;
}
.result-table .prize {
    width: 70px;
    font-weight: 700;
    color: #c20000;
    background: #fff7e6;
    font-size: 13px;
}
.result-table .number {
    font-family: 'Roboto Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 1px;
    line-height: 1.8;
}
.result-table .jackpot {
    font-size: 26px;
    color: #d10000;
    text-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.result-table .two-digits { color: #2563eb; }

/* Tap-to-copy on number cells */
.num-cell {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: all .15s;
    position: relative;
}
.num-cell:hover {
    background: #fff7e6;
    transform: scale(1.05);
}
.num-cell.copied {
    background: #10b981 !important;
    color: white !important;
    animation: pulse-copy .4s ease;
}
.num-cell.highlight {
    background: #fef3c7 !important;
    box-shadow: 0 0 0 2px #f59e0b inset;
}
@keyframes pulse-copy {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1.05); }
}

/* ---------- LOTO TABLE ---------- */
.loto-box { padding: 15px; background: #f9fafb; }
.loto-box h3 {
    font-size: 14px;
    color: #c20000;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 2px solid #d10000;
}
.loto-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.loto-table th {
    background: #c20000;
    color: white;
    padding: 6px;
    font-weight: 700;
}
.loto-table td {
    padding: 5px 8px;
    border: 1px solid #e5e7eb;
    text-align: center;
}
.loto-table td:nth-child(1),
.loto-table td:nth-child(3) {
    background: #fff7e6;
    font-weight: 700;
    color: #c20000;
    width: 40px;
}

/* ---------- GRID 2 COLUMNS ---------- */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.sub-box {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.sub-title {
    padding: 10px 15px;
    color: white;
    font-size: 14px;
    font-weight: 700;
}
.sub-title.red { background: #d10000; }
.sub-title.blue { background: #1d4ed8; }

.sub-list { padding: 5px 0; }
.sub-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    border-bottom: 1px dashed #e5e7eb;
    font-size: 13px;
}
.sub-list li:last-child { border-bottom: 0; }
.sub-list .num {
    font-weight: 700;
    color: #c20000;
    font-family: 'Roboto Mono', monospace;
}

.view-more {
    display: block;
    text-align: center;
    padding: 10px;
    background: #f9fafb;
    font-size: 12px;
    color: #c20000;
    font-weight: 700;
    border-top: 1px solid #e5e7eb;
}
.view-more:hover { background: #fee2e2; }

/* ---------- SECTION HEAD COLOR VARIANTS ---------- */
.section-head.purple { background: linear-gradient(180deg, #7c3aed, #5b21b6); }
.section-head.orange { background: linear-gradient(180deg, #f59e0b, #d97706); }
.section-head.green { background: linear-gradient(180deg, #10b981, #047857); }

/* ---------- SCHEDULE ---------- */
.schedule-section {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    margin-bottom: 20px;
}
.schedule-grid { padding: 12px; }
.schedule-day {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px dashed #e5e7eb;
    align-items: center;
}
.schedule-day:last-child { border-bottom: 0; }
.schedule-day.today {
    background: linear-gradient(90deg, #fff7e6, transparent);
    border-left: 3px solid #f59e0b;
    margin: 0 -12px;
    padding: 12px;
}
.day-name {
    font-weight: 700;
    font-size: 14px;
    color: #c20000;
    display: flex;
    align-items: center;
    gap: 6px;
}
.badge-today {
    background: #f59e0b;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}
.day-regions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.region-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 700;
    transition: transform .15s;
    cursor: pointer;
}
.region-tag:hover { transform: scale(1.05); }
.region-tag.mb { background: #fee2e2; color: #c20000; }
.region-tag.mt { background: #fef3c7; color: #d97706; }
.region-tag.mn { background: #dbeafe; color: #1d4ed8; }

/* ---------- TOP LOTO ---------- */
.top-loto-section {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    margin-bottom: 20px;
}
.top-loto-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 15px;
}
.loto-rank {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: transform .2s;
    border: 2px solid transparent;
}
.loto-rank:hover {
    transform: translateY(-3px);
    border-color: #f59e0b;
}
.loto-rank.rank-1 {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
}
.loto-rank.rank-2 {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-color: #9ca3af;
}
.loto-rank.rank-3 {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    border-color: #ea580c;
}
.rank-num {
    font-family: 'Roboto Mono', monospace;
    font-size: 28px;
    font-weight: 900;
    color: #c20000;
    line-height: 1;
    margin-bottom: 4px;
}
.rank-info strong {
    display: block;
    font-size: 13px;
    color: #1f2937;
}
.rank-info small {
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
}

/* ---------- FAQ ---------- */
.faq-section {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    margin-bottom: 20px;
}
.faq-list { padding: 15px; }
.faq-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: background .2s;
}
.faq-item[open] {
    background: white;
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16,185,129,.1);
}
.faq-item summary {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 40px;
    transition: color .2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: 700;
    transition: transform .2s;
}
.faq-item[open] summary::after {
    content: "−";
    transform: translateY(-50%) rotate(180deg);
}
.faq-item summary:hover { color: #047857; }
.faq-content {
    padding: 0 16px 14px;
    font-size: 13px;
    line-height: 1.6;
    color: #4b5563;
}
.faq-content strong { color: #c20000; }

/* ---------- NEWS ---------- */
.news-section {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: linear-gradient(180deg, #1d4ed8, #1e40af);
    color: white;
}
.section-head h2 { font-size: 16px; font-weight: 700; }
.section-head h2 i { margin-right: 6px; color: #ffd700; }
.section-head a {
    color: white;
    font-size: 12px;
    background: rgba(255,255,255,.15);
    padding: 4px 10px;
    border-radius: 4px;
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 15px;
}
.news-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,.1);
}
.news-thumb img {
    width: 100%;
    height: 130px;
    object-fit: cover;
}
.news-card h3 {
    font-size: 13px;
    font-weight: 700;
    padding: 8px 10px 4px;
    line-height: 1.4;
    color: #1f2937;
}
.news-date {
    display: block;
    padding: 0 10px 10px;
    font-size: 11px;
    color: #6b7280;
}

/* ---------- SIDEBAR ---------- */
.side-box {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    margin-bottom: 15px;
}
.side-title {
    background: linear-gradient(180deg, #c20000, #a00000);
    color: white;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 700;
}
.side-title i { margin-right: 6px; color: #ffd700; }

.date-pick {
    padding: 12px;
    background: #fff7e6;
}
.date-pick select {
    width: 100%;
    padding: 7px;
    margin-bottom: 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
}
.btn-red {
    width: 100%;
    background: #d10000;
    color: white;
    border: 0;
    padding: 8px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
}
.btn-red:hover { background: #a00000; }

.side-list li,
.quick-stat li,
.yesterday-list li {
    padding: 10px 15px;
    border-bottom: 1px dashed #e5e7eb;
    font-size: 13px;
}
.side-list li:last-child,
.quick-stat li:last-child,
.yesterday-list li:last-child { border-bottom: 0; }
.side-list a { color: #1f2937; transition: color .2s; }
.side-list a:hover { color: #c20000; }
.side-list li::before {
    content: "›";
    color: #c20000;
    margin-right: 6px;
    font-weight: 700;
}

.quick-stat li i {
    color: #d10000;
    margin-right: 8px;
    width: 16px;
}
.quick-stat a { color: #1f2937; }
.quick-stat li:hover a { color: #c20000; }

.yellow-box .side-title {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}
.yesterday-list li {
    display: flex;
    justify-content: space-between;
}
.yesterday-list span {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    color: #c20000;
}

.ads-box {
    text-align: center;
    margin-bottom: 15px;
}
.ads-box img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* ---------- FOOTER ---------- */
.site-footer {
    background: #1f2937;
    color: #d1d5db;
    padding-top: 35px;
    margin-top: 30px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 30px;
    padding-bottom: 25px;
}
.footer-col h4 {
    color: white;
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #d10000;
    display: inline-block;
}
.footer-logo {
    font-size: 22px !important;
    font-weight: 900;
    color: white !important;
    border: 0 !important;
    padding: 0 !important;
}
.footer-logo span { color: #ffd700; }
.footer-col p {
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 15px;
}
.footer-col ul li {
    padding: 5px 0;
    font-size: 13px;
}
.footer-col ul li i {
    margin-right: 6px;
    color: #d10000;
    width: 14px;
}
.footer-col ul a { transition: color .2s; }
.footer-col ul a:hover { color: white; }

.socials {
    display: flex;
    gap: 8px;
}
.socials a {
    width: 32px;
    height: 32px;
    background: #374151;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.socials a:hover { background: #d10000; }

.footer-bottom {
    background: #111827;
    padding: 12px 0;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

/* =============================================
   MOBILE COMPONENTS (hidden by default on desktop)
   ============================================= */

/* ---------- HAMBURGER ---------- */
.hamburger {
    display: none;
    background: transparent;
    border: 0;
    width: 36px;
    height: 36px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
    transition: background .2s;
}
.hamburger:active { background: rgba(0,0,0,.2); }
.hamburger span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: white;
    border-radius: 2px;
    transition: transform .3s, opacity .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- MOBILE SEARCH TRIGGER ---------- */
.m-search-trigger {
    display: none;
    background: rgba(255,255,255,.15);
    border: 0;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    transition: background .2s;
}
.m-search-trigger:active { background: rgba(0,0,0,.25); }

.m-search-bar {
    display: none;
    background: var(--red-dark);
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,.1);
    animation: slideDown .25s ease;
}
.m-search-bar.open { display: block; }
.m-search-bar .container {
    display: flex;
    gap: 8px;
    align-items: center;
}
.m-search-bar input {
    flex: 1;
    padding: 10px 14px;
    border: 0;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.m-search-close {
    background: transparent;
    color: white;
    border: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
}

/* ---------- DRAWER ---------- */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    z-index: 1099;
    transition: opacity .25s;
}
.drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 86%;
    max-width: 340px;
    background: var(--surface);
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.16, 1, .3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,.2);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}
.mobile-drawer.open { transform: translateX(0); }

.drawer-head {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: white;
    padding: 18px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-logo {
    font-size: 22px;
    font-weight: 900;
}
.drawer-close {
    background: rgba(255,255,255,.15);
    border: 0;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
}
.drawer-user {
    padding: 14px 18px;
    background: var(--surface-warm);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}
.drawer-user i {
    font-size: 38px;
    color: var(--red);
}
.drawer-user strong {
    display: block;
    color: var(--text);
    font-size: 14px;
}
.drawer-user a {
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
}
.drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.drawer-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
    border-bottom: 1px solid var(--border-soft);
    transition: background .15s;
}
.drawer-nav a i {
    width: 22px;
    color: var(--red);
    font-size: 15px;
}
.drawer-nav a:active { background: var(--surface-warm); }
.drawer-nav a.active {
    background: linear-gradient(90deg, var(--surface-warm), transparent);
    color: var(--red);
    font-weight: 700;
    border-left: 3px solid var(--red);
    padding-left: 17px;
}
.drawer-foot {
    border-top: 1px solid var(--border);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-alt);
}
.drawer-theme-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.drawer-theme-btn:active { background: var(--surface-warm); }
.drawer-socials {
    display: flex;
    gap: 8px;
}
.drawer-socials a {
    width: 32px;
    height: 32px;
    background: var(--red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

/* ---------- BOTTOM NAVIGATION ----------
 * Z-INDEX HIERARCHY (mobile floating UI):
 *   bottom-nav      990  (always-on bottom bar)
 *   pwa-banner      991  (one-time install prompt above nav)
 *   mini-toggle     992  (FAB above nav)
 *   back-to-top     993  (FAB above nav)
 *   mini-panel      994  (when opened, covers nav)
 *   site-header    1000  (sticky top)
 *   drawer-backdrop 1099
 *   mobile-drawer  1100
 *   toast          9999  (top-most transient)
 */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 15px rgba(0,0,0,.08);
    z-index: 990;
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(62px + env(safe-area-inset-bottom));
}
.bottom-nav .bn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: color .2s;
    position: relative;
    padding: 6px 0;
}
.bottom-nav .bn-item i { font-size: 18px; }
.bottom-nav .bn-item.active {
    color: var(--red);
    font-weight: 700;
}
.bottom-nav .bn-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--red);
    border-radius: 0 0 4px 4px;
}
.bottom-nav .bn-item:active { background: var(--surface-warm); }

.bottom-nav .bn-fab {
    color: white !important;
}
.bottom-nav .bn-fab i {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -22px;
    box-shadow: 0 4px 12px rgba(194,0,0,.4);
    font-size: 18px;
}
.bottom-nav .bn-fab span { color: var(--text-soft); font-size: 10px; margin-top: 0; }
.bottom-nav .bn-fab.active::before { display: none; }

/* ---------- PWA INSTALL BANNER ---------- */
.pwa-banner {
    display: none;
    position: fixed;
    left: 12px;
    right: 12px;
    /* sit just above bottom-nav (62px) + safe-area, +14px breathing room */
    bottom: calc(76px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    padding: 12px;
    z-index: 991;
    align-items: center;
    gap: 12px;
    animation: bannerUp .4s ease;
    border: 1px solid var(--border);
}
.pwa-banner.show { display: flex; }
@keyframes bannerUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.pwa-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.pwa-text {
    flex: 1;
    min-width: 0;
}
.pwa-text strong {
    display: block;
    font-size: 13px;
    color: var(--text);
}
.pwa-text small {
    font-size: 11px;
    color: var(--text-soft);
}
.pwa-install {
    background: var(--red);
    color: white;
    border: 0;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.pwa-install:active { background: var(--red-dark); }
.pwa-dismiss {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}

/* ---------- MINI CHECKER FAB ---------- */
.mini-checker { display: none; }

.mini-checker-toggle {
    display: none; /* shown only via .show */
    position: fixed;
    right: 16px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    background: linear-gradient(135deg, #ffd700, #f59e0b);
    color: #c20000;
    border: 0;
    border-radius: 30px;
    padding: 12px 16px;
    box-shadow: 0 6px 18px rgba(245,158,11,.4);
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    z-index: 992;
    align-items: center;
    gap: 6px;
}
.mini-checker-toggle.show { display: inline-flex; }
.mini-checker-toggle:active { transform: scale(.96); }
.mini-checker-toggle i { font-size: 16px; }

.mini-checker-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    padding: 14px;
    z-index: 994; /* above bottom-nav (990) when opened */
    transform: translateY(120%);
    opacity: 0;
    transition: all .25s ease;
    border: 2px solid #ffd700;
}
.mini-checker-panel.open {
    transform: translateY(0);
    opacity: 1;
}
.mini-checker-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.mini-checker-head strong {
    color: var(--red);
    font-size: 14px;
}
.mini-checker-head i { margin-right: 4px; color: #f59e0b; }
.mini-checker-close {
    background: var(--surface-alt);
    border: 0;
    color: var(--text-soft);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
}
.mini-checker-form {
    display: flex;
    gap: 6px;
}
.mini-checker-form input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #ffd700;
    border-radius: 8px;
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 15px;
    outline: none;
    background: var(--surface);
    color: var(--text);
}
.mini-checker-form button {
    background: linear-gradient(180deg, var(--red), var(--red-dark));
    color: white;
    border: 0;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 15px;
}
.mini-checker-result {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    display: none;
}
.mini-checker-result.show { display: block; }
.mini-checker-result.win {
    background: linear-gradient(90deg, var(--red), #f59e0b);
    color: white;
    font-weight: 700;
}
.mini-checker-result.lose {
    background: var(--surface-alt);
    color: var(--text-soft);
}

/* ---------- TOAST ---------- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(17, 24, 39, .95);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    z-index: 9999;
    box-shadow: 0 8px 25px rgba(0,0,0,.25);
    opacity: 0;
    pointer-events: none;
    transition: all .3s cubic-bezier(.34, 1.56, .64, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast i { color: #10b981; font-size: 16px; }

/* ---------- BACK TO TOP ---------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: linear-gradient(180deg, #d10000, #a00000);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(194,0,0,.4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all .3s;
    z-index: 993;
}
.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.back-to-top:hover { transform: translateY(-3px); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .main-grid { grid-template-columns: 1fr; }
    .right-col { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .top-loto-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {

    /* ----- HIDE / SHOW MOBILE ELEMENTS ----- */
    .topbar { display: none; }
    .hamburger { display: flex; }
    .m-search-trigger { display: inline-flex; align-items: center; justify-content: center; }
    .bottom-nav { display: flex; }
    .main-nav { display: none; }
    .btn-dudoan { display: none; }

    /* ----- HEADER ----- */
    .site-header {
        padding-top: env(safe-area-inset-top);
    }
    .header-inner {
        height: 56px;
        padding: 0 12px;
        gap: 10px;
        justify-content: space-between;
    }
    .logo { flex: 1; text-align: center; }
    .logo-text { font-size: 22px; }
    .logo small { display: none; }
    .site-header.scrolled .header-inner { height: 50px; }

    /* ----- HERO COMPACT ----- */
    .hero { padding: 18px 0; }
    .hero-inner {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }
    .hero-text h1 { font-size: 22px; margin-bottom: 4px; }
    .hero-text p { font-size: 14px; margin-bottom: 8px; }
    .hero-meta { flex-direction: column; gap: 4px; font-size: 12px; }
    .hero-balls { gap: 5px; }
    .ball { width: 38px; height: 38px; font-size: 14px; }

    /* Countdown stays prominent */
    .countdown-box {
        min-width: 0;
        width: 100%;
        padding: 10px 12px;
        margin-top: 12px;
    }
    .countdown-label { font-size: 11px; margin-bottom: 6px; }
    .countdown-timer { justify-content: center; }
    .time-unit { min-width: 56px; padding: 5px 10px; }
    .time-unit span { font-size: 20px; }
    .time-unit small { font-size: 8px; }

    /* ----- CHECKER (full width stacked) ----- */
    .checker-section { padding: 14px 0; }
    .checker-box { grid-template-columns: 1fr; gap: 10px; text-align: center; }
    .checker-left { justify-content: center; gap: 8px; }
    .checker-left i { width: 44px; height: 44px; font-size: 20px; }
    .checker-left h2 { font-size: 15px; }
    .checker-left p { font-size: 11px; }
    .checker-form { grid-column: 1; flex-wrap: wrap; gap: 8px; }
    .checker-form select { flex: 1; min-width: 110px; }
    .checker-form input { flex: 2; min-width: 0; padding: 12px; font-size: 16px; }
    .btn-check { flex: 1 1 100%; padding: 12px; font-size: 15px; }

    /* ----- MAIN GRID ----- */
    .main-content { padding: 14px 0; }
    .main-grid { gap: 14px; }
    .container { padding: 0 12px; }
    .grid-2col { grid-template-columns: 1fr; gap: 12px; }
    .right-col { grid-template-columns: 1fr; gap: 12px; }

    /* ----- RESULT TABLE (more readable) ----- */
    .result-head { padding: 10px 12px; }
    .result-head h2 { font-size: 14px; }
    .result-tabs .tab { font-size: 11px; padding: 4px 10px; }
    .result-date { padding: 10px; }
    .result-date strong { font-size: 14px; }
    .result-table td { padding: 8px 10px; }
    .result-table .prize { width: 50px; font-size: 12px; }
    .result-table .number { font-size: 15px; line-height: 1.6; }
    .result-table .jackpot { font-size: 28px; }
    .num-cell { padding: 3px 6px; margin: 1px 1px; }

    /* Loto table: smaller text */
    .loto-table th, .loto-table td { padding: 5px 4px; font-size: 12px; }
    .loto-box h3 { font-size: 13px; }

    /* ----- SECTIONS ----- */
    .news-grid { grid-template-columns: 1fr; padding: 12px; }
    .news-thumb img { height: 180px; }
    .news-card h3 { font-size: 14px; }

    .top-loto-grid { grid-template-columns: repeat(3, 1fr); padding: 10px; gap: 6px; }
    .loto-rank { padding: 8px 4px; }
    .rank-num { font-size: 22px; }
    .rank-info strong { font-size: 11px; }
    .rank-info small { font-size: 9px; }

    .schedule-grid { padding: 8px; }
    .schedule-day { grid-template-columns: 1fr; gap: 6px; padding: 10px; }
    .day-name { font-size: 13px; }
    .region-tag { font-size: 11px; padding: 3px 8px; }

    .faq-list { padding: 10px; }
    .faq-item summary { padding: 12px 40px 12px 14px; font-size: 13px; }

    /* ----- SIDEBAR boxes ----- */
    .side-title { padding: 9px 12px; font-size: 13px; }
    .side-list li, .quick-stat li, .yesterday-list li { padding: 10px 12px; font-size: 13px; }

    /* ----- FOOTER ----- */
    .footer-grid { grid-template-columns: 1fr; gap: 20px; padding: 25px 0 20px; }
    .footer-col h4 { font-size: 14px; }
    .site-footer { padding-bottom: 80px; /* room for bottom nav */ }
    .footer-bottom { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

    /* ----- FAB / BACK-TO-TOP -----
     * Stacked at right edge: back-to-top on top of mini-toggle.
     */
    .back-to-top {
        bottom: calc(130px + env(safe-area-inset-bottom));
        right: 16px;
        width: 40px;
        height: 40px;
    }

    /* ----- TOAST ----- */
    .toast {
        bottom: calc(76px + env(safe-area-inset-bottom));
        left: 12px;
        right: 12px;
        transform: translateY(100px);
        max-width: none;
    }
    .toast.show { transform: translateY(0); }

    /* Show mini checker container on mobile (toggle button hidden until scroll) */
    .mini-checker { display: block; }

    /* Result-tabs spacing */
    .result-tabs { gap: 4px; }
}

/* ----- ULTRA-SMALL (<400px) ----- */
@media (max-width: 400px) {
    .container { padding: 0 10px; }
    .hero-text h1 { font-size: 19px; }
    .ball { width: 32px; height: 32px; font-size: 12px; }
    .time-unit { min-width: 48px; padding: 4px 6px; }
    .time-unit span { font-size: 17px; }
    .result-table .jackpot { font-size: 24px; }
    .result-table .number { font-size: 14px; }
    .top-loto-grid { grid-template-columns: repeat(2, 1fr); }
    .bottom-nav .bn-item span { font-size: 10px; }
    .bottom-nav .bn-fab i { width: 44px; height: 44px; font-size: 16px; }
}

/* ----- LANDSCAPE phones: shrink hero ----- */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    .hero { padding: 10px 0; }
    .hero-text h1 { font-size: 18px; }
    .hero-balls { display: none; }
    .countdown-box { margin-top: 6px; }
}
