/* ============================================
    HOME - BASE
    Container + Header + Stats + Streak + Carousel + Clock
    CORRIGIDO: Contador de dias separado do clock
    © 2026 LITE STUDIO
    ============================================ */

/* ============================================
   CONTAINER PRINCIPAL
   ============================================ */
.st-home-container {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top, 20px));
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   HEADER
   ============================================ */
.st-home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.st-home-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-strong);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.st-home-brand-logo {
    color: var(--accent);
    display: flex;
}

.st-home-brand-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.st-home-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.st-home-add-small {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border: none;
    color: var(--bg-void);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    box-shadow: 0 0 15px var(--accent-glow);
}

.st-home-add-small:active {
    transform: scale(0.92);
}

.st-home-add-small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.st-home-counter-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--accent);
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    box-shadow: 0 0 12px var(--accent-glow);
}

.st-home-counter-badge-count {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.st-home-counter-badge-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 2px;
}

.st-home-limit-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(251, 191, 36, 0.1);
    border: 1.5px solid var(--warning);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    flex-shrink: 0;
}

.st-home-limit-warning-icon {
    color: var(--warning);
    flex-shrink: 0;
    display: flex;
}

.st-home-limit-warning-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.st-home-limit-warning-text strong {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--warning);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.st-home-limit-warning-text span {
    font-family: var(--font-main);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ============================================
   STATS BAR
   ============================================ */
.st-home-stats-bar {
    flex-shrink: 0;
}

.st-home-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: var(--bg-card);
    border: 2px solid var(--border-default);
    position: relative;
}

.st-home-stats-row::before,
.st-home-stats-row::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--border-default) 20%, var(--border-default) 80%, transparent);
}

.st-home-stats-row::before {
    left: 33.33%;
}

.st-home-stats-row::after {
    left: 66.66%;
}

.st-home-stat {
    text-align: center;
    padding: 12px 8px;
}

.st-home-stat-icon {
    color: var(--accent);
    opacity: 0.8;
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

.st-home-stat-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 2px 2px 0 #000;
}

.st-home-stat-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* ============================================
   STREAK BANNER
   ============================================ */
.st-streak-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(42,42,42,0.6) 0%, rgba(20,20,20,0.8) 100%);
    border: 2px solid var(--border-strong);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.st-streak-banner.milestone {
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--gold-glow);
}

.st-streak-fire {
    font-size: 2rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-streak-fire .st-streak-icon-svg {
    width: 40px;
    height: 40px;
    color: var(--accent);
}

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

.st-streak-count {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.st-streak-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
    text-shadow: 2px 2px 0 #000;
}

.st-streak-unit {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.st-streak-message {
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 3px;
    line-height: 1.3;
}

/* ============================================
   CAROUSEL
   ============================================ */
.st-home-carousel-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 12px;
}

.st-home-carousel {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 16px;
    padding: 8px 4px;
    touch-action: pan-x;
    flex: 1;
}

.st-home-carousel::-webkit-scrollbar {
    display: none;
}

/* ============================================
   SLIDE
   ============================================ */
.st-home-slide {
    flex: 0 0 calc(100% - 8px);
    min-width: calc(100% - 8px);
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-primary) 100%);
    border: 2px solid var(--border-strong);
    position: relative;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.st-home-slide::before,
.st-home-slide::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, var(--metal-bright) 30%, var(--metal) 70%);
    border-radius: 50%;
    z-index: 10;
}

.st-home-slide::before {
    top: 10px;
    left: 10px;
}

.st-home-slide::after {
    bottom: 10px;
    right: 10px;
}

.st-home-slide-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(239,68,68,0.15);
    border: 1.5px solid var(--danger);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    z-index: 11;
    opacity: 0.7;
}

.st-home-slide-delete:hover {
    background: var(--danger);
    color: #FFF;
    opacity: 1;
}

.st-home-slide-delete:active {
    transform: scale(0.95);
}

/* ============================================
   CLOCK WRAPPER
   ============================================ */
.st-home-clock-wrapper {
    position: relative;
    width: min(260px, 65vw);
    height: min(260px, 65vw);
    flex-shrink: 0;
}

.st-home-clock-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

.st-home-clock-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.st-home-clock-bg {
    fill: none;
    stroke: var(--metal);
    stroke-width: 10;
}

.st-home-clock-progress {
    fill: none;
    stroke: url(#clockGradient);
    stroke-width: 12;
    stroke-linecap: square;
    transition: stroke-dashoffset 1s var(--ease-out);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

/* ============================================
   CLOCK CONTENT
   ============================================ */
.st-home-clock-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.st-home-clock-vice-icon {
    width: 44px;
    height: 44px;
    background: var(--metal);
    border: 1.5px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 6px;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

/* ============================================
   ✅ CONTADOR DE DIAS - GRANDE E DOURADO
   Aparece quando tem 1+ dia, ACIMA das horas
   ============================================ */
.st-home-days-counter {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 2px;
    animation: daysCounterIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes daysCounterIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.st-home-days-value {
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vw, 2.6rem);
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
    letter-spacing: 0.02em;
    text-shadow:
        2px 2px 0 #000,
        0 0 20px var(--gold-glow);
}

.st-home-days-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.9;
}

/* ============================================
   ✅ CLOCK TIME - PADRÃO (grande)
   ============================================ */
.st-home-clock-time {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 9vw, 2.4rem);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    line-height: 1;
    margin-bottom: 4px;
    text-shadow: 0 0 24px var(--accent-glow), 2px 2px 0 #000;
    transition: all 0.3s ease;
}

/* ============================================
   ✅ CLOCK TIME - COMPACTO (quando tem dias)
   Reduz tamanho para caber junto com contador de dias
   ============================================ */
.st-home-clock-time.st-home-clock-time-compact {
    font-size: clamp(1.3rem, 6.5vw, 1.7rem);
    color: var(--text-secondary);
    text-shadow: 0 0 12px var(--accent-glow), 1px 1px 0 #000;
    margin-bottom: 2px;
}

.st-home-clock-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

/* Label muda quando tem dias */
.st-home-clock-content:has(.st-home-days-counter) .st-home-clock-label {
    font-size: 0.6rem;
    color: var(--text-tertiary);
}

.st-home-clock-vice-name {
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ============================================
   SLIDE INFO
   ============================================ */
.st-home-slide-info {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.st-home-slide-breakdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-default);
}

.st-home-slide-unit {
    padding: 10px 4px;
    text-align: center;
    position: relative;
}

.st-home-slide-unit:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-default);
}

.st-home-slide-unit-value {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 2px;
    text-shadow: 2px 2px 0 #000;
}

.st-home-slide-unit-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.st-home-slide-achievement {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--metal-dark);
    border: 1px solid var(--gold);
    align-self: center;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.st-home-slide-achievement-text {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.st-home-clock-btn {
    width: 100%;
    padding: 14px;
    min-height: 48px;
    background: var(--accent);
    border: 2px solid var(--accent);
    color: var(--bg-void);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    box-shadow: 0 4px 16px var(--accent-glow);
}

.st-home-clock-btn:active {
    transform: scale(0.96);
}

.st-home-clock-btn:hover {
    background: var(--accent-light);
}

/* ============================================
   DOTS DE NAVEGAÇÃO
   ============================================ */
.st-home-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
    flex-shrink: 0;
}

.st-home-dot {
    width: 6px;
    height: 6px;
    background: var(--metal);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    padding: 0;
}

.st-home-dot.active {
    width: 24px;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.st-home-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    min-height: 60vh;
}

.st-home-empty-icon {
    width: 100px;
    height: 100px;
    background: var(--bg-card);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--accent);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
    box-shadow: 0 0 30px var(--accent-glow);
}

.st-home-empty h3 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: var(--accent);
    letter-spacing: 0.1em;
}

.st-home-empty p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    max-width: 260px;
    margin-bottom: 16px;
}

.st-home-empty-limit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(229,229,229,0.05);
    border: 1px solid var(--border-default);
    margin-bottom: 24px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.st-home-empty-limit-icon {
    color: var(--accent);
    display: flex;
}

.st-home-empty-btn {
    padding: 16px 32px;
    min-height: 52px;
    background: var(--accent);
    color: var(--bg-void);
    border: 2px solid var(--accent);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    box-shadow: 0 4px 20px var(--accent-glow);
}

.st-home-empty-btn:active {
    transform: scale(0.96);
}

.st-home-empty-btn:hover {
    background: var(--accent-light);
}

/* ============================================
   ANÚNCIO ADCASH
   ============================================ */
.st-ad-wrapper {
    margin-top: 8px;
    padding: 0;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(229,229,229,0.05);
    overflow: hidden;
    flex-shrink: 0;
    height: 50px;
    max-height: 50px;
    opacity: 0.4;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.st-ad-wrapper:hover {
    opacity: 0.8;
    height: 80px;
    max-height: 80px;
}

.st-ad-label-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 3px 8px;
    background: transparent;
    border-bottom: none;
}

.st-ad-label-dot {
    width: 3px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    box-shadow: none;
    animation: none;
}

.st-ad-label-text {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-shadow: none;
}

.st-ad-container {
    position: relative;
    width: 100%;
    min-height: 30px;
    max-height: 30px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    overflow: hidden;
}

.st-ad-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.st-ad-loading {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 0.1em;
}

.st-ad-spinner {
    width: 12px;
    height: 12px;
    border: 1px solid var(--border-default);
    border-top-color: var(--text-muted);
    border-radius: 50%;
    animation: stSpin 1s linear infinite;
}

.st-ad-footer {
    display: none;
}

.st-ad-footer span {
    display: none;
}

/* ============================================
   RESPONSIVO
   ============================================ */
@media (max-width: 380px) {
    .st-streak-banner {
        padding: 12px;
        gap: 10px;
    }
    .st-streak-number {
        font-size: 1.6rem;
    }
    .st-streak-message {
        font-size: 0.75rem;
    }
    .st-home-stat-value {
        font-size: 1.2rem;
    }
    .st-home-clock-time {
        font-size: clamp(1.6rem, 8.5vw, 2rem);
    }
    .st-home-clock-time.st-home-clock-time-compact {
        font-size: clamp(1.2rem, 6vw, 1.5rem);
    }
    .st-home-days-value {
        font-size: clamp(1.8rem, 7.5vw, 2.2rem);
    }
    .st-ad-wrapper {
        height: 40px;
        max-height: 40px;
    }
    .st-ad-wrapper:hover {
        height: 60px;
        max-height: 60px;
    }
}

@media (min-width: 600px) {
    .st-home-container {
        padding: 28px;
        gap: 20px;
    }
    .st-streak-banner {
        padding: 20px;
    }
    .st-streak-number {
        font-size: 2.4rem;
    }
    .st-home-stat-value {
        font-size: 1.6rem;
    }
    .st-home-days-value {
        font-size: 3rem;
    }
    .st-home-clock-time.st-home-clock-time-compact {
        font-size: 2rem;
    }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .st-home-days-counter {
        animation: none;
    }
}

/* Garantir que conteúdo não fique atrás do BottomNav */
.st-home-container {
    padding-bottom: 90px !important;
    min-height: calc(100vh - 90px);
}

.st-home-scroll {
    padding-bottom: 20px;
}