:root {
    --primary: #012169;
    --primary-dark: #001040;
    --secondary: #C8102E;
    --secondary-dark: #9b0c23;
    --accent: #FFD700;
    --white: #FFFFFF;
    --light-bg: #EDF1F7;
    --dark-bg: #0A1628;
    --card-bg: #FFFFFF;
    --text-dark: #1a1a2e;
    --text-light: #6c7a8d;
    --border: #d0d8e4;
    --gradient-blue: linear-gradient(135deg, #012169, #1a3a7a);
    --gradient-red: linear-gradient(135deg, #C8102E, #e63946);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    background: var(--light-bg);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.has-bg {
    background-size: cover !important;
    background-attachment: fixed !important;
    background-position: center center !important;
}

main#root {
    flex: 1;
}

a { color: var(--white); text-decoration: none; }
a:hover { text-decoration: none; }

#wrap {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 12px;
}

.hd {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    overflow: hidden;
}

.hd-nav {
    background: linear-gradient(180deg, #1a1a2e, #0f0f1f);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hd-nav a {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.8px;
    padding: 12px 18px;
    transition: all 0.25s;
    position: relative;
    text-transform: uppercase;
}

.hd-nav a i { margin-right: 5px; font-size: 10px; }

.hd-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.25s;
}

.hd-nav a:hover {
    color: var(--white);
    background: rgba(255,255,255,0.04);
}

.hd-nav a:hover::after,
.hd-nav a.on::after {
    width: 70%;
}

.hd-nav a.on {
    color: var(--accent);
}

.hd-main {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-dark) 100%);
    padding: 16px 20px;
    border-bottom: 3px solid var(--secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hd-clock {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hd-date {
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.8px;
}

.hd-time {
    color: var(--white);
    font-size: 40px;
    font-weight: 800;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 3px;
    line-height: 1;
    background: linear-gradient(180deg, #fff, #c0c8e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hd-logo img {
    max-height: 72px;
    max-width: 220px;
    display: block;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,0.5));
}

.hd-days {
    display: flex;
    background: var(--secondary);
}

.hd-days a {
    flex: 1;
    text-align: center;
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 10px 0;
    transition: all 0.2s;
    border-right: 1px solid rgba(255,255,255,0.12);
}

.hd-days a:last-child { border-right: none; }

.hd-days a:hover {
    background: rgba(0,0,0,0.2);
    color: var(--accent);
}

#xbody {
    padding: 16px 0;
}

.banner-img {
    width: 100%;
    border: 3px solid var(--primary);
    border-radius: 6px;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.welcome-bar {
    background: var(--gradient-blue);
    color: var(--white);
    padding: 14px 20px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 1.5px;
    border-radius: 6px;
    margin: 16px 0;
    text-align: center;
    box-shadow: 0 2px 8px rgba(1,33,105,0.3);
    border-left: 4px solid var(--secondary);
    border-right: 4px solid var(--secondary);
    position: relative;
    overflow: hidden;
}

.welcome-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary), var(--accent), var(--secondary));
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 0;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 16px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.no-results i {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
    color: #ccc;
}

.result-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.rc-header {
    background: var(--gradient-blue);
    color: var(--white);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.rc-date {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.rc-day {
    font-size: 10px;
    opacity: 0.8;
    font-weight: 400;
}

.rc-draw {
    font-size: 11px;
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.rc-prize-label {
    background: var(--gradient-red);
    color: var(--white);
    text-align: center;
    font-weight: 700;
    font-size: 11px;
    padding: 5px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.rc-prize1 {
    text-align: center;
    padding: 12px 8px;
    background: linear-gradient(180deg, #f8f9ff, #eef1ff);
}

.rc-prize1 .ball-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.ball {
    width: 36px;
    height: 36px;
    background: var(--gradient-red);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(200,16,46,0.3), inset 0 -2px 4px rgba(0,0,0,0.1);
    font-family: 'Courier New', monospace;
}

.rc-prize-sub {
    display: flex;
    border-top: 1px solid var(--border);
}

.rc-prize-sub-item {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    border-right: 1px solid var(--border);
}

.rc-prize-sub-item:last-child { border-right: none; }

.rc-prize-sub-label {
    font-size: 10px;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rc-prize-sub-value {
    display: flex;
    justify-content: center;
    gap: 3px;
}

.ball-sm {
    width: 26px;
    height: 26px;
    background: var(--gradient-blue);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(1,33,105,0.25);
    font-family: 'Courier New', monospace;
}

.rc-extras { border-top: 1px solid var(--border); }
.rc-extras-header { display: flex; }

.rc-extras-header-item {
    flex: 1;
    text-align: center;
    background: var(--primary);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 5px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.rc-extras-header-item:first-child { border-right: 1px solid rgba(255,255,255,0.2); }
.rc-extras-body { display: flex; }
.rc-extras-col { flex: 1; border-right: 1px solid var(--border); }
.rc-extras-col:last-child { border-right: none; }
.rc-extras-grid { display: grid; grid-template-columns: 1fr 1fr; }

.rc-extras-cell {
    text-align: center;
    padding: 4px 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.rc-extras-cell:nth-child(even) { border-right: none; }

.page-card {
    padding: 28px;
    line-height: 1.8;
    font-size: 14px;
    color: var(--text-dark);
}

.page-card h2 { color: var(--primary); margin-bottom: 14px; font-size: 20px; }
.page-card h3 { color: var(--secondary); margin-bottom: 8px; font-size: 16px; }
.page-card p { margin-bottom: 8px; }
.page-card a { color: var(--secondary); text-decoration: underline; }
.page-card img { max-width: 100%; height: auto; border-radius: 6px; }

.footer {
    background: var(--dark-bg);
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    text-align: center;
    padding: 18px 12px;
    position: relative;
}

.footer::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
    position: absolute;
    top: 0; left: 0; right: 0;
}

.footer a { color: var(--accent); }

.img_blur { max-width: 100%; }
.block { display: inline-block; margin: 2px; }


@media (max-width: 900px) {
    .result-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .hd-nav a { padding: 10px 12px; font-size: 10px; letter-spacing: 1.2px; }
    .hd-time { font-size: 32px; }
    .hd-logo img { max-height: 60px; max-width: 180px; }
    .hd-days a { font-size: 11px; padding: 8px 0; letter-spacing: 1.5px; }
}

@media (max-width: 600px) {
    .result-grid { grid-template-columns: 1fr; gap: 10px; }
    #wrap { padding: 0 8px; }

    .hd-nav { flex-wrap: wrap; }
    .hd-nav a {
        padding: 8px 12px;
        font-size: 10px;
        letter-spacing: 1px;
    }
    .hd-nav a::after { display: none; }
    .hd-nav a.on { background: rgba(255,255,255,0.08); }

    .hd-main {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 12px;
    }
    .hd-clock { align-items: center; text-align: center; }
    .hd-time { font-size: 28px; letter-spacing: 2px; }
    .hd-date { font-size: 12px; }
    .hd-logo img { max-height: 50px; }

    .hd-days { flex-wrap: wrap; }
    .hd-days a {
        flex: 0 0 calc(100%/4);
        font-size: 10px;
        padding: 8px 0;
        letter-spacing: 1px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .hd-days a:nth-child(4) { border-right: none; }
    .hd-days a:nth-child(n+5) { border-bottom: none; }

    .welcome-bar { font-size: 13px; padding: 10px 14px; }
    .ball { width: 32px; height: 32px; font-size: 16px; }
    .ball-sm { width: 22px; height: 22px; font-size: 11px; }
    .rc-extras-cell { font-size: 11px; padding: 3px 1px; }
}

@media (max-width: 380px) {
    .hd-nav a { padding: 6px 8px; font-size: 9px; }
    .hd-time { font-size: 24px; }
    .hd-days a { font-size: 9px; padding: 6px 0; }
    .ball { width: 28px; height: 28px; font-size: 14px; }
    .ball-sm { width: 20px; height: 20px; font-size: 10px; }
    .rc-header { padding: 8px 10px; }
}

.err-page {
    max-width: 560px;
    margin: 40px auto;
    text-align: center;
    padding: 48px 32px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.err-icon {
    width: 80px; height: 80px;
    margin: 0 auto 20px;
    background: var(--gradient-blue);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(1,33,105,0.3);
}
.err-icon i { font-size: 32px; color: var(--accent); }
.err-code {
    font-size: 72px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.err-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 4px 0 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.err-line {
    width: 60px; height: 3px;
    background: var(--gradient-red);
    margin: 0 auto 20px;
    border-radius: 3px;
}
.err-msg {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
    max-width: 400px;
    margin: 0 auto 28px;
}
.err-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.err-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px;
    font-size: 13px; font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}
.err-btn:hover { background: var(--primary); color: var(--white); }
.err-btn-primary {
    background: var(--gradient-red);
    border-color: var(--secondary);
    color: var(--white);
}
.err-btn-primary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(200,16,46,0.3);
}
.err-ref {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-light);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.err-ref span { font-weight: 700; color: var(--primary); }

@media (max-width: 600px) {
    .err-page { margin: 20px 12px; padding: 32px 20px; }
    .err-code { font-size: 56px; }
    .err-title { font-size: 16px; letter-spacing: 1px; }
    .err-msg { font-size: 13px; }
    .err-actions { flex-direction: column; }
    .err-btn { justify-content: center; }
}
