:root {
    --bg: #f5f3ee;
    --card-bg: #fffaf2;
    --header-bg: #990000;
    --gold: #cc9a00;
    --gold-light: #ffd700;
    --red: #d00000;
    --text: #222222;
    --text-muted: #555555;
    --border: #e0d6c0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.6;
    scroll-behavior: smooth;
}

/* Loading spinner */
.spinner {
    border: 4px solid #f3f3f3; border-top: 4px solid #990000;
    border-radius: 50%; width: 40px; height: 40px;
    animation: spin 0.8s linear infinite; margin-bottom: 1rem;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Header */
.header {
    background: linear-gradient(135deg, #8b0000 0%, #b30000 100%);
    color: #fff; padding: 1rem 2rem; display: flex;
    align-items: center; justify-content: center; flex-wrap: wrap; gap: 1.5rem;
    box-shadow: 0 4px 12px rgba(139,0,0,0.2);
}
.header img { height:55px; border-radius:50%; background:#fff; padding:5px; }
.header h1 {
    font-size:2.5rem; font-weight:800; letter-spacing:1px;
    color:var(--gold-light); text-shadow:1px 1px 4px rgba(0,0,0,0.3);
    text-transform:uppercase;
}
.header p { font-size:1rem; color:#ffcc00; margin-top:0.2rem; }

/* Marquee */
.marquee-wrap {
    background:#fff; border-bottom:2px solid var(--gold);
    padding:0.6rem 1rem; overflow:hidden;
    box-shadow:0 2px 4px rgba(0,0,0,0.04);
}
.marquee {
    white-space:nowrap; animation:marquee 25s linear infinite;
    color:#990000; font-weight:700; font-size:1rem;
}
@keyframes marquee { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* Live info */
.live-info {
    background:#f9f7f2; padding:0.6rem 2rem;
    display:flex; justify-content:space-between; align-items:center;
    border-bottom:1px solid var(--border); font-weight:500; color:#444;
    flex-wrap:wrap;
}

.container { max-width:1200px; margin:2rem auto; padding:0 1.5rem; }

/* Refresh button */
.refresh-btn {
    background: #fff; border: 1px solid #990000; color: #990000;
    padding: 0.4rem 1rem; border-radius: 6px; font-weight: 600; cursor: pointer;
    transition: background 0.2s; font-size: 0.9rem;
}
.refresh-btn:hover { background: #990000; color: #fff; }

/* Upcoming Game */
.upcoming-game { margin-bottom:2rem; }
.upcoming-card {
    background:#fff8e7; border:2px solid var(--gold);
    border-radius:12px; padding:1.2rem; text-align:center; box-shadow:var(--shadow);
    transition: transform 0.2s;
}
.upcoming-card:hover { transform: translateY(-2px); }
.upcoming-badge {
    display:inline-block; background:var(--red); color:#fff;
    padding:0.2rem 0.8rem; border-radius:20px; font-size:0.85rem; font-weight:600; margin-bottom:0.5rem;
}
.upcoming-title { font-size:1.6rem; font-weight:700; color:#990000; }
.upcoming-result { font-size:2.8rem; font-weight:800; color:var(--red); margin:0.3rem 0; }
.upcoming-time { font-size:0.9rem; color:var(--text-muted); }

/* Result Cards */
.result-grid {
    display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap:1.5rem; margin-bottom:3rem;
}
.result-card {
    border-radius:16px; padding:1.5rem 1.2rem; box-shadow:var(--shadow);
    border:1px solid var(--border); text-align:center; transition: transform 0.2s;
    background:#fff;
}
.result-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.result-card h2 {
    font-size:1.2rem; font-weight:700; color:#990000;
    border-bottom:2px solid var(--gold); padding-bottom:0.5rem; margin-bottom:0.8rem;
    text-transform:uppercase;
}
.result-number { font-size:3.5rem; font-weight:800; color:var(--red); line-height:1.1; margin:0.4rem 0; }
.result-number.wait { font-size:2rem; color:#888; }
.result-time { font-weight:600; color:#b30000; margin-top:0.4rem; }
.prev-result {
    font-size:1.2rem; font-weight:700; color:#000; background:#ffeb3b;
    display:inline-block; padding:0.3rem 0.8rem; border-radius:8px; margin-top:0.5rem;
}
.chart-link {
    display:inline-block; margin-top:1rem; color:#cc9a00; font-weight:600;
    text-decoration:none; border-bottom:1px dashed #cc9a00; cursor:pointer;
}

/* Colourful backgrounds per game (new order) */
.result-card.desawar     { background: linear-gradient(135deg, #eafaf1 0%, #d5f5e3 100%); }
.result-card.delhi-bazar { background: linear-gradient(135deg, #eaf2f8 0%, #d4e6f1 100%); }
.result-card.shri-ganesh { background: linear-gradient(135deg, #fef5e7 0%, #fdebd0 100%); }
.result-card.faridabad   { background: linear-gradient(135deg, #f4ecf7 0%, #e8daef 100%); }
.result-card.ghaziabad   { background: linear-gradient(135deg, #fdecea 0%, #f8d7da 100%); }
.result-card.gali        { background: linear-gradient(135deg, #e8faf8 0%, #d1f2eb 100%); }

/* Inline Khelwal Ads – one per row, solid colours */
.khelwal-section {
    display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 3rem;
}
.khelwal-ad {
    border-radius: 12px; padding: 1.5rem; text-align: center; box-shadow: var(--shadow);
    color: #fff; transition: transform 0.2s;
}
.khelwal-ad:hover { transform: scale(1.01); }
.khelwal-ad .ad-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.8rem; }
.khelwal-ad .ad-table { width: 100%; margin: 0.8rem 0; border-collapse: collapse; color: #fff; }
.khelwal-ad .ad-table td { padding: 0.3rem 0.6rem; border: 1px solid rgba(255,255,255,0.3); }
.khelwal-ad .ad-rate { color: #fff; font-weight: 700; margin: 0.5rem 0; }
.khelwal-ad .ad-note { font-size: 0.9rem; margin-bottom: 0.8rem; color: rgba(255,255,255,0.9); }
.khelwal-ad .ad-icons { display: flex; justify-content: center; gap: 1rem; margin-top: 0.5rem; }
.khelwal-ad .ad-icons a {
    background: rgba(255,255,255,0.2); color: #fff; width: 40px; height: 40px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; text-decoration: none; transition: background 0.2s;
}
.khelwal-ad .ad-icons a:hover { background: rgba(255,255,255,0.4); }

/* Distinct solid colours for inline ads */
.khelwal-ad.color0 { background: #e74c3c; }
.khelwal-ad.color1 { background: #2ecc71; }
.khelwal-ad.color2 { background: #3498db; }
.khelwal-ad.color3 { background: #9b59b6; }
.khelwal-ad.color4 { background: #e67e22; }

/* Compact Monthly Chart */
.compact-chart { padding: 1rem; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-table-compact {
    width: 100%; border-collapse: collapse; background: #fff;
    font-size: 0.75rem; table-layout: fixed;
}
.chart-table-compact th, .chart-table-compact td {
    padding: 0.4rem; border: 1px solid #ddd; text-align: center;
}
.chart-table-compact th { background: #990000; color: #fff; font-weight: 600; white-space: nowrap; }
.chart-table-compact .date-cell { font-weight: 700; color: #b30000; background: #fef9f9; width: 50px; }
.chart-nav {
    display: flex; justify-content: center; gap: 1rem; margin-bottom: 1rem;
    align-items: center; flex-wrap: wrap;
}
.chart-nav button {
    background: #fff; border: 1px solid #990000; color: #990000;
    padding: 0.3rem 1rem; border-radius: 6px; font-weight: 600; cursor: pointer;
    transition: background 0.2s;
}
.chart-nav button:hover { background: #990000; color: #fff; }
#currentMonthYear { font-weight: 700; font-size: 1.1rem; color: #990000; }

/* Yearly Links */
.year-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.year-links a {
    display: block; padding: 1rem; background: #fdfbf7; border: 1px solid var(--border);
    border-radius: 10px; text-align: center; font-weight: 600; color: #990000;
    text-decoration: none; box-shadow: 0 2px 6px rgba(0,0,0,0.04); transition: all 0.2s;
}
.year-links a:hover { background: #990000; color: #fff; border-color: #990000; }
.year-section-title {
    grid-column: 1 / -1; font-size: 1.2rem; font-weight: 700; color: #990000;
    margin-top: 0.8rem; border-bottom: 1px dashed var(--gold); padding-bottom: 0.3rem;
}

/* Info & FAQ */
.info-section, .faq-section {
    background: var(--card-bg); border-radius: 16px; padding: 2rem;
    margin-bottom: 3rem; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.info-section h2, .faq-section h2 { color: #990000; border-bottom: 2px solid var(--gold); padding-bottom: 0.5rem; margin-bottom: 1.5rem; font-size: 1.7rem; }
.faq-grid { display: grid; gap: 0.8rem; }
.faq-item { border: 1px solid #ddd; border-radius: 10px; overflow: hidden; background: #fff; }
.faq-question {
    padding: 0.9rem 1.2rem; font-weight: 700; color: #990000; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; background: #fef9f9;
    transition: background 0.2s;
}
.faq-question:hover { background: #f9f0f0; }
.faq-answer { display: none; padding: 1rem 1.2rem; color: #333; background: #fff; }
.faq-item.active .faq-answer { display: block; }

/* Disclaimer */
.disclaimer-section {
    background: var(--card-bg); border-radius: 16px; padding: 2rem;
    margin-bottom: 3rem; box-shadow: var(--shadow); border: 1px solid var(--border);
    border-left: 5px solid #990000;
}
.disclaimer-section h2 { color: #990000; border-bottom: 2px solid var(--gold); padding-bottom: 0.5rem; margin-bottom: 1rem; font-size: 1.7rem; }
.disclaimer-section .content { color: #333; line-height: 1.6; }

/* Footer */
.footer {
    background: #2b2b2b; color: #ccc; text-align: center;
    padding: 2.5rem 1.5rem; margin-top: 3rem;
}
.footer a { color: #ffd700; margin: 0 0.5rem; text-decoration: none; cursor: pointer; }
.footer a:hover { text-decoration: underline; }

/* Floating WhatsApp (bottom‑right) */
.floating-whatsapp {
    position: fixed; bottom: 30px; right: 30px;
    background: #25D366; color: white; width: 55px; height: 55px;
    border-radius: 50%; display: none; align-items: center; justify-content: center;
    font-size: 2rem; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 1999;
    text-decoration: none; transition: transform 0.3s;
}
.floating-whatsapp:hover { transform: scale(1.1); }

/* Side floating ads (vertical stacks, bottom area) */
.floating-ads-group {
    position: fixed; bottom: 30px; z-index: 1998;
    display: flex; flex-direction: column; gap: 10px;
    width: 260px;
}
.left-stack { left: 10px; }
.right-stack { right: 10px; }
.floating-side-ad {
    background: #fff8e7; border: 2px dashed #cc9a00; border-radius: 10px;
    padding: 0.8rem; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    color: #333; transition: transform 0.2s;
}
.floating-side-ad:hover { transform: scale(1.02); }
.floating-side-ad .ad-title { font-size: 1rem; font-weight: 700; color: #990000; margin-bottom: 0.5rem; }
.floating-side-ad .ad-note { font-size: 0.8rem; margin-bottom: 0.5rem; }
.floating-side-ad .ad-rate { font-weight: 600; color: #990000; margin: 0.4rem 0; }
.floating-side-ad .ad-icons { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.5rem; }
.floating-side-ad .ad-icons a {
    background: #25D366; color: #fff; padding: 0.3rem 1rem; border-radius: 20px;
    text-decoration: none; font-weight: 600; font-size: 0.9rem;
}

/* Modals */
.modal-overlay {
    display: none; position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.6); z-index: 5000; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: #fff; padding: 2rem; border-radius: 12px; max-width: 500px;
    width: 90%; position: relative; box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.modal-close { position: absolute; top:10px; right:15px; background:none; border:none; font-size:1.8rem; cursor:pointer; color:#990000; }

/* Responsive */
@media (max-width: 768px) {
    .header { flex-direction: column; text-align: center; }
    .header h1 { font-size: 1.8rem; }
    .result-grid { grid-template-columns: 1fr; }
    .chart-table-compact { font-size: 0.65rem; }
    .floating-ads-group { width: 200px; bottom: 20px; }
    .floating-side-ad { padding: 0.6rem; font-size: 0.8rem; }
}
@media (max-width: 480px) {
    .floating-ads-group { display: none !important; }
    .floating-whatsapp { width: 45px; height: 45px; font-size: 1.5rem; right: 15px; bottom: 15px; }
}