:root {
    color-scheme: light;
    --page: #edf2f5;
    --surface: #ffffff;
    --navy: #102a43;
    --navy-soft: #183e59;
    --green: #16835d;
    --green-soft: #e8f7ee;
    --gold: #f3c64e;
    --text: #243447;
    --muted: #64748b;
    --border: #e1e8ef;
    --radius: 18px;
    --shadow: 0 8px 28px rgba(16, 42, 67, 0.07);
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--page);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
.container { width: min(1160px, 92%); margin-inline: auto; }

.site-header {
    color: white;
    background: var(--navy);
    border-bottom: 4px solid var(--gold);
}

.header-inner {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-block: 14px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: white;
    font-size: 1.5rem;
    font-weight: 850;
    letter-spacing: -0.05em;
    text-decoration: none;
}

.brand strong { color: #7ee4ab; }
.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    color: var(--navy);
    background: var(--gold);
    font-size: 0.95rem;
    letter-spacing: 0;
}

.tagline { margin: 0; color: #d8e5ef; font-size: 0.93rem; }

.main-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(16, 42, 67, 0.04);
    backdrop-filter: blur(12px);
}

.nav-links { display: flex; gap: 5px; overflow-x: auto; }
.nav-links a {
    flex: 0 0 auto;
    padding: 14px 15px 12px;
    color: var(--navy);
    border-bottom: 3px solid transparent;
    font-size: 0.91rem;
    font-weight: 750;
    text-decoration: none;
}

.nav-links a:hover, .nav-links a:focus-visible { color: var(--green); border-bottom-color: var(--gold); }
.page-content { padding-block: 28px 60px; }

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 42px;
    padding: clamp(24px, 5vw, 46px);
    overflow: hidden;
    border-radius: 24px;
    color: white;
    background: radial-gradient(circle at 89% 8%, rgba(126, 228, 171, 0.18), transparent 30%), linear-gradient(125deg, #102a43, #174d55);
    box-shadow: var(--shadow);
}

.hero-copy { max-width: 720px; }
.eyebrow { display: block; margin-bottom: 8px; color: #87e8b1; font-size: 0.72rem; font-weight: 850; letter-spacing: 0.13em; }
.eyebrow-dark { color: var(--green); }
.hero h1 { margin: 0 0 12px; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1; letter-spacing: -0.04em; }
.hero p { max-width: 660px; margin: 0; color: #e1ebf2; }

.live-indicator {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.23);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    font-size: 0.8rem;
    font-weight: 750;
}

.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #f7ca55; }
.live-indicator.is-online .status-dot { background: #71e5a4; box-shadow: 0 0 0 4px rgba(113, 229, 164, 0.14); }
.live-indicator.is-offline .status-dot { background: #ff9f9f; }
.live-indicator.is-loading .status-dot { background: #f7ca55; animation: pulse 1.1s infinite ease-in-out; }

@keyframes pulse { 50% { opacity: 0.35; } }

.section { margin-bottom: 48px; scroll-margin-top: 92px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; color: var(--navy); font-size: clamp(1.4rem, 3vw, 1.85rem); letter-spacing: -0.03em; }
.section-description { max-width: 760px; margin: 7px 0 0; color: var(--muted); font-size: 0.92rem; }

.button {
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 800;
    transition: transform 0.15s ease, background 0.15s ease;
}

.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { background: #116849; }
.button-secondary { color: var(--navy); background: white; border-color: var(--border); }
.button-secondary:hover { background: #f8fbfd; }

.toolbar {
    display: flex;
    align-items: end;
    gap: 14px;
    margin-bottom: 14px;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: 0 3px 12px rgba(16, 42, 67, 0.03);
}

.field { display: flex; min-width: 185px; flex-direction: column; gap: 6px; }
.field-grow { flex: 1 1 260px; }
.field > span { color: var(--navy); font-size: 0.79rem; font-weight: 800; }
.field input, .field select {
    width: 100%;
    min-height: 43px;
    padding: 9px 11px;
    border: 1px solid #cad5e0;
    border-radius: 9px;
    outline: none;
    color: var(--text);
    background: white;
}

.field input:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 131, 93, 0.12); }
.result-summary { margin: 0 0 14px; color: var(--muted); font-size: 0.84rem; font-weight: 650; }
.results-list { display: grid; gap: 17px; }

.operator-section, .catalog-card, .stat-card, .panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.operator-section { overflow: hidden; border: 1px solid #d9e1e8; border-radius: var(--radius); background: #e6edf2; box-shadow: var(--shadow); }
.operator-heading { display: flex; align-items: center; gap: 11px; padding: 13px 18px; color: white; background: var(--operator-color, var(--navy)); border-bottom: 3px solid var(--gold); }
.operator-heading h3 { margin: 0; font-size: 1.12rem; font-weight: 850; }
.operator-mark { display: grid; min-width: 39px; height: 39px; padding-inline: 5px; place-items: center; border: 1px solid rgba(255,255,255,.65); border-radius: 50%; color: var(--operator-color, var(--navy)); background: white; font-size: 0.66rem; font-weight: 950; letter-spacing: -0.04em; }
.operator-empty { box-shadow: none; }
.operator-empty .operator-heading { padding-block: 10px; }
.empty-note { margin: 0; padding: 12px 18px 15px; color: var(--muted); font-size: 0.84rem; }
.draw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; }

.draw-card { min-width: 0; overflow: hidden; border: 1px solid #d7e0e7; border-radius: 15px; background: white; box-shadow: 0 3px 12px rgba(16, 42, 67, 0.055); }
.draw-card:nth-child(odd):last-child { grid-column: 1 / -1; }
.draw-card-heading { display: flex; min-height: 106px; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px 12px; color: var(--navy); background: white; }
.draw-card-title { display: flex; min-width: 0; align-items: flex-start; }
.draw-card-labels { display: grid; min-width: 0; justify-items: start; gap: 4px; }
.game-logo { display: grid; width: 49px; height: 49px; flex: 0 0 auto; place-items: center; border: 1px solid #d7e5dc; border-radius: 12px; color: var(--operator-color, var(--green)); background: #f0f7f2; font-size: 0.7rem; font-weight: 950; letter-spacing: -0.04em; box-shadow: 0 2px 7px rgba(16, 42, 67, 0.08); }
@supports (background: color-mix(in srgb, green 10%, white)) {
    .game-logo { border-color: color-mix(in srgb, var(--operator-color, var(--green)) 28%, white); background: color-mix(in srgb, var(--operator-color, var(--green)) 9%, white); }
}
.draw-card h3 { margin: 0; color: var(--navy); font-size: 1.17rem; font-weight: 850; line-height: 1.2; }
.draw-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; color: var(--muted); font-size: 0.73rem; }
.draw-date { display: inline-flex; min-height: 25px; align-items: center; padding: 3px 8px; border-radius: 6px; color: white; background: #64788a; font-size: 0.73rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.draw-time { color: #64748b; font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.draw-status { color: #657589; font-size: 0.68rem; font-weight: 650; }
.status-complete, .status-published { color: #657589; }
.status-pending { color: #956d1b; }

.number-list { display: flex; min-height: 76px; flex-wrap: wrap; align-items: center; justify-content: center; gap: 9px; margin: 0; padding: 14px 12px; background: #f8fafb; }
.number-ball { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid; border-radius: 50%; font-family: inherit; font-size: 1.14rem; font-weight: 850; font-variant-numeric: tabular-nums; transition: background-color 160ms ease, transform 160ms ease; }
.draw-card .number-ball { cursor: pointer; }
.draw-card .number-ball:hover { transform: translateY(-2px); }
.draw-card .number-ball:active { transform: scale(0.96); }
.number-ball-drawn { color: #176445; border-color: #b7dfc7; background: #d8f1e1; }
.number-ball-empty { color: #747f8a; border-color: #c5cdd5; background: #dce1e6; }
.number-ball-bonus.number-ball-drawn { color: #155c3f; border-color: #a8d8bc; background: #c9ebd6; }
.inline-link:hover { text-decoration: underline; }
.source-note { margin: 13px 0 0; color: var(--muted); font-size: 0.8rem; }

.directory-section { padding-top: 4px; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.catalog-card { padding: 17px 18px; box-shadow: 0 4px 16px rgba(16, 42, 67, 0.035); }
.catalog-card h3 { margin: 0 0 11px; color: var(--navy); font-size: 0.98rem; }
.catalog-games { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.catalog-game { padding: 2px 0; border: 0; color: var(--muted); background: transparent; font-size: 0.8rem; text-align: left; }
.catalog-game:hover { color: var(--green); text-decoration: underline; }

.panel { padding: clamp(20px, 4vw, 30px); }
.history-toolbar { margin-top: 20px; }
.history-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.history-drawer { position: fixed; inset: auto 0 0 auto; width: min(560px, 100%); max-width: none; max-height: min(82vh, 850px); margin: 0; padding: 0; overflow: auto; border: 1px solid #d7e0e7; border-right: 0; border-bottom: 0; border-radius: 20px 0 0 0; color: var(--text); background: #f7f9fb; box-shadow: 0 -12px 50px rgba(16, 42, 67, 0.2); }
.history-drawer::backdrop { background: rgba(10, 25, 41, 0.45); }
.history-drawer-header { position: sticky; z-index: 1; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid var(--border); background: #f7f9fb; }
.history-drawer-header h2 { margin: 4px 0; color: var(--navy); font-size: 1.25rem; }
.history-drawer-header .result-summary { margin: 7px 0 0; }
.history-close { flex: 0 0 auto; }
.recent-draw-list { display: grid; gap: 10px; padding: 16px 20px 24px; }
.recent-draw { padding: 12px; border: 1px solid #d7e0e7; border-radius: 13px; background: white; }
.recent-draw-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 0.8rem; }
.recent-draw-heading strong { color: var(--navy); }
.recent-number-list { display: flex; flex-wrap: wrap; gap: 7px; }
.recent-number-list .number-ball { width: 39px; height: 39px; font-size: 0.95rem; }
.recent-no-numbers { align-self: center; color: var(--muted); font-size: 0.83rem; }
.history-results .draw-card { border: 1px solid var(--border); border-radius: 14px; background: #f8fafb; }
.message-card { margin: 0; padding: 17px; border: 1px dashed #cbd6e0; border-radius: 12px; color: var(--muted); background: white; }
.message-card p { margin: 0 0 8px; }
.message-card p:last-child { margin-bottom: 0; }
.muted-copy { font-size: 0.84rem; }
.inline-link { display: inline-block; margin-top: 7px; color: var(--green); font-weight: 800; }
.stats-game-field { min-width: 210px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-card { padding: 17px; box-shadow: none; }
.stat-card h3 { margin: 0 0 15px; color: var(--navy); font-size: 0.96rem; }
.frequency-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.frequency-row { display: grid; grid-template-columns: 31px minmax(50px, 1fr) auto; align-items: center; gap: 8px; }
.frequency-number { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; color: var(--navy); background: #eef2f6; font-size: 0.78rem; font-weight: 850; }
.frequency-track { height: 7px; overflow: hidden; border-radius: 99px; background: #eaf0f4; }
.frequency-fill { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.frequency-count { color: var(--muted); font-size: 0.71rem; font-variant-numeric: tabular-nums; }

.site-footer { padding: 29px 0; color: #dce7f0; background: var(--navy); text-align: center; }
.footer-inner p { margin: 7px 0; }
.footer-brand { justify-content: center; font-size: 1.25rem; }
.disclaimer { max-width: 750px; margin-inline: auto !important; color: #afc1d1; font-size: 0.78rem; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

@media (max-width: 900px) {
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .header-inner { align-items: flex-start; flex-direction: column; gap: 4px; padding-block: 12px; }
    .brand { font-size: 1.35rem; }
    .tagline { font-size: 0.82rem; }
    .nav-links a { padding: 12px 11px 10px; font-size: 0.82rem; }
    .page-content { padding-top: 18px; }
    .hero { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 32px; border-radius: 17px; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .field { min-width: 0; }
    .draw-grid, .history-results { grid-template-columns: 1fr; }
    .draw-card:nth-child(odd):last-child { grid-column: auto; }
    .catalog-grid { grid-template-columns: 1fr; }
    .stats-game-field { width: 100%; }
    .history-drawer { width: 100%; max-height: 85vh; border-right: 0; border-radius: 18px 18px 0 0; }
    .history-drawer-header { padding: 18px 16px 14px; }
    .recent-draw-list { padding-inline: 14px; }
}

@media (max-width: 480px) {
    .draw-card-heading { min-height: 98px; gap: 10px; padding-inline: 13px; }
    .draw-card h3 { font-size: 1.12rem; }
    .game-logo { width: 45px; height: 45px; }
    .draw-card-meta { column-gap: 7px; }
}

@media (max-width: 390px) {
    .number-list { gap: 7px; }
    .number-ball { width: 43px; height: 43px; font-size: 1.03rem; }
}

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