/* =============================================
   FERRO E FOGO — Visual de Forja, Fogo, RPG
   Arquivo independente — NÃO altera style.css
   ============================================= */

/* === VARIÁVEIS DE FOGO === */
.ff-root {
    --ff-fire: #e8621a;
    --ff-ember: #ff8c38;
    --ff-gold: #f0c040;
    --ff-copper: #b87333;
    --ff-crimson: #c12a1c;
    --ff-dark: #0a0608;
    --ff-card: #140c0e;
    --ff-card2: #1a100f;
    --ff-border: #2a1810;
    --ff-border-glow: #e8621a33;
    --ff-text: #f0e6dc;
    --ff-text2: #b8a090;
    --ff-text3: #7a6258;
    --ff-green: #4ade80;
    --ff-xp: #f0c040;
}

/* === CONTAINER PRINCIPAL === */
.ff-root {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(232, 98, 26, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(184, 115, 51, 0.04) 0%, transparent 40%),
        var(--ff-dark);
    min-height: calc(100dvh - 80px);
    padding-bottom: 90px;
    animation: ffFadeIn .4s ease;
}

@keyframes ffFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ffSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ffGlow {
    0%, 100% { box-shadow: 0 0 12px rgba(232, 98, 26, 0.2); }
    50% { box-shadow: 0 0 28px rgba(232, 98, 26, 0.4); }
}

@keyframes ffFirePulse {
    0%, 100% { text-shadow: 0 0 8px rgba(232, 98, 26, 0.3); }
    50% { text-shadow: 0 0 20px rgba(232, 98, 26, 0.6), 0 0 40px rgba(240, 192, 64, 0.2); }
}

@keyframes ffXpPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes ffCheckmark {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes ffVictoryGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(74, 222, 128, 0.15); }
    50% { box-shadow: 0 0 50px rgba(74, 222, 128, 0.35), 0 0 80px rgba(240, 192, 64, 0.15); }
}

@keyframes ffStreakFire {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* === HEADER === */
.ff-header {
    text-align: center;
    padding: 20px 16px 8px;
    position: relative;
}

.ff-header-icon {
    font-size: 36px;
    margin-bottom: 4px;
    animation: ffStreakFire 2.5s ease infinite;
}

.ff-header-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #e8621a, #f0c040, #ff8c38);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: ffFirePulse 3s ease infinite;
}

.ff-header-sub {
    font-size: 11px;
    color: var(--ff-text3);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* === CARDS === */
.ff-card {
    background: linear-gradient(145deg, var(--ff-card), var(--ff-card2));
    border: 1px solid var(--ff-border);
    border-radius: 16px;
    padding: 16px;
    margin: 10px 16px;
    animation: ffSlideUp .4s ease;
    position: relative;
    overflow: hidden;
}

.ff-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(232, 98, 26, 0.2), transparent);
}

.ff-card-glow {
    border-color: var(--ff-border-glow);
    box-shadow: 0 0 20px rgba(232, 98, 26, 0.08);
}

.ff-card-victory {
    border-color: rgba(74, 222, 128, 0.3) !important;
    animation: ffVictoryGlow 2.5s ease infinite;
}

/* === DAY BADGE === */
.ff-day-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e8621a, #b83a0c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 8px;
    animation: ffGlow 3s ease infinite;
    position: relative;
}

.ff-day-badge-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(240, 192, 64, 0.3);
}

.ff-day-label {
    font-size: 13px;
    color: var(--ff-text3);
    letter-spacing: 2px;
    text-align: center;
}

/* === PROGRESS BAR GERAL === */
.ff-progress-track {
    background: #1a100f;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    border: 1px solid var(--ff-border);
}

.ff-progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #c12a1c, #e8621a, #f0c040);
    transition: width .6s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.ff-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15));
    border-radius: 0 10px 10px 0;
}

/* === XP BAR === */
.ff-xp-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.ff-xp-level {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, #2a1a08, #1a1008);
    border: 2px solid var(--ff-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--ff-gold);
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(240, 192, 64, 0.15);
}

.ff-xp-bar-wrap {
    flex: 1;
}

.ff-xp-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--ff-text3);
    margin-bottom: 4px;
}

.ff-xp-bar {
    background: #1a100f;
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
    border: 1px solid #2a1a08;
}

.ff-xp-bar-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #b87333, #f0c040);
    transition: width .6s ease;
}

/* === STATS ROW === */
.ff-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin: 8px 0;
}

.ff-stat {
    text-align: center;
    padding: 10px 4px;
    background: rgba(26, 16, 15, 0.5);
    border-radius: 12px;
    border: 1px solid var(--ff-border);
}

.ff-stat-val {
    font-size: 22px;
    font-weight: 700;
}

.ff-stat-label {
    font-size: 10px;
    color: var(--ff-text3);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* === STREAK === */
.ff-streak {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
}

.ff-streak-fire {
    font-size: 24px;
    animation: ffStreakFire 1.5s ease infinite;
}

.ff-streak-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--ff-fire);
}

.ff-streak-text {
    font-size: 12px;
    color: var(--ff-text3);
}

/* === CHECKLIST === */
.ff-checklist {
    list-style: none;
}

.ff-task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(42, 24, 16, 0.6);
    cursor: pointer;
    transition: all .15s;
    -webkit-tap-highlight-color: transparent;
}

.ff-task:last-child {
    border-bottom: none;
}

.ff-task:active {
    background: rgba(232, 98, 26, 0.05);
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 10px;
}

.ff-task-check {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 2px solid var(--ff-border);
    background: transparent;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all .2s;
}

.ff-task.done .ff-task-check {
    background: linear-gradient(145deg, #e8621a, #c12a1c);
    border-color: #e8621a;
    animation: ffCheckmark .3s ease;
}

.ff-task-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.ff-task-name {
    font-size: 14px;
    color: var(--ff-text2);
    flex: 1;
    line-height: 1.4;
}

.ff-task.done .ff-task-name {
    color: var(--ff-fire);
    font-weight: 600;
}

.ff-task-xp {
    font-size: 11px;
    color: var(--ff-gold);
    font-weight: 700;
    opacity: 0;
    transition: opacity .3s;
}

.ff-task.done .ff-task-xp {
    opacity: 1;
    animation: ffXpPop .3s ease;
}

/* === SECTION LABELS === */
.ff-section {
    font-size: 11px;
    color: var(--ff-fire);
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 10px;
    font-weight: 700;
}

/* === MOTIVATIONAL PHRASE === */
.ff-phrase {
    text-align: center;
    padding: 12px 8px;
    font-style: italic;
    color: var(--ff-ember);
    font-size: 15px;
    line-height: 1.7;
    border-left: 3px solid var(--ff-fire);
    margin: 0;
    background: rgba(232, 98, 26, 0.04);
    border-radius: 0 12px 12px 0;
}

/* === COMPLETION BANNER === */
.ff-victory-banner {
    text-align: center;
    padding: 16px;
    background: linear-gradient(145deg, rgba(74, 222, 128, 0.08), rgba(240, 192, 64, 0.05));
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 14px;
    margin-top: 8px;
}

.ff-victory-icon {
    font-size: 40px;
    margin-bottom: 4px;
}

.ff-victory-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--ff-green);
}

.ff-victory-sub {
    font-size: 12px;
    color: var(--ff-text3);
    margin-top: 4px;
}

/* === INCOMPLETE BANNER === */
.ff-incomplete-banner {
    text-align: center;
    padding: 12px;
    background: rgba(232, 98, 26, 0.06);
    border: 1px solid rgba(232, 98, 26, 0.15);
    border-radius: 14px;
    margin-top: 8px;
}

.ff-incomplete-text {
    font-size: 14px;
    color: var(--ff-ember);
    font-weight: 600;
}

.ff-incomplete-sub {
    font-size: 12px;
    color: var(--ff-text3);
    margin-top: 2px;
}

/* === CALENDAR GRID (mini) === */
.ff-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.ff-cal-day {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}

.ff-cal-day.empty {
    background: transparent;
}

.ff-cal-day.missed {
    background: rgba(232, 98, 26, 0.08);
    color: var(--ff-text3);
    border-color: var(--ff-border);
}

.ff-cal-day.partial {
    background: rgba(232, 98, 26, 0.2);
    color: var(--ff-ember);
    border-color: rgba(232, 98, 26, 0.3);
}

.ff-cal-day.complete {
    background: linear-gradient(145deg, #e8621a, #c12a1c);
    color: #fff;
    border-color: #e8621a;
    box-shadow: 0 0 6px rgba(232, 98, 26, 0.3);
}

.ff-cal-day.today {
    border-color: var(--ff-gold) !important;
    box-shadow: 0 0 8px rgba(240, 192, 64, 0.3);
}

/* === JOURNAL === */
.ff-journal-entry {
    padding: 14px 0;
    border-bottom: 1px solid var(--ff-border);
    cursor: pointer;
    transition: background .2s;
}

.ff-journal-entry:last-child {
    border-bottom: none;
}

.ff-journal-entry:active {
    background: rgba(232, 98, 26, 0.04);
}

.ff-journal-date {
    font-size: 12px;
    color: var(--ff-fire);
    font-weight: 700;
}

.ff-journal-title {
    font-size: 15px;
    color: var(--ff-text);
    font-weight: 600;
    margin-top: 2px;
}

.ff-journal-preview {
    font-size: 13px;
    color: var(--ff-text3);
    margin-top: 4px;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* === JOURNAL EDITOR === */
.ff-journal-textarea {
    width: 100%;
    min-height: 200px;
    background: var(--ff-card);
    border: 1px solid var(--ff-border);
    border-radius: 12px;
    color: var(--ff-text);
    padding: 14px;
    font-size: 15px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    line-height: 1.8;
    outline: none;
    resize: vertical;
}

.ff-journal-textarea:focus {
    border-color: rgba(232, 98, 26, 0.3);
    box-shadow: 0 0 12px rgba(232, 98, 26, 0.08);
}

.ff-journal-textarea::placeholder {
    color: var(--ff-text3);
}

.ff-journal-input {
    width: 100%;
    background: var(--ff-card);
    border: 1px solid var(--ff-border);
    border-radius: 10px;
    color: var(--ff-text);
    padding: 10px 14px;
    font-size: 15px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    outline: none;
    margin-bottom: 10px;
}

.ff-journal-input:focus {
    border-color: rgba(232, 98, 26, 0.3);
}

/* === BUTTONS === */
.ff-btn {
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 1px;
    width: 100%;
    margin-top: 8px;
    transition: all .2s;
    text-align: center;
}

.ff-btn:active {
    transform: scale(0.97);
}

.ff-btn-fire {
    background: linear-gradient(135deg, #e8621a, #c12a1c);
    color: #fff;
    box-shadow: 0 4px 16px rgba(232, 98, 26, 0.25);
}

.ff-btn-outline {
    background: transparent;
    color: var(--ff-fire);
    border: 1px solid rgba(232, 98, 26, 0.3);
}

.ff-btn-sm {
    padding: 10px 14px;
    font-size: 13px;
}

.ff-btn-gold {
    background: linear-gradient(135deg, var(--ff-gold), var(--ff-copper));
    color: var(--ff-dark);
}

/* === TABS === */
.ff-tabs {
    display: flex;
    margin: 10px 16px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--ff-border);
}

.ff-tab {
    flex: 1;
    padding: 10px 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: var(--ff-card);
    color: var(--ff-text3);
    font-family: inherit;
    transition: all .2s;
    letter-spacing: .5px;
}

.ff-tab.active {
    background: linear-gradient(145deg, rgba(232, 98, 26, 0.15), rgba(232, 98, 26, 0.05));
    color: var(--ff-fire);
    border-bottom: 2px solid var(--ff-fire);
}

.ff-tab:active {
    transform: scale(0.97);
}

/* === MOOD SELECTOR === */
.ff-mood-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 8px 0;
}

.ff-mood-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid var(--ff-border);
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.ff-mood-btn.active {
    border-color: var(--ff-fire);
    background: rgba(232, 98, 26, 0.1);
    box-shadow: 0 0 10px rgba(232, 98, 26, 0.2);
}

/* === PHASE LABEL === */
.ff-phase-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.ff-phase-inferno {
    background: linear-gradient(135deg, rgba(193, 42, 28, 0.2), rgba(232, 98, 26, 0.15));
    color: var(--ff-fire);
    border: 1px solid rgba(232, 98, 26, 0.2);
}

.ff-phase-forja {
    background: linear-gradient(135deg, rgba(184, 115, 51, 0.2), rgba(240, 192, 64, 0.15));
    color: var(--ff-gold);
    border: 1px solid rgba(240, 192, 64, 0.2);
}

/* === GRAPH / CHART AREA === */
.ff-chart-area {
    padding: 8px 0;
}

/* === ONBOARD / START === */
.ff-start-screen {
    text-align: center;
    padding: 40px 20px;
}

.ff-start-icon {
    font-size: 64px;
    margin-bottom: 12px;
    animation: ffStreakFire 2s ease infinite;
}

.ff-start-title {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, #e8621a, #f0c040);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.ff-start-desc {
    font-size: 15px;
    color: var(--ff-text2);
    line-height: 1.8;
    max-width: 340px;
    margin: 0 auto 24px;
}

/* === BACK BUTTON (top) === */
.ff-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--ff-text3);
    cursor: pointer;
    padding: 8px 16px;
    border: none;
    background: none;
    font-family: inherit;
}

.ff-back:active {
    color: var(--ff-fire);
}

/* === READING VIEW (journal entry) === */
.ff-reading {
    padding: 20px 16px;
}

.ff-reading-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--ff-fire);
    margin-bottom: 6px;
    line-height: 1.4;
}

.ff-reading-meta {
    font-size: 12px;
    color: var(--ff-text3);
    margin-bottom: 16px;
}

.ff-reading-body {
    font-size: 16px;
    color: var(--ff-text);
    line-height: 2;
    white-space: pre-wrap;
    word-wrap: break-word;
}