@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800&display=swap');

:root {
    --color-primary: #FF7A00;
    --color-hero-bg: #8B5CF6;
    --color-hero-sec: #EC4899;
    --color-page-bg: #FFF8E7;
    --color-alt-bg: #FFFFFF;
    --color-text: #242424;
    --color-muted: #666666;
    --color-rules: #FFC83D;
    --color-accent-1: #FF5C5C;
    --color-accent-2: #65C466;
    --font-sans: 'Nunito', sans-serif;
    --font-serif: 'Nunito', sans-serif;
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-page-bg);
    line-height: 1.7;
    font-size: 17px;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); border: 0;
}
.skip-link {
    position: absolute; top: -40px; left: 0; background: var(--color-primary);
    color: #FFF; padding: 8px; z-index: 999;
}
.skip-link:focus { top: 0; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 800; margin-bottom: 1rem; color: var(--color-text); }
h1 { font-size: 38px; }
h2 { font-size: 28px; }
h3 { font-size: 20px; }
@media (max-width: 768px) {
    h1 { font-size: 29px; }
    h2 { font-size: 24px; }
}

.container { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.article-container { max-width: 780px; margin: 0; } 
@media(min-width: 1040px) {
    .article-container { margin: 0 auto; margin-left: 0; }
    .content-section > .container { display: flex; flex-direction: column; align-items: flex-start; }
}

/* Header */
.site-header {
    background: var(--color-primary);
    position: sticky; top: 0; z-index: 100; height: 56px;
    display: flex; align-items: center;
}
.header-container {
    max-width: 1040px; width: 100%; margin: 0 auto; padding: 0 16px;
    display: flex; justify-content: space-between; align-items: center;
}
.site-logo { color: #FFF; font-size: 19px; font-weight: 800; }
.main-nav ul { list-style: none; display: flex; gap: 18px; }
.main-nav a { color: #FFF; font-size: 14px; font-weight: bold; padding: 5px 0; border-bottom: 2px solid transparent; transition: border-bottom-color 0.2s; }
.main-nav a.active, .main-nav a:hover { border-bottom-color: #FFF; text-decoration: none; }
.menu-toggle { display: none; background: transparent; border: none; cursor: pointer; padding: 5px; }
.hamburger { display: block; width: 24px; height: 2px; background: #FFF; position: relative; }
.hamburger::before, .hamburger::after {
    content: ''; position: absolute; width: 24px; height: 2px; background: #FFF; left: 0;
}
.hamburger::before { top: -6px; } .hamburger::after { top: 6px; }

.search-trigger {
    background: transparent; border: 1px solid #FFF; color: #FFF;
    font-size: 13px; font-weight: bold; padding: 4px 8px; cursor: pointer;
    border-radius: 4px; margin-left: 18px;
    transition: background 0.2s;
}
.search-trigger:hover { background: rgba(255,255,255,0.1); }
@media (max-width: 1180px) {
    .main-nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--color-primary); padding: 16px; flex-direction: column; }
    .main-nav.open { display: flex; }
    .main-nav ul { flex-direction: column; gap: 12px; }
    .menu-toggle { display: block; }
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}
.floating-animation { animation: float 4s ease-in-out infinite; }
.float-1 { animation: float 3s ease-in-out infinite; }
.float-2 { animation: float 5s ease-in-out infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.spin { animation: spin 8s linear infinite; }
.spin-slow { animation: spin 12s linear infinite; }

/* Interactive Transitions */
.btn-primary, .btn-secondary, .btn-anchor, .toc-list a, .result-card, .news-card, .glossary-item, .clarification-box, .support-card, .draft-form-box {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Hero */
.hero {
    background: var(--color-hero-bg); color: #FFF;
    min-height: 440px; display: flex; flex-wrap: wrap; position: relative; overflow: hidden;
}
.hero-content {
    flex: 1 1 58%; padding: 48px 16px; max-width: 780px; margin-left: max(16px, calc((100vw - 1040px)/2)); z-index: 2;
}
.hero h1 { color: #FFF; margin-top: 8px; }
.eyebrow { color: var(--color-rules); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
.hero-independence { font-size: 13px; color: var(--color-rules); margin-top: 24px; }
.hero-actions { margin-top: 32px; display: flex; gap: 16px; flex-wrap: wrap; }
.btn-anchor { display: inline-block; background: transparent; border: 2px solid #FFF; color: #FFF; padding: 10px 20px; font-weight: bold; font-size: 15px; border-radius: 4px; }
.btn-anchor:hover { background: rgba(255,255,255,0.1); text-decoration: none; transform: translateY(-2px); }
.hero-graphics { flex: 1 1 42%; position: relative; min-height: 200px; display: flex; align-items: center; justify-content: center; opacity: 0.95; }
.hero-graphics svg { width: 100%; max-width: 400px; }
@media (max-width: 768px) {
    .hero { flex-direction: column; min-height: auto; }
    .hero-content { padding: 32px 16px; margin-left: 0; }
    .hero-graphics { border-top: 4px solid var(--color-hero-sec); }
}

/* Sections */
.content-section { padding: 48px 0; }
.content-section.alternate-bg { background: var(--color-alt-bg); }
.page-header { padding: 48px 0 24px; }
@media (max-width: 768px) { .content-section, .page-header { padding: 30px 0; } }

.section-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-hero-bg);
    margin-bottom: 32px;
    text-align: center;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--color-primary);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* Results Grid & Lottery Balls */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}
.result-card {
    background: #FFF;
    border-radius: 16px;
    padding: 24px;
    border: 3px solid var(--color-rules);
    text-align: center;
}
.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px dashed var(--color-rules);
    padding-bottom: 12px;
}
.result-header h3 { margin: 0; font-size: 24px; color: var(--color-text); font-weight: 800; }
.draw-date { font-size: 14px; color: var(--color-muted); font-weight: bold; background: var(--color-page-bg); padding: 4px 12px; border-radius: 12px; }

.lottery-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
.ball {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ball-color);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    box-shadow: inset -4px -4px 8px rgba(0,0,0,0.2), 0 4px 8px rgba(0,0,0,0.1);
}
.ball.star { border-radius: 12px; }

/* News Cards */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.news-card {
    background: #FFF;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid var(--color-rules);
    display: flex;
    flex-direction: column;
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}
.news-image {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fun-graphic { width: 80px; height: 80px; }
.news-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.news-category {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.news-content h3 { font-size: 20px; font-weight: bold; margin-bottom: 12px; line-height: 1.3; }
.news-content p { font-size: 15px; color: var(--color-muted); margin-bottom: 24px; flex: 1; }
.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-rules);
    padding-top: 16px;
}
.news-date { font-size: 13px; color: var(--color-muted); font-weight: bold; }
.read-more { font-weight: bold; color: var(--color-hero-bg); display: inline-flex; align-items: center; gap: 4px; }
.read-more::after { content: '→'; transition: transform 0.2s; }
.read-more:hover { text-decoration: none; }
.read-more:hover::after { transform: translateX(4px); }

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, var(--color-hero-sec), var(--color-hero-bg));
    color: #FFF;
    text-align: center;
    padding: 64px 20px;
    border-radius: 24px;
    margin: 48px 16px;
    max-width: 1040px;
}
@media(min-width: 1080px) { .newsletter-section { margin: 48px auto; } }
.newsletter-section h2 { color: #FFF; font-size: 32px; margin-bottom: 16px; }
.newsletter-section p { font-size: 18px; opacity: 0.9; }
.newsletter-form { display: flex; gap: 8px; max-width: 500px; margin: 24px auto 0; flex-wrap: wrap; }
.newsletter-form input { flex: 1; min-width: 200px; padding: 14px 20px; border: none; border-radius: 8px; font-size: 16px; font-family: inherit; }
.newsletter-form button { background: var(--color-rules); color: var(--color-text); padding: 14px 24px; border: none; border-radius: 8px; font-weight: bold; font-size: 16px; cursor: pointer; transition: transform 0.2s; }
.newsletter-form button:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,0.2); }

/* TOC */
.toc-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toc-list a { display: block; padding: 12px 16px; background: var(--color-page-bg); border: 2px solid var(--color-rules); border-radius: 8px; color: var(--color-text); text-decoration: none; font-weight: bold; }
.toc-list a:hover { border-color: var(--color-primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
@media (max-width: 768px) { .toc-list { grid-template-columns: 1fr; } }

/* Components */
.timeline { border-left: 3px solid var(--color-rules); padding-left: 16px; margin-bottom: 24px; }
.timeline-row { margin-bottom: 16px; position: relative; }
.timeline-row::before { content: ''; position: absolute; left: -24px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--color-primary); }
.timeline-date { font-weight: 800; font-size: 15px; color: var(--color-muted); }

.semantic-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; background: #FFF; border-radius: 8px; overflow: hidden; }
.semantic-table caption { text-align: left; font-weight: bold; margin-bottom: 12px; font-size: 18px; }
.semantic-table th, .semantic-table td { padding: 16px; border: 1px solid var(--color-rules); text-align: left; vertical-align: top; }
.semantic-table th { background: var(--color-page-bg); width: 30%; font-weight: 800; }
.semantic-table:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.05); }

.clarification-box { background: var(--color-page-bg); border-left: 6px solid var(--color-accent-1); padding: 16px 20px; margin-bottom: 24px; border-radius: 0 8px 8px 0; }
.clarification-box:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.05); }
.source-marker { font-size: 14px; font-weight: bold; color: var(--color-muted); margin-top: 16px; }

.definition-list dt { font-weight: 800; margin-top: 12px; color: var(--color-primary); }
.definition-list dd { margin-bottom: 12px; margin-left: 0; padding-left: 16px; border-left: 3px solid var(--color-rules); }

.support-card { border: 2px solid var(--color-rules); padding: 32px; border-radius: 12px; margin: 24px 0; text-align: center; background: #FFF; }
.support-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.05); }

.btn-primary { display: inline-block; width: 100%; min-height: 48px; background: var(--color-primary); color: #FFF; font-weight: 800; font-size: 16px; border: none; border-radius: 8px; padding: 12px; cursor: pointer; text-align: center; }
.btn-primary:hover { opacity: 0.95; text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 16px rgba(255, 122, 0, 0.3); }
.btn-secondary { display: inline-block; width: 100%; min-height: 48px; background: var(--color-page-bg); color: var(--color-text); border: 2px solid var(--color-text); font-weight: 800; font-size: 16px; border-radius: 8px; padding: 12px; cursor: pointer; text-align: center; margin-top: 12px; }
.btn-secondary:hover { background: var(--color-text); color: var(--color-page-bg); transform: translateY(-2px); }

/* Glossary */
.glossary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.glossary-item { padding: 16px; border: 2px solid var(--color-rules); border-radius: 8px; background: #FFF; }
.glossary-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); border-color: var(--color-primary); }
.glossary-item .term { display: block; font-weight: 800; margin-bottom: 4px; color: var(--color-hero-bg); font-size: 18px; }
@media (max-width: 768px) { .glossary-grid { grid-template-columns: 1fr; } }

/* FAQ */
.faq details { background: #FFF; border: 2px solid var(--color-rules); border-radius: 8px; margin-bottom: 12px; transition: box-shadow 0.2s; }
.faq details:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.05); border-color: var(--color-primary); }
.faq summary { padding: 16px; font-weight: 800; cursor: pointer; list-style: none; position: relative; font-size: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 16px; top: 16px; font-weight: bold; color: var(--color-primary); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: '-'; }
.details-content { padding: 0 16px 16px; border-top: 1px dashed var(--color-rules); margin-top: 12px; padding-top: 16px; }

/* Form / Contact */
.correction-form { background: #FFF; padding: 32px; border: 2px solid var(--color-rules); border-radius: 12px; margin-bottom: 24px; }
.draft-form-box:hover .correction-form { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.05); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 800; margin-bottom: 8px; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 2px solid var(--color-rules); border-radius: 8px; font-family: inherit; font-size: 15px; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--color-primary); }
.draft-notice { font-size: 13px; color: var(--color-muted); margin-bottom: 16px; font-weight: bold; }
.error-msg { color: #d32f2f; font-size: 14px; margin-bottom: 12px; font-weight: bold; }
.draft-output-area { background: var(--color-page-bg); padding: 24px; border: 2px solid var(--color-rules); border-radius: 12px; }
.draft-output-area pre { background: #FFF; padding: 16px; border: 1px solid var(--color-rules); border-radius: 8px; white-space: pre-wrap; font-family: monospace; margin-bottom: 16px; }
.draft-actions { display: flex; gap: 12px; }
#draft-status { margin-top: 12px; font-size: 14px; font-weight: bold; color: var(--color-primary); }

/* Dialogs */
#age-dialog, #search-modal {
    max-width: 500px; width: calc(100vw - 32px); margin: auto;
    background: #FFFFFF; border: none; border-top: 8px solid var(--color-primary);
    border-radius: 16px; padding: 32px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
#search-modal { max-width: 600px; padding: 24px; }
#age-dialog::backdrop, #search-modal::backdrop { background: rgba(36,36,36,.5); }
.age-badge { display: inline-block; background: var(--color-primary); color: #FFF; font-weight: 800; font-size: 24px; padding: 4px 16px; border-radius: 20px; margin-bottom: 16px; }
.age-title { font-size: 28px; font-weight: 800; margin-bottom: 16px; color: var(--color-hero-bg); }
.age-text { font-size: 16px; margin-bottom: 24px; }
.age-actions { margin-bottom: 24px; display: flex; flex-direction: column; gap: 12px; }
.age-actions button { margin: 0; }
.age-note { font-size: 14px; color: var(--color-muted); margin-bottom: 12px; font-weight: bold; }
.age-independence { font-size: 14px; font-weight: 800; margin-bottom: 24px; }
.age-links a { margin-right: 16px; font-size: 14px; text-decoration: underline; font-weight: bold; }

.search-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.search-header h2 { margin: 0; }
.btn-close { background: transparent; border: none; font-size: 14px; font-weight: bold; cursor: pointer; text-decoration: underline; color: var(--color-muted); }
.search-form { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.search-form input { flex: 1; min-width: 200px; padding: 12px; border: 2px solid var(--color-rules); border-radius: 8px; font-family: inherit; }
.search-form button { width: auto; min-height: 0; padding: 12px 16px; margin: 0; }
.search-result-item { border-bottom: 1px solid var(--color-rules); padding: 16px 0; }
.search-result-item a { font-weight: 800; font-size: 18px; }
.search-result-item p { font-size: 15px; color: var(--color-muted); margin-top: 8px; }

/* Cookie Banner */
#cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 600px;
    margin: 0 auto;
    background: #FFF;
    border: 3px solid var(--color-primary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 9999;
    animation: slideUp 0.5s ease-out;
}
.cookie-content h3 { font-size: 20px; margin-bottom: 12px; color: var(--color-hero-bg); }
.cookie-content p { font-size: 15px; margin-bottom: 20px; color: var(--color-text); }
.cookie-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cookie-actions button { flex: 1; min-width: 120px; margin: 0; }
@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Footer */
.site-footer { background: var(--color-hero-bg); color: #FFF; padding: 48px 0; font-size: 15px; }
.footer-brand { font-size: 22px; font-weight: 800; margin-bottom: 16px; }
.footer-text { margin-bottom: 8px; color: var(--color-page-bg); opacity: 0.9; }
.footer-nav { margin: 24px 0 32px; display: flex; flex-wrap: wrap; gap: 16px; }
.footer-nav a { color: #FFF; text-decoration: underline; font-weight: bold; }
.footer-meta { border-top: 1px solid rgba(255,255,255,0.2); padding-top: 24px; display: flex; justify-content: space-between; color: var(--color-page-bg); font-weight: bold; }
.btn-text { background: transparent; border: none; color: var(--color-rules); text-decoration: underline; cursor: pointer; font-size: 15px; font-weight: bold; }
.btn-text:hover { color: #FFF; }

.exit-main { min-height: 60vh; display: flex; align-items: center; }
.exit-container { text-align: center; }
.exit-links { display: flex; flex-direction: column; gap: 12px; max-width: 300px; margin: 24px auto; }