/* ====================================================================
   SATTA-KING-FAST - 100% BULLETPROOF ADAPTIVE RESPONSIVE STYLESHEET
   Guaranteed Zero Horizontal Overflow across 320px, 375px, 430px, Tablet & 4K
   ==================================================================== */

:root {
  --primary-green: #33CC99;
  --dark-header: #383838;
  --gold-highlight: #FBC503;
  --gold-border: #D49F00;
  --red-alert: #FF5252;
  --number-red: #D50000;
  --bg-color: #F1F1F1;
  --card-bg: #FFFFFF;
  --border-color: #CCCCCC;
  --text-main: #212121;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-color);
  font-family: 'Hind', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: #2962FF;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ====================================================================
   HEADER & LOGO
   ==================================================================== */
#header {
  width: 100%;
  background: var(--card-bg);
  padding: 10px 8px;
  border-bottom: 2px solid #E0E0E0;
  text-align: center;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 960px;
  margin: 0 auto;
}

.logo-badge {
  background: linear-gradient(135deg, #FF1744 0%, #D50000 100%);
  color: #FFF;
  font-weight: 900;
  font-size: clamp(1.15rem, 3.5vw, 1.55rem);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 1px;
  box-shadow: 0 3px 6px rgba(213,0,0,0.25);
  flex-shrink: 0;
}

.logo-text-block {
  text-align: left;
}

.logo-title {
  font-size: clamp(1.1rem, 4vw, 1.65rem);
  font-weight: 900;
  color: #1A237E;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.logo-sub {
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  color: #616161;
  font-weight: 600;
}

/* ====================================================================
   MAIN CONTAINER (BLOCK LAYOUT - NO SIDE-BY-SIDE FLEX BUGS)
   ==================================================================== */
#section {
  width: 100%;
  display: block;
  margin: 0 auto;
  padding: 6px 0 24px 0;
}

#container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 6px;
  display: block;
}

/* Marquee News Ticker */
.ticker-wrap {
  width: 100%;
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: 4px;
  margin: 6px 0;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.ticker-badge {
  background: #D50000;
  color: #FFF;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.ticker-text {
  font-size: clamp(0.8rem, 2.4vw, 0.92rem);
  font-weight: 700;
  color: #B71C1C;
  white-space: nowrap;
  animation: marquee 16s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Top Ad Banner Slot */
.ad-slot-container {
  width: 100%;
  margin: 6px 0;
  text-align: center;
}

.ad-banner-box {
  background: #FFF;
  border: 2px dashed #00C853;
  border-radius: 6px;
  padding: 8px 12px;
  display: block;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  text-decoration: none !important;
}

.ad-title {
  font-size: clamp(0.88rem, 2.4vw, 1.05rem);
  font-weight: 800;
  color: #D50000;
}

.ad-desc {
  font-size: clamp(0.74rem, 2vw, 0.86rem);
  color: #333;
  margin-top: 2px;
  font-weight: 600;
}

/* Disclaimer Box */
.disclaimer-box {
  width: 100%;
  padding: 8px 10px;
  margin: 6px 0;
  background: var(--red-alert);
  color: #FFF;
  font-size: clamp(0.76rem, 2.2vw, 0.88rem);
  text-align: center;
  border-radius: 4px;
  line-height: 1.35;
}

.disclaimer-box a {
  color: #FFF !important;
  text-decoration: underline;
  font-weight: 800;
}

/* Status Row */
.update-status-row {
  width: 100%;
  margin: 6px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #E8F5E9;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid #C8E6C9;
  font-size: clamp(0.74rem, 2vw, 0.86rem);
  font-weight: 700;
  color: #2E7D32;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #00C853;
  border-radius: 50%;
  animation: pulse-dot-anim 1.5s infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot-anim {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(0, 200, 83, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 200, 83, 0); }
}

.admin-link-box a {
  color: #666;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Search Box */
.search-filter-box {
  width: 100%;
  margin: 6px 0 10px 0;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 6px 12px;
  font-size: clamp(0.85rem, 2.4vw, 0.95rem);
  border: 2px solid var(--primary-green);
  border-radius: 4px;
  outline: none;
  background: #FFF;
  font-family: inherit;
}

/* ====================================================================
   TABLES: STRICT FIXED COLUMN SIZING VIA COLGROUP
   ==================================================================== */
.main-content {
  width: 100%;
  margin-bottom: 16px;
}

table.quick-result-board {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: #FFF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border-radius: 4px;
  overflow: hidden;
}

/* Fixed Colgroup Definition */
.col-name { width: 56%; }
.col-yest { width: 22%; }
.col-today { width: 22%; }

tr.board-title {
  width: 100%;
  background-color: var(--primary-green);
  border: 1px solid #339966;
}

tr.board-title th {
  padding: 8px 6px;
  text-align: center;
}

tr.board-title h1 {
  font-size: clamp(0.92rem, 3vw, 1.22rem);
  font-weight: 800;
  color: #FFF;
  line-height: 1.3;
}

tr.board-head {
  width: 100%;
  background-color: var(--dark-header);
  border: 1px solid #212121;
  height: 36px;
}

tr.board-head th {
  color: #FFF;
  font-size: clamp(0.78rem, 2.2vw, 0.92rem);
  font-weight: 700;
  vertical-align: middle;
  padding: 4px 6px;
  text-align: center;
}

tr.board-head th.games-name-col {
  text-align: left;
  padding-left: 8px;
}

tr.board-section {
  border-left: 6px solid var(--red-alert);
}

td.section-label {
  vertical-align: middle;
  font: normal 800 clamp(0.82rem, 2.2vw, 1rem) Arial, sans-serif;
  height: 34px;
  padding-left: 10px;
  background-color: #F1F1F1;
  color: var(--red-alert);
}

/* Game Row */
tr.game-result {
  width: 100%;
  height: 56px;
  background-color: #FFFFFF;
  border-bottom: 1px solid #E0E0E0;
}

tr.game-result:hover {
  background-color: #F7F9FA;
}

tr.highlight {
  background-color: var(--gold-highlight) !important;
  border-bottom: 1px solid var(--gold-border) !important;
}

tr.highlight:hover {
  background-color: #F5BE00 !important;
}

td.game-details {
  vertical-align: middle;
  text-align: left;
  padding: 6px 8px;
  overflow: hidden;
}

.game-details .game-name {
  font-size: clamp(0.9rem, 2.6vw, 1.08rem);
  font-weight: 800;
  color: #111;
  line-height: 1.2;
  word-break: break-word;
}

.game-details .meta-sub {
  margin-top: 2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.game-details .game-time {
  font-size: clamp(0.7rem, 1.8vw, 0.78rem);
  color: #444;
  font-weight: 700;
}

.game-details .game-link a {
  background: rgba(41, 98, 255, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: clamp(0.68rem, 1.8vw, 0.76rem);
  font-weight: 700;
  border: 1px solid rgba(41, 98, 255, 0.25);
  display: inline-block;
}

.game-details .game-link a:hover {
  background: #2962FF;
  color: #FFF !important;
}

td.yesterday-number, td.today-number {
  vertical-align: middle;
  text-align: center;
  padding: 4px;
}

.today-number h3, .yesterday-number h3 {
  font-size: clamp(1.35rem, 4.4vw, 1.75rem);
  font-weight: 900;
  line-height: 1;
}

.today-number h3 {
  color: var(--number-red);
}

.yesterday-number h3 {
  color: #212121;
}

tr.highlight .today-number h3 {
  color: #990000;
}

/* Flash Glow when Live Update arrives */
@keyframes flash-update {
  0% { background-color: #00E676; transform: scale(1.15); }
  50% { background-color: #B9F6CA; transform: scale(1.05); }
  100% { background-color: transparent; transform: scale(1); }
}

.just-updated {
  animation: flash-update 2s ease-out;
  display: inline-block;
  padding: 2px 4px;
  border-radius: 4px;
}

/* Middle Sponsor Card */
.middle-sponsor-card {
  width: 100%;
  margin: 10px 0 16px 0;
  background: #FFF;
  border: 2px solid #D50000;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}

.middle-sponsor-card h3 {
  font-size: clamp(0.95rem, 2.6vw, 1.15rem);
  font-weight: 800;
  color: #D50000;
}

.middle-sponsor-card p {
  font-size: clamp(0.78rem, 2vw, 0.88rem);
  color: #444;
  margin: 3px 0 6px 0;
  font-weight: 600;
}

.middle-sponsor-card .sponsor-btn {
  display: inline-block;
  background: #D50000;
  color: #FFF !important;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 4px;
}

/* ====================================================================
   MONTHLY MIX RESULT CHART (5 FIXED COLUMNS VIA COLGROUP)
   ==================================================================== */
.chart-container {
  width: 100%;
  margin: 16px 0;
  background: #FFF;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
}

table.chart-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

/* Colgroup Definition for Mix Chart */
.col-chart-date { width: 16%; }
.col-chart-market { width: 21%; }

tr.chart-head {
  background-color: var(--primary-green);
  border: 1px solid #339966;
}

tr.chart-head th.month {
  padding: 8px 6px;
  text-align: center;
}

tr.chart-head span {
  font-size: clamp(0.85rem, 2.6vw, 1.05rem);
  font-weight: 800;
  color: #FFF;
  line-height: 1.3;
  display: block;
}

tr.date-name {
  background-color: var(--gold-highlight);
  border: 1px solid var(--gold-border);
  height: 34px;
}

tr.date-name th {
  border-right: 1px solid var(--gold-border);
  vertical-align: middle;
  text-align: center;
  font-weight: 800;
  font-size: clamp(0.76rem, 2vw, 0.9rem);
}

th.date-col, td.day {
  text-align: center;
  color: #D50000;
  font-weight: 800;
}

th.market-col, td.number {
  text-align: center;
  font-weight: 800;
  font-size: clamp(0.92rem, 2.6vw, 1.2rem);
  color: #212121;
}

tr.day-number {
  height: 34px;
  border-bottom: 1px solid #E0E0E0;
}

table tr.day-number:nth-child(even) { background-color: #F9F9F9; }
table tr.day-number:nth-child(odd) { background-color: #FFFFFF; }
table tr.day-number:hover { background-color: #FFF8E1; }

tr.day-number td {
  border-right: 1px solid #E0E0E0;
  vertical-align: middle;
}

tr.option {
  font-size: 0.88rem;
  color: white;
  border: 2px solid #F1F1F1;
  height: 38px;
  background: #F1F1F1;
}

td.e-link {
  vertical-align: middle;
  background-color: rgb(23, 108, 238);
  border: 1px solid #003399;
  text-align: center;
  cursor: pointer;
}

td.e-link a {
  color: white !important;
  display: block;
  padding: 6px;
  font-weight: 800;
  font-size: clamp(0.82rem, 2.2vw, 0.95rem);
}

td.s-link {
  text-align: center;
  font-weight: bold;
  color: #999;
}

/* Nav Link Banner */
.nav-link-banner {
  width: 100%;
  margin: 10px 0;
  background: #176CEE;
  border: 1px solid #003399;
  border-radius: 4px;
  text-align: center;
}

.nav-link-banner a {
  display: block;
  padding: 10px 8px;
  color: #FFF !important;
  font-weight: 700;
  font-size: clamp(0.82rem, 2.2vw, 0.95rem);
  line-height: 1.3;
}

/* ====================================================================
   FOOTER MONTH SELECTOR (100% FLUID)
   ==================================================================== */
#footer {
  width: 100%;
  margin: 10px 0 32px 0;
  display: block;
  clear: both;
}

#chart-form {
  width: 100%;
  background-color: var(--gold-highlight);
  border: 1px solid var(--gold-border);
  border-radius: 6px;
  padding: 12px 10px;
  text-align: center;
}

h2#chart-text {
  color: #111;
  font-size: clamp(0.82rem, 2.2vw, 0.96rem);
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.35;
}

.chart-select-form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

select#month, select#year, input#direct-chart {
  height: 38px;
  font-size: 0.9rem;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: inherit;
}

select#month, select#year {
  border: 1px solid #BF8302;
  background: #FFF;
}

input#direct-chart {
  border: 1px solid #003399;
  background-color: rgb(23, 108, 238);
  color: white;
  cursor: pointer;
  padding: 4px 16px;
}

.footer-copy {
  margin-top: 14px;
  color: #777;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
}

/* Floating Actions */
.floating-actions {
  position: fixed;
  bottom: 14px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  z-index: 9999;
}

.chat-bubble-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(44px, 11vw, 52px);
  height: clamp(44px, 11vw, 52px);
  background: #25D366;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  color: #FFF;
  font-size: clamp(20px, 5vw, 25px);
  border: 2px solid #FFF;
  text-decoration: none !important;
}

.refresh-pill-btn {
  border: 1px solid #E7AA26;
  background: var(--gold-highlight);
  color: #B71C1C;
  padding: 6px 12px;
  font-weight: 900;
  font-size: clamp(0.78rem, 2vw, 0.88rem);
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}

/* Modal Popup */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.modal-content {
  background: #FFF;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.modal-header {
  background: var(--primary-green);
  color: #FFF;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #FFF;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 10px;
  overflow-y: auto;
}

/* Strict Mobile Rules (Screens <= 480px) */
@media screen and (max-width: 480px) {
  #container { padding: 0 4px; }
  .col-name { width: 54%; }
  .col-yest { width: 23%; }
  .col-today { width: 23%; }
  td.game-details { padding: 5px 6px; }
  td.yesterday-number, td.today-number { padding: 3px 2px; }
  select#month, select#year { width: calc(50% - 4px); min-width: unset; }
  input#direct-chart { width: 100%; margin-top: 4px; }
}
