/* Tufao777 - layout mobile-first idêntico ao original */
:root {
    --primary: #006CFF;
    --primary-light: #4E98FE;
    --primary-lighter: #92C0FF;
    --primary-bg: #EEF5FF;
    --header-bg: #D5E6FF;
    --topnav: #00CCFF;
    --accent-green: #00DA0F;
    --accent-green-dark: #00B80D;
    --accent-red: #FF0000;
    --accent-yellow: #F9D115;
    --border: #BAD7FF;
    --text-dark: #333;
    --text-muted: #666;
    --white: #fff;
    --shell-max: 480px;
    --header-h: 48px;
    --bottomnav-h: 62px;
}

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

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #C8DFFF;
    color: var(--text-dark);
    min-height: 100vh;
    padding-bottom: var(--bottomnav-h);
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }
ul { list-style: none; }

/* Shell centralizado como app mobile */
.app-shell {
    max-width: var(--shell-max);
    margin: 0 auto;
    background: var(--primary-bg);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,.12);
}

/* Header mobile */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--header-bg);
    height: var(--header-h);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    height: 100%;
    padding: 0 10px;
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
}

.menu-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px;
}

.menu-btn span {
    display: block;
    height: 2.5px;
    background: var(--primary);
    border-radius: 2px;
}

.logo-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.logo-center img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-center .logo-text {
    font-size: 1.125rem;
    font-weight: 800;
    background: linear-gradient(180deg, #FFE566, #F9D115);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-balance {
    grid-column: 3;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--primary);
    text-align: right;
    line-height: 1.2;
}

/* Sidebar */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: .3s;
}

.sidebar-overlay.open { opacity: 1; visibility: visible; }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    max-width: 80vw;
    height: 100%;
    background: var(--white);
    z-index: 301;
    transform: translateX(-100%);
    transition: .3s;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar.open { transform: translateX(0); }

.sidebar-header {
    padding: 0 16px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header img { width: 40px; border-radius: 8px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-dark);
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-left-color: var(--primary);
}

.main-content { padding: 0 0 16px; }

/* Banner */
.banner-carousel {
    position: relative;
    overflow: hidden;
    background: #111;
}

.banner-slide { display: none; }
.banner-slide.active { display: block; }

.banner-slide img {
    width: 100%;
    aspect-ratio: 16/7;
    object-fit: cover;
}

.banner-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}

.banner-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.45);
    border: none;
    padding: 0;
    cursor: pointer;
}

.banner-dot.active { background: #fff; width: 16px; border-radius: 3px; }

/* Ticker */
.ticker-bar {
    background: linear-gradient(90deg, #006CFF, #4E98FE);
    color: #fff;
    height: 32px;
    display: flex;
    align-items: center;
    overflow: hidden;
    font-size: 0.75rem;
    padding: 0 8px;
    gap: 8px;
}

.ticker-icon { flex-shrink: 0; font-size: 0.875rem; }

.ticker-track {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.ticker-text {
    display: inline-block;
    animation: ticker 22s linear infinite;
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.ticker-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Auth buttons */
.auth-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
}

.btn-login {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
    font-size: 0.9375rem;
    text-align: center;
    cursor: pointer;
}

.btn-registro {
    background: var(--accent-green);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
    font-size: 0.9375rem;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,218,15,.35);
}

.user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--white);
    margin: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.user-bar-balance {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--primary);
}

/* Referral widget */
.referral-widget {
    margin: 0 12px 12px;
    background: linear-gradient(135deg, #CAE1FF 0%, #EEF5FF 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.referral-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #FF6B6B, #FF0000);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.referral-info { flex: 1; min-width: 0; }

.referral-info h3 {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.referral-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 8px;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.referral-stats strong { color: var(--text-dark); }

.referral-btn {
    margin-top: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
}

/* Category slider */
.category-slider-wrap {
    position: relative;
    padding: 0 32px;
    margin-bottom: 10px;
}

.category-slider {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 4px 0;
}

.category-slider::-webkit-scrollbar { display: none; }

.cat-slide {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--white);
    border: 1px solid var(--border);
    min-width: 72px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--primary-lighter);
    transition: .2s;
}

.cat-slide.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.cat-slide .cat-icon { font-size: 1.25rem; }

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    z-index: 2;
}

.slider-arrow.left { left: 4px; }
.slider-arrow.right { right: 4px; }

/* Sub filters */
.sub-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px 12px;
}

.sub-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--primary-lighter);
}

.sub-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.search-toggle {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
}

.search-panel {
    display: none;
    padding: 0 12px 12px;
    position: relative;
}

.search-panel.open { display: block; }

.search-panel input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--white);
    outline: none;
}

.search-panel svg {
    position: absolute;
    left: 24px;
    top: 11px;
    width: 16px;
    height: 16px;
    color: var(--primary);
}

/* Games grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0 12px;
}

.game-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 1px 4px rgba(0,108,255,.1);
}

.game-thumb {
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
}

.game-thumb img,
.game-thumb svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-provider-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 0.5625rem;
    font-weight: 700;
    text-align: center;
    padding: 3px 4px;
    letter-spacing: .5px;
}

.game-badges {
    position: absolute;
    top: 4px;
    left: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.badge {
    font-size: 0.5625rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    color: #fff;
}

.badge-hot { background: var(--accent-red); }
.badge-new { background: var(--accent-green); }

.game-fav-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,.4);
    border: none;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
}

.game-fav-btn.active { color: var(--accent-yellow); }

/* Floating social */
.float-social {
    position: fixed;
    bottom: calc(var(--bottomnav-h) + 16px);
    left: max(12px, calc(50% - var(--shell-max)/2 + 12px));
    z-index: 50;
}

.float-social a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 3px 12px rgba(0,0,0,.25);
}

/* Bottom nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--shell-max);
    height: var(--bottomnav-h);
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 200;
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--primary-lighter);
    font-size: 0.625rem;
    font-weight: 600;
    padding-top: 4px;
}

.bottom-nav-item.active { color: var(--primary); }

.bottom-nav-item svg { width: 22px; height: 22px; }

.bottom-nav-item.nav-register {
    color: var(--accent-green);
}

.bottom-nav-item.nav-register .nav-icon-wrap {
    width: 44px;
    height: 44px;
    background: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -18px;
    box-shadow: 0 3px 10px rgba(0,218,15,.4);
    color: #fff;
}

.bottom-nav-item.nav-register span { color: var(--accent-green); font-weight: 700; }

/* Footer */
.site-footer {
    text-align: center;
    padding: 16px 12px 8px;
    color: var(--text-muted);
    font-size: 0.6875rem;
    line-height: 1.5;
}

/* Alerts */
.alert {
    margin: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8125rem;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }

/* Auth pages */
.auth-page {
    min-height: calc(100vh - var(--bottomnav-h));
    display: flex;
    align-items: center;
    padding: 24px 16px;
}

.auth-card {
    background: var(--white);
    border-radius: 12px;
    padding: 28px 20px;
    width: 100%;
    border: 1px solid var(--border);
}

.auth-card h1 {
    text-align: center;
    color: var(--primary);
    font-size: 1.375rem;
    margin-bottom: 6px;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-bottom: 20px;
}

.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
}

.form-group input:focus { border-color: var(--primary); }

.form-error { color: var(--accent-red); font-size: 0.75rem; margin-top: 4px; }

.auth-link {
    text-align: center;
    margin-top: 14px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.auth-link a { color: var(--primary); font-weight: 600; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-green { background: var(--accent-green); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }

/* Profile */
.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--topnav));
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    margin: 12px;
}

.profile-balance { font-size: 1.75rem; font-weight: 800; margin: 6px 0; }

.wallet-form {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    margin: 0 12px 12px;
    border: 1px solid var(--border);
}

.wallet-form h3 { color: var(--primary); margin-bottom: 12px; font-size: 0.9375rem; }

.transactions-table {
    width: calc(100% - 24px);
    margin: 0 12px;
    background: var(--white);
    border-radius: 12px;
    border-collapse: collapse;
    overflow: hidden;
    font-size: 0.75rem;
}

.transactions-table th,
.transactions-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.transactions-table th { background: var(--primary-bg); color: var(--primary); }

.status-approved { color: var(--accent-green); font-weight: 600; }
.status-pending { color: #FFAA09; font-weight: 600; }
.status-rejected { color: var(--accent-red); font-weight: 600; }

/* Game play */
.game-play-container {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 500;
    display: flex;
    flex-direction: column;
    max-width: var(--shell-max);
    margin: 0 auto;
}

.game-play-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0,0,0,.85);
    color: #fff;
    font-size: 0.8125rem;
}

.game-play-frame {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
}

.game-demo { text-align: center; color: #fff; padding: 20px; }

.slot-machine {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.slot-reel {
    width: 64px;
    height: 90px;
    background: var(--primary-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 2px solid var(--border);
}

/* Promotions */
.promo-grid { padding: 0 12px; display: flex; flex-direction: column; gap: 10px; }

.promo-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 14px;
    display: flex;
    gap: 12px;
}

.promo-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--topnav));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.promo-content h3 { font-size: 0.875rem; color: var(--primary); margin-bottom: 4px; }
.promo-content p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

.promo-bonus {
    display: inline-block;
    margin-top: 6px;
    background: var(--accent-yellow);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 16px 12px;
}

.pagination a, .pagination span {
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--white);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--primary);
}

.pagination span.current { background: var(--primary); color: #fff; }

/* Search results */
.search-results {
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    display: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.search-results.show { display: block; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

/* Admin */
.admin-layout { display: flex; min-height: 100vh; padding-bottom: 0; }

.admin-sidebar {
    width: 200px;
    background: #1a1a2e;
    color: #fff;
    padding: 16px 0;
}

.admin-sidebar h2 { padding: 0 16px 16px; font-size: 1rem; color: var(--accent-yellow); }

.admin-nav a {
    display: block;
    padding: 10px 16px;
    color: #aaa;
    font-size: 0.8125rem;
}

.admin-nav a:hover, .admin-nav a.active { background: rgba(0,108,255,.2); color: #fff; }

.admin-content { flex: 1; padding: 20px; background: #f5f5f5; }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--border);
}

.stat-card .value { font-size: 1.5rem; font-weight: 800; color: var(--primary); }

.admin-table {
    width: 100%;
    background: var(--white);
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.75rem;
}

.admin-table th, .admin-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.admin-table th { background: var(--primary-bg); color: var(--primary); }

@media (min-width: 768px) {
    :root { --shell-max: 520px; }
}
