/* Prevent horizontal overflow on all devices */
html {
    overflow-x: hidden;
    max-width: 100vw;
}
body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Contain horizontal scroll areas so they don't expand the page */
@media (max-width: 1023px) {
    main {
        min-width: 0;
    }
    .main-content {
        min-width: 0;
    }
    .cat-nav-wrap {
        min-width: 0;
    }
    .cat-nav-wrap > div {
        min-width: 0;
        max-width: 100%;
    }
    /* All horizontal scroll sections inside main content */
    .main-content > div {
        min-width: 0;
        max-width: 100%;
    }
    .main-content .flex.overflow-x-auto {
        min-width: 0;
    }
}

/* Mobile: entire page scrolls (body), not inner main */
@media (max-width: 1023px) {
    html {
        overflow-x: hidden;
    }
    body {
        height: auto !important;
        min-height: 100vh;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        display: block !important;
    }
    .main-layout {
        flex: none !important;
        min-height: 0 !important;
        overflow: visible !important;
        height: auto !important;
    }
    .main-layout main {
        overflow: visible !important;
        min-height: 0 !important;
        height: auto !important;
    }
}

/* Custom Scrollbar for Dark Theme */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #15191f; 
}
::-webkit-scrollbar-thumb {
    background: #333; 
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #e81d2c; 
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hero Banner Background */
.hero-bg {
    background-image: url('mafia-casino-banner.webp');
    background-size: cover;
    background-position: var(--hero-bg-x, 50%) var(--hero-bg-y, 50%);
}

@media (max-width: 1023px) {
    .hero-banner {
        min-height: 300px;
        --hero-bg-x: 70%;
    }
    .hero-content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-bottom: 2.5rem !important;
    }
    .hero-label {
        letter-spacing: 0.12em;
    }
    .hero-title {
        line-height: 1.15 !important;
        word-break: break-word;
        font-size: 1.125rem !important;
    }
    .hero-cta {
        -webkit-tap-highlight-color: transparent;
        min-height: 40px;
        font-size: 0.6875rem !important;
        padding: 0.5rem 1.25rem !important;
    }
}

@media (max-width: 639px) {
    .hero-banner {
        min-height: 280px;
    }
    .hero-title {
        font-size: 1rem !important;
    }
    .hero-cta {
        min-height: 38px;
        font-size: 0.6875rem !important;
        padding: 0.5rem 1.1rem !important;
    }
}

/* Sidebar Desktop */
.sidebar-desktop .sidebar-sep {
    height: 1px;
    background: #2f3640;
    margin: 8px 16px;
}

/* Urus Promozione block */
.sidebar-urus {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}
.sidebar-urus:hover { opacity: 0.9; }
.sidebar-urus .urus-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}
.sidebar-urus .urus-title {
    font-size: 13px;
    font-weight: 700;
    color: #e81d2c;
    text-transform: uppercase;
}
.sidebar-urus .urus-sub {
    font-size: 11px;
    font-weight: 500;
    color: #8a93a2;
    text-transform: uppercase;
}

/* Sidebar Item Styling */
.sidebar-item {
    color: #8a93a2;
    font-weight: 500;
    font-size: 13px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    margin: 0 16px 2px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}
.sidebar-item:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}
.sidebar-item.active {
    color: #fff;
    background: linear-gradient(180deg, #b91a26 0%, #e81d2c 50%, #c41522 100%);
    border: 1px solid #e81d2c;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(232, 29, 44, 0.25);
}
.sidebar-item.active i {
    color: #ffb3b8;
}
.sidebar-item i { width: 24px; text-align: center; font-size: 16px; flex-shrink: 0; }

/* Sidebar bottom blocks (Italiano / Centro Assistenza) */
.sidebar-bottom-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    background: #0b0e13;
    border-radius: 4px;
    color: #8a93a2;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.sidebar-bottom-block:hover {
    background: #15191f;
    color: #fff;
}
.sidebar-bottom-label {
    display: block;
    line-height: 1.25;
}

/* Game Card Styling */
.game-card {
    border-radius: 6px;
    overflow: hidden;
    background: #1e232b; /* Mafia Panel */
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    z-index: 10;
}

/* Rank Badge Style (Red square with number) */
.rank-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: #e81d2c;
    color: white;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 20;
}

/* Category Nav Button */
.cat-nav-btn {
    background: #2a3038;
    color: #8a93a2;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    border: 1px solid transparent;
}
.cat-nav-btn:hover {
    color: white;
    background: #353b45;
}
.cat-nav-btn.active {
    background: #2a3038;
    color: white;
    border-color: #e81d2c;
}
.cat-nav-btn i { color: #e81d2c; }

/* Mobile specific deposit cards adapted */
.deposit-card {
    min-width: 130px;
    height: 180px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    text-align: center;
    position: relative;
    cursor: pointer;
    border: 1px solid #2f3640;
    background: #1e232b;
}
.deposit-card.active {
    background: linear-gradient(180deg, #1e232b 0%, #2a3038 100%);
    border-color: #e81d2c;
    box-shadow: 0 0 10px rgba(232, 29, 44, 0.2);
}

/* --- Header Specific Styles --- */

/* Mafia Button Base (Glassy Effect) */
.btn-mafia {
    height: 40px; 
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    font-weight: 800; /* Extra bold */
    font-size: 13px;
    border-radius: 2px; /* Sharper corners */
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    cursor: pointer;
    /* Dark Blue/Grey Base */
    background-color: #3b4350;
    border: 1px solid #4a515e;
    color: white;
    transition: all 0.2s;
}

/* Mobile Variant - Smaller */
.btn-mafia-sm {
    height: 32px;
    font-size: 10px;
    padding: 0 12px;
    font-weight: 700;
}

/* The "Glass" shine effect on top half */
.btn-mafia::after, .btn-mafia-sm::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.02) 100%);
    pointer-events: none;
}

.btn-mafia:hover, .btn-mafia-sm:hover {
    background-color: #464e5c;
    border-color: #58606e;
}

.btn-mafia span, .btn-mafia-sm span {
    position: relative;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Search Input Styling */
.search-container {
    position: relative;
    height: 40px;
    background-color: #11141a; /* Very dark */
    border: 1px solid #2f3640;
    border-radius: 3px;
    display: flex;
    align-items: center;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.4); 
}
.search-container:focus-within {
    border-color: #4a5058;
}

/* Mobile Sub-Nav Tab */
.mobile-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #8a93a2;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    position: relative;
}
.mobile-tab.active {
    color: white;
    border-bottom-color: #e81d2c;
    background: linear-gradient(to top, rgba(232, 29, 44, 0.05), transparent);
}
/* Vertical separator */
.mobile-tab:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background-color: #2f3640;
}

/* ========== SEO Block (styles via selectors only, naked HTML inside) ========== */
.seo-block {
    max-width: 100%;
    margin-top: 2.5rem;
    padding: 1.75rem 1rem;
    background: #1e232b;
    border: 1px solid #2f3640;
    border-radius: 8px;
    color: #b8bdc6;
    font-size: 0.9375rem;
    line-height: 1.6;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* H1 — главный заголовок SEO-блока, визуально выделен */
.seo-block h1 {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1.2;
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #e81d2c;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.seo-block h2 {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e81d2c;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.seo-block h3 {
    color: #e8eaed;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.5rem 0 0.6rem;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.seo-block p {
    margin: 0 0 1rem;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.seo-block p:last-of-type {
    margin-bottom: 0;
}

/* Unordered list */
.seo-block ul {
    list-style: none;
    margin: 0.75rem 0 1.25rem;
    padding: 0;
}

.seo-block ul li {
    position: relative;
    padding: 0.4rem 0 0.4rem 1.5rem;
    border-left: 3px solid #e81d2c;
    margin-left: 0.5rem;
    background: rgba(232, 29, 44, 0.06);
    margin-bottom: 0.35rem;
    border-radius: 0 4px 4px 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.seo-block ul li::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #e81d2c;
    border-radius: 50%;
}

/* Ordered list */
.seo-block ol {
    margin: 0.75rem 0 1.25rem;
    padding-left: 1.5rem;
    counter-reset: seo-ol;
}

.seo-block ol li {
    position: relative;
    padding: 0.35rem 0 0.35rem 0.25rem;
    margin-bottom: 0.4rem;
    counter-increment: seo-ol;
    overflow-wrap: break-word;
    word-break: break-word;
}

.seo-block ol li::marker {
    color: #e81d2c;
    font-weight: 700;
}

/* Table wrapper: horizontal scroll on small screens */
.seo-block > div {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border: 1px solid #2f3640;
    max-width: 100%;
}

.seo-block table {
    width: 100%;
    min-width: 280px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.seo-block thead {
    background: #0b0e13;
}

.seo-block th {
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #e81d2c;
}

.seo-block tbody tr {
    background: #252b34;
    transition: background 0.15s;
}

.seo-block tbody tr:nth-child(even) {
    background: #1e232b;
}

.seo-block tbody tr:hover {
    background: #2a3038;
}

.seo-block td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #2f3640;
}

.seo-block tbody tr:last-child td {
    border-bottom: none;
}

/* SEO Block: mobile adaptation */
@media (max-width: 1023px) {
    .seo-block {
        margin-top: 1.5rem;
        padding: 1.25rem 0.875rem;
        font-size: 0.875rem;
        border-radius: 6px;
    }
    .seo-block h1 {
        font-size: 1.35rem;
        margin-bottom: 1rem;
        padding-bottom: 0.6rem;
        border-bottom-width: 2px;
    }
    .seo-block h2 {
        font-size: 1.15rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.4rem;
    }
    .seo-block h3 {
        font-size: 1rem;
        margin-top: 1.25rem;
        margin-bottom: 0.5rem;
    }
    .seo-block p {
        margin-bottom: 0.75rem;
    }
    .seo-block ul {
        margin: 0.5rem 0 1rem;
    }
    .seo-block ul li {
        padding: 0.35rem 0 0.35rem 1.25rem;
        margin-left: 0.25rem;
        font-size: 0.8125rem;
    }
    .seo-block ul li::before {
        width: 6px;
        height: 6px;
        left: -5px;
    }
    .seo-block ol {
        margin: 0.5rem 0 1rem;
        padding-left: 1.25rem;
    }
    .seo-block ol li {
        padding: 0.3rem 0 0.3rem 0.2rem;
        font-size: 0.8125rem;
    }
    .seo-block > div {
        margin-top: 0.75rem;
        margin-bottom: 0.25rem;
        border-radius: 4px;
    }
    .seo-block table {
        min-width: 260px;
        font-size: 0.8125rem;
    }
    .seo-block th,
    .seo-block td {
        padding: 0.5rem 0.65rem;
    }
    .seo-block th {
        font-size: 0.65rem;
    }
}

@media (max-width: 479px) {
    .seo-block {
        padding: 1rem 0.75rem;
        font-size: 0.8125rem;
    }
    .seo-block h1 {
        font-size: 1.2rem;
        margin-bottom: 0.85rem;
        padding-bottom: 0.5rem;
    }
    .seo-block h2 {
        font-size: 1.05rem;
    }
    .seo-block h3 {
        font-size: 0.9375rem;
    }
    .seo-block ul li,
    .seo-block ol li {
        padding-left: 1rem;
    }
    .seo-block table {
        min-width: 240px;
        font-size: 0.75rem;
    }
    .seo-block th,
    .seo-block td {
        padding: 0.4rem 0.5rem;
    }
}
