/* ============================================================
   GANHEJOGANDO — Estilos Globais
   Mobile-first, design moderno e atraente
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #00b09b;
    --primary-dark: #008a78;
    --primary-light: #00d4b8;
    --secondary: #96c93d;
    --gold: #ffc107;
    --gold-dark: #e6a800;
    --danger: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --bg: #f0f4f8;
    --card: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --nav-height: 70px;
    --header-height: 60px;
    --ad-height: 60px;
}

html, body {
    height: 100%;
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    overflow-x: hidden;
}

/* ============================================================
   ADS
   ============================================================ */
.ad-banner-top,
.ad-banner-bottom {
    width: 100%;
    text-align: center;
    overflow: hidden;
    min-height: 0;
}

.ad-banner-top ins,
.ad-banner-bottom ins {
    display: block;
}

@keyframes sbFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-4px); }
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
    background: #0A0A0A;
    height: 64px;
    position: relative;
    z-index: 90;
    box-shadow: 0 2px 16px rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(204,255,0,0.12);
}

.header-content {
    max-width: 480px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: relative;
}

.header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    display: block;
    height: 34px;
    width: auto;
}

/* Horizontal visível por padrão (navbar wide) */
.logo-horizontal { display: block; }
.logo-vertical   { display: none;  }

/* Em telas muito estreitas, usa a versão mais compacta se necessário */
@media (max-width: 300px) {
    .logo-horizontal { display: none;  }
    .logo-vertical   { display: block; }
}

.header-balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.balance-label {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-value {
    font-size: 16px;
    font-weight: 800;
    color: #CCFF00;
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-message {
    max-width: 480px;
    margin: 12px auto;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.flash-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.flash-error   { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.flash-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid var(--primary); }

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: inherit;
    opacity: 0.6;
    padding: 0 4px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px 100px;
    min-height: 60vh;
    background: #f0f4f8;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 50px;
    border: none;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(0,176,155,0.4);
}

.btn-primary:hover, .btn-primary:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,176,155,0.5);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), #ff8c00);
    color: white;
    box-shadow: 0 4px 15px rgba(255,193,7,0.4);
}

.btn-gold:hover, .btn-gold:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,193,7,0.5);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-section-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary, #f59e0b);
    padding: 10px 0 6px;
    margin: 8px 0 4px;
    border-bottom: 2px solid rgba(245,158,11,0.15);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    color: var(--text);
    background: #fafafa;
    transition: border-color 0.2s;
    outline: none;
}

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

.form-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 100;
    padding: 0 8px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    min-width: 56px;
}

.nav-icon {
    font-size: 22px;
    transition: transform 0.2s;
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nav-item.active .nav-icon {
    transform: scale(1.2);
}

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

/* ============================================================
   GAME — COIN CLICKER
   ============================================================ */
.game-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

.game-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,193,7,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.game-points-display {
    margin-bottom: 16px;
}

.game-points-label {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.game-points-value {
    font-size: 36px;
    font-weight: 900;
    color: var(--gold);
    line-height: 1;
}

.game-points-brl {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
}

/* Moeda clicável */
.coin-container {
    position: relative;
    display: inline-block;
    margin: 16px 0;
}

.coin-btn {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffe066, #ffc107, #e6a800, #b8860b);
    border: none;
    cursor: pointer;
    font-size: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 4px rgba(255,193,7,0.3),
        0 0 0 8px rgba(255,193,7,0.15),
        0 8px 30px rgba(255,193,7,0.5),
        inset 0 -4px 8px rgba(0,0,0,0.2);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    animation: coinPulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.coin-btn::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 35%;
    height: 20%;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    transform: rotate(-30deg);
}

@keyframes coinPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.coin-btn:active {
    transform: scale(0.92) !important;
    box-shadow:
        0 0 0 4px rgba(255,193,7,0.3),
        0 4px 15px rgba(255,193,7,0.3),
        inset 0 -2px 4px rgba(0,0,0,0.2);
    animation: none;
}

.coin-btn.limit-reached {
    filter: grayscale(0.8);
    cursor: not-allowed;
    animation: none;
}

/* Floating +10 text */
.float-text {
    position: absolute;
    font-size: 22px;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    pointer-events: none;
    animation: floatUp 0.8s ease-out forwards;
    z-index: 10;
}

@keyframes floatUp {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) scale(0.7); }
}

/* Daily progress bar */
.daily-progress {
    margin-top: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.progress-label {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-value {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    font-weight: 700;
}

.progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--gold));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.game-hint {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 12px;
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 20px;
    font-weight: 900;
    color: var(--primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ============================================================
   TASKS
   ============================================================ */
.task-item {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s;
}

.task-item:hover { transform: translateY(-2px); }

.task-icon {
    font-size: 32px;
    min-width: 44px;
    text-align: center;
}

.task-info {
    flex: 1;
}

.task-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.task-desc {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.task-reward {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff9e6;
    color: var(--gold-dark);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.task-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e8f5e9;
    color: var(--success);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.task-action {
    min-width: 90px;
}

/* Modal de tarefas */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-sheet {
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Timer do vídeo */
.video-timer {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    color: white;
    margin-bottom: 16px;
}

.timer-display {
    font-size: 48px;
    font-weight: 900;
    color: var(--gold);
}

.timer-label {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

/* ============================================================
   WALLET
   ============================================================ */
.balance-card-big {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    color: white;
    margin-bottom: 16px;
    box-shadow: 0 8px 25px rgba(0,176,155,0.3);
}

.balance-card-big .label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.balance-card-big .amount {
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
}

.balance-card-big .points {
    font-size: 14px;
    opacity: 0.7;
    margin-top: 6px;
}

.balance-card-big .progress-min {
    margin-top: 16px;
    font-size: 12px;
    opacity: 0.7;
}

.balance-card-big .progress-bar {
    margin-top: 8px;
    background: rgba(255,255,255,0.2);
}

.balance-card-big .progress-fill {
    background: rgba(255,255,255,0.9);
}

/* Transaction list */
.transaction-list { margin-top: 8px; }

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.transaction-item:last-child { border-bottom: none; }

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.icon-game    { background: #e3f2fd; }
.icon-task    { background: #e8f5e9; }
.icon-bonus   { background: #fff9e6; }
.icon-withdrawal { background: #fce4ec; }

.transaction-info { flex: 1; }

.transaction-desc {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.transaction-date {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.transaction-amount {
    font-size: 16px;
    font-weight: 800;
}

.amount-positive { color: var(--success); }
.amount-negative { color: var(--danger); }

/* ============================================================
   WITHDRAWAL PAGE
   ============================================================ */
.withdrawal-info {
    display: flex;
    gap: 12px;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #276749;
}

.withdrawal-warning {
    background: #fffbeb;
    border-color: #fef3c7;
    color: #92400e;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.status-pending  { background: #fef3c7; color: #92400e; }
.status-paid     { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.admin-stat {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    text-align: center;
    box-shadow: var(--shadow);
}

.admin-stat-value {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary);
}

.admin-stat-label {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    background: var(--bg);
    padding: 10px 8px;
    text-align: left;
    font-weight: 700;
    color: var(--text-light);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.login-logo .emoji {
    font-size: 64px;
    display: block;
    margin-bottom: 8px;
    animation: coinPulse 2s infinite;
}

.login-logo h1 {
    font-size: 32px;
    font-weight: 900;
    color: white;
}

.login-logo p {
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    margin-top: 4px;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 28px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.tab-switcher {
    display: flex;
    background: var(--bg);
    border-radius: 50px;
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 50px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ============================================================
   LOADING
   ============================================================ */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

.section-subtitle {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 360px) {
    .coin-btn { width: 120px; height: 120px; font-size: 48px; }
    .game-points-value { font-size: 28px; }
    .admin-stats { grid-template-columns: 1fr 1fr; }
}


/* ── TikTok Shop Task ────────────────────────────────────────────── */
.tt-card-icon img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}
