:root {
    --primary: #005fa9;
    --primary-hover: #004b85;
    --primary-light: #e5f2ff;
    --accent: #d0021b;
    --accent-hover: #b00114;
    --bg-body: #f4f6fa;
    --bg-card: #ffffff;
    --border: #dddddd;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

/* HEADER & NAVIGATION */
.main-header {
    background-color: var(--bg-card);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--accent);
}

.nav-menu {
    display: flex;
    gap: 6px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.25s ease;
}

.nav-menu a:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.nav-menu a.active {
    background-color: var(--primary);
    color: #ffffff;
}

/* MOBILE TOGGLE */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

/* APP CONTAINER LAYOUT */
.app-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    gap: 20px;
}

/* SIDEBAR STYLES (COMMON) */
.sidebar-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    background-color: var(--primary);
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    letter-spacing: 0.5px;
}

/* LEFT SIDEBAR Schedule */
.schedule-group {
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 0;
}

.schedule-group:last-child {
    border-bottom: none;
}

.group-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 0 16px 8px;
    letter-spacing: 0.5px;
}

.schedule-list {
    list-style: none;
}

.schedule-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
}

.schedule-list a:hover {
    background-color: #f8fafc;
    color: var(--primary);
    padding-left: 20px;
}

.schedule-list a.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
}

.schedule-list .bullet {
    width: 6px;
    height: 6px;
    background-color: #cbd5e1;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.schedule-list a:hover .bullet {
    background-color: var(--primary);
    transform: scale(1.3);
}

.schedule-list a.active .bullet {
    background-color: var(--primary);
}

.day {
    font-size: 11px;
    color: var(--text-secondary);
}

.badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 12px;
    text-transform: uppercase;
}

.badge.red {
    background-color: #fee2e2;
    color: var(--accent);
}

.badge.blue {
    background-color: #e0f2fe;
    color: var(--primary);
}

/* CENTER COLUMN STYLES */
.region-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.region-tabs .tab-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.region-tabs .tab-btn:hover {
    background-color: #f8fafc;
    border-color: var(--primary);
    color: var(--primary);
}

.region-tabs .tab-btn.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* CONTROL BOX */
.control-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.control-title, #control-title-text {
    font-family: 'Roboto', sans-serif !important;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.25px;
}

.control-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.select-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.select-wrapper label {
    font-weight: 600;
    color: var(--text-secondary);
}

.select-wrapper select {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: border 0.2s ease;
}

.select-wrapper select:focus {
    border-color: var(--primary);
}

.btn-primary {
    padding: 10px 28px;
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(208, 2, 27, 0.2);
}

.btn-primary:disabled {
    background-color: #f1f5f9;
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border: 1px solid var(--border);
}

/* RESULTS BOARD WIDGET */
.results-board-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.board-header {
    background-color: var(--primary);
    color: #ffffff;
    padding: 16px;
    text-align: center;
}

.board-header h3, #board-title-text {
    font-family: 'Roboto', sans-serif !important;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

.board-header p {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 4px;
    font-weight: 500;
}

.board-body {
    padding: 1px; /* border collapsed styling */
}

/* LOTTERY TABLE GRID */
.lottery-grid {
    display: grid;
    background-color: var(--border);
    gap: 1px;
}

.grid-row {
    display: flex;
    background-color: #ffffff;
}

.grid-row.row-db {
    background-color: #fffbeb;
}

.grid-label {
    width: 80px;
    font-weight: 700;
    color: var(--text-secondary);
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
    padding: 12px 6px;
    font-size: 14px;
    text-transform: uppercase;
}

.grid-label.text-db {
    color: var(--accent);
    background-color: #fef3c7;
    font-size: 15px;
}

.grid-value {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: normal;
    color: #334155;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 40px;
    min-height: 40px;
}

.grid-value.text-db,
.text-db .grid-values > div,
span.text-db {
    color: var(--accent);
}

.grid-value.text-db {
    font-size: 34px;
    letter-spacing: normal;
}

.text-db .grid-values > div {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: normal;
}

.grid-values {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(var(--split, 1), 1fr);
    grid-auto-rows: 1fr;
    background-color: var(--border);
    gap: 1px;
    padding: 0;
}

.grid-values > div {
    font-size: 28px;
    font-weight: 700;
    color: #334155;
    letter-spacing: normal;
    padding: 2px 10px;
    text-align: center;
    background-color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 40px;
    min-height: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fix for odd item (like 7 items in 3 columns for G.4 XSMN) */
.grid-values > div:last-child:nth-child(7) {
    grid-column: 1 / -1;
}

.row-db .grid-values > div {
    background-color: #fffbeb;
}

/* DIGIT SPINS */
.digit-spin {
    display: inline-block;
    transition: transform 0.05s ease;
}

.digit-spin.spinning {
    color: var(--text-muted);
    animation: bounceDigit 0.08s infinite alternate;
}

@keyframes bounceDigit {
    from { transform: translateY(0); }
    to { transform: translateY(-2px); }
}

/* FILTER TOOLBAR */
.filter-toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.filter-label {
    font-weight: 700;
    color: var(--text-secondary);
}

.filter-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    background-color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background-color: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* LOTO DIGIT SELECTOR BAR */
.loto-selector-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.loto-selector-bar .label {
    font-weight: 700;
    color: var(--text-secondary);
}

.number-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.loto-num-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background-color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

#loto-btn-all {
    width: 64px;
    font-size: 13px;
}

.loto-num-btn:hover {
    background-color: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
}

.loto-num-btn.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 95, 169, 0.2);
}

/* HIGHLIGHT STYLING */
.red-highlight {
    color: var(--accent);
    font-weight: 800;
    background-color: #ffe4e6;
    padding: 0 4px;
    border-radius: 3px;
    display: inline-block;
}

.text-db .red-highlight {
    background-color: #fef3c7;
    color: var(--accent);
}

/* LOTO TRỰC TIẾP WIDGET */
.loto-live-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.loto-live-header {
    background: linear-gradient(135deg, #fff8e1 0%, #fffde7 100%);
    border-bottom: 2px solid #f0c848;
    color: #7a5800;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    padding: 10px 16px;
    letter-spacing: 0.3px;
}

.loto-live-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    background-color: var(--border);
    gap: 1px;
    padding: 1px;
}

.loto-live-cell {
    background-color: #ffffff;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.loto-live-cell.special-cell {
    color: var(--accent);
    background-color: #fffbeb;
}

.loto-live-cell.filled {
    animation: cellPop 0.25s ease;
}

@keyframes cellPop {
    0%   { transform: scale(0.85); opacity: 0.5; }
    60%  { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* LOTO STATS CONTAINER TABLES */

.loto-stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.stats-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stats-header {
    background-color: #f8fafc;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.5px;
}

.stats-body {
    display: flex;
    flex-direction: column;
}

.stats-row {
    display: flex;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    transition: all 0.15s ease;
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-row.active-row {
    background-color: #f0f7ff;
    border-left: 3px solid var(--primary);
}

.stats-label {
    width: 50px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    background-color: #f8fafc;
    text-align: center;
    padding: 8px 0;
    border-right: 1px solid #f1f5f9;
}

.stats-row.active-row .stats-label {
    background-color: #e0f2fe;
    color: var(--primary);
}

.stats-val {
    flex: 1;
    padding: 8px 16px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    letter-spacing: 1px;
}

.stats-val span {
    display: inline-block;
}

.stats-val .red-highlight {
    padding: 0 4px;
}

/* MULTI-PROVINCE GRID STYLES */
.multi-province-grid .header-row {
    background-color: #f1f5f9;
    font-weight: 700;
}
.col-header {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 6px;
    font-size: 15px;
    border-right: 1px solid var(--border);
    color: var(--primary);
}
.col-header:last-child {
    border-right: none;
}
.province-cell {
    flex: 1;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}
.province-cell:last-child {
    border-right: none;
}
.multi-col-values {
    /* For multi-column layout, we stack values vertically */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    background-color: transparent;
}
.multi-col-values > div {
    font-size: 22px; /* Slightly smaller for multi-col */
    padding: 2px 6px;
    background-color: transparent;
    min-height: auto;
    height: auto;
    line-height: 1.2;
}

/* LOTO LIVE TABS */
.loto-live-tabs {
    display: flex;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.loto-live-tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid var(--border);
}
.loto-live-tab-btn:last-child {
    border-right: none;
}
.loto-live-tab-btn:hover {
    background-color: #e2e8f0;
}
.loto-live-tab-btn.active {
    background-color: #ffffff;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

/* NEW LOTO STATS LAYOUT */
.multi-prov-stats {
    display: grid;
    gap: 12px;
}
.multi-prov-stats.col-1 { grid-template-columns: 1fr; }
.multi-prov-stats.col-2 { grid-template-columns: 1fr 1fr; }
.multi-prov-stats.col-3 { grid-template-columns: 1fr 1fr 1fr; }
.multi-prov-stats.col-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.new-stats-box {
    box-shadow: var(--shadow-sm);
}

.col-header-row {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    background-color: #f1f5f9;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-secondary);
}

.new-stats-row {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    border-bottom: 1px solid #f1f5f9;
}
.new-stats-row:last-child {
    border-bottom: none;
}

.stats-col-chuc, .stats-col-donvi {
    padding: 6px 8px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #334155;
    flex-wrap: wrap;
    gap: 4px;
}
.stats-col-so {
    background-color: #f8fafc;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    color: var(--primary);
}

.new-stats-row.active-row .stats-col-so {
    background-color: #fef3c7;
    color: var(--accent);
}
.new-stats-row.active-row {
    background-color: #fffbeb;
}

/* Make sure superscripts look nice */
.stats-col-chuc sup, .stats-col-donvi sup {
    font-size: 10px;
    color: var(--accent);
    margin-left: 1px;
}

/* RIGHT SIDEBAR Links & Information */
.widget-links {
    list-style: none;
    padding: 8px 0;
}

.widget-links li a {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.widget-links li a:hover {
    background-color: #f8fafc;
    color: var(--primary);
}

.widget-links .icon {
    margin-right: 10px;
    font-size: 16px;
}

.info-content {
    padding: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

.info-content p {
    margin-bottom: 12px;
}

.info-content p:last-child {
    margin-bottom: 0;
}

/* FOOTER STYLING */
.main-footer {
    background-color: #1e293b;
    color: #94a3b8;
    padding: 40px 20px;
    margin-top: 40px;
    border-top: 4px solid var(--primary);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
}

.footer-text {
    font-size: 13px;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

/* DAY TABS STYLES */
.day-tabs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 15px;
}

.day-tab-btn {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.day-tab-btn:hover {
    background: #f1f5f9;
}

.day-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.day-short { display: none; }
.day-full { display: inline; }

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 1100px) {
    .app-container {
        grid-template-columns: 200px 1fr;
    }
    .right-sidebar {
        grid-column: span 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .right-sidebar .sidebar-box {
        margin-bottom: 0;
    }
}

@media (max-width: 820px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    .left-sidebar {
        display: none; /* Hide schedule panel on smaller screens to keep main focus */
    }
    .right-sidebar {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 550px) {
    .day-tabs-container {
        justify-content: center;
    }
    .day-short { display: inline; }
    .day-full { display: none; }
    
    .day-tab-btn {
        padding: 5px 8px;
        font-size: 13px;
    }
    body {
        padding: 0;
    }
    
    .app-container {
        margin: 10px auto;
        padding: 0 10px;
    }

    .header-container {
        padding: 10px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        padding: 10px 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        border-radius: 0;
        padding: 10px 20px;
        width: 100%;
    }

    .region-tabs {
        flex-direction: row;
        gap: 6px;
    }

    .region-tabs .tab-btn {
        padding: 10px 4px;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: -0.3px;
        white-space: nowrap;
    }

    .control-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .select-wrapper {
        justify-content: space-between;
    }

    .btn-primary {
        width: 100%;
    }

    .loto-stats-container {
        grid-template-columns: 1fr;
    }

    .grid-label {
        width: 60px;
        font-size: 12px;
    }

    .grid-value {
        font-size: 22px;
        letter-spacing: normal;
        min-height: 32px;
        line-height: 32px;
    }

    .grid-value.text-db {
        font-size: 28px;
        letter-spacing: normal;
        min-height: 32px;
        line-height: 32px;
    }

    .grid-values > div {
        font-size: 20px;
        letter-spacing: normal;
        padding: 2px 6px;
        min-height: 32px;
        line-height: 32px;
        height: 100%;
    }

    .text-db .grid-values > div {
        font-size: 28px;
        letter-spacing: normal;
        min-height: 32px;
        line-height: 32px;
        height: 100%;
    }

    .multi-province-grid .row-db .grid-value.text-db,
    .multi-province-grid .row-db.text-db .grid-values > div {
        font-size: 18px;
    }

    .multi-province-grid .grid-row:not(.row-db) .grid-value.text-db {
        font-size: 22px;
    }

    .stats-label {
        font-size: 16px;
    }

    .stats-val {
        font-size: 16px;
    }

    /* Filter Toolbar Mobile Optimization */
    .filter-toolbar {
        padding: 8px 10px;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .filter-label {
        font-size: 12px;
        white-space: nowrap;
        width: 100%;
    }

    .filter-btn {
        padding: 6px 0;
        font-size: 11px;
        white-space: nowrap;
        flex: 1;
        text-align: center;
        min-width: 0;
    }

    /* Loto Selector Bar Mobile Optimization */
    .loto-selector-bar {
        padding: 12px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .loto-selector-bar .label {
        font-size: 13px;
        white-space: nowrap;
    }

    .number-btns {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 4px;
        width: 100%;
        padding-bottom: 2px;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none;  /* IE and Edge */
    }

    .number-btns::-webkit-scrollbar {
        display: none; /* Chrome, Safari and Opera */
    }

    .loto-num-btn {
        flex: 0 0 25px;
        width: 25px;
        height: 28px;
        font-size: 12px;
        border-radius: 4px;
    }

    #loto-btn-all {
        flex: 0 0 48px;
        width: 48px;
        font-size: 11px;
    }

    /* Loto Live Widget Mobile Optimization */
    .loto-live-header {
        font-size: 13px;
        padding: 8px 10px;
    }

    .loto-live-cell {
        height: 36px;
        font-size: 14px;
    }

    /* Multi-province specific mobile fixes to prevent shifting/overflow */
    .loto-live-tabs {
        flex-wrap: wrap;
    }

    .loto-live-tab-btn {
        flex: 1 1 40%;
        font-size: 12px;
        padding: 8px 4px;
        border-bottom: 1px solid var(--border);
    }

    .col-header {
        font-size: 11px;
        padding: 8px 2px;
        word-break: break-word;
    }

    .multi-col-values {
        padding: 4px 2px;
    }

    .multi-col-values > div {
        font-size: 16px;
        padding: 2px;
    }

    .multi-prov-stats.col-2, 
    .multi-prov-stats.col-3, 
    .multi-prov-stats.col-4 {
        grid-template-columns: 1fr;
    }
}