:root {
    --qy-canvas: #f7f7f5;
    --qy-surface: #ffffff;
    --qy-text: #212529;
    --qy-muted: #5c636a;
    --qy-border: #d8d8d2;
    --qy-red: #b42318;
    --qy-red-dark: #8f1d14;
    --qy-orange: #c2410c;
    --qy-header: #20242a;
    --qy-focus: #005fcc;
    --qy-radius: 0.85rem;
}

html {
    font-size: 16px;
    min-height: 100%;
    scroll-padding-top: 1rem;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--qy-canvas);
    color: var(--qy-text);
    line-height: 1.6;
}

.site-content {
    flex: 1 0 auto;
    min-width: 0;
}

img,
iframe,
video {
    max-width: 100%;
}

p,
li,
dd,
td,
th {
    overflow-wrap: anywhere;
}

footer {
    flex-shrink: 0;
}

a {
    color: var(--qy-red-dark);
    text-decoration-thickness: 0.09em;
    text-underline-offset: 0.16em;
}

a:hover {
    color: #68150f;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--qy-focus) !important;
    outline-offset: 3px;
    box-shadow: none !important;
}

.qy-navbar :where(a, button):focus-visible,
footer :where(a, button):focus-visible {
    outline-color: #ffbf47 !important;
}

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1100;
    padding: 0.75rem 1rem;
    border-radius: 0.4rem;
    background: var(--qy-surface);
    color: var(--qy-text);
    font-weight: 700;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.qy-navbar {
    min-height: 4.5rem;
    background: var(--qy-header);
    border-bottom: 4px solid var(--qy-orange);
    box-shadow: 0 0.25rem 0.8rem rgba(0, 0, 0, 0.16);
}

.qy-navbar .navbar-brand,
.qy-navbar .navbar-toggler,
.qy-navbar .nav-link {
    min-height: 44px;
}

.qy-navbar .navbar-brand {
    display: inline-flex;
    align-items: center;
}

.qy-navbar .navbar-toggler {
    min-width: 48px;
    border: 2px solid rgba(255, 255, 255, 0.75);
}

.qy-navbar .navbar-nav {
    gap: 0.1rem;
}

.qy-navbar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.58rem;
    border-radius: 0.4rem;
    color: #f8f9fa;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.25;
}

.qy-navbar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
    text-decoration: underline;
}

.qy-navbar .nav-link.active {
    color: #fff;
    background: var(--qy-red);
    box-shadow: inset 0 -3px 0 #ffbf47;
}

.hero,
.qy-page-header {
    color: var(--qy-text);
    background: var(--qy-surface);
    border: 1px solid var(--qy-border);
    border-top: 5px solid var(--qy-orange);
    border-radius: var(--qy-radius);
}

.card,
.control-card,
.resultado-card {
    color: var(--qy-text);
    background: var(--qy-surface);
    border-color: var(--qy-border);
    border-radius: var(--qy-radius);
}

.bg-light {
    background-color: #fff !important;
    color: var(--qy-text);
}

.text-muted,
.form-text {
    color: var(--qy-muted) !important;
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 650;
}

.btn-sm {
    min-height: 44px;
}

.btn-primary {
    color: #fff;
    background-color: var(--qy-red);
    border-color: var(--qy-red);
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:first-child:active {
    color: #fff;
    background-color: var(--qy-red-dark);
    border-color: var(--qy-red-dark);
}

.btn-outline-primary {
    color: var(--qy-red-dark);
    border-color: var(--qy-red);
}

.btn-outline-primary:hover,
.btn-outline-primary:active {
    color: #fff;
    background-color: var(--qy-red-dark);
    border-color: var(--qy-red-dark);
}

.text-primary {
    color: var(--qy-red-dark) !important;
}

.bg-primary,
.text-bg-primary {
    color: #fff !important;
    background-color: var(--qy-red) !important;
}

.form-control,
.form-select {
    min-height: 44px;
    color: var(--qy-text);
    border-color: #767676;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--qy-focus);
}

.text-danger {
    color: #a2191f !important;
}

.table {
    --bs-table-color: var(--qy-text);
    --bs-table-bg: var(--qy-surface);
    --bs-table-striped-bg: #f0f0ec;
    --bs-table-border-color: #b8b8b2;
    vertical-align: middle;
}

.table > thead {
    border-bottom: 2px solid var(--qy-orange);
}

.table caption {
    color: var(--qy-text);
    font-weight: 700;
}

.qy-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--qy-border);
    border-radius: 0.5rem;
    background: var(--qy-surface);
}

.qy-table-scroll .table {
    min-width: 42rem;
    margin-bottom: 0;
}

.qy-scroll-hint {
    color: var(--qy-muted);
    font-size: 0.9rem;
}

.progress {
    min-height: 1.5rem;
    background: #e4e4df;
}

.progress-bar {
    min-width: 2.75rem;
    color: #fff;
    font-weight: 700;
}

.site-footer-links a,
footer .bg-dark a {
    color: #ffd2a8;
}

.footer-links-shell {
    color: #fff;
    background: var(--qy-header);
    border-top: 4px solid var(--qy-orange);
}

.site-footer-links h2 {
    color: #fff;
}

.site-footer-links a:hover,
footer .bg-dark a:hover {
    color: #fff;
}

.site-footer-links li > a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
}

.site-footer-links ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer-links li + li {
    margin-top: 0.45rem;
}

.responsible-gaming-banner {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    text-align: center;
    color: #fff;
    background: #111;
    border-top: 2px solid #ffbf47;
    border-bottom: 2px solid #ffbf47;
}

.responsible-gaming-banner a {
    color: #ffcf70;
    font-weight: 700;
}

.w80 {
    width: min(72%, 44rem) !important;
}

.qy-hero p {
    line-height: 1.55;
}

.qy-hero .lead {
    max-width: 58ch;
}

.qy-note {
    color: var(--qy-text);
    background: #fff4e8;
    border: 1px solid #e8a66d;
}

.qy-card {
    border-radius: var(--qy-radius);
}

.qy-soft {
    color: var(--qy-muted);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 0.5rem;
}

.custom-table th {
    color: #fff;
    background: var(--qy-red-dark);
}

.custom-table th,
.custom-table td {
    padding: 0.7rem;
}

.sorteos-history-scroll {
    max-height: 25rem;
    overflow: auto;
}

.sorteos-history-scroll thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.sorteos-history-scroll th {
    background: var(--qy-surface);
}

.bolilla {
    width: 44px;
    height: 44px;
    margin: auto;
    border: 2px solid var(--qy-red-dark);
    border-radius: 50%;
    color: var(--qy-text);
    background: #fff4e8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
    font-weight: 800;
    line-height: 40px;
    text-align: center;
}

.draw-numbers .bolilla {
    position: relative;
    display: inline-flex;
    width: 3.5rem;
    height: 3.5rem;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--qy-red-dark);
    color: var(--qy-text);
    background: #ffd9b8;
    font-size: 1.35rem;
    line-height: 1;
    text-shadow: none;
}

.draw-numbers--compact .bolilla {
    width: 2.25rem;
    height: 2.25rem;
    border-width: 2px;
    font-size: 1rem;
}

.draw-numbers .bolilla.acertado {
    color: #fff;
    background: #187a2f;
    border-color: #0e5a20;
}

.match-indicator {
    position: absolute;
    top: -0.45rem;
    right: -0.35rem;
    display: inline-flex;
    width: 1.25rem;
    height: 1.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: #0e5a20;
    font-size: 0.8rem;
}

.validation-summary-valid {
    display: none;
}

.latest-results-shell {
    padding: 1.5rem;
    color: var(--qy-text);
    background: var(--qy-surface);
    border-radius: 1.1rem;
    box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.12);
}

.modalidad-item {
    margin-bottom: 0.75rem;
    padding: 0.9rem;
    background: #f8fafc;
    border: 1px solid #e2e5e9;
    border-left: 5px solid var(--qy-red);
    border-radius: 0.75rem;
}

.modalidad-item h3 {
    margin-bottom: 0.65rem;
    color: var(--qy-text);
    font-size: 1.05rem;
}

.cronica-card,
.boleta-card {
    height: 100%;
    padding: 1.1rem;
    color: var(--qy-text);
    background: #fffdf8;
    border: 1px solid #ead8c5;
    border-radius: 0.75rem;
}

.cronica-card h3 {
    color: var(--qy-red-dark);
}

.cronica-card h4 {
    margin-top: 0.9rem;
    color: var(--qy-text);
    font-size: 1.02rem;
}

.boleta-card {
    height: auto;
    background: #f8fafc;
    border-color: #e2e5e9;
}

.latest-links a {
    color: var(--qy-red-dark);
    font-weight: 650;
}

.control-help {
    max-width: 47.5rem;
    margin-inline: auto;
}

.countdown-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.countdown-box,
.random-number {
    display: flex;
    width: 5rem;
    height: 5rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--qy-orange);
    border-radius: 0.7rem;
    color: var(--qy-text);
    background: #fff4e8;
    font-weight: 700;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.16);
}

#blog-snippet {
    padding: 1.25rem;
    color: var(--qy-text);
    background: rgba(255, 255, 255, 0.94);
    border-radius: var(--qy-radius);
}

#blog-snippet h2,
#blog-snippet .fw-semibold,
#blog-snippet .lh-sm {
    color: var(--qy-text);
}

#blog-snippet p,
#blog-snippet .text-muted {
    color: var(--qy-muted) !important;
}

#blog-snippet a.stretched-link,
#blog-snippet a.text-decoration-none {
    color: var(--qy-red-dark);
}

#blog-snippet a.stretched-link:hover,
#blog-snippet a.text-decoration-none:hover {
    color: #68150f;
    text-decoration: underline;
}

#blog-snippet .blog-snippet-card {
    background: var(--qy-surface);
    border: 1px solid var(--qy-border);
    border-radius: var(--qy-radius);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
}

#blog-snippet .object-fit-cover {
    object-fit: cover;
}

#blog-snippet .btn-blog {
    color: var(--qy-red-dark);
    background: var(--qy-surface);
    border: 1px solid var(--qy-border);
}

#blog-snippet .btn-blog:hover {
    color: #fff;
    background: var(--qy-red-dark);
    border-color: var(--qy-red-dark);
}

.countdown-number {
    font-family: "Courier New", monospace;
    font-size: 1.75rem;
}

.countdown-label {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.random-number {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0.3rem;
    border-radius: 50%;
    font-size: 1.15rem;
    line-height: 1;
}

@media (max-width: 1199.98px) {
    .qy-navbar .navbar-collapse {
        padding-top: 0.75rem;
    }

    .qy-navbar .nav-link {
        padding-inline: 0.85rem;
    }
}

@media (min-width: 768px) {
    .border-md-start {
        border-left: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
    }
}

@media (min-width: 992px) {
    #blog-snippet .ratio {
        border-top-left-radius: var(--qy-radius);
        border-bottom-left-radius: var(--qy-radius);
    }
}

@media (max-width: 575.98px) {
    h1.display-5,
    h1.display-6 {
        font-size: clamp(2rem, 9vw, 2.5rem);
    }

    .w80 {
        width: 100% !important;
    }

    .btn:not(.navbar-toggler) {
        white-space: normal;
    }

    .qy-table-scroll .table {
        min-width: 38rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
