/* Crazy Matka shared navigation, footer and chart archive. */
.header-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1030;
    height: var(--header-height);
    background: #141415;
    border-bottom: 1px solid rgb(247 230 138 / 13%);
    color: #fff;
}
.header-row, .header-brand, .header-actions { display: flex; align-items: center; }
.header-row { height: 100%; justify-content: space-between; gap: 24px; }
.header-brand { flex: 0 0 auto; min-width: 0; }
.navbar-brand { display: inline-flex; padding: 0; margin: 0; color: #fff; }
.navbar-brand:hover { color: #fff; }
.cm-brand { display: inline-flex; align-items: center; gap: 11px; text-align: left; }
.cm-brand-mark { display: block; flex: 0 0 44px; width: 44px; height: 44px; color: #f7e68a; }
.cm-brand-type { display: block; color: #fff; line-height: 1; }
.cm-brand-type strong { display: block; font: 800 19px/1.15 var(--display); letter-spacing: -.6px; }
.cm-brand-type strong > span { color: #f7e68a; }
.cm-brand-type small { display: block; margin-top: 6px; color: #b4b7ad; font-size: 7px; font-weight: 500; letter-spacing: 1.35px; white-space: nowrap; }
.navbar-toggler { display: none; padding: 8px 0; margin-right: 16px; border: 0; color: #fff; background: transparent; border-radius: 0; }
.navbar-toggler .ui-icon { width: 23px; height: 23px; }
.header-menu.collapse { display: block; }
.header-menu .navbar-nav { display: flex; align-items: center; flex-direction: row; gap: 20px; margin: 0; padding: 0; list-style: none; }
.header-menu .nav-item { position: relative; }
.header-menu .nav-link { display: inline-flex; align-items: center; gap: 5px; padding: 11px 0; color: #c9ccc2; font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.header-menu .nav-link:hover, .header-menu .nav-link[aria-expanded="true"], .header-menu .active > .nav-link { color: #f7e68a; }
.header-menu .active > .nav-link::before { content: ""; position: absolute; bottom: 4px; left: 0; width: 16px; height: 2px; border-radius: 2px; background: #f7e68a; }
.header-menu .dropdown-toggle::after { display: none; }
.nav-chevron { font-size: 15px; line-height: .75; transition: transform .2s; }
.header-menu [aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.header-menu .dropdown-menu { position: absolute; top: 100%; left: -18px; min-width: 280px; width: 300px; max-height: min(65vh, 480px); overflow-y: auto; margin: 8px 0 0; padding: 14px; border: 1px solid #44483f; border-radius: 14px; background: #252828; color: #fff; box-shadow: 0 20px 50px rgb(0 0 0 / 23%); scrollbar-width: thin; scrollbar-color: #737668 #252828; }
.header-menu .nav-item:nth-last-child(-n+2) .dropdown-menu { right: -18px; left: auto; }
.header-menu .dropdown-menu.show { display: block; }
.header-menu .dropdown-title { margin: 0 0 8px; padding: 3px 10px 10px; border-bottom: 1px solid #44483f; color: #f7e68a; font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
.header-menu .dropdown-item { padding: 10px; border-radius: 7px; color: #e2e4dc; white-space: normal; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; }
.header-menu .dropdown-item:hover, .header-menu .dropdown-item:focus { color: #141415; background: #f7e68a; }
.header-menu .dropdown-overview { color: #f7e68a; font-weight: 600; }
.header-actions { flex-shrink: 0; gap: 10px; }
.header-actions .header-download { min-height: 42px; padding: 11px 16px; border-radius: 8px; font-size: 11px; }
.header-actions .header-download .ui-icon { width: 17px; height: 17px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 1px solid #45483e; border-radius: 50%; background: transparent; color: #e3e6dc; cursor: pointer; }
.theme-toggle .ui-icon { width: 17px; height: 17px; }
.theme-toggle:hover { border-color: #f7e68a; color: #f7e68a; }
.header-menu .menu-download { display: none; }
.header-nav a:focus-visible, .header-nav button:focus-visible, .site-footer a:focus-visible { outline: 2px solid #f7e68a; outline-offset: 4px; }

/* A compact four-column directory under a spacious brand and contact area. */
.site-footer { padding: 66px 0 24px; background: #141415; color: #b4b7ad; font-size: 12px; }
.site-footer .container { min-width: 0; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; gap: 12%; padding-bottom: 44px; }
.footer-brand-logo { display: inline-flex; margin-bottom: 22px; color: #fff; }
.footer-intro p { max-width: 370px; margin: 0 0 20px; color: #b4b7ad; font-size: 13px; line-height: 1.9; }
.footer-explore { display: inline-flex; align-items: center; gap: 22px; color: #f7e68a; font-size: 12px; font-weight: 600; }
.footer-explore:hover { color: #fff; }
.footer-explore > span { font-size: 21px; }
.footer-contact h2 { margin: 0 0 20px; color: #fff; font: 500 22px/1.3 var(--display); letter-spacing: -.7px; }
.footer-contact-link { display: flex; align-items: center; gap: 14px; max-width: 360px; margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px solid #343730; color: #fff; }
.footer-contact-link > .ui-icon { width: 18px; height: 18px; flex-shrink: 0; color: #f7e68a; }
.footer-contact-link > span:nth-child(2) { flex: 1; min-width: 0; }
.footer-contact-link small { display: block; color: #a2a69a; font-size: 10px; line-height: 1.6; }
.footer-contact-link strong { display: block; color: #fff; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.footer-contact-link > span:last-child { color: #f7e68a; font-size: 20px; }
.footer-contact-link:hover strong { color: #f7e68a; }
.footer-download { margin-top: 6px; min-height: 42px; padding: 10px 18px; font-size: 12px; }
.footer-charts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; padding: 36px 0; border-top: 1px solid #343730; border-bottom: 1px solid #343730; }
.footer-chart-group { min-width: 0; }
.footer-chart-group h3 { margin: 0 0 17px; color: #fff; font: 600 13px/1.5 var(--display); }
.footer-chart-group ul { margin: 0; padding: 0; list-style: none; }
.footer-chart-group li { margin: 0 0 8px; }
.footer-chart-group li a { display: inline-block; max-width: 100%; color: #a8ada0; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.footer-chart-group li a:hover { color: #f7e68a; }
.footer-all-link { display: inline-flex; align-items: center; gap: 14px; margin-top: 10px; color: #f7e68a; font-size: 11px; font-weight: 600; }
.footer-all-link:hover { color: #fff; }
.footer-responsible { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 0; }
.footer-age { display: flex; align-items: center; gap: 13px; }
.footer-age-mark { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid #777d69; border-radius: 50%; color: #f7e68a; font-size: 11px; font-weight: 600; }
.footer-age p { margin: 0; color: #92998a; font-size: 10px; line-height: 1.7; }
.footer-support-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-support-links a { color: #92998a; font-size: 11px; }
.footer-support-links a:hover { color: #f7e68a; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 24px; padding-top: 22px; border-top: 1px solid #343730; }
.footer-copyright { color: #8b9282; font-size: 10px; }
.linking-footerhome { display: flex; flex-wrap: wrap; gap: 12px 20px; margin: 0; padding: 0; list-style: none; }
.linking-footerhome a { color: #a8ada0; font-size: 10px; }
.linking-footerhome a:hover { color: #f7e68a; }

/* Directory and history pages keep their existing server-rendered routes. */
.directory-banner { padding: 45px 24px; border-bottom: 1px solid var(--line); background: var(--dark); color: #fff; text-align: center; }
.directory-banner .section-heading { display: block; margin: 0; color: #f7e68a; font: 600 clamp(28px, 4vw, 45px)/1.2 var(--display); letter-spacing: -1px; }
.chart-directory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 18px; width: calc(100% - 48px); max-width: 1192px; margin: 46px auto 0; }
.chart-directory { min-width: 0; grid-column: 1; grid-row: 1; }
.chart-directory + a { grid-column: 1; grid-row: 2; justify-self: center; }
.chart-directory:nth-of-type(2), .chart-directory:nth-of-type(2) + a { grid-column: 2; }
.chart-directory:nth-of-type(3) { grid-column: 3; }
.chart-directory:nth-of-type(4) { grid-column: 4; }
.chart-directory .container { padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.chart-directory h2, .chart-directory .directory-title { margin: 0; padding: 21px 18px; color: #f7e68a; background: #2b2e2e; font: 600 15px/1.4 var(--display); text-align: left; }
.chart-directory h2 strong { font-weight: inherit; }
.chart-directory .row { display: block; margin: 0; padding: 8px 17px; }
.chart-directory .row > div { width: 100%; max-width: 100%; padding: 0; }
.chart-directory .row > div + div { border-top: 1px solid var(--line); }
.chart-directory .card { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.chart-directory .card-body { padding: 0; }
.chart-directory a { display: block; padding: 13px 2px; color: var(--ink); text-align: left; }
.chart-directory a:hover { color: var(--gold-dark); }
.chart-directory h3, .directory-link-label { display: block; margin: 0; font: 500 12px/1.65 var(--display); overflow-wrap: anywhere; }
.chart-directory-grid .download-button { margin: 0; font-size: 11px; min-width: 0; }
.chart-page { padding: 48px 0; }
.chart-page h1 { max-width: 920px; margin: 0 auto 20px; color: var(--ink); font-size: clamp(25px, 3.2vw, 42px); font-weight: 600; line-height: 1.3; letter-spacing: -1px; text-align: center; overflow-wrap: anywhere; }
.chart-page h1 strong { font-weight: inherit; }
.chart-intro { display: block; max-width: 760px; margin: 0 auto 26px; color: var(--muted); font-size: 13px; line-height: 1.9; text-align: center; }
.chart-page > .container > a:has(.download-button) { display: flex; justify-content: center; }
.chart-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 26px auto; }
.chart-actions-row .chart-actions { margin: 24px auto; }
.chart-actions .btn { font-size: 12px; }
.table.t-cell { width: 100%; max-width: 750px; margin: 0 auto; table-layout: fixed; border: 1px solid var(--line); border-collapse: separate; border-spacing: 0; border-radius: 13px; overflow: hidden; background: var(--surface); color: var(--ink); text-align: center; font-variant-numeric: tabular-nums; }
.table.t-cell th, .table.t-cell td { padding: 15px 8px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table.t-cell tr > :last-child { border-right: 0; }
.table.t-cell tr:last-child > td { border-bottom: 0; }
.table.t-cell th { padding: 15px 5px; color: #f7e68a; background: #2b2e2e; font: 500 11px/1.5 var(--display); text-transform: uppercase; }
.table.t-cell td { font-size: 19px; font-weight: 600; line-height: 1.5; }
.table.t-cell tr:nth-child(2n+3) td { background: var(--soft); }
.table.t-cell tr:hover td { background: var(--gold-light); color: #252828; }
.table.t-cell:has(tr > :nth-child(8)) { max-width: 960px; }
.table.t-cell:has(tr > :nth-child(8)) tr > :first-child { width: 108px; }
.table.t-cell .cp { display: block; font-size: 12px; font-weight: 500; line-height: 1.6; }
.table.t-cell .j08 { font-size: 19px; }
.table.t-cell td:first-child .cp { overflow-wrap: anywhere; }
.chart-empty { max-width: 800px; margin: 30px auto; padding: 30px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 13px; text-align: center; }
.related-charts { width: calc(100% - 48px); max-width: 1192px; margin: 40px auto; padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); text-align: center; }
.related-charts h2 { margin: 0 0 24px; font-size: 25px; }
.related-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.related-links a { padding: 10px 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--soft); color: var(--ink); font-size: 11px; font-weight: 500; }
.related-links a:hover { border-color: var(--gold); background: var(--gold); color: #252828; }
.chart-content { padding: 54px 0; }
.chart-content .container { max-width: 1050px; }
.chart-content .row { margin-inline: 0; }
.chart-content .row > .col-12 { padding-inline: 0; }
.chart-content h1 { margin-bottom: 24px; font-size: clamp(24px, 3vw, 36px); line-height: 1.4; letter-spacing: -.7px; }
.chart-content h2, .chart-list2 h2 { margin: 28px 0 16px; font-size: 23px; line-height: 1.4; }
.chart-content h3, .chart-list2 h3 { margin: 24px 0 14px; font-size: 18px; line-height: 1.5; }
.chart-content p, .chart-content li, .chart-list2 p, .chart-list2 li { color: var(--muted); font-size: 13px; line-height: 1.9; }
.chart-content ul, .chart-list2 ul { padding-left: 22px; }
.chart-list2 { width: calc(100% - 48px); max-width: 1050px; margin-inline: auto; }
.main-section { padding: 44px 0 64px; }
.main-section .container { max-width: 1050px; }
.main-section h1 { margin: 0 0 32px; padding-bottom: 26px; border-bottom: 1px solid var(--line); font-size: clamp(26px, 4vw, 44px); line-height: 1.3; letter-spacing: -1px; }
.main-section h2 { margin: 28px 0 16px; font-size: 23px; }
.main-section h3 { margin: 24px 0 14px; font-size: 18px; }
.main-section p, .main-section li { color: var(--muted); }

@media (max-width: 1199px) and (min-width: 1101px) {
    .header-row { gap: 18px; }
    .header-menu .navbar-nav { gap: 13px; }
    .header-menu .nav-link { font-size: 11px; }
    .cm-brand-type strong { font-size: 17px; }
    .cm-brand-type small { font-size: 6px; letter-spacing: 1.2px; }
}

@media (max-width: 1100px) {
    .navbar-toggler { display: inline-flex; align-items: center; justify-content: center; }
    .header-menu { position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100dvh - var(--header-height)); overflow-y: auto; border-bottom: 1px solid #45483e; background: #141415; box-shadow: 0 18px 32px rgb(0 0 0 / 17%); }
    .header-menu.collapse:not(.show) { display: none; }
    .header-menu .navbar-nav { display: block; padding: 15px 24px; }
    .header-menu .nav-item { border-bottom: 1px solid #343730; }
    .header-menu .nav-link { display: flex; justify-content: space-between; width: 100%; padding: 15px 0; font-size: 13px; }
    .header-menu .active > .nav-link::before { display: none; }
    .header-menu .dropdown-menu, .header-menu .nav-item:nth-last-child(-n+2) .dropdown-menu { position: static; width: 100%; min-width: 0; max-height: 290px; margin: 0 0 12px; padding: 10px; box-shadow: none; }
    .header-menu .menu-download { display: inline-flex; margin: 2px 24px 24px; }
}

@media (max-width: 1000px) {
    .chart-directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chart-directory:nth-of-type(3) { grid-column: 1; grid-row: 3; }
    .chart-directory:nth-of-type(4) { grid-column: 2; grid-row: 3; }
}

@media (max-width: 767px) {
    .header-row { gap: 12px; }
    .navbar-toggler { margin-right: 13px; }
    .cm-brand { gap: 8px; }
    .cm-brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
    .cm-brand-type strong { font-size: 16px; letter-spacing: -.5px; }
    .cm-brand-type small { margin-top: 5px; font-size: 5.6px; letter-spacing: 1.1px; }
    .header-actions .header-download { display: none; }
    .theme-toggle { width: 33px; height: 33px; flex-basis: 33px; }
    .header-menu .navbar-nav { padding: 12px 20px; }
    .header-menu .menu-download { margin-inline: 20px; }
    .site-footer { padding: 44px 0 23px; }
    .footer-top { grid-template-columns: 1fr; gap: 34px; padding-bottom: 30px; }
    .footer-brand-logo { margin-bottom: 18px; }
    .footer-intro p { max-width: 440px; font-size: 12px; }
    .footer-contact h2 { font-size: 21px; }
    .footer-contact-link { max-width: none; }
    .footer-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 20px; padding: 28px 0; }
    .footer-chart-group h3 { margin-bottom: 12px; }
    .footer-chart-group li a { font-size: 10px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .footer-support-links { gap: 16px; }
    .directory-banner { padding: 32px 20px; }
    .chart-directory-grid { width: calc(100% - 40px); margin-top: 28px; gap: 14px; }
    .chart-directory h2, .chart-directory .directory-title { padding: 17px 14px; font-size: 13px; }
    .chart-directory .row { padding: 5px 13px; }
    .chart-directory h3, .directory-link-label { font-size: 11px; }
    .chart-page { padding: 30px 0; }
    .chart-page h1 { font-size: 26px; letter-spacing: -.6px; }
    .chart-intro { font-size: 12px; }
    .table.t-cell th, .table.t-cell td { padding: 12px 4px; }
    .table.t-cell th { font-size: 10px; }
    .table.t-cell td, .table.t-cell .j08 { font-size: 16px; }
    .table.t-cell .cp { font-size: 10px; }
    .table.t-cell:has(tr > :nth-child(8)) tr > :first-child { width: 76px; }
    .chart-empty { padding: 24px 18px; }
    .related-charts { width: calc(100% - 40px); padding: 24px 18px; margin-block: 28px; }
    .related-charts h2 { font-size: 22px; }
    .related-links { gap: 8px; }
    .related-links a { padding: 9px 12px; font-size: 10px; }
    .chart-content { padding: 36px 0; }
    .chart-list2 { width: calc(100% - 40px); }
    .chart-content h2, .chart-list2 h2, .main-section h2 { font-size: 21px; }
}

@media (max-width: 480px) {
    .table.t-cell th, .table.t-cell td { padding: 11px 2px; }
    .table.t-cell th { font-size: 9px; }
    .table.t-cell td, .table.t-cell .j08 { font-size: 14px; }
    .table.t-cell .cp { font-size: 9px; }
    .table.t-cell:has(tr > :nth-child(8)) tr > :first-child { width: 65px; }
    .chart-directory-grid { grid-template-columns: 1fr; }
    .chart-directory:nth-of-type(2) { grid-column: 1; grid-row: 3; }
    .chart-directory:nth-of-type(2) + a { grid-column: 1; grid-row: 4; }
    .chart-directory:nth-of-type(3) { grid-column: 1; grid-row: 5; }
    .chart-directory:nth-of-type(4) { grid-column: 1; grid-row: 6; }
    .chart-directory h3, .directory-link-label { font-size: 12px; }
    .chart-directory-grid > a { margin-bottom: 10px; }
}

@media (max-width: 359px) {
    .navbar-toggler { margin-right: 10px; }
    .navbar-toggler .ui-icon { width: 20px; }
    .cm-brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
    .cm-brand-type strong { font-size: 14px; }
    .cm-brand-type small { font-size: 5px; letter-spacing: .85px; }
    .table.t-cell:has(tr > :nth-child(8)) tr > :first-child { width: 60px; }
    .table.t-cell th { font-size: 8px; }
    .table.t-cell td, .table.t-cell .j08 { font-size: 13px; }
    .table.t-cell .cp { font-size: 8px; }
    .linking-footerhome { gap: 10px 14px; }
}

/* Keep history readable on narrow screens; only the table region scrolls. */
:root { --result-highlight: #a63232; }
[data-theme="dark"] { --result-highlight: #ff9999; }
.directory-banner h1 { color: #f7e68a; margin: 12px 0; font-size: clamp(28px, 4vw, 45px); }
.directory-banner p { margin: 0; color: #d1d4c9; }
.chart-directory-grid { margin-bottom: 60px; }
.chart-directory > .container > .card .card-body { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.chart-directory > .container > .card:last-child .card-body { border-bottom: 0; }
.chart-directory .card-body .ui-icon { width: 16px; height: 16px; flex-shrink: 0; }
.chart-actions-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 22px; margin: 26px auto; }
.chart-table-scroll { width: 100%; max-width: 960px; margin: 0 auto; overflow-x: auto; overscroll-behavior-x: contain; border-radius: 13px; }
.chart-table-scroll:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 4px; }
.chart-table-scroll .pana-history { min-width: 600px; }
.chart-table-scroll .jodi-history { min-width: 330px; }
.chart-table-scroll .table.t-cell th { font-size: 11px; }
.chart-table-scroll .table.t-cell .cp { font-size: 12px; }
.chart-table-scroll .table.t-cell td, .chart-table-scroll .table.t-cell .j08 { font-size: 18px; }
.chart-table-scroll .table.t-cell.pana-history tr > :first-child { width: 116px; }
.chart-scroll-hint { display: none; margin: 0 auto 12px; max-width: 960px; color: var(--muted); font-size: 11px; }
.page-download { margin: 24px auto; }
@media (max-width: 650px) {
    .chart-scroll-hint { display: block; }
    .chart-table-scroll .table.t-cell th, .chart-table-scroll .table.t-cell td { padding: 12px 6px; }
}
