:root {
    --night: #050b2f;
    --deep-blue: #071f83;
    --royal-blue: #263195;
    --gold: #ffd23f;
    --soft-gold: #ffe994;
    --paper: #ffffff;
    --mist: #f4f6fb;
    --line: #dfe5f7;
    --text: #080b18;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: linear-gradient(180deg, var(--night) 0, var(--deep-blue) 320px, #eef2f8 320px, #eef2f8 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hero {
    color: #fff;
    margin: 0 auto;
    max-width: 1180px;
    padding: 2rem 1.25rem 2.5rem;
}

.topbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.brand-mark {
    align-items: center;
    background: radial-gradient(circle at 35% 35%, #fff, #67d8ff 34%, #1947b8 35%, #071f83 100%);
    border: 3px solid #fff;
    border-radius: 20px;
    color: var(--gold);
    display: flex;
    font-size: 2rem;
    height: 66px;
    justify-content: center;
    transform: rotate(-8deg);
    width: 66px;
}

.eyebrow,
.near-text {
    color: #cfd8ff;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0 0 0.35rem;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
}

h1 {
    font-size: clamp(2.1rem, 5vw, 4.5rem);
    line-height: 0.95;
}

.jackpot-card {
    align-items: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 34px;
    box-shadow: 0 28px 70px rgba(0,0,0,0.25);
    display: grid;
    gap: 1.75rem;
    grid-template-columns: minmax(260px, 0.8fr) minmax(520px, 1.5fr);
    overflow: hidden;
    padding: 2rem;
    position: relative;
}

.jackpot-card::after {
    color: rgba(255,255,255,0.08);
    content: "★ ★ ★";
    font-size: 9rem;
    position: absolute;
    right: 1rem;
    top: -2rem;
}

.draw-date {
    font-weight: 800;
    margin: 0 0 0.75rem;
}

#jackpotText {
    color: var(--gold);
    display: block;
    font-size: clamp(1.9rem, 4.3vw, 3.1rem);
    line-height: 1.05;
    text-shadow: 0 4px 0 rgba(0,0,0,0.18);
}

.jackpot-status {
    color: #e7ecff;
    font-weight: 700;
    margin: 0.75rem 0 0;
}

.summary-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(285px, 1fr));
    z-index: 1;
}

.summary-grid article {
    background: rgba(255,255,255,0.95);
    border-radius: 22px;
    color: var(--deep-blue);
    min-height: 104px;
    padding: 1.15rem 1.2rem;
}

.summary-grid span {
    color: #4d5a8c;
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.summary-grid strong {
    display: block;
    font-size: clamp(1.15rem, 2vw, 1.35rem);
    margin-top: 0.35rem;
    white-space: nowrap;
}

.page-shell {
    margin: 0 auto;
    max-width: 1180px;
    padding: 0 1.25rem 3rem;
}

.card,
.notice-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 18px 45px rgba(10, 24, 82, 0.08);
    margin-bottom: 1.25rem;
    padding: 1.25rem;
}

.notice-card {
    color: #26315f;
    font-size: 0.95rem;
}

.error-text {
    color: #b42318;
    display: block;
    margin-top: 0.35rem;
}

.section-title {
    align-items: center;
    color: var(--royal-blue);
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.coins-icon {
    display: grid;
    gap: 2px;
}

.coins-icon span {
    background: var(--royal-blue);
    border-radius: 50%;
    display: block;
    height: 7px;
    width: 18px;
}

.table-scroll {
    overflow-x: auto;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1040px;
    width: 100%;
}

th {
    color: #020515;
    font-size: 0.98rem;
    line-height: 1.05;
    padding: 1rem 0.9rem;
    text-align: left;
}

td {
    padding: 0.72rem 0.9rem;
}

tbody tr:nth-child(odd) td {
    background: #f7f7f8;
}

tbody tr:nth-child(even) td {
    background: #fff;
}

tbody tr td:first-child {
    border-bottom-left-radius: 10px;
    border-top-left-radius: 10px;
}

tbody tr td:last-child {
    border-bottom-right-radius: 10px;
    border-top-right-radius: 10px;
}

.rank-cell {
    font-weight: 800;
    white-space: nowrap;
}

.ball-dot {
    background: #001b78;
    border-radius: 50%;
    display: inline-block;
    height: 13px;
    margin: 0 0.2rem;
    vertical-align: -1px;
    width: 13px;
}

.star-dot {
    color: #f6c600;
    display: inline-block;
    font-size: 0.95rem;
    margin-left: 0.1rem;
    text-shadow: 0 1px 0 #b48100;
}

.money-cell {
    font-weight: 900;
}

.controls-card {
    align-items: center;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr auto;
}

.controls-card .eyebrow {
    color: var(--royal-blue);
}

.settings-form {
    align-items: end;
    display: grid;
    gap: 1rem;
    grid-template-columns: auto minmax(230px, 280px) auto;
}

.toggle-line,
.jackpot-field {
    color: #19255d;
    font-weight: 800;
}

.toggle-line {
    align-items: center;
    display: flex;
    gap: 0.65rem;
}

.toggle-line input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.toggle-ui {
    background: #cfd6ee;
    border-radius: 999px;
    display: inline-block;
    height: 30px;
    position: relative;
    transition: 0.2s ease;
    width: 56px;
}

.toggle-ui::after {
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    content: "";
    height: 24px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: 0.2s ease;
    width: 24px;
}

.toggle-line input:checked + .toggle-ui {
    background: var(--royal-blue);
}

.toggle-line input:checked + .toggle-ui::after {
    transform: translateX(26px);
}

.jackpot-field span {
    display: block;
    margin-bottom: 0.4rem;
}

input[type="text"] {
    border: 2px solid #d9def4;
    border-radius: 999px;
    font: inherit;
    padding: 0.85rem 1rem;
    width: 100%;
}

button {
    background: var(--royal-blue);
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    padding: 0.95rem 1.3rem;
}

button:hover {
    background: #101b70;
}

.expected-gain-cell {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.gain-badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    padding: 0.18rem 0.42rem;
    text-transform: uppercase;
}

.gain-badge-jackpot,
.expected-source-jackpot td {
    background: #fff7d7 !important;
}

.gain-badge-jackpot {
    color: #7a5400;
}

.gain-badge-estimated,
.expected-source-estimated td {
    background: #edf7ff !important;
}

.gain-badge-estimated {
    color: #075985;
}

.gain-badge-mymillion,
.expected-source-mymillion td {
    background: #f0edff !important;
}

.gain-badge-mymillion {
    color: #4c1d95;
}

.expectation-legend {
    color: #425078;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1.1rem;
    list-style: none;
    margin: 0.9rem 0 0;
    padding: 0;
}

.expectation-legend li {
    align-items: center;
    display: flex;
    font-size: 0.86rem;
    gap: 0.35rem;
}

.legend-dot {
    border-radius: 999px;
    display: inline-block;
    height: 0.7rem;
    width: 0.7rem;
}

.legend-dot-jackpot {
    background: #fff0a8;
    border: 1px solid #c28a00;
}

.legend-dot-estimated {
    background: #dff1ff;
    border: 1px solid #0ea5e9;
}

.legend-dot-mymillion {
    background: #e8ddff;
    border: 1px solid #8b5cf6;
}

.total-row td {
    background: #e9edff !important;
    color: var(--deep-blue);
    font-weight: 900;
}

@media (max-width: 860px) {
    .jackpot-card,
    .controls-card,
    .settings-form {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }
}
@media (max-width: 620px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}
