:root {
    --text: #f6f2ea;
    --gold-1: #fff38d;
    --gold-2: #f6d42f;
    --gold-3: #d7a300;
    --gold-4: #8f5f00;
    --blue-1: #8fd6ff;
    --blue-2: #37aef6;
    --blue-3: #0e6bc7;
    --blue-4: #093f82;
    --red-1: #ffadad;
    --red-2: #ff5050;
    --red-3: #cf1717;
    --red-4: #7a0909;
    --macau-1: #ffe7b0;
    --macau-2: #ffba35;
    --macau-3: #d47b00;
    --macau-4: #7a3900;
    --panel-border: #2a0808;
    --row-black: #060606;
    --row-charcoal: #181818;
    --shadow: 0 10px 28px rgba(0, 0, 0, .45);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: Tahoma, Verdana, Arial, sans-serif;
    color: var(--text);
}

.page-shell {
    display: flex;
    justify-content: center;
    padding: 6px;
}

.table-wrap {
    width: min(100%, 860px);
}

.market-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 8px;
}

.market-tab {
    min-width: 0;
    padding: 0;
    border-radius: 10px 10px 0 0;
    border: 1px solid #737373;
    background: linear-gradient(180deg, #5d5d5d 0%, #2c2c2c 18%, #151515 55%, #2f2f2f 100%);
    color: #ececec;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .3px;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.market-tab span {
    display: block;
    min-width: 136px;
    padding: 10px 16px;
    text-align: center;
    white-space: nowrap;
}

.market-tab.is-active {
    background: linear-gradient(180deg, #565656 0%, #2e2e2e 18%, #141414 52%, #010101 100%);
    border-color: #8f8f8f;
}

.result-panel {
    display: none;
    background: #060606;
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.result-panel.is-active {
    display: block;
}

.panel-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.macau-card .panel-scroll {
    overflow-x: hidden;
}

.table-head,
.result-row {
    display: grid;
    grid-template-columns: var(--grid-columns, minmax(100px, 1.2fr) repeat(3, minmax(0, 1fr)));
    align-items: center;
}

.table-head {
    background: linear-gradient(180deg, #fff685 0%, #f8dc31 26%, #e2bd04 62%, #b07a00 100%);
    color: #0a0a0a;
    border-bottom: 1px solid #8a5c00;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
    position: sticky;
    top: 0;
    z-index: 8;
}

.table-head>div {
    padding: 11px 8px;
    font-size: clamp(16px, 2.3vw, 26px);
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.table-body {
    display: block;
    position: relative;
}

.result-row {
    min-height: 54px;
    padding: 0 8px;
}

.row-black {
    background: var(--row-black);
}

.row-charcoal {
    background: var(--row-charcoal);
}

.cell {
    padding: 8px 5px;
}

.cell-date {
    text-align: center;
    color: #f3f4f5;
    font-size: clamp(11px, 1.6vw, 19px);
    font-weight: 900;
    letter-spacing: .2px;
    white-space: nowrap;
}

.cell-market {
    text-align: center;
}

.digits {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.digit {
    width: clamp(14px, 1.95vw, 24px);
    height: clamp(28px, 4vw, 40px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #6b4400;
    color: #111;
    font-size: clamp(13px, 2.1vw, 24px);
    font-weight: 900;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 1px 0 rgba(0, 0, 0, .25);
}

.digit.is-placeholder {
    letter-spacing: -1px;
}

.digits-sdy .digit {
    background: linear-gradient(180deg, var(--gold-1) 0%, var(--gold-2) 26%, var(--gold-3) 68%, var(--gold-4) 100%);
    border-color: #6b4400;
    color: #111;
}

.digits-sgp .digit {
    background: linear-gradient(180deg, var(--blue-1) 0%, var(--blue-2) 28%, var(--blue-3) 68%, var(--blue-4) 100%);
    border-color: #0a3b73;
    color: #f2fbff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
}

.digits-hk .digit {
    background: linear-gradient(180deg, var(--red-1) 0%, var(--red-2) 28%, var(--red-3) 68%, var(--red-4) 100%);
    border-color: #5e0606;
    color: #fff3f3;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
}

.digits-macau .digit {
    background: linear-gradient(180deg, var(--macau-1) 0%, var(--macau-2) 26%, var(--macau-3) 68%, var(--macau-4) 100%);
    border-color: #7a3900;
    color: #1b0b00;
}

.ad-slot-row {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #0e0e0e 0%, #131313 100%);
    border-top: 1px solid #2b0b0b;
    border-bottom: 1px solid #2b0b0b;
    position: relative;
    z-index: 12;
    clear: both;
}

.ad-slot-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.ad-slot-link {
    position: relative;
    z-index: 13;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    width: auto;
    text-decoration: none;
    overflow: visible;
}

.ad-slot-image {
    display: block;
    max-width: min(100%, 468px);
    width: auto;
    height: auto;
    min-height: 60px;
    border: 1px solid #6a3c00;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .35);
    background: #1a0909;
}

.ad-slot-image.is-hidden {
    display: none;
}

.ad-slot-fallback {
    display: none;
    min-width: 280px;
    max-width: 100%;
    padding: 14px 22px;
    text-align: center;
    font-weight: 900;
    color: #ffe39d;
    border: 1px solid #6a3c00;
    background: linear-gradient(180deg, #3a1600, #1a0909);
}

.ad-slot-fallback.is-visible {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.status-alert {
    margin-top: 10px;
    padding: 9px 12px;
    background: rgba(255, 204, 0, .09);
    border: 1px solid rgba(255, 204, 0, .25);
    color: #ffe29a;
}

.result-panel-macau {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.macau-card {
    background: linear-gradient(180deg, #090909 0%, #050505 100%);
    border: 1px solid #6b3f00;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.macau-title {
    padding: 11px 10px;
    text-align: center;
    font-size: clamp(16px, 2vw, 28px);
    font-weight: 900;
    color: #fff4c7;
    text-transform: uppercase;
    background: linear-gradient(180deg, #4f2600 0%, #251104 65%, #160803 100%);
    border-bottom: 1px solid #8a5200;
}

.macau-wrap {
    width: 100%;
    overflow: hidden;
}

.macau-grid {
    display: grid;
    grid-template-columns: minmax(104px, 1.05fr) repeat(6, minmax(0, 1fr));
    align-items: stretch;
}

.macau-head {
    background: linear-gradient(180deg, #fff090 0%, #f5d12a 30%, #dbac00 72%, #9f6400 100%);
    border-bottom: 1px solid #7b4700;
}

.macau-head-cell {
    padding: 10px 4px;
    font-size: clamp(11px, 1.25vw, 18px);
    font-weight: 900;
    text-align: center;
    color: #130700;
    text-transform: uppercase;
    white-space: nowrap;
}

.macau-body {
    display: block;
}

.macau-row {
    min-height: 56px;
    padding: 0 6px;
}

.macau-cell {
    padding: 8px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.macau-date-cell {
    color: #fff2bd;
    font-weight: 900;
    font-size: clamp(9px, 1vw, 14px);
    white-space: nowrap;
    letter-spacing: .15px;
}

.macau-value-cell {
    flex-direction: column;
    gap: 4px;
}

.macau-mini-label {
    display: none;
    color: #ffebb8;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.macau-value-cell .digit {
    width: clamp(13px, 1.6vw, 18px);
    height: clamp(24px, 2.7vw, 30px);
    font-size: clamp(11px, 1.25vw, 15px);
}

.macau-ad-row {
    background: #0d0d0d;
    border-top: 1px solid #3d3d3d;
    border-bottom: 1px solid #3d3d3d;
}

.ad-slot-row-inline {
    padding: 0;
    background: transparent;
    border: 0;
}

@media (max-width: 700px) {
    .page-shell {
        padding: 4px;
    }
    .market-tabs {
        gap: 6px;
        margin-bottom: 6px;
    }
    .market-tab {
        flex: 1 1 calc(33.333% - 6px);
    }
    .market-tab span {
        min-width: 0;
        padding: 8px 8px;
        font-size: 11px;
        white-space: normal;
    }
    .table-head>div {
        padding: 10px 6px;
        font-size: 16px;
    }
    .result-row {
        min-height: 48px;
        padding: 0 4px;
    }
    .cell {
        padding: 7px 3px;
    }
    .cell-date {
        font-size: 10px;
    }
    .digit {
        width: 14px;
        height: 26px;
        font-size: 12px;
    }
    .ad-slot-row {}
    .ad-slot-image {
        max-width: 100%;
        min-height: 54px;
    }
    .macau-title {
        padding: 10px 8px;
        font-size: 18px;
        background: linear-gradient(180deg, #fff685 0%, #f8dc31 26%, #e2bd04 62%, #b07a00 100%) !important;
        color: #0a0a0a !important;
    }
    .macau-head {
        display: none;
    }
    .macau-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-height: 0;
        padding: 6px;
        gap: 6px;
    }
    .macau-date-cell {
        grid-column: 1 / -1;
        justify-content: center;
        font-size: 9px;
        padding: 4px 2px 2px;
    }
    .macau-value-cell {
        gap: 3px;
        padding: 6px 2px 8px;
        background: rgba(255, 193, 58, .04);
        border: 1px solid rgba(214, 140, 0, .18);
        border-radius: 8px;
    }
    .macau-mini-label {
        display: block;
    }
    .macau-value-cell .digit {
        width: 13px;
        height: 23px;
        font-size: 11px;
    }
}

/* ===== Manual Admin UI ===== */

.admin-body {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(255, 205, 68, .13), transparent 28%), linear-gradient(180deg, #080808 0%, #020202 100%);
    color: var(--text);
}

.admin-shell {
    width: min(1180px, calc(100% - 22px));
    margin: 0 auto;
    padding: 18px 0 42px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(219, 177, 0, .35);
    background: linear-gradient(180deg, rgba(28, 28, 28, .98), rgba(5, 5, 5, .98));
    box-shadow: var(--shadow);
}

.admin-brand strong {
    display: block;
    font-size: 20px;
    letter-spacing: .5px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #fff48d 0%, #f1d62c 34%, #dbb100 72%, #966000 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.admin-brand span,
.admin-muted {
    color: #b9b1a4;
    font-size: 12px;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.admin-nav a,
.admin-btn,
.admin-btn-secondary,
.admin-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 10px;
    border: 1px solid rgba(255, 221, 84, .35);
    color: #fff1b7;
    background: linear-gradient(180deg, #2f2100, #0d0d0d);
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.admin-nav a.is-active,
.admin-btn {
    color: #111;
    background: linear-gradient(180deg, #fff38d 0%, #f6d42f 35%, #d7a300 100%);
    border-color: #f6d42f;
}

.admin-btn-secondary {
    background: linear-gradient(180deg, #2d2d2d, #111);
}

.admin-danger {
    background: linear-gradient(180deg, #5a1010, #1a0505);
    border-color: rgba(255, 70, 70, .45);
    color: #ffe0e0;
}

.admin-card {
    margin: 14px 0;
    padding: 16px;
    border: 1px solid rgba(219, 177, 0, .35);
    background: linear-gradient(180deg, rgba(16, 16, 16, .98), rgba(5, 5, 5, .98));
    box-shadow: var(--shadow);
}

.admin-card h1,
.admin-card h2,
.admin-card h3 {
    margin: 0 0 12px;
    color: #fff0a4;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.admin-stat {
    padding: 14px;
    border: 1px solid rgba(255, 221, 84, .22);
    background: rgba(255, 255, 255, .035);
    border-radius: 14px;
}

.admin-stat b {
    display: block;
    font-size: 28px;
    color: #ffe65a;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-form-grid .full {
    grid-column: 1 / -1;
}

.admin-field label {
    display: block;
    margin-bottom: 6px;
    color: #ffebad;
    font-weight: 800;
    font-size: 13px;
}

.admin-input,
.admin-select,
.admin-textarea {
    width: 100%;
    min-height: 40px;
    padding: 10px 11px;
    border-radius: 10px;
    border: 1px solid rgba(255, 221, 84, .25);
    background: #0a0a0a;
    color: #f6f2ea;
    outline: none;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
    border-color: #f6d42f;
    box-shadow: 0 0 0 3px rgba(246, 212, 47, .12);
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.admin-table th,
.admin-table td {
    padding: 10px 9px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    text-align: left;
}

.admin-table th {
    color: #111;
    background: linear-gradient(180deg, #fff38d 0%, #d7a300 100%);
    text-transform: uppercase;
    font-size: 12px;
}

.admin-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, .035);
}

.admin-alert {
    padding: 11px 13px;
    margin: 12px 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 221, 84, .35);
    color: #fff4c0;
    background: rgba(255, 221, 84, .08);
}

.admin-alert.ok {
    border-color: rgba(59, 220, 116, .35);
    background: rgba(59, 220, 116, .08);
    color: #d7ffe4;
}

.admin-alert.bad {
    border-color: rgba(255, 70, 70, .35);
    background: rgba(255, 70, 70, .08);
    color: #ffdede;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
}

.login-card {
    width: min(420px, 100%);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.admin-preview {
    max-width: 100%;
    border: 1px solid #6a3c00;
    background: #111;
    padding: 6px;
}

.admin-mini-results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.admin-mini-item {
    padding: 10px;
    border: 1px solid rgba(255, 221, 84, .18);
    background: rgba(255, 255, 255, .035);
    border-radius: 12px;
}

.admin-code {
    font-family: Consolas, monospace;
    background: #050505;
    border: 1px solid rgba(255, 221, 84, .2);
    padding: 2px 5px;
    border-radius: 6px;
    color: #ffe65a;
}

.macau-grid {
    grid-template-columns: minmax(104px, 1.05fr) repeat(var(--macau-count, 6), minmax(0, 1fr));
}

@media (max-width: 800px) {
    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .admin-grid,
    .admin-form-grid,
    .admin-mini-results {
        grid-template-columns: 1fr;
    }
    .admin-nav a {
        flex: 1 1 calc(50% - 8px);
    }
}

/* ===== v3 admin/dashboard refinements ===== */

.hp-field {
    position: absolute !important;
    left: -99999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid rgba(255, 221, 84, .28);
    border-radius: 999px;
    color: #ffe885;
    background: rgba(255, 221, 84, .07);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-card-head h2,
.admin-card-head p {
    margin-top: 0;
}

.admin-dash-group {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid rgba(255, 221, 84, .18);
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012));
    border-radius: 14px;
}

.admin-dash-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-dash-group-head h3 {
    margin: 0;
    font-size: 18px;
    color: #fff0a4;
}

.admin-dash-group-head span {
    color: #b9b1a4;
    font-size: 12px;
    font-weight: 800;
}

.admin-mini-results-main {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-mini-results-lotto {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-mini-results-macau {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-mini-digits {
    margin-top: 8px;
}

.admin-mini-item {
    min-height: 86px;
}

.admin-edit-group {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid rgba(255, 221, 84, .18);
    background: rgba(255, 255, 255, .02);
    border-radius: 14px;
}

.admin-edit-group h3 {
    margin: 0 0 12px;
}

.admin-date-picker-row {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-date-field {
    min-width: 240px;
}

.admin-date-field span {
    display: block;
    margin-bottom: 6px;
    color: #ffebad;
    font-weight: 900;
    font-size: 13px;
}

.admin-preview {
    max-width: 100%;
    border: 1px solid rgba(255, 221, 84, .35);
    background: #080808;
    padding: 4px;
}

/* ===== protected ad visibility hardening ===== */

.ad-slot-protected,
.ad-slot-protected.ad-slot-row,
.ad-slot-protected.ad-slot-row-inline {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 54px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 999 !important;
}

.ad-slot-protected .ad-slot-inner {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 54px !important;
    height: auto !important;
    max-height: none !important;
    justify-content: center !important;
    align-items: center !important;
    pointer-events: auto !important;
}

.ad-slot-protected .ad-slot-link {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.ad-slot-protected .ad-slot-image {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 54px !important;
    height: auto !important;
    max-height: none !important;
    pointer-events: auto !important;
}

.ad-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: #1a0a00;
    font-weight: 1000;
    font-size: clamp(18px, 3vw, 34px);
    background: linear-gradient(180deg, rgba(255, 243, 141, .98), rgba(215, 163, 0, .98));
}

.ad-lock-overlay[hidden] {
    display: none !important;
}

@media (max-width: 800px) {
    .admin-card-head {
        flex-direction: column;
    }
    .admin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .admin-mini-results-main,
    .admin-mini-results-lotto,
    .admin-mini-results-macau {
        grid-template-columns: 1fr;
    }
    .admin-form-grid {
        grid-template-columns: 1fr;
    }
    .admin-topbar {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-actions {
        flex-wrap: wrap;
    }
}

/* ===== v5 ad lock + multi banner ===== */

.admin-banner-box {
    padding: 12px;
    border: 1px solid rgba(255, 221, 84, .18);
    background: rgba(255, 255, 255, .025);
    border-radius: 14px;
}

.admin-banner-box h3 {
    margin: 0 0 10px !important;
}

html.ad-lock-active [data-panel].is-active .result-row,
html.ad-lock-active [data-panel].is-active .macau-row,
html.ad-lock-active [data-panel].is-active .table-head,
html.ad-lock-active [data-panel].is-active .macau-head {
    filter: blur(5px) !important;
    opacity: .12 !important;
    pointer-events: none !important;
    user-select: none !important;
}

html.ad-lock-active .ad-slot-protected,
html.ad-lock-active .ad-slot-protected * {
    filter: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.ad-slot-protected .ad-slot-link {
    cursor: pointer !important;
    text-decoration: none !important;
}

.ad-slot-protected .ad-slot-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* ===== v6 per-banner ads admin ===== */

.admin-banner-box.is-hidden {
    display: none !important;
}

.admin-banner-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-banner-fields {
    margin-top: 8px;
}

.admin-field small.admin-muted {
    display: block;
    margin-top: 6px;
    line-height: 1.4;
}

.js-add-ad:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.admin-banner-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-btn-danger {
    border: 1px solid rgba(255, 70, 70, .55);
    background: linear-gradient(180deg, #5b1111, #250606);
    color: #ffd6d6;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}

.admin-btn-danger:hover {
    border-color: rgba(255, 90, 90, .95);
    box-shadow: 0 0 14px rgba(255, 0, 0, .22);
    transform: translateY(-1px);
}

/* ===== FIX TOTO MACAU MOBILE: tetap table 1 row seperti PC ===== */

@media (max-width: 700px) {
    .result-panel-macau {
        overflow: hidden !important;
    }
    .macau-card {
        overflow: hidden !important;
    }
    .macau-wrap {
        width: 100% !important;
        overflow: hidden !important;
    }
    .macau-title {
        padding: 10px 8px !important;
        font-size: 18px !important;
        line-height: 1.1 !important;
        color: #0a0a0a !important;
        background: linear-gradient(180deg, #fff685 0%, #f8dc31 26%, #e2bd04 62%, #b07a00 100%) !important;
        border-bottom: 1px solid #8a5200 !important;
    }
    .macau-grid,
    .macau-head.macau-grid,
    .macau-row.macau-grid {
        display: grid !important;
        grid-template-columns: 72px repeat(var(--macau-count, 6), minmax(0, 1fr)) !important;
        align-items: center !important;
        gap: 0 !important;
    }
    .macau-head {
        display: grid !important;
        background: linear-gradient(180deg, #fff090 0%, #f5d12a 30%, #dbac00 72%, #9f6400 100%) !important;
        border-bottom: 1px solid #7b4700 !important;
    }
    .macau-head-cell {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 0 !important;
        padding: 7px 1px !important;
        font-size: 10px !important;
        line-height: 1 !important;
        font-weight: 900 !important;
        color: #130700 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-transform: uppercase !important;
    }
    .macau-row {
        min-height: 40px !important;
        padding: 0 !important;
        border-bottom: 1px solid rgba(255, 221, 84, .10) !important;
    }
    .macau-cell {
        min-width: 0 !important;
        padding: 5px 1px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        overflow: hidden !important;
    }
    .macau-date-cell {
        grid-column: auto !important;
        font-size: 8px !important;
        line-height: 1.05 !important;
        font-weight: 900 !important;
        color: #fff2bd !important;
        white-space: normal !important;
        letter-spacing: 0 !important;
        background: transparent !important;
        border: 0 !important;
    }
    .macau-value-cell {
        flex-direction: column !important;
        gap: 0 !important;
        padding: 5px 1px !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
    }
    .macau-mini-label {
        display: none !important;
    }
    .macau-value-cell .digits {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        gap: 1px !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .macau-value-cell .digit {
        width: 8px !important;
        min-width: 8px !important;
        height: 18px !important;
        font-size: 8px !important;
        line-height: 18px !important;
        border-radius: 1px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

@media (max-width: 390px) {
    .macau-grid,
    .macau-head.macau-grid,
    .macau-row.macau-grid {
        grid-template-columns: 66px repeat(var(--macau-count, 6), minmax(0, 1fr)) !important;
    }
    .macau-head-cell {
        font-size: 9px !important;
    }
    .macau-date-cell {
        font-size: 7px !important;
    }
    .macau-value-cell .digit {
        width: 10px !important;
        min-width: 7px !important;
        height: 17px !important;
        font-size: 10px !important;
        line-height: 17px !important;
    }
}