/* ===== RESET & VARIABLES ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:        #0d0b0b;
  --bg2:       #110f0f;
  --bg3:       #181414;
  --bg4:       #201b1b;
  --border:    rgba(255,255,255,0.07);
  --border-r:  rgba(200,40,40,0.18);
  --gold:      #f5c842;
  --gold2:     #ffd700;
  --gold-dim:  rgba(245,200,66,0.12);
  --gold-glow: rgba(245,200,66,0.28);
  --red:       #c82828;
  --red2:      #e53535;
  --red-dim:   rgba(200,40,40,0.12);
  --red-glow:  rgba(200,40,40,0.28);
  --red-light: #ff6b6b;
  --green:     #22d98a;
  --blue:      #4fc3f7;
  --text:      #f0ebe8;
  --text2:     #a89e9a;
  --text3:     #6b5f5c;
  --r:         14px;
  --r-sm:      9px;
  --shadow:    0 4px 28px rgba(0,0,0,0.55);
  --font:      'Segoe UI', system-ui, -apple-system, sans-serif;
}
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: #2a1e1e; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ===== LOADER ===== */
#page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  transition: opacity 0.4s;
}
#page-loader.gone { opacity: 0; pointer-events: none; }
#page-loader p { font-size: 0.82rem; color: var(--text3); letter-spacing: 0.05em; }
.loader-ring {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--red2);
  border-right-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SHARED ===== */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.gold { color: var(--gold); }

/* ===== LOGO ===== */
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.22rem; font-weight: 800; white-space: nowrap; text-decoration: none;
}
.logo-img {
  height: 36px; width: auto; object-fit: cover; border-radius: 7px;
  border: 1.5px solid rgba(245,200,66,0.3);
  box-shadow: 0 0 10px rgba(200,40,40,0.3);
  flex-shrink: 0;
}
.logo-text { color: var(--text); font-weight: 800; letter-spacing: -0.01em; }
.logo-text em { font-style: normal; color: var(--gold); }
.footer-logo .logo-img { height: 32px; }
.logo-img-brand {
  height: 48px; width: auto; object-fit: contain;
  border: none; box-shadow: none; border-radius: 0;
  filter: drop-shadow(0 1px 8px rgba(0,0,0,0.5));
}
.footer-logo .logo-img-brand { height: 42px; }

/* ===== BADGES ===== */
.badge {
  font-size: 0.67rem; font-weight: 700; padding: 3px 9px; border-radius: 50px;
  text-transform: uppercase; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 4px;
}
.badge-live   { background: rgba(200,40,40,0.14); color: var(--red-light); border: 1px solid rgba(200,40,40,0.3); animation: blink 1.8s ease infinite; }
.badge-open   { background: rgba(34,217,138,0.1); color: var(--green); border: 1px solid rgba(34,217,138,0.26); }
.badge-closed { background: rgba(255,255,255,0.04); color: var(--text3); border: 1px solid var(--border); }
.badge-waiting{ background: rgba(245,200,66,0.09); color: var(--gold); border: 1px solid rgba(245,200,66,0.22); }
.badge-active  { background: rgba(34,217,138,0.1); color: var(--green); border: 1px solid rgba(34,217,138,0.26); }
.badge-archived{ background: rgba(255,255,255,0.04); color: var(--text3); border: 1px solid var(--border); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.55} }

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--red2), var(--red));
  color: #fff; font-weight: 700; font-size: 0.9rem;
  padding: 10px 22px; border-radius: var(--r-sm); border: none; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 3px 14px rgba(200,40,40,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 20px rgba(200,40,40,0.5); }
.btn-full { width: 100%; justify-content: center; }
.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text2);
  font-size: 0.88rem; padding: 9px 18px; border-radius: var(--r-sm); cursor: pointer; transition: all 0.2s;
}
.btn-ghost:hover { background: var(--bg4); color: var(--text); }
.btn-danger {
  background: rgba(200,40,40,0.12); border: 1px solid rgba(200,40,40,0.28); color: var(--red-light);
  font-size: 0.88rem; font-weight: 600; padding: 9px 18px; border-radius: var(--r-sm);
  cursor: pointer; transition: all 0.2s;
}
.btn-danger:hover { background: rgba(200,40,40,0.22); }
.btn-sm {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg4); border: 1px solid var(--border); color: var(--text2);
  font-size: 0.8rem; padding: 7px 13px; border-radius: var(--r-sm); cursor: pointer; transition: all 0.2s;
}
.btn-sm:hover { color: var(--gold); border-color: var(--gold-glow); }
.btn-sm-inline {
  background: var(--gold-dim); border: 1px solid var(--gold-glow); color: var(--gold);
  font-size: 0.8rem; font-weight: 600; padding: 6px 14px; border-radius: var(--r-sm);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-sm-inline:hover { background: rgba(245,200,66,0.2); }
.btn-spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.2); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block;
}

/* ===== FORMS ===== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text2); }
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg2); border: 1px solid var(--border); color: var(--text);
  font-size: 0.9rem; padding: 10px 13px; border-radius: var(--r-sm);
  outline: none; transition: border-color 0.2s; font-family: var(--font); width: 100%;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--gold); }
.form-group select option { background: var(--bg3); }
.form-error { font-size: 0.8rem; color: var(--red-light); min-height: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inp { background: var(--bg2); border: 1px solid var(--border); color: var(--text); font-size: 0.85rem; padding: 8px 12px; border-radius: var(--r-sm); outline: none; }
.inp:focus { border-color: var(--gold); }
.sel { background: var(--bg3); border: 1px solid var(--border); color: var(--text); font-size: 0.85rem; padding: 8px 12px; border-radius: var(--r-sm); outline: none; cursor: pointer; }
.sel option { background: var(--bg3); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; min-width: 620px; }
thead th {
  background: linear-gradient(180deg, rgba(200,40,40,0.1) 0%, rgba(200,40,40,0.04) 100%);
  padding: 13px 16px; text-align: left;
  font-weight: 700; color: var(--text2); font-size: 0.73rem;
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
  border-bottom: 2px solid rgba(200,40,40,0.2);
}
thead th:first-child { border-left: 3px solid var(--red2); }
tbody tr { border-top: 1px solid rgba(255,255,255,0.04); transition: background 0.15s; }
tbody tr:nth-child(even) { background: rgba(255,255,255,0.01); }
tbody tr:hover { background: rgba(245,200,66,0.03); }
tbody td { padding: 11px 16px; vertical-align: middle; }
.td-num { font-weight: 700; font-size: 1rem; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.td-gold { color: var(--gold); }
.td-silver { color: #c0c8dc; }
.td-bronze { color: #cd9a5a; }
.td-muted { color: var(--text3); font-size: 0.8rem; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg4); border: 1px solid var(--border); color: var(--text);
  padding: 12px 22px; border-radius: 50px; font-size: 0.85rem; font-weight: 500;
  z-index: 9000; opacity: 0; transition: all 0.3s; pointer-events: none; white-space: nowrap;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(34,217,138,0.35); color: var(--green); }
.toast.error { border-color: rgba(200,40,40,0.35); color: var(--red-light); }

/* ===== HEADER ===== */
#site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,11,11,0.94); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(200,40,40,0.18);
  box-shadow: 0 1px 0 rgba(245,200,66,0.08), 0 4px 20px rgba(0,0,0,0.4);
}
#site-header::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--red2) 0%, var(--gold) 50%, var(--red2) 100%);
  opacity: 0.7;
}
.hdr-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 16px; height: 64px;
}
#main-nav { display: flex; gap: 2px; align-items: center; margin-left: 16px; }
.nav-link {
  padding: 6px 13px; border-radius: var(--r-sm); font-size: 0.86rem; font-weight: 500; color: var(--text2);
  transition: all 0.2s; position: relative;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-link.active { color: var(--gold); background: rgba(245,200,66,0.07); }
.hdr-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.live-pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(200,40,40,0.1); border: 1px solid rgba(200,40,40,0.28);
  padding: 5px 13px; border-radius: 50px; font-size: 0.77rem; font-weight: 700; color: var(--red-light);
  letter-spacing: 0.04em;
}
.pulse-dot, .live-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.pulse-dot { background: var(--green); animation: pulse-g 1.6s ease infinite; }
.live-dot { background: var(--green); animation: pulse-g 1.6s ease infinite; }
@keyframes pulse-r { 0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(200,40,40,.6)} 50%{opacity:.8;box-shadow:0 0 0 5px rgba(200,40,40,0)} }
@keyframes pulse-g { 0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(34,217,138,.6)} 50%{opacity:.8;box-shadow:0 0 0 5px rgba(34,217,138,0)} }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 6px; color: var(--text); flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }
.mobile-nav {
  display: none; position: fixed; top: 64px; left: 0; right: 0;
  background: rgba(13,11,11,0.98); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(200,40,40,0.18);
  padding: 10px 20px 18px; z-index: 99; flex-direction: column; gap: 2px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 11px 14px; border-radius: var(--r-sm); font-size: 0.9rem; color: var(--text2); transition: all 0.2s; }
.mobile-nav a:hover { background: rgba(245,200,66,0.07); color: var(--gold); }
.btn-refresh {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(200,40,40,0.1); border: 1px solid rgba(200,40,40,0.25); color: var(--red-light);
  font-size: 0.8rem; font-weight: 600; padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer; transition: all 0.2s;
}
.btn-refresh:hover { background: rgba(200,40,40,0.2); border-color: rgba(200,40,40,0.4); }
.btn-refresh.spinning svg { animation: spin 0.6s linear; }

/* ===== HERO BANNER (pengganti slider) ===== */
.hero-banner {
  position: relative; overflow: hidden;
  border-radius: 16px; margin: 24px 0 0;
  min-height: 260px;
  background: linear-gradient(135deg, #1a0808 0%, #200e0e 40%, #1a1000 70%, #130b00 100%);
  border: 1px solid rgba(200,40,40,0.2);
  box-shadow: 0 8px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(245,200,66,0.06);
  display: flex; align-items: center;
}
.hero-banner::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 85% 50%, rgba(245,200,66,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 10% 50%, rgba(200,40,40,0.12) 0%, transparent 55%);
  pointer-events: none;
}
.hero-banner-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(245,200,66,0.02) 40px, rgba(245,200,66,0.02) 41px),
    repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(200,40,40,0.02) 40px, rgba(200,40,40,0.02) 41px);
}
.hero-banner-content {
  position: relative; z-index: 2;
  padding: 40px 52px; max-width: 680px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(200,40,40,0.15); border: 1px solid rgba(200,40,40,0.35);
  color: var(--red-light); font-size: 0.72rem; font-weight: 700;
  padding: 5px 14px; border-radius: 50px; margin-bottom: 16px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.hero-title {
  font-size: clamp(1.55rem, 3.5vw, 2.4rem); font-weight: 800; line-height: 1.18;
  color: var(--text); margin-bottom: 10px; letter-spacing: -0.02em;
}
.hero-title em { font-style: normal; color: var(--gold); }
.hero-sub {
  font-size: 0.94rem; color: var(--text2); line-height: 1.65; margin-bottom: 28px; max-width: 420px;
}
.hero-stats { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; gap: 2px; padding: 0 24px; }
.hero-stat:first-child { padding-left: 0; }
.hero-stat-num { font-size: 1.55rem; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1; }
.hero-stat-lbl { font-size: 0.73rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; }
.hero-stat-sep { width: 1px; height: 36px; background: rgba(255,255,255,0.08); flex-shrink: 0; }

.hero-banner-deco {
  position: absolute; right: -40px; top: 50%; transform: translateY(-50%);
  pointer-events: none; z-index: 1;
}
.deco-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(245,200,66,0.1);
  transform: translate(-50%, -50%);
}
.deco-ring.r1 { width: 260px; height: 260px; border-color: rgba(200,40,40,0.1); }
.deco-ring.r2 { width: 380px; height: 380px; border-color: rgba(245,200,66,0.07); }
.deco-ring.r3 { width: 500px; height: 500px; border-color: rgba(200,40,40,0.04); }

/* ===== STATUS BAR ===== */
.status-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 20px; margin: 10px 0 0;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); flex-wrap: wrap;
  border-left: 3px solid var(--red2);
}
.status-bar-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.status-bar-right { display: flex; align-items: center; gap: 10px; }
.status-chip { display: flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 50px; font-size: 0.8rem; font-weight: 600; }
.status-chip.green { background: rgba(34,217,138,0.08); border: 1px solid rgba(34,217,138,0.22); color: var(--green); }
.meta-row { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text3); }
.meta-row svg { opacity: 0.5; }
.meta-row strong { color: var(--text2); }

/* ===== TAB BAR ===== */
.tab-bar { display: flex; gap: 7px; flex-wrap: wrap; padding: 18px 0; border-bottom: 1px solid var(--border); }
.tab-btn {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); color: var(--text2);
  font-size: 0.83rem; font-weight: 500; padding: 7px 17px; border-radius: 50px;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.tab-btn:hover { border-color: rgba(245,200,66,0.3); color: var(--text); background: rgba(245,200,66,0.04); }
.tab-btn.active { background: linear-gradient(135deg, rgba(200,40,40,0.2), rgba(245,200,66,0.12)); border-color: rgba(245,200,66,0.35); color: var(--gold); font-weight: 700; }

/* ===== NOTICE BAR ===== */
.notice-bar {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(245,200,66,0.04); border: 1px solid rgba(245,200,66,0.12);
  border-radius: var(--r); padding: 13px 18px; margin: 16px 0 4px;
  font-size: 0.83rem; color: var(--text2);
  border-left: 3px solid rgba(245,200,66,0.4);
}
.notice-bar strong { color: var(--gold); margin-right: 6px; }
.notice-icon { font-size: 1.1rem; margin-top: 1px; flex-shrink: 0; }

/* ===== CONTENT GRID ===== */
.content-grid { display: grid; grid-template-columns: 1fr 285px; gap: 26px; padding-top: 4px; }

/* ===== SECTION HEAD ===== */
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 26px 0 16px; gap: 12px; }
.section-head h2 { font-size: 1.08rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-head h2::before {
  content:''; display: block; width: 4px; height: 18px;
  background: linear-gradient(180deg, var(--gold), var(--red2));
  border-radius: 2px;
}
.section-chip { font-size: 0.75rem; color: var(--text3); border: 1px solid var(--border); padding: 4px 10px; border-radius: 50px; }
.hist-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ===== RESULTS BANNER ===== */
.results-banner {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.06);
}
.results-banner-img {
  width: 100%; height: auto; display: block;
  max-height: 160px; object-fit: cover; object-position: center;
}

/* ===== CARDS GRID ===== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.skeleton-card {
  height: 290px; border-radius: var(--r);
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ===== RESULT CARD ===== */
.result-card {
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 55%, #0f3460 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.24s, box-shadow 0.24s;
  cursor: pointer;
  position: relative;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.result-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #e53535 0%, #f5c842 50%, #e53535 100%);
}
.result-card:hover { transform: translateY(-4px); box-shadow: 0 18px 52px rgba(0,0,0,0.65), 0 0 28px rgba(229,53,53,0.14); }

.rc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px 10px 14px;
  background: rgba(0,0,0,0.22);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  gap: 8px;
}
.rc-head-title {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
}
.rc-head-flag {
  width: 3px; height: 18px;
  background: linear-gradient(180deg, #f5c842, #e53535);
  border-radius: 2px;
  flex-shrink: 0;
}
.rc-name {
  font-size: 0.84rem; font-weight: 800; color: #e8eef8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.rc-head .badge { flex-shrink: 0; font-size: 0.62rem; }

.rc-date {
  font-size: 0.67rem; color: rgba(200,215,240,0.5); padding: 5px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.12);
}
.rc-date svg { opacity: 0.4; flex-shrink: 0; }

/* Result rows */
.rc-results {
  padding: 12px 14px 10px; flex: 1;
  display: flex; flex-direction: column; gap: 0;
  overflow: visible;
  min-width: 0;
}

.rc-prize-row {
  display: flex; align-items: flex-start; gap: 0;
  padding: 10px 0;
  flex-direction: column;
  min-width: 0;
}
.rc-prize-row + .rc-prize-row {
  border-top: 1px solid rgba(255,255,255,0.06);
}

.rc-prize-right { width: 100%; }
.rc-prize-label {
  font-size: 0.58rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px;
  color: rgba(200,215,240,0.55);
  display: flex; align-items: center; gap: 7px;
}
.rc-prize-row:nth-child(1) .rc-prize-label { color: #c8804a; }
.rc-prize-row:nth-child(2) .rc-prize-label { color: #b4b4c8; }
.rc-prize-row:nth-child(3) .rc-prize-label { color: #f5c842; }
.rc-result-time {
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.04em;
  opacity: 0.75; font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,0.07); border-radius: 10px; padding: 1px 6px;
}

.rc-digit-boxes { display: flex; gap: 6px; flex-wrap: nowrap; }

.rc-digit {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 900; color: #fff;
  font-variant-numeric: tabular-nums;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.rc-digit:hover { transform: scale(1.1); }
.rc-digit.pop { animation: digitPop 0.35s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes digitPop {
  0% { transform: scale(0.4); opacity: 0.3; }
  100% { transform: scale(1); opacity: 1; }
}

.rc-prize-row:nth-child(1) .rc-digit {
  background: radial-gradient(circle at 35% 28%, #ff9f5a, #d42000 90%);
  box-shadow: 0 4px 14px rgba(200,40,0,0.6), inset 0 2px 0 rgba(255,255,255,0.28), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.rc-prize-row:nth-child(1) .rc-digit.empty {
  background: rgba(229,53,53,0.15);
  box-shadow: inset 0 0 0 1.5px rgba(229,53,53,0.25);
  color: rgba(255,255,255,0.18);
}
.rc-prize-row:nth-child(2) .rc-digit {
  background: radial-gradient(circle at 35% 28%, #74b9ff, #0044a3 90%);
  box-shadow: 0 4px 14px rgba(0,68,163,0.55), inset 0 2px 0 rgba(255,255,255,0.28), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.rc-prize-row:nth-child(2) .rc-digit.empty {
  background: rgba(0,86,179,0.15);
  box-shadow: inset 0 0 0 1.5px rgba(0,86,179,0.25);
  color: rgba(255,255,255,0.18);
}
.rc-prize-row:nth-child(3) .rc-digit {
  background: radial-gradient(circle at 35% 28%, #74b9ff, #0044a3 90%);
  box-shadow: 0 4px 14px rgba(0,68,163,0.55), inset 0 2px 0 rgba(255,255,255,0.28), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.rc-prize-row:nth-child(3) .rc-digit.empty {
  background: rgba(0,86,179,0.15);
  box-shadow: inset 0 0 0 1.5px rgba(0,86,179,0.25);
  color: rgba(255,255,255,0.18);
}

.rc-countdown {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px 8px; gap: 8px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.rc-cdlabel { font-size: 0.62rem; color: rgba(200,215,240,0.4); text-transform: uppercase; letter-spacing: 0.05em; }
.rc-timer { font-size: 0.88rem; font-weight: 700; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; color: #f5c842; }
.rc-timer.urgent { color: #ff6b6b; }
.rc-timer.done { color: rgba(200,215,240,0.28); }

.rc-footer {
  padding: 9px 14px 12px;
  display: flex; gap: 7px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.15);
}
.rc-btn {
  flex: 1; text-align: center;
  background: rgba(229,53,53,0.14);
  border: 1px solid rgba(229,53,53,0.28);
  color: #f5c842; font-size: 0.74rem; font-weight: 700; padding: 8px 8px;
  border-radius: 8px; cursor: pointer; transition: all 0.18s;
  letter-spacing: 0.03em;
}
.rc-btn:hover { background: rgba(229,53,53,0.28); color: #fff; border-color: rgba(229,53,53,0.5); }
.rc-share {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09); color: rgba(200,215,240,0.45);
  padding: 8px 11px; border-radius: 8px; cursor: pointer; transition: all 0.18s;
  display: flex; align-items: center;
}
.rc-share:hover { background: rgba(255,255,255,0.1); color: #e8eef8; }

/* ===== HISTORY MOBILE CARDS ===== */
.hist-table-wrap { display: block; }
.hist-mobile-list-wrap { display: none; }

.hist-mobile-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; margin-bottom: 10px;
  border-left: 3px solid var(--red2);
}
.hmc-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 11px 14px 10px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(200,40,40,0.05) 0%, transparent 100%);
  gap: 10px;
}
.hmc-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hmc-market { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.hmc-period { font-size: 0.7rem; color: var(--text3); }
.hmc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.hmc-date { font-size: 0.7rem; color: var(--text3); }
.hmc-nums {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.hmc-nums-3 { grid-template-columns: repeat(3, 1fr); }
.hmc-num-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 10px 4px;
  border-right: 1px solid var(--border);
}
.hmc-num-item:last-child { border-right: none; }
.hmc-rank {
  font-size: 0.55rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text3);
}
.hmc-val {
  font-size: 1.15rem; font-weight: 800; letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums; line-height: 1; color: var(--text);
}
.hmc-gold .hmc-rank { color: var(--gold); }
.hmc-gold .hmc-val { color: var(--gold); text-shadow: 0 0 12px rgba(245,200,66,0.3); }
.hmc-silver .hmc-val { color: #c8d0e8; }
.hmc-bronze .hmc-val { color: #c8935a; }
.hmc-dim { color: var(--text3) !important; font-size: 1rem !important; }
.hist-empty { padding: 28px; text-align: center; color: var(--text3); font-size: 0.85rem; }

/* ===== HISTORY SECTION ===== */
.hist-section { padding: 0 0 44px; }

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 16px; padding-bottom: 44px; }
.sdb-card { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.sdb-head {
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(200,40,40,0.08) 0%, transparent 100%);
  font-size: 0.81rem; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--text2);
  border-left: 3px solid var(--red2);
}
.sdb-body { padding: 12px 16px; }
.qlink { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; color: var(--text2); transition: color 0.2s; }
.qlink::before { content: '›'; color: var(--gold); opacity: 0.7; font-size: 1rem; }
.qlink:last-child { border-bottom: none; padding-bottom: 0; }
.qlink:hover { color: var(--gold); }
.recent-item { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.recent-item:last-child { border-bottom: none; padding-bottom: 0; }
.ri-market { color: var(--text2); font-weight: 600; margin-bottom: 1px; }
.ri-num { color: var(--gold); font-weight: 700; letter-spacing: 0.06em; }
.ri-date { color: var(--text3); font-size: 0.73rem; margin-top: 2px; }

/* ===== NUMBER GENERATOR (lottery ball style) ===== */
#numgen-sdb-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  overflow: visible !important;
}

.numgen-card {
  background: #b00000;
  background-image: linear-gradient(180deg, #c20000 0%, #9a0000 100%);
  border-radius: 8px;
  border: 3px solid #780000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  padding: 8px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.numgen-balls-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.numgen-slot {
  background: linear-gradient(180deg, #f8f8f8 0%, #e8e8e8 100%);
  border-radius: 5px;
  border: 1px solid #bbb;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.35),
    inset 0 1px 2px rgba(255,255,255,1),
    inset 0 -2px 4px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 3px;
  aspect-ratio: 1 / 1.05;
}

.ngb-ball {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.ngb-ball::after {
  content: '';
  position: absolute;
  top: 7px;
  left: 11px;
  width: 13px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transform: rotate(-35deg);
  pointer-events: none;
  z-index: 2;
}

.ngb-color-0 {
  background: radial-gradient(circle at 36% 30%, #5ba3f0 0%, #1a52b0 50%, #0a2870 100%);
  box-shadow:
    0 0 0 4px rgba(255,255,255,0.25),
    0 3px 10px rgba(10,40,112,0.7),
    inset 0 -3px 5px rgba(0,0,0,0.3);
}
.ngb-color-1 {
  background: radial-gradient(circle at 36% 30%, #ffb060 0%, #e06800 50%, #7a3600 100%);
  box-shadow:
    0 0 0 4px rgba(255,255,255,0.25),
    0 3px 10px rgba(120,50,0,0.7),
    inset 0 -3px 5px rgba(0,0,0,0.3);
}
.ngb-color-2 {
  background: radial-gradient(circle at 36% 30%, #6ee07a 0%, #1e9030 50%, #0a4a12 100%);
  box-shadow:
    0 0 0 4px rgba(255,255,255,0.25),
    0 3px 10px rgba(10,74,18,0.7),
    inset 0 -3px 5px rgba(0,0,0,0.3);
}
.ngb-color-3 {
  background: radial-gradient(circle at 36% 30%, #6adcf8 0%, #0ea8d8 50%, #044c70 100%);
  box-shadow:
    0 0 0 4px rgba(255,255,255,0.25),
    0 3px 10px rgba(4,76,112,0.7),
    inset 0 -3px 5px rgba(0,0,0,0.3);
}

.ngb-inner {
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  display: block;
}

.ngb-ball.ng-spin {
  animation: ngb-spin 0.08s linear infinite;
}
.ngb-ball.ng-land {
  animation: ngb-land 0.5s cubic-bezier(0.22, 1.5, 0.4, 1);
}
@keyframes ngb-spin {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(0.85); }
}
@keyframes ngb-land {
  0%   { transform: scale(0.4) rotate(-15deg); opacity: 0.2; }
  55%  { transform: scale(1.22) rotate(4deg); opacity: 1; }
  78%  { transform: scale(0.95) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.numgen-btn-row {
  padding: 0;
}

.numgen-gen-btn {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, #ffe040 0%, #f5c500 45%, #d9a800 100%);
  color: #4a2800;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 6px;
  border: 2px solid #b08000;
  cursor: pointer;
  box-shadow:
    0 3px 10px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -2px 0 rgba(0,0,0,0.18);
  transition: all 0.15s ease;
  font-family: inherit;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.numgen-gen-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -110%; width: 70%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}
.numgen-gen-btn:hover::before { left: 130%; }
.numgen-gen-btn:hover {
  background: linear-gradient(180deg, #ffea55 0%, #ffd200 45%, #e6b400 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.6);
}
.numgen-gen-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 5px rgba(0,0,0,0.4), inset 0 1px 2px rgba(0,0,0,0.15);
}
.numgen-gen-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.numgen-history-wrap {
  padding: 0;
}
.numgen-history-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  min-height: 4px;
}
.ng-hist-chip {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: 20px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.15em;
  animation: ng-fadein 0.3s ease both;
  font-variant-numeric: tabular-nums;
  cursor: default;
}

@keyframes ng-fadein { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }

/* ===== RESULT HISTORY WIDGET (sidebar) ===== */
.rh-list { display: flex; flex-direction: column; gap: 0; }
.rh-item {
  padding: 10px 0; border-bottom: 1px solid var(--border);
  animation: ng-fadein 0.4s ease both;
}
.rh-item:last-child { border-bottom: none; padding-bottom: 0; }
.rh-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.rh-market { font-size: 0.78rem; font-weight: 800; color: var(--text); letter-spacing: 0.04em; text-transform: uppercase; }
.rh-date { font-size: 0.68rem; color: var(--text3); }
.rh-nums { display: flex; gap: 6px; }
.rh-num-block { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rh-num-label { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3); }
.rh-num-val {
  font-size: 0.88rem; font-weight: 900; letter-spacing: 0.1em;
  padding: 3px 7px; border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.rh-num-val.rh-gold   { background: rgba(245,200,66,0.12); color: var(--gold); border: 1px solid rgba(245,200,66,0.25); }
.rh-num-val.rh-silver { background: rgba(180,200,220,0.1); color: #b0bec5; border: 1px solid rgba(180,200,220,0.2); }
.rh-num-val.rh-bronze { background: rgba(205,127,50,0.1); color: #cd7f32; border: 1px solid rgba(205,127,50,0.2); }
.rh-empty { font-size: 0.8rem; color: var(--text3); text-align: center; padding: 12px 0; }
.info-box {
  background: rgba(200,40,40,0.05); border: 1px solid rgba(200,40,40,0.14);
  border-radius: var(--r-sm); padding: 13px; font-size: 0.81rem; color: var(--text2); line-height: 1.6;
}
.info-box strong { color: var(--red-light); }

/* ===== FOOTER ===== */
footer {
  background: var(--bg2); padding: 44px 0 22px; margin-top: 8px;
  border-top: 1px solid rgba(200,40,40,0.15);
  position: relative;
}
footer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--red2) 0%, var(--gold) 50%, var(--red2) 100%);
  opacity: 0.5;
}
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 32px; }
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { font-size: 0.81rem; color: var(--text3); line-height: 1.7; max-width: 230px; }
.footer-col h4 { font-size: 0.77rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 0.82rem; color: var(--text3); margin-bottom: 9px; transition: color 0.2s; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 22px; display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.footer-bottom p { font-size: 0.77rem; color: var(--text3); }
.disclaimer { max-width: 500px; line-height: 1.6; text-align: right; }

/* ===== BACK TO TOP ===== */
#back-top {
  position: fixed; right: 20px; bottom: 24px; width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--red2), rgba(200,40,40,0.6));
  border: 1px solid rgba(200,40,40,0.4); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.25s; z-index: 80;
  opacity: 0; pointer-events: none;
  box-shadow: 0 4px 18px rgba(200,40,40,0.4);
}
#back-top.visible { opacity: 1; pointer-events: auto; }
#back-top:hover { background: linear-gradient(135deg, var(--gold), #e0a800); border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 6px 22px rgba(245,200,66,0.4); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; }
  .sdb-card { flex: 1; min-width: 240px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  #main-nav { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .footer-bottom { flex-direction: column; }
  .disclaimer { text-align: left; }
  .form-row { grid-template-columns: 1fr; }
  .hero-banner { margin: 12px 0 0; border-radius: 12px; min-height: auto; }
  .hero-banner-content { padding: 28px 24px; }
  .hero-title { font-size: 1.45rem; }
  .hero-sub { font-size: 0.85rem; margin-bottom: 20px; }
  .hero-stats { gap: 0; }
  .hero-stat { padding: 0 16px; }
  .hero-stat:first-child { padding-left: 0; }
  .hero-stat-num { font-size: 1.25rem; }
  .status-bar { padding: 10px 14px; gap: 10px; }
  .status-bar-left { gap: 10px; }
  .tab-bar { gap: 6px; padding: 14px 0 16px; }
  .tab-btn { font-size: 0.79rem; padding: 6px 13px; }
  .section-head { padding: 20px 0 14px; }
  .notice-bar { padding: 11px 14px; font-size: 0.8rem; }
}
@media (max-width: 640px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hist-table-wrap { display: none; }
  .hist-mobile-list-wrap { display: block; }
  .rc-digit { width: 34px; height: 34px; font-size: 0.88rem; }
  .rc-digit-boxes { gap: 4px; flex-wrap: nowrap; }
  .rc-results { padding: 8px 10px 8px; }
  .rc-prize-row { padding: 8px 0; }
}
@media (max-width: 480px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .rc-digit { width: 30px; height: 30px; font-size: 0.8rem; }
  .rc-digit-boxes { gap: 3px; flex-wrap: nowrap; }
  .rc-results { padding: 6px 8px 6px; }
  .footer-grid { grid-template-columns: 1fr; }
  .sidebar { flex-direction: column; }
  .hero-banner-deco { display: none; }
  .hero-banner-content { padding: 22px 18px; }
  .hero-title { font-size: 1.2rem; }
  .hero-sub { display: none; }
  .hero-stats { gap: 0; }
  .hero-stat { padding: 0 12px; }
  .hero-stat-num { font-size: 1.1rem; }
  .status-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .status-bar-right { width: 100%; }
  .btn-refresh { width: 100%; justify-content: center; }
  .hdr-inner { padding: 0 14px; height: 58px; }
  .wrap { padding: 0 12px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hist-controls { width: 100%; }
  .hist-controls .sel { flex: 1; }
  .logo-img { height: 28px; }
  .logo-text { font-size: 1.05rem; }
  .rc-main-num { font-size: 1.9rem; }
  .rc-sub-num { font-size: 1.05rem; }
  .rc-main-block { padding: 9px 12px; }
  .rc-sub-block { padding: 7px 5px; }
  .hmc-val { font-size: 1rem; }
  .hmc-num-item { padding: 9px 3px; }
}
