/**
 * ──────────────────────────────────────────────────────────────
 *  Folhas do Hábito — Iniciativa B.2
 *  Fogo de Streak — estilos do painel e do mini portal
 * ──────────────────────────────────────────────────────────────
 */

/* ── Painel grande no dashboard ── */
.streak-fire-panel {
    position: relative;
    margin: 24px 0;
    padding: 24px 28px;
    background: linear-gradient(180deg, rgba(20, 20, 28, 0.55) 0%, rgba(10, 10, 16, 0.65) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.streak-fire-panel::before {
    /* Glow sutil ao redor do painel reagindo à cor do tema */
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 20px;
    background: radial-gradient(ellipse 60% 50% at 50% 100%, var(--accent-soft, rgba(74,222,128,0.08)) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.streak-fire-panel-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: center;
}

.streak-fire-canvas-wrap {
    position: relative;
    width: 240px;
    height: 200px;
}

#streakFireCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Marca do recorde no contorno do canvas — uma linha sutil
   indicando o "nível máximo" alcançado historicamente. */
.streak-fire-record-mark {
    position: absolute;
    left: -2px;
    right: -2px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent, #4ade80), transparent);
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.3s ease, top 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.streak-fire-record-mark::before,
.streak-fire-record-mark::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 5px;
    height: 5px;
    background: var(--accent, #4ade80);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 6px var(--accent, #4ade80);
}
.streak-fire-record-mark::before { left: -2px; }
.streak-fire-record-mark::after  { right: -2px; }

/* Marca "fantasma" — quando ainda não há recorde histórico.
   Marca de água sutil, tracejada, sem brilho nos pontos. */
.streak-fire-record-mark.is-watermark {
    background: repeating-linear-gradient(
        90deg,
        transparent 0,
        rgba(255,255,255,0.18) 4px,
        rgba(255,255,255,0.18) 8px,
        transparent 12px
    );
    opacity: 0.35;
}
.streak-fire-record-mark.is-watermark::before,
.streak-fire-record-mark.is-watermark::after {
    background: rgba(255,255,255,0.3);
    box-shadow: none;
}

.streak-fire-record-mark-hover {
    position: absolute;
    left: -2px;
    right: -2px;
    height: 16px;
    cursor: help;
    z-index: 3;
}
.streak-fire-record-mark-hover:hover ~ .streak-fire-record-mark {
    opacity: 1;
}

/* Tooltip */
.streak-fire-tooltip {
    position: absolute;
    background: rgba(15, 15, 22, 0.95);
    color: var(--accent, #4ade80);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--accent, #4ade80);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.streak-fire-record-mark-hover:hover + .streak-fire-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Lado direito: textos */
.streak-fire-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.streak-fire-eyebrow {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.38);
    font-weight: 700;
}

.streak-fire-number {
    font-size: 3.2rem;
    line-height: 1;
    font-weight: 800;
    color: var(--accent, #4ade80);
    font-feature-settings: 'tnum';
    text-shadow: 0 0 24px var(--accent-soft, rgba(74,222,128,0.4));
}

.streak-fire-number .unit {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
    margin-left: 8px;
    letter-spacing: 1px;
}

.streak-fire-stage-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    font-style: italic;
}

.streak-fire-message {
    margin-top: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    max-width: 460px;
}

.streak-fire-message strong {
    color: var(--accent, #4ade80);
}

/* Estado "fagulha apagada" — sem streak ainda */
.streak-fire-panel.is-empty .streak-fire-number {
    color: rgba(255, 255, 255, 0.35);
    text-shadow: none;
}

/* ── Mini fogo no portal (substitui o emoji 🔥 do card) ── */
.streak-card-mini-fire {
    width: 64px;
    height: 56px;
    margin: 0 auto 4px;
    display: block;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .streak-fire-record-mark {
        transition: none;
    }
    .streak-fire-tooltip {
        transition: none;
    }
}

/* ── Responsivo (mobile): o painel grande NÃO aparece no mobile ──
   No mobile a chama vive na mini-pílula do HUD (streakHudFire); o painel grande é
   desktop-only. (As regras abaixo ficaram inertes com o display:none, mantidas por histórico.) */
@media (max-width: 768px) {
    .streak-fire-panel { display: none; }
    .streak-fire-panel-inner {
        grid-template-columns: auto 1fr;
        gap: 14px;
        align-items: center;
    }
    .streak-fire-canvas-wrap {
        width: 56px;
        height: 50px;
        margin: 0;
    }
    .streak-fire-info {
        text-align: left;
        align-items: flex-start;
    }
    .streak-fire-eyebrow { display: none; }
    .streak-fire-number { font-size: 1.7rem; margin: 0; }
    .streak-fire-number .unit { font-size: 0.78rem; }
    .streak-fire-stage-label { font-size: 0.82rem; margin-top: 1px; }
    .streak-fire-message { display: none; }
    .streak-fire-record-mark,
    .streak-fire-record-mark-hover,
    .streak-fire-tooltip { display: none; }
}
