/* ==========================================================================
   SKLotto — mobile-first design system
   No external CSS framework. Layout starts at 320px and scales up.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
    --brand: #e0192d;
    --brand-strong: #ff3346;
    --brand-dark: #a80f1f;
    --gold: #f5c451;
    --gold-strong: #ffe29a;
    --gold-ink: #1d1505;
    --green: #34d399;
    --red: #f87171;

    --bg: #08090d;
    --bg-soft: #0d0f15;
    --surface: #12141d;
    --surface-2: #171a25;
    --surface-3: #1f2331;
    --text: #f4f5f8;
    --text-soft: #cfd3de;
    --muted: #a2a8ba;
    --faint: #7b8194;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.25);
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 24px;
    --pill: 999px;

    --header-h: 64px;
    --container: 1180px;
    --gutter: 1rem;

    --font-body: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-display: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html[data-theme="light"] {
    --bg: #f4f5f9;
    --bg-soft: #ebeef5;
    --surface: #ffffff;
    --surface-2: #f7f8fc;
    --surface-3: #eef0f7;
    --text: #121522;
    --text-soft: #333a4b;
    --muted: #5a6274;
    --faint: #7b8395;
    --border: rgba(18, 21, 34, 0.1);
    --border-strong: rgba(18, 21, 34, 0.18);
    --shadow: 0 24px 50px rgba(20, 26, 48, 0.12);
    --shadow-soft: 0 10px 24px rgba(20, 26, 48, 0.08);
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 560px at 50% -12%, rgba(224, 25, 45, 0.16), transparent 62%),
        radial-gradient(800px 480px at 92% 0%, rgba(245, 196, 81, 0.07), transparent 58%);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

html[data-theme="light"] body {
    background-image:
        radial-gradient(1100px 520px at 50% -14%, rgba(224, 25, 45, 0.1), transparent 62%),
        radial-gradient(760px 420px at 92% 0%, rgba(245, 196, 81, 0.14), transparent 58%);
}

body.nav-open {
    overflow: hidden;
}

img,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

p,
h1,
h2,
h3,
h4 {
    margin: 0;
}

ul,
ol {
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    line-height: 1.18;
    letter-spacing: -0.02em;
    font-weight: 800;
}

::selection {
    background: var(--gold);
    color: var(--gold-ink);
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* ---------- Layout primitives ---------- */
[id] {
    scroll-margin-top: calc(var(--header-h) + 1rem);
}

.container {
    width: min(var(--container), 100% - (var(--gutter) * 2));
    margin-inline: auto;
}

.section {
    padding-block: 1.75rem 2.5rem;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 1rem;
    z-index: 200;
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 12px 12px;
    background: var(--gold);
    color: var(--gold-ink);
    font-weight: 800;
    transition: top 0.2s var(--ease);
}

.skip-link:focus {
    top: 0;
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
}

.text-gold {
    color: var(--gold);
}

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

.required-mark {
    color: var(--brand-strong);
}

[hidden] {
    display: none !important;
}

/* ---------- Buttons / pills / links ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.68rem 1.15rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 750;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.btn .icon {
    width: 18px;
    height: 18px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn--gold {
    background: linear-gradient(135deg, var(--gold-strong), var(--gold) 55%, #dfa72c);
    color: var(--gold-ink);
    box-shadow: 0 10px 26px rgba(245, 196, 81, 0.18);
}

.btn--gold:hover {
    box-shadow: 0 14px 32px rgba(245, 196, 81, 0.28);
}

.btn--primary {
    background: linear-gradient(135deg, #f3223b, var(--brand) 60%, var(--brand-dark));
    color: #fff;
    box-shadow: 0 10px 26px rgba(224, 25, 45, 0.25);
}

.btn--ghost {
    background: rgba(255, 255, 255, 0.045);
    border-color: var(--border-strong);
    color: var(--text);
}

html[data-theme="light"] .btn--ghost {
    background: rgba(18, 21, 34, 0.035);
}

.btn--ghost:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.btn--small {
    min-height: 40px;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    border-radius: 10px;
}

.btn--block {
    width: 100%;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    text-decoration: underline;
    text-decoration-color: rgba(245, 196, 81, 0.35);
    text-underline-offset: 3px;
}

.text-link .icon {
    width: 15px;
    height: 15px;
}

.text-link:hover {
    text-decoration-color: currentColor;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 26px;
    padding: 0.18rem 0.6rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--pill);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.pill--gold {
    border-color: rgba(245, 196, 81, 0.35);
    background: rgba(245, 196, 81, 0.12);
    color: var(--gold);
}

.pill--red {
    border-color: rgba(224, 25, 45, 0.45);
    background: rgba(224, 25, 45, 0.2);
    color: #fff;
}

.pill--green {
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.12);
    color: var(--green);
}

/* ---------- Cards ---------- */
.card {
    min-width: 0;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.card__head--tight {
    gap: 0.7rem;
}

.card__head h2 {
    font-size: 1.02rem;
    line-height: 1.25;
}

.card__head p {
    margin-top: 0.18rem;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.45;
}

.card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    background: rgba(224, 25, 45, 0.16);
    color: #ff6b7a;
}

html[data-theme="light"] .card__icon {
    color: var(--brand);
}

.card__icon--gold {
    background: rgba(245, 196, 81, 0.15);
    color: var(--gold);
}

/* ---------- Header / navigation ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(8, 9, 13, 0.86);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

html[data-theme="light"] .site-header {
    background: rgba(255, 255, 255, 0.88);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.brand__mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
}

.brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    min-width: 0;
}

.brand__name {
    font-size: 1.02rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.brand__tag {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text-soft);
    transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
}

html[data-theme="light"] .icon-btn:hover {
    background: rgba(18, 21, 34, 0.06);
}

.icon-btn .icon {
    width: 21px;
    height: 21px;
}

/* ---------- Theme toggle (icon button beside the language picker) ---------- */
.theme-toggle__icon {
    display: none;
}

html[data-theme-mode="light"] .theme-toggle__icon[data-mode="light"],
html[data-theme-mode="dark"] .theme-toggle__icon[data-mode="dark"],
html[data-theme-mode="system"] .theme-toggle__icon[data-mode="system"] {
    display: inline-flex;
}

.theme-toggle[data-theme-cycle] {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.045);
}

html[data-theme="light"] .theme-toggle[data-theme-cycle] {
    background: rgba(18, 21, 34, 0.035);
}

.theme-toggle[data-theme-cycle]:hover {
    border-color: rgba(245, 196, 81, 0.45);
    color: var(--gold);
}

/* ---------- Language / theme picker ---------- */
.settings {
    position: relative;
}

.settings__trigger {
    width: auto;
    min-width: 52px;
    gap: 0.25rem;
    padding-inline: 0.45rem;
    list-style: none;
}

.settings__trigger::-webkit-details-marker {
    display: none;
}

.settings__trigger .icon {
    width: 19px;
    height: 19px;
}

.settings__code {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--gold);
}

.settings__panel {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    z-index: 95;
    width: min(300px, calc(100vw - 1.5rem));
    padding: 0.9rem;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: fade-up 0.18s ease;
}

.settings__heading {
    margin-bottom: 0.55rem;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

.settings__group + .settings__group {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.settings__title {
    margin-bottom: 0.4rem;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
}

.lang-list {
    list-style: none;
    display: grid;
    gap: 0.15rem;
}

.lang-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.48rem 0.55rem;
    border-radius: 9px;
    font-size: 0.82rem;
    color: var(--text-soft);
}

.lang-link:hover {
    background: var(--surface-2);
    color: var(--text);
}

.lang-link.is-current {
    background: rgba(245, 196, 81, 0.1);
    color: var(--gold);
}

.lang-link__native {
    font-weight: 700;
}

.lang-link__name {
    margin-left: auto;
    overflow: hidden;
    font-size: 0.68rem;
    color: var(--faint);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lang-link__check {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    color: var(--gold);
}

.theme-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.3rem;
}

.theme-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 54px;
    padding: 0.4rem 0.2rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 700;
}

.theme-choice .icon {
    width: 17px;
    height: 17px;
}

.theme-choice:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.theme-choice[aria-pressed="true"] {
    border-color: rgba(245, 196, 81, 0.5);
    background: rgba(245, 196, 81, 0.12);
    color: var(--gold);
}

.nav-toggle__close {
    display: none;
}

.site-header[data-nav-open="true"] .nav-toggle__open {
    display: none;
}

.site-header[data-nav-open="true"] .nav-toggle__close {
    display: inline-flex;
}

.install-shortcut {
    display: none;
}

/* Mobile nav drawer */
.primary-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 79;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    padding: 0.75rem var(--gutter) calc(1.25rem + env(safe-area-inset-bottom));
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
}

.site-header[data-nav-open="true"] .primary-nav {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.primary-nav__list {
    list-style: none;
    display: grid;
    gap: 0.2rem;
}

.primary-nav__link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 650;
    color: var(--text-soft);
}

.primary-nav__link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

html[data-theme="light"] .primary-nav__link:hover {
    background: rgba(18, 21, 34, 0.05);
}

.primary-nav__link.is-active {
    background: rgba(224, 25, 45, 0.12);
    color: var(--brand-strong);
    box-shadow: inset 2px 0 0 var(--brand);
}

html[data-theme="light"] .primary-nav__link.is-active {
    color: var(--brand);
}

.primary-nav__footer {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}

.primary-nav__note {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--faint);
}

.nav-scrim {
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 78;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: 1.9rem 0 2.2rem;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), var(--brand), var(--gold), transparent);
    opacity: 0.85;
}

.hero__glow {
    position: absolute;
    top: -40%;
    left: 50%;
    width: min(900px, 160%);
    aspect-ratio: 1;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(224, 25, 45, 0.22), transparent 62%);
    pointer-events: none;
}

html[data-theme="light"] .hero__glow {
    background: radial-gradient(circle, rgba(224, 25, 45, 0.12), transparent 62%);
}

.hero__inner {
    position: relative;
    display: grid;
    gap: 1.5rem;
    align-items: center;
}

.hero__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.hero h1 {
    font-size: clamp(2rem, 8.2vw, 3.5rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.hero__lead {
    margin-top: 0.85rem;
    max-width: 48ch;
    color: var(--muted);
    font-size: clamp(0.95rem, 2.6vw, 1.05rem);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.35rem;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 28px;
    padding: 0.2rem 0.7rem;
    border-radius: var(--pill);
    background: rgba(224, 25, 45, 0.16);
    border: 1px solid rgba(224, 25, 45, 0.45);
    color: #ff8a96;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.live-badge__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-strong);
    box-shadow: 0 0 0 0 rgba(255, 51, 70, 0.6);
    animation: pulse-dot 1.8s infinite;
}

.countdown-card {
    padding: 1.15rem 1.2rem;
    border: 1px solid rgba(245, 196, 81, 0.26);
    border-radius: var(--radius);
    background:
        radial-gradient(120% 120% at 100% 0%, rgba(245, 196, 81, 0.14), transparent 55%),
        linear-gradient(180deg, var(--surface-2), var(--surface));
    box-shadow: var(--shadow-soft);
}

.countdown {
    margin-top: 0.2rem;
    font-family: var(--font-mono);
    font-size: clamp(2rem, 9vw, 2.9rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--gold-strong);
}

.countdown-card__date {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.schedule-list {
    list-style: none;
    display: grid;
    gap: 0.45rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}

.schedule-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.schedule-list strong {
    color: var(--text);
    font-size: 0.82rem;
    white-space: nowrap;
}

/* ---------- Home layout ---------- */
.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.15rem;
}

/* ---------- Result card ---------- */
.result-card {
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(224, 25, 45, 0.14), transparent 55%),
        linear-gradient(180deg, var(--surface-2), var(--surface));
}

.result-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem;
    border-bottom: 1px solid var(--border);
}

.result-card__head--compact {
    align-items: center;
}

.result-card__title h2 {
    margin-top: 0.18rem;
    font-size: clamp(1.2rem, 4.6vw, 1.6rem);
    line-height: 1.15;
}

.result-card__meta {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.result-card__aside {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 28px;
    padding: 0.2rem 0.65rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--pill);
    background: rgba(255, 255, 255, 0.045);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.status-badge--live {
    border-color: rgba(224, 25, 45, 0.5);
    background: rgba(224, 25, 45, 0.18);
    color: #ff8a96;
}

.status-badge--done {
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.12);
    color: var(--green);
}

.draw-switcher {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
}

.draw-switcher label {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faint);
}

.select-wrap {
    position: relative;
    display: block;
}

.select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    min-height: 42px;
    padding: 0.5rem 2.4rem 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-3);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 650;
}

.select-wrap__icon {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--muted);
}

.result-card__body {
    padding: 1.15rem;
}

.result-card__foot {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin-top: 1.35rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
    font-size: 0.74rem;
    color: var(--faint);
}

.result-card__foot .icon {
    width: 16px;
    height: 16px;
    margin-top: 0.15rem;
    color: var(--muted);
}

/* ---------- Prize cards ---------- */
.prize-grid {
    display: grid;
    gap: 0.7rem;
}

.prize-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.1rem;
    min-height: 128px;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    overflow: hidden;
    isolation: isolate;
}

.prize-card::after {
    content: "";
    position: absolute;
    inset: -40% -20% auto auto;
    width: 60%;
    height: 140%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: translateX(120%) rotate(12deg);
    animation: prize-shine 9s infinite;
    z-index: -1;
}

.prize-card--first {
    background: linear-gradient(145deg, #ffe39a, #f5c451 46%, #d89d22);
    color: #201704;
    box-shadow: 0 18px 40px rgba(245, 196, 81, 0.18);
}

.prize-card--second {
    background: linear-gradient(145deg, #f1f4f8, #c7ced9 52%, #9aa4b3);
    color: #171b24;
}

.prize-card--third {
    background: linear-gradient(145deg, #f25564, #d61f34 55%, #971323);
    color: #fff;
    box-shadow: 0 18px 40px rgba(214, 31, 52, 0.18);
}

.prize-card__rank {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.86;
}

.prize-card__rank > span:first-child {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 24px;
    padding-inline: 0.35rem;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.14);
    letter-spacing: 0.08em;
}

.prize-card--third .prize-card__rank > span:first-child {
    background: rgba(255, 255, 255, 0.18);
}

.prize-card__label {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.prize-card__number {
    font-family: var(--font-display);
    font-size: clamp(2.35rem, 11vw, 3.3rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.prize-card__number .is-placeholder {
    opacity: 0.4;
    letter-spacing: 0.08em;
}

.prize-card__number.is-updated {
    animation: number-pop 0.65s var(--ease);
}

/* ---------- Number grids ---------- */
.number-section {
    margin-top: 1.45rem;
}

.number-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.number-section__head h3 {
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}

.number-section__head h3 span {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.06em;
}

.number-section__count {
    font-size: 0.68rem;
    color: var(--faint);
    white-space: nowrap;
}

.number-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
    gap: 0.45rem;
}

.number-chip {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 0.3rem 0.25rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--faint);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.number-chip.is-filled {
    border-color: rgba(245, 196, 81, 0.3);
    background: rgba(245, 196, 81, 0.09);
    color: var(--gold);
}

.number-chip.is-filled:hover {
    transform: translateY(-1px);
    background: rgba(245, 196, 81, 0.16);
}

.number-grid--green .number-chip.is-filled {
    border-color: rgba(52, 211, 153, 0.28);
    background: rgba(52, 211, 153, 0.09);
    color: var(--green);
}

.number-grid--green .number-chip.is-filled:hover {
    background: rgba(52, 211, 153, 0.16);
}

.number-chip.is-updated {
    animation: number-pop 0.65s var(--ease);
}

html[data-theme="light"] .number-chip.is-filled {
    color: #8a6204;
}

html[data-theme="light"] .number-grid--green .number-chip.is-filled {
    color: #067a52;
}

/* ---------- Sidebar cards ---------- */
.check-card,
.announcement-card,
.lucky-card,
.sidebar-card,
.filter-card,
.form-card,
.prose-card {
    padding: 1.15rem;
}

.check-form {
    margin-top: 1rem;
}

.input-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-row input {
    flex: 1 1 auto;
    min-width: 0;
}

.check-form input {
    min-height: 46px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    text-align: center;
}

.check-form input::placeholder {
    color: var(--faint);
    letter-spacing: 0.18em;
}

.field-hint {
    margin-top: 0.4rem;
    font-size: 0.72rem;
    color: var(--faint);
}

.check-card .text-link {
    margin-top: 0.8rem;
}

.check-result {
    margin-top: 0.85rem;
    font-size: 0.85rem;
}

.check-result:empty {
    display: none;
}

.check-result__box {
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.check-result__box.is-win {
    border-color: rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.1);
}

.check-result__box.is-loss {
    border-color: var(--border-strong);
}

.check-result__box.is-error {
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.1);
}

.check-result__title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 800;
}

.check-result__title .icon {
    width: 17px;
    height: 17px;
}

.check-result ul {
    list-style: none;
    display: grid;
    gap: 0.25rem;
    margin-top: 0.4rem;
}

.check-result li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.check-result li strong {
    color: var(--text);
}

.announcement-card__message {
    margin-top: 0.9rem;
    font-size: 0.9rem;
    font-weight: 650;
    color: var(--text-soft);
}

.lucky-card {
    text-align: center;
}

.lucky-card .card__head {
    text-align: left;
}

.lucky-number {
    margin: 0.9rem 0 1rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 9vw, 2.8rem);
    font-weight: 900;
    letter-spacing: 0.18em;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

.lucky-number.is-updated {
    animation: number-pop 0.6s var(--ease);
}

/* ---------- Highlights ---------- */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.section-title h2 {
    font-size: 1.05rem;
}

.highlights-track {
    list-style: none;
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.highlights-track > li {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.highlight-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 245px;
    min-height: 112px;
    padding: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
}

.highlight-card__date {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

.highlight-card h3 {
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.35;
}

/* ---------- App promo ---------- */
.app-promo {
    display: grid;
    gap: 1.35rem;
    padding: 1.35rem;
    border: 1px solid rgba(245, 196, 81, 0.22);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(110% 100% at 0% 0%, rgba(224, 25, 45, 0.2), transparent 58%),
        linear-gradient(150deg, var(--surface-2), var(--surface));
    box-shadow: var(--shadow-soft);
}

.app-promo h2 {
    margin-top: 0.25rem;
    font-size: clamp(1.4rem, 5vw, 1.95rem);
}

.app-promo p {
    margin-top: 0.6rem;
    font-size: 0.88rem;
    color: var(--muted);
    max-width: 52ch;
}

.feature-list {
    list-style: none;
    display: grid;
    gap: 0.45rem;
    margin-top: 0.9rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    color: var(--text-soft);
}

.feature-list .icon {
    width: 17px;
    height: 17px;
    color: var(--green);
}

.app-promo__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.15rem;
}

.install-hint {
    margin-top: 0.75rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(245, 196, 81, 0.3);
    border-radius: 10px;
    background: rgba(245, 196, 81, 0.08);
    color: var(--text-soft) !important;
    font-size: 0.8rem !important;
}

.app-promo__visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone {
    position: relative;
    width: min(190px, 62vw);
    aspect-ratio: 9 / 18;
    padding: 0.45rem;
    border: 1px solid var(--border-strong);
    border-radius: 30px;
    background: #05060a;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.phone__notch {
    position: absolute;
    top: 0.55rem;
    left: 50%;
    width: 38%;
    height: 5px;
    border-radius: var(--pill);
    background: #1d2130;
    transform: translateX(-50%);
    z-index: 2;
}

.phone__screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 100%;
    border-radius: 24px;
    background:
        radial-gradient(90% 60% at 50% 0%, rgba(224, 25, 45, 0.28), transparent 60%),
        linear-gradient(180deg, #10131d, #08090d);
    color: #fff;
    overflow: hidden;
}

.phone__screen img {
    width: 44px;
    height: 44px;
}

.phone__title {
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.phone__number {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

.phone__caption {
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #9aa1b5;
}

/* ---------- Page hero / breadcrumbs ---------- */
.page-hero {
    position: relative;
    padding: 1.75rem 0 1.65rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(224, 25, 45, 0.07), transparent);
}

.page-hero h1 {
    font-size: clamp(1.7rem, 6vw, 2.7rem);
    letter-spacing: -0.03em;
}

.page-hero p {
    margin-top: 0.6rem;
    max-width: 62ch;
    color: var(--muted);
    font-size: 0.94rem;
}

.page-hero .page-hero__meta {
    margin-top: 0.5rem;
    font-size: 0.74rem;
    color: var(--faint);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    font-size: 0.74rem;
    color: var(--faint);
}

.breadcrumbs a {
    color: var(--muted);
}

.breadcrumbs a:hover {
    color: var(--gold);
}

/* ---------- Content layouts ---------- */
.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.15rem;
}

.content-main,
.content-side {
    display: grid;
    gap: 1.15rem;
    align-content: start;
    min-width: 0;
}

.content-side {
    order: 2;
}

/* ---------- Forms ---------- */
label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    font-weight: 750;
    color: var(--text-soft);
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 1rem; /* prevents iOS zoom */
    line-height: 1.4;
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--faint);
    opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245, 196, 81, 0.16);
}

.field {
    min-width: 0;
}

.field-optional {
    font-weight: 500;
    color: var(--faint);
}

.form-grid {
    display: grid;
    gap: 0.9rem;
}

.form-grid + .form-actions {
    margin-top: 1.2rem;
}

.field--full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.privacy-note {
    font-size: 0.72rem;
    color: var(--faint);
}

.privacy-note a {
    color: var(--gold);
    text-decoration: underline;
}

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Won page ---------- */
.date-form {
    margin-top: 1rem;
}

.date-form label {
    margin-bottom: 0.4rem;
}

.date-form .input-row {
    flex-wrap: wrap;
}

.date-form input[type="date"] {
    flex: 1 1 12rem;
    min-width: 0;
    min-height: 48px;
}

.date-form .btn {
    flex: 0 0 auto;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1.1rem;
    justify-content: center;
}

.date-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--pill);
    background: var(--surface-2);
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--text-soft);
}

.date-chip:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.empty-state {
    padding: 2rem 1.15rem;
    text-align: center;
}

.empty-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 0.75rem;
    border-radius: 16px;
    background: rgba(245, 196, 81, 0.12);
    color: var(--gold);
}

.empty-state__icon .icon {
    width: 25px;
    height: 25px;
}

.empty-state h2 {
    font-size: 1.2rem;
}

.empty-state p {
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.empty-note {
    margin-top: 0.75rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.draw-list {
    list-style: none;
    display: grid;
    gap: 0.35rem;
    margin-top: 0.9rem;
}

.draw-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-height: 46px;
    padding: 0.55rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--surface-2);
    transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.draw-list__item:hover {
    border-color: var(--border-strong);
    background: var(--surface-3);
}

.draw-list__item.is-current {
    border-color: rgba(245, 196, 81, 0.4);
    background: rgba(245, 196, 81, 0.08);
}

.draw-list__date {
    font-size: 0.86rem;
    font-weight: 700;
}

.draw-list__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--faint);
}

.info-list {
    list-style: none;
    display: grid;
    gap: 0.55rem;
    margin-top: 0.9rem;
}

.info-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--muted);
}

.info-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.info-list strong {
    color: var(--text);
    font-size: 0.84rem;
    text-align: right;
}

.info-list a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.link-list {
    list-style: none;
    display: grid;
    gap: 0.3rem;
    margin-top: 0.85rem;
}

.link-list a {
    display: block;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-soft);
    border-bottom: 1px solid var(--border);
}

.link-list li:last-child a {
    border-bottom: 0;
}

.link-list a:hover {
    color: var(--gold);
}

.sidebar-card--accent {
    border-color: rgba(245, 196, 81, 0.22);
    background:
        radial-gradient(120% 100% at 100% 0%, rgba(245, 196, 81, 0.12), transparent 60%),
        linear-gradient(180deg, var(--surface-2), var(--surface));
}

.sidebar-card .btn--block {
    margin-top: 1rem;
}

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 0.86rem;
}

.alert__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
}

.alert__icon .icon {
    width: 17px;
    height: 17px;
}

.alert strong {
    display: block;
    font-size: 0.9rem;
}

.alert p,
.alert ul {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.alert ul {
    padding-left: 1.1rem;
    display: grid;
    gap: 0.15rem;
}

.alert--success {
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.09);
}

.alert--success .alert__icon {
    background: rgba(52, 211, 153, 0.16);
    color: var(--green);
}

.alert--error {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.08);
}

.alert--error .alert__icon {
    background: rgba(248, 113, 113, 0.16);
    color: var(--red);
}

.alert--warning {
    border-color: rgba(245, 196, 81, 0.32);
    background: rgba(245, 196, 81, 0.08);
    display: block;
}

.alert--warning strong {
    color: var(--gold);
}

/* ---------- Prose / documents ---------- */
.prose {
    max-width: 72ch;
    color: var(--text-soft);
    font-size: 0.94rem;
}

.prose p {
    margin-top: 0.8rem;
    color: var(--muted);
}

.prose section + section {
    margin-top: 1.8rem;
}

.prose h2 {
    font-size: 1.22rem;
    margin-top: 0;
}

.prose h3 {
    margin-top: 1.4rem;
    font-size: 1.02rem;
}

.prose ul,
.prose ol {
    margin-top: 0.75rem;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
}

.prose li::marker {
    color: var(--gold);
}

.prose a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose strong {
    color: var(--text);
}

.prose code {
    padding: 0.1rem 0.35rem;
    border-radius: 5px;
    background: var(--surface-3);
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--text);
}

.prose-card__intro {
    display: grid;
    gap: 1rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border);
}

.prose-card__intro h2 {
    margin-top: 0.25rem;
    font-size: clamp(1.25rem, 4vw, 1.65rem);
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.stat {
    padding: 0.7rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    text-align: center;
}

.stat strong {
    display: block;
    font-size: 1.05rem;
    color: var(--gold);
    line-height: 1.2;
}

.stat span {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--faint);
}

.prose-split {
    display: grid;
    gap: 1.35rem;
    margin-top: 1.35rem;
}

.prose-figure {
    margin: 0;
    align-self: start;
}

.prose-figure img {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-3);
}

.prose-figure figcaption,
.media-card figcaption {
    margin-top: 0.45rem;
    font-size: 0.72rem;
    color: var(--faint);
    text-align: center;
}

.prose-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.35rem;
}

.check-list {
    list-style: none !important;
    padding-left: 0 !important;
    gap: 0.5rem !important;
}

.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.check-list .icon {
    width: 18px;
    height: 18px;
    margin-top: 0.18rem;
    color: var(--green);
}

.value-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.value-card {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
}

.value-card h2 {
    margin-top: 0.6rem;
    font-size: 1.05rem;
}

.value-card p {
    margin-top: 0.4rem;
    font-size: 0.86rem;
}

.media-card {
    padding: 0.6rem;
}

.media-card img {
    width: 100%;
    border-radius: 12px;
}

/* Documentation TOC */
.docs-toc {
    position: static;
    padding: 1rem !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    height: max-content;
}

.docs-toc .eyebrow {
    margin-bottom: 0.55rem;
}

.docs-toc ol {
    list-style: none;
    counter-reset: toc;
    display: grid;
    gap: 0.1rem;
}

.docs-toc li {
    counter-increment: toc;
}

.docs-toc a {
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem 0.35rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.35;
}

.docs-toc a::before {
    content: counter(toc, decimal-leading-zero);
    color: var(--gold);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding-top: 0.1rem;
}

.docs-toc a:hover {
    background: var(--surface-2);
    color: var(--text);
}

/* Tables */
.table-wrap {
    margin: 1rem 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.table-wrap th,
.table-wrap td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.table-wrap th {
    background: var(--surface-2);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.table-wrap tr:last-child td {
    border-bottom: 0;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 2.5rem;
    padding: 2.25rem 0 1.1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
}

.footer-grid {
    display: grid;
    gap: 1.65rem;
}

.brand--footer .brand__mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
}

.footer-brand p {
    margin-top: 0.7rem;
    max-width: 38ch;
    font-size: 0.83rem;
    color: var(--muted);
}

.footer-badge-line {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem !important;
}

.footer-heading {
    margin-bottom: 0.65rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
}

.footer-column ul {
    list-style: none;
    display: grid;
    gap: 0.35rem;
}

.footer-column a {
    display: inline-block;
    padding: 0.18rem 0;
    font-size: 0.84rem;
    color: var(--muted);
}

.footer-column a:hover {
    color: var(--gold);
}

.footer-small {
    margin-bottom: 0.7rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 1.75rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
    font-size: 0.74rem;
    color: var(--faint);
}

.footer-bottom__links {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.footer-bottom a {
    color: var(--muted);
}

.footer-bottom a:hover {
    color: var(--gold);
}

/* ---------- Cookie banner / to-top ---------- */
.cookie-banner {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.9rem;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: rgba(14, 16, 23, 0.97);
    color: #f4f5f8;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.cookie-banner__text {
    flex: 1 1 16rem;
    min-width: 0;
}

.cookie-banner strong {
    font-size: 0.86rem;
}

.cookie-banner p {
    margin-top: 0.15rem;
    font-size: 0.76rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
}

.cookie-banner a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.cookie-banner .btn--ghost {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.to-top {
    position: fixed;
    right: 0.9rem;
    bottom: calc(0.9rem + env(safe-area-inset-bottom));
    z-index: 70;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: rgba(18, 20, 29, 0.9);
    color: var(--text);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(8px);
}

html[data-theme="light"] .to-top {
    background: rgba(255, 255, 255, 0.94);
}

.to-top .icon {
    width: 19px;
    height: 19px;
}

/* ---------- Error page ---------- */
.error-page {
    display: grid;
    place-items: center;
    min-height: calc(100dvh - var(--header-h) - 120px);
    padding: 2.5rem 0;
    text-align: center;
}

.error-page__inner {
    max-width: 640px;
}

.error-page__code {
    font-family: var(--font-display);
    font-size: clamp(5rem, 28vw, 10rem);
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--gold-strong), var(--brand-strong));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0.9;
}

.error-page__code--small {
    font-size: clamp(4rem, 22vw, 7rem);
}

.error-page h1 {
    margin-top: 0.5rem;
    font-size: clamp(1.5rem, 5vw, 2.2rem);
}

.error-page__lead {
    margin: 0.65rem auto 0;
    max-width: 44ch;
    color: var(--muted);
    font-size: 0.94rem;
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 1.5rem;
}

/* ---------- Motion ---------- */
@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(255, 51, 70, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(255, 51, 70, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 51, 70, 0); }
}

@keyframes prize-shine {
    0%, 62% { transform: translateX(120%) rotate(12deg); }
    82%, 100% { transform: translateX(-260%) rotate(12deg); }
}

@keyframes number-pop {
    0% { transform: scale(0.82); opacity: 0.4; }
    55% { transform: scale(1.06); opacity: 1; }
    100% { transform: scale(1); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Breakpoints
   ========================================================================== */

@media (min-width: 480px) {
    .result-card__aside {
        width: auto;
    }

    .draw-switcher {
        width: auto;
        min-width: 12rem;
    }

    .btn {
        padding-inline: 1.25rem;
    }
}

@media (min-width: 600px) {
    :root {
        --gutter: 1.5rem;
    }

    .section {
        padding-block: 2.25rem 3rem;
    }

    .result-card__head,
    .result-card__body {
        padding: 1.35rem;
    }

    .check-card,
    .announcement-card,
    .lucky-card,
    .sidebar-card,
    .filter-card,
    .form-card,
    .prose-card {
        padding: 1.35rem;
    }

    .prize-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .prize-card {
        min-height: 138px;
    }

    .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .highlights-track {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
        overflow: visible;
        padding-bottom: 0;
    }

    .highlight-card {
        width: auto;
        height: 100%;
    }

    .prose-split {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
        align-items: start;
    }

    .value-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 768px) {
    :root {
        --header-h: 70px;
        --gutter: 2rem;
    }

    .hero {
        padding: 2.5rem 0 2.75rem;
    }

    .hero__inner {
        gap: 2rem;
    }

    .countdown-card {
        padding: 1.35rem 1.4rem;
    }

    .app-promo {
        grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.55fr);
        align-items: center;
        padding: 1.75rem;
    }

    .cookie-banner {
        left: 1.25rem;
        right: auto;
        width: min(620px, calc(100% - 2.5rem));
        padding: 1rem 1.1rem;
    }

    .to-top {
        right: 1.25rem;
        bottom: 1.25rem;
    }

    .page-hero {
        padding: 2.25rem 0 2rem;
    }
}

@media (min-width: 900px) {
    .hero__inner {
        grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    }

    .header-inner {
        gap: 1.5rem;
    }

    .install-shortcut {
        display: inline-flex;
    }

    .nav-toggle {
        display: none;
    }

    .primary-nav {
        position: static;
        display: flex;
        align-items: center;
        gap: 0.25rem;
        max-height: none;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        overflow: visible;
    }

    .primary-nav__list {
        display: flex;
        align-items: center;
        gap: 0.15rem;
    }

    .primary-nav__link {
        min-height: 38px;
        padding: 0.4rem 0.65rem;
        border-radius: 9px;
        font-size: 0.82rem;
        font-weight: 650;
        white-space: nowrap;
    }

    .primary-nav__link.is-active {
        box-shadow: none;
        background: rgba(224, 25, 45, 0.12);
    }

    .primary-nav__footer {
        display: none;
    }

    .nav-scrim {
        display: none;
    }

    .content-layout {
        grid-template-columns: minmax(0, 1fr) 330px;
        gap: 1.35rem;
    }

    .content-layout--wide {
        grid-template-columns: minmax(0, 1fr) 310px;
    }

    .content-side {
        order: 0;
    }

    .content-layout--docs {
        grid-template-columns: 245px minmax(0, 1fr);
    }

    .docs-toc {
        position: sticky;
        top: calc(var(--header-h) + 1rem);
    }

    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .home-layout {
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 1.35rem;
        align-items: start;
    }

    .home-layout .result-card {
        grid-column: 1;
        grid-row: 1;
    }

    .home-layout .check-card {
        grid-column: 2;
        grid-row: 1;
    }

    .home-layout .announcement-card {
        grid-column: 2;
        grid-row: 2;
    }

    .home-layout .lucky-card {
        grid-column: 2;
        grid-row: 3;
    }

    .home-layout .highlights {
        grid-column: 1;
        grid-row: 2;
    }

    .home-layout .app-promo {
        grid-column: 1;
        grid-row: 3;
    }

    .home-layout .result-card__body {
        padding: 1.6rem;
    }

    .home-layout .result-card__head {
        padding: 1.4rem 1.6rem;
    }

    .home-layout .prize-card {
        min-height: 152px;
        padding: 1.1rem;
    }

    .prize-card__number {
        font-size: clamp(2.6rem, 4vw, 3.35rem);
    }
}

@media (min-width: 1200px) {
    .hero h1 {
        font-size: 3.6rem;
    }

    .number-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .number-grid--green {
        grid-template-columns: repeat(10, minmax(0, 1fr));
    }
}

/* Very small phones */
@media (max-width: 359px) {
    .brand__tag {
        display: none;
    }

    .prize-card__number {
        letter-spacing: 0.08em;
    }

    .number-grid {
        grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    }

    .check-form input {
        letter-spacing: 0.14em;
    }
}

/* ---------- Accessibility preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

@media (prefers-contrast: more) {
    :root {
        --border: rgba(255, 255, 255, 0.25);
        --border-strong: rgba(255, 255, 255, 0.4);
        --muted: #c6cad5;
    }
}

/* ---------- Print ---------- */
@media print {
    .site-header,
    .site-footer,
    .cookie-banner,
    .to-top,
    .hero__actions,
    .app-promo,
    .check-card,
    .lucky-card {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .card,
    .prize-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .result-card__body,
    .result-card__head {
        padding: 0.5rem;
    }
}

/* ==========================================================================
   Localisation, settings button and runtime helpers (v5)
   ========================================================================== */

/* Script-specific font fallbacks (no webfont downloads — keeps payload small) */
html[lang="zh-Hans"] body,
html[lang="zh-Hans"] .brand__name,
[lang="zh-Hans"] {
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", "Segoe UI", Roboto, sans-serif;
}

html[lang="km"] body,
html[lang="km"] .brand__name,
[lang="km"] {
    font-family: "Khmer OS Battambang", "Khmer OS", "Noto Sans Khmer", "Segoe UI", Roboto, sans-serif;
    line-height: 1.75;
}

/* Khmer diacritics need a little extra leading */
html[lang="km"] h1,
html[lang="km"] h2,
html[lang="km"] h3 {
    line-height: 1.5;
}

html[lang="km"] .brand__tag,
html[lang="km"] .eyebrow,
html[lang="km"] .settings__title {
    letter-spacing: 0.04em;
}

/* Footer language switcher */
.footer-languages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.9rem;
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}

.footer-languages a {
    padding: 0.2rem 0;
    font-size: 0.78rem;
    color: var(--faint);
}

.footer-languages a:hover {
    color: var(--gold);
}

.footer-languages a.is-current {
    color: var(--gold);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Confetti canvas + install toast (created by JS) */
.confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.install-toast {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 200;
    max-width: 420px;
    margin-inline: auto;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(245, 196, 81, 0.35);
    border-radius: 12px;
    background: rgba(14, 16, 23, 0.96);
    color: #f4f5f8;
    font-size: 0.82rem;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
    animation: fade-up 0.2s ease;
}

/* Compact header actions on small screens */
@media (max-width: 359px) {
    .settings__code {
        display: none;
    }

    .settings__trigger {
        min-width: 44px;
    }
}

/* Wider settings panel on desktop */
@media (min-width: 600px) {
    .settings__panel {
        width: 320px;
    }
}

/* Keep the settings panel reachable inside the mobile drawer stacking order */
@media (max-width: 899px) {
    .settings__panel {
        position: fixed;
        top: calc(var(--header-h) + 0.4rem);
        right: 0.75rem;
    }
}
