/* Scoped theo .xsmb-container để hạn chế bị theme đè */
.xsmb-container *{box-sizing:border-box}
.xsmb-container{max-width:1100px;margin:18px auto;padding:0 12px;color:#1f2937;font:15px/1.5 system-ui}

.xsmb-controls{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin-bottom:12px}
.xsmb-field{display:flex;flex-direction:column;gap:6px}
.xsmb-label{font-size:12px;color:#6b7280}
.xsmb-input{width:66px;padding:8px 10px;border:1px solid #e9eef5;border-radius:8px;background:#fff;font-weight:700;text-align:center}

.xsmb-btn{border:1px solid #e9eef5;border-radius:8px;padding:10px 14px;cursor:pointer;font-weight:600;background:#fff}
.xsmb-primary{background:#0b61ff;color:#fff;border-color:#0b61ff}
.xsmb-warn{background:#ffd54f}
.xsmb-ghost{background:#fff}

.xsmb-titlebar{background:#e10600;color:#fff;border-radius:6px;padding:10px 12px;margin-bottom:10px;text-align:center;font-weight:800}

.xsmb-grid{display:block;gap:12px}
@media (max-width:920px){.xsmb-grid{grid-template-columns:1fr}}

.xsmb-panel{background:#fff;border:1px solid #e9eef5;border-radius:8px;overflow:hidden}
.xsmb-panel table{width:100%;border-collapse:collapse}
.xsmb-panel th,.xsmb-panel td{border-bottom:1px solid #e9eef5;padding:10px 8px;text-align:center}
.xsmb-gcol{width:60px;color:#555}

.xsmb-num{display:inline-flex;align-items:center;justify-content:center;min-width:86px;height:36px;padding:0 10px;
  border:1px solid #e9eef5;border-radius:8px;background:#fff;font-weight:800;font-size:18px}
.xsmb-num.small{min-width:64px}
.xsmb-num.placeholder{color:#9aa3af}
.xsmb-num.db,.xsmb-num.g7{color:#d90429;font-weight:900;font-size:22px}

.last2{padding:0 1px}
.last2.highlight{background:#fff8c2;color:#c0392b;border-radius:4px;padding:0 2px}
.xsmb-lucky{background:#ffeb99; box-shadow:0 0 0 2px #ffd24d inset; border-radius:6px}

@keyframes shake {0%{transform:translateX(0)}25%{transform:translateX(-3px)}50%{transform:translateX(3px)}75%{transform:translateX(-3px)}100%{transform:translateX(0)}}
.xsmb-num.shake{animation:shake 0.6s ease}

.spin{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;
  border:3px solid #ffdd66;border-top-color:#f39c12;animation:rot 1s linear infinite}
@keyframes rot{to{transform:rotate(360deg)}}

.xsmb-view{display:flex;align-items:center;gap:8px;padding:8px 10px;justify-content:center}
.xsmb-chips{display:flex;gap:6px;align-items:center;justify-content:center;padding:6px 10px; margin-bottom: 20px;}
.xsmb-chip{width:28px;height:28px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;
  background:#e5e7eb;color:#111;font-weight:700;border:1px solid #d1d5db;cursor:pointer}

.xsmb-stats-wrap{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:720px){.xsmb-stats-wrap{grid-template-columns:1fr}}
.xsmb-stats-title{background:#eaf5ff;color:#0d4d86;padding:10px;font-weight:800;text-align:center}
.xsmb-stat th,.xsmb-stat td{padding:8px;border-bottom:1px solid #e9eef5;text-align:center}
.xsmb-col-idx{width:46px;font-weight:800;color:#d90429}
.xsmb-list{font-variant-numeric:tabular-nums}

.xsmb-cells{display:grid;align-items:center;justify-items:center}
.xsmb-cells.center{display:flex;justify-content:center}
.xsmb-grid-3{grid-template-columns:repeat(3,1fr);gap:32px}
.xsmb-grid-4{grid-template-columns:repeat(4,1fr);gap:28px}
.pos-1{grid-column:1}
.pos-3{grid-column:3}

.xsmb-history{padding:8px 10px}
.xsmb-history h3{margin:8px 0 6px 0;font-size:16px}
.xsmb-h-row{display:flex;justify-content:space-between;gap:8px;border-bottom:1px dashed #e9eef5;padding:6px 0}
.xsmb-h-row strong{color:#d90429}

.xsmb-leader{padding:10px}
.xsmb-leader h3{margin:8px 0 6px 0;font-size:16px}
.xsmb-leader .rank{display:flex;align-items:center;gap:8px;margin:6px 0}
.xsmb-leader .badge{width:26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:#eef2ff;font-weight:900}

.xsmb-footer{margin:14px 4px 6px 4px;color:#6b7280;font-size:13px;text-align:center}

.xsmb-toast{position:fixed;left:50%;top:14px;transform:translateX(-50%);background:#fff;border:1px solid #ffd24d;
  box-shadow:0 6px 20px rgba(0,0,0,.08);padding:10px 14px;border-radius:10px;font-weight:800;z-index:9999}
