/* ============================================================
   TAO FORTUNE CASINO — BRAND STYLESHEET
   Palette derived from the Red-Panda mascot logo.
   ============================================================ */
:root {
    --bg: #1e1140;
    --bg-deep: #100721;
    --bg-panel: #14092b;
    --card: #241548;
    --card-2: #2d1a5c;
    --border: #3a2470;
    --border-lite: #4a2f8c;
    --white: #ffffff;
    --gray: #b0a5d0;
    --lt-gray: #d8d0f0;
    --lime: #d4ec1e;
    --lime-soft: #eaf58b;
    --purple: #9b3fdd;
    --purple-lite: #b975f0;
    --orange: #ea5624;
    --pink: #e94ba0;
    --success: #6ee06e;
    --tao-grad: linear-gradient(135deg, #d4ec1e 0%, #9b3fdd 100%);
    --tao-grad-h: linear-gradient(90deg, #d4ec1e, #9b3fdd);
    --tao-glow: 0 0 24px rgba(212, 236, 30, .35);
    --purple-glow: 0 0 24px rgba(155, 63, 221, .35);
    --font-h: 'Outfit', system-ui, sans-serif;
    --font-t: 'Inter', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: radial-gradient(ellipse at top, #1a0e3a 0%, var(--bg-deep) 60%);
    color: var(--lt-gray);
    font-family: var(--font-t);
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5 { font-family: var(--font-h); color: var(--white); letter-spacing: -.01em; }
h1 { font-weight: 800; line-height: 1.05; }
h2 { font-weight: 700; line-height: 1.15; }
h3 { font-weight: 600; }

a { text-decoration: none; color: var(--lime); transition: color .25s; }
a:hover { color: var(--purple-lite); }

p { line-height: 1.75; color: var(--lt-gray); }

.text-anchor {
    border-bottom: 1px dotted var(--lime);
    color: var(--lime);
    padding-bottom: 1px;
}
.text-anchor:hover { color: var(--orange); border-bottom-color: var(--orange); }

.skip-link {
    position: absolute; top: -100px; left: 0; z-index: 10000; padding: 10px;
    background: var(--lime); color: var(--bg-deep);
}
.skip-link:focus { top: 0; }

/* === HEADER === */
.tao-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(16, 7, 33, .88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 3px solid transparent;
    border-image: var(--tao-grad-h) 1;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px;
    height: 108px;
}

.tao-logo {
    display: flex; align-items: center;
    text-decoration: none;
}
.tao-logo img {
    height: 96px; width: auto; max-width: 220px; object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(212, 236, 30, .35));
}
.tao-logo-text { display: none !important; }

.tao-nav {
    display: flex; gap: 22px; align-items: center;
}
.tao-nav a {
    color: var(--gray); font-size: .88rem; font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: color .25s, border-color .25s;
}
.tao-nav a:hover, .tao-nav a.active {
    color: var(--white);
    border-bottom-color: var(--lime);
}

.tao-cta {
    background: var(--tao-grad);
    color: var(--bg-deep) !important;
    padding: 11px 24px !important;
    border-radius: 999px;
    font-weight: 800 !important;
    font-size: .88rem;
    border-bottom: 0 !important;
    box-shadow: var(--tao-glow);
    letter-spacing: .02em;
}
.tao-cta:hover { transform: translateY(-1px); filter: brightness(1.08); }

.tao-auth { display: flex; gap: 8px; }
.tao-auth a { font-size: .82rem; padding: 9px 16px; border-radius: 8px; font-weight: 600; }
.tao-auth .tao-login {
    border: 1px solid var(--border);
    color: var(--white);
}
.tao-auth .tao-login:hover { border-color: var(--lime); color: var(--lime); }
.tao-auth .tao-join {
    background: var(--purple);
    color: var(--white);
    border: 1px solid var(--purple-lite);
}
.tao-auth .tao-join:hover { background: var(--purple-lite); }

/* Mobile Play Now (visible only on mobile) */
.tao-cta-mobile { display: none; }

/* === MAIN === */
.tao-main {
    max-width: 1240px; margin: 0 auto; padding: 42px 30px 60px;
}

/* === HERO === */
.tao-hero {
    position: relative;
    border-radius: 22px; overflow: hidden;
    height: 440px; margin-bottom: 40px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(155, 63, 221, .15);
}
.tao-hero img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center;
}
.tao-hero-ov {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 90px 42px 34px;
    background: linear-gradient(to top, rgba(16, 7, 33, 1) 10%, transparent 100%);
}
.tao-hero-ov h1 { font-size: 3rem; margin-bottom: 10px; }
.tao-hero-ov p { font-size: 1.15rem; color: var(--lime); font-weight: 600; margin-bottom: 20px; }
.tao-hero-ov .tao-cta { display: inline-block; }

/* === SECTIONS & GRIDS === */
.tao-section-title {
    font-size: 1.9rem; color: var(--white);
    margin: 40px 0 14px; padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    position: relative;
}
.tao-section-title::after {
    content: ''; position: absolute; left: 0; bottom: -2px;
    width: 90px; height: 2px; background: var(--tao-grad-h);
}

.tao-lead {
    font-size: 1.06rem; color: var(--lt-gray); line-height: 1.85;
    margin-bottom: 24px;
}

.tao-masonry {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
    margin-bottom: 40px;
}
.tao-masonry .span-2 { grid-column: span 2; }

.tao-block {
    background: linear-gradient(145deg, var(--card) 0%, var(--card-2) 100%);
    border: 1px solid var(--border);
    border-radius: 16px; padding: 26px;
    transition: transform .3s, box-shadow .3s;
}
.tao-block:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(155, 63, 221, .18);
    border-color: var(--border-lite);
}
.tao-block h3 {
    font-size: 1.05rem; margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--lime);
    display: inline-block;
    color: var(--white);
}
.tao-block p { font-size: .95rem; }
.tao-block .chart-box { position: relative; width: 100%; height: 280px; }

/* Two-column feature row */
.tao-two {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
    margin: 30px 0;
}
@media (max-width: 800px) { .tao-two { grid-template-columns: 1fr; } }

/* Feature cards row */
.tao-features {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
    margin: 30px 0;
}
.tao-feature {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    text-align: center;
}
.tao-feature .ico {
    width: 52px; height: 52px; margin: 0 auto 14px;
    display: grid; place-items: center;
    background: var(--tao-grad);
    border-radius: 14px;
    font-size: 1.6rem;
    box-shadow: var(--tao-glow);
    color: var(--bg-deep);
}
.tao-feature h4 { font-size: 1.02rem; margin-bottom: 6px; color: var(--white); }
.tao-feature p { font-size: .85rem; color: var(--gray); }

@media (max-width: 900px) { .tao-features { grid-template-columns: repeat(2, 1fr); } }

/* Inline image */
.tao-inline-img {
    display: block; width: 100%; max-width: 720px;
    margin: 26px auto; border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

/* === TABLE === */
.tao-table-wrap { width: 100%; overflow-x: auto; margin: 22px 0; }
.tao-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
    min-width: 500px;
}
.tao-table caption {
    padding: 14px 16px; font-family: var(--font-h);
    font-weight: 700; font-size: 1rem; text-align: left;
    color: var(--lime); background: var(--card-2);
    border-bottom: 2px solid var(--purple);
    caption-side: top;
}
.tao-table th {
    background: var(--bg-panel); color: var(--lime);
    padding: 13px 16px; text-align: left;
    font-family: var(--font-h); font-weight: 700; font-size: .87rem;
    border-bottom: 2px solid var(--purple);
    text-transform: uppercase; letter-spacing: .04em;
}
.tao-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: .92rem;
    color: var(--lt-gray);
}
.tao-table tr:last-child td { border-bottom: 0; }
.tao-table tr:hover td { background: rgba(212, 236, 30, .05); }
.tao-table .ok { color: var(--success); font-weight: 700; }
.tao-table .warn { color: var(--orange); font-weight: 700; }
.tao-table .bad { color: var(--pink); font-weight: 700; }

/* === SVG DIAGRAM WRAPPER === */
.tao-diagram {
    background: linear-gradient(145deg, var(--card) 0%, var(--card-2) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin: 30px 0;
}
.tao-diagram h3 {
    font-size: 1.05rem; margin-bottom: 14px;
    padding-bottom: 8px; border-bottom: 2px solid var(--lime);
    display: inline-block;
    color: var(--white);
}
.tao-diagram svg { display: block; width: 100%; height: auto; }
.tao-diagram .legend {
    display: flex; flex-wrap: wrap; gap: 14px 24px;
    margin-top: 14px; font-size: .82rem;
}
.tao-diagram .legend span { display: flex; align-items: center; gap: 6px; color: var(--gray); }
.tao-diagram .legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* === SEO / CONTENT BLOCKS === */
.tao-seo {
    background: linear-gradient(145deg, var(--card) 0%, var(--card-2) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    margin-top: 34px;
}
.tao-seo h2 {
    font-size: 1.7rem; margin: 24px 0 14px;
    color: var(--lime);
}
.tao-seo h2:first-child { margin-top: 0; }
.tao-seo h3 { font-size: 1.2rem; margin: 20px 0 10px; color: var(--white); }
.tao-seo p { margin-bottom: 16px; line-height: 1.85; font-size: 1rem; }
.tao-seo ul, .tao-seo ol { margin: 10px 0 16px 22px; }
.tao-seo li { margin-bottom: 8px; line-height: 1.7; color: var(--lt-gray); }

/* Callout box */
.tao-callout {
    background: linear-gradient(135deg, rgba(212, 236, 30, .1) 0%, rgba(155, 63, 221, .1) 100%);
    border-left: 4px solid var(--lime);
    padding: 18px 22px;
    border-radius: 10px;
    margin: 20px 0;
    color: var(--lt-gray);
}
.tao-callout strong { color: var(--lime); }

/* FAQ */
.tao-faq details {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
}
.tao-faq summary {
    cursor: pointer; font-weight: 700;
    color: var(--white); font-family: var(--font-h);
    font-size: 1rem;
    list-style: none;
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px;
}
.tao-faq summary::-webkit-details-marker { display: none; }
.tao-faq summary::after {
    content: '+'; color: var(--lime); font-size: 1.5rem; font-weight: 400;
    transition: transform .3s;
}
.tao-faq details[open] summary::after { content: '−'; }
.tao-faq details[open] { border-color: var(--purple); }
.tao-faq details p { margin-top: 12px; color: var(--gray); font-size: .95rem; line-height: 1.7; }

/* Form */
.tao-form {
    display: flex; flex-direction: column; gap: 15px; max-width: 480px; margin-top: 20px;
}
.tao-form input, .tao-form select {
    padding: 16px; border: 1px solid var(--border);
    border-radius: 10px; background: var(--bg-deep);
    color: var(--white); font-size: 1rem;
    font-family: var(--font-t);
}
.tao-form input:focus, .tao-form select:focus {
    outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px rgba(212, 236, 30, .15);
}
.tao-form .tao-submit {
    display: block; text-align: center; padding: 16px;
    background: var(--tao-grad); color: var(--bg-deep) !important;
    font-weight: 800; border-radius: 10px;
    font-family: var(--font-h); border: 0; cursor: pointer;
    box-shadow: var(--tao-glow);
    font-size: 1rem;
}

/* Breadcrumb */
.tao-crumb {
    font-size: .82rem; color: var(--gray); margin-bottom: 20px;
}
.tao-crumb a { color: var(--gray); }
.tao-crumb a:hover { color: var(--lime); }
.tao-crumb span { color: var(--white); }

/* === FOOTER === */
.tao-footer {
    background: var(--bg-panel);
    border-top: 3px solid transparent;
    border-image: var(--tao-grad-h) 1;
    padding: 55px 40px 25px;
    margin-top: 60px;
}
.tao-footer-grid {
    max-width: 1240px; margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px; margin-bottom: 34px;
}
.tao-footer-brand .tao-logo { margin-bottom: 14px; }
.tao-footer-brand p {
    font-size: .87rem; color: var(--gray); line-height: 1.7;
    margin-bottom: 12px;
}
.tao-footer-brand .foot-badges {
    display: flex; gap: 10px; margin-top: 10px;
}
.tao-footer-brand .foot-badges span {
    background: var(--card); color: var(--lime);
    border: 1px solid var(--border);
    padding: 6px 10px; border-radius: 6px;
    font-size: .72rem; font-weight: 700; letter-spacing: .05em;
}
.tao-footer-col h4 {
    font-size: .95rem; color: var(--lime); margin-bottom: 14px;
    font-family: var(--font-h);
}
.tao-footer-col a {
    display: block; color: var(--gray);
    font-size: .87rem; padding: 5px 0;
}
.tao-footer-col a:hover { color: var(--white); }
.tao-footer-bottom {
    max-width: 1240px; margin: 0 auto;
    text-align: center; padding-top: 20px;
    border-top: 1px solid var(--border);
}
.tao-footer-bottom p {
    font-size: .78rem; color: var(--gray); margin-bottom: 6px;
}
.tao-footer-bottom .responsible { color: var(--lime); font-weight: 600; }

/* === MOBILE === */
.tao-burger { display: none; }

.tao-mobile-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 300px; background: var(--bg-deep);
    border-left: 3px solid transparent;
    border-image: var(--tao-grad) 1;
    padding: 25px 20px 20px;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform .3s ease;
    display: flex; flex-direction: column; gap: 8px;
    overflow-y: auto;
    box-shadow: -20px 0 60px rgba(0, 0, 0, .5);
}
.tao-mobile-drawer.active { transform: translateX(0); }
.tao-mobile-drawer a {
    display: block; padding: 13px 18px;
    color: var(--lt-gray); border-radius: 8px;
    font-family: var(--font-h); font-size: .96rem;
    border-bottom: 0;
}
.tao-mobile-drawer a:hover { background: var(--card); color: var(--lime); }
.tao-mobile-drawer .m-cta {
    background: var(--tao-grad);
    color: var(--bg-deep);
    font-weight: 800;
    text-align: center; margin-top: 8px;
    box-shadow: var(--tao-glow);
}
.tao-close {
    align-self: flex-end; cursor: pointer;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 8px; width: 42px; height: 42px;
    display: grid; place-items: center;
    color: var(--white); font-size: 1.6rem;
    margin-bottom: 12px;
}
.tao-drawer-auth {
    display: flex; gap: 10px; margin-top: auto;
    padding-top: 18px; border-top: 1px solid var(--border);
}
.tao-drawer-auth a {
    flex: 1; text-align: center; padding: 12px;
    border-radius: 8px; font-size: .88rem;
}
.tao-drawer-auth .dl {
    border: 1px solid var(--lime); color: var(--lime);
}
.tao-drawer-auth .dj {
    background: var(--purple); color: var(--white); font-weight: 700;
}

/* Backdrop */
.tao-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 1500; opacity: 0; pointer-events: none;
    transition: opacity .3s;
}
.tao-backdrop.active { opacity: 1; pointer-events: auto; }

@media (max-width: 1080px) {
    .tao-header { padding: 0 20px; }
    .tao-nav, .tao-auth { display: none; }
    .tao-burger {
        display: flex; align-items: center; justify-content: center;
        width: 46px; height: 46px;
        background: var(--tao-grad); border: none;
        border-radius: 12px; cursor: pointer;
        box-shadow: var(--tao-glow);
    }
    .tao-burger svg { width: 24px; height: 24px; fill: var(--bg-deep); }
    .tao-cta-mobile {
        display: inline-block;
        background: var(--tao-grad); color: var(--bg-deep) !important;
        padding: 9px 18px; border-radius: 999px;
        font-family: var(--font-h); font-weight: 800; font-size: .82rem;
        text-decoration: none;
        margin-left: auto;
        box-shadow: var(--tao-glow);
    }
    .tao-logo img { height: 76px; width: auto; max-width: 170px; }
    .tao-masonry { grid-template-columns: 1fr; }
    .tao-masonry .span-2 { grid-column: span 1; }
    .tao-features { grid-template-columns: repeat(2, 1fr); }
    .tao-footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
}

@media (max-width: 640px) {
    .tao-main { padding: 24px 12px 40px; }
    .tao-hero { height: 240px; border-radius: 14px; }
    .tao-hero-ov { padding: 40px 18px 18px; }
    .tao-hero-ov h1 { font-size: 1.55rem; }
    .tao-hero-ov p { font-size: .92rem; margin-bottom: 12px; }
    .tao-hero-ov .tao-cta { padding: 9px 18px !important; font-size: .8rem; }
    .tao-section-title { font-size: 1.35rem; }
    .tao-seo { padding: 22px 16px; }
    .tao-seo h2 { font-size: 1.3rem; }
    .tao-seo p { font-size: .95rem; }
    .tao-features { grid-template-columns: 1fr; gap: 12px; }
    .tao-footer { padding: 40px 18px 20px; }
    .tao-footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .tao-logo img { height: 60px; width: auto; max-width: 130px; }
    .tao-header { height: 78px; padding: 0 12px; gap: 8px; }
    .tao-cta-mobile { padding: 8px 14px; font-size: .74rem; }
    .tao-burger { width: 42px; height: 42px; }
    .tao-masonry { gap: 14px; }
    .tao-block { padding: 18px 16px; border-radius: 14px; }
    .tao-block h3 { font-size: .98rem; }
    .tao-block .chart-box { height: 240px; }
    .tao-diagram { padding: 18px 14px; margin: 22px 0; border-radius: 14px; }
    .tao-diagram h3 { font-size: .98rem; }
    .tao-diagram .legend { font-size: .74rem; gap: 8px 14px; }
    .tao-crumb { font-size: .78rem; margin-bottom: 14px; }
}

/* === Universal overflow safety === */
html, body { max-width: 100%; overflow-x: hidden; }
.tao-main, .tao-seo, .tao-block, .tao-diagram, .tao-feature { min-width: 0; }
.tao-diagram svg, .tao-block canvas { max-width: 100%; }
.tao-seo p, .tao-seo li, .tao-block p { word-wrap: break-word; overflow-wrap: break-word; }
.tao-seo a, .tao-block a { word-break: break-word; }

/* Print */
@media print {
    .tao-header, .tao-footer, .tao-mobile-drawer, .tao-burger, .tao-cta-mobile { display: none; }
}
