/* =====================================================
== 1. VARIÁVEIS E ESTILOS GLOBAIS
=====================================================
*/
:root {
    --bg-color: #f2f6ff;
    --text-color: #1d1f2b;
    --accent-color: #5865f2;
    --accent-color-soft: rgba(88, 101, 242, 0.2);
    --card-bg: #ffffff;
    --border-color: rgba(29, 31, 43, 0.08);
    --shadow-color: rgba(21, 21, 56, 0.15);
    --primary-font: 'Nunito', Arial, sans-serif;
    --title-font: 'Playfair Display', serif;
}

[data-theme="aurora"] {
    --bg-color: #0b1021;
    --text-color: #f8fbff;
    --card-bg: rgba(13, 21, 43, 0.9);
    --border-color: rgba(248, 251, 255, 0.1);
    --shadow-color: rgba(8, 12, 26, 0.7);
}

[data-contrast="high"] {
    --bg-color: #0a0a0a;
    --text-color: #fdfdfd;
    --card-bg: #101010;
    --border-color: #ffffff;
    --accent-color: #f97316;
    --accent-color-soft: rgba(249, 115, 22, 0.25);
    --shadow-color: rgba(0, 0, 0, 0.7);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--primary-font);
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    padding: 0;
    padding-top: 120px; /* Espaço para o header fixo */
    padding-bottom: clamp(1.5rem, 2vw + 1rem, 3rem);
    position: relative;
    overflow-y: auto;
}

/* =====================================================
== 2. FUNDO ANIMADO (Partículas)
=====================================================
*/
.background-glow {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(88, 101, 242, 0.18), transparent 55%),
                radial-gradient(circle at 80% 30%, rgba(251, 191, 36, 0.14), transparent 60%),
                radial-gradient(circle at 50% 80%, rgba(56, 189, 248, 0.16), transparent 60%);
    z-index: -3;
    opacity: 0.7;
}

[data-theme="aurora"] .background-glow {
    background: radial-gradient(circle at 20% 20%, rgba(88, 101, 242, 0.3), transparent 55%),
                radial-gradient(circle at 80% 30%, rgba(251, 191, 36, 0.2), transparent 60%),
                radial-gradient(circle at 50% 80%, rgba(56, 189, 248, 0.25), transparent 60%);
}

.particle-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    bottom: -20px;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 20s linear infinite;
}

.particle:nth-child(3n) { animation-duration: 25s; animation-delay: -5s; }
.particle:nth-child(4n) { animation-duration: 30s; animation-delay: -10s; }
.particle:nth-child(5n) { animation-duration: 15s; animation-delay: -3s; }

@keyframes particleFloat {
    from {
        transform: translate3d(var(--x-start), 0, 0);
        opacity: 0.3;
    }
    to {
        transform: translate3d(var(--x-end), -100vh, 0);
        opacity: 0;
    }
}

/* =====================================================
== 3. LAYOUT PRINCIPAL (Cabeçalho, Livro, Controles)
=====================================================
*/
.top-bar {
    width: 100%;
    max-width: 100vw;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background: var(--card-bg);
    border-radius: 0;
    padding: 1rem 2rem;
    border: none;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    backdrop-filter: blur(12px);
    z-index: 1000;
}

.top-bar:hover {
    box-shadow: 0 6px 30px var(--shadow-color);
}

/* Container interno do header para limitar largura */
.top-bar .brand,
.top-bar .actions {
    flex: 1;
    min-width: 200px;
}

.top-bar .brand {
    max-width: 500px;
}

.top-bar .actions {
    max-width: 700px;
    justify-content: flex-end;
}

.brand h1 {
    margin: 0;
    font-family: var(--title-font);
    font-size: clamp(1.5rem, 2vw + 1rem, 2.2rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand p {
    margin: 0.4rem 0 0;
    opacity: 0.75;
    font-size: clamp(0.85rem, 1vw + 0.4rem, 1rem);
    letter-spacing: 0.3px;
}

.actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.action-button {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.7rem 1.3rem;
    background: var(--card-bg);
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.action-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.action-button:hover::before {
    left: 100%;
}

.action-button:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 8px 20px var(--accent-color-soft);
}

.action-button[aria-pressed="true"] {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px var(--accent-color-soft);
}

[data-theme="aurora"] .action-button:hover,
[data-theme="aurora"] .action-button[aria-pressed="true"] {
    color: var(--bg-color);
}
[data-contrast="high"] .action-button:hover,
[data-contrast="high"] .action-button[aria-pressed="true"] {
    color: var(--bg-color);
}


.stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 1800px; /* Aumentado para ocupar mais espaço lateral */
    margin: 0 auto;
}

.book-container {
    width: 100%;
    max-width: 1800px; /* Container maior para o livro */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.book-area {
    position: relative;
    width: 100%;
    max-width: 1600px; /* Área do livro maior */
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.book-wrapper {
    position: relative;
    /* Os tamanhos do flipbook são definidos no JS */
}

.book-shadow {
    position: absolute;
    bottom: -20px;
    left: 5%;
    width: 90%;
    height: 40px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    opacity: 0.7;
}

.reader-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: min(600px, 90vw);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1rem 1.5rem;
    box-shadow: 0 18px 40px var(--shadow-color);
}

.ghost-btn, .primary-btn {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.6rem 1.2rem;
    background: var(--accent-color-soft);
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}
.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--shadow-color);
}

.ghost-btn:hover {
    background: var(--card-bg);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.reader-progress {
    text-align: center;
    flex-grow: 1;
    padding: 0 1rem;
}

.progress-label {
    margin: 0 0 0.4rem 0;
    font-size: 0.8rem;
    opacity: 0.7;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: var(--accent-color-soft);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    display: block;
    width: 0%;
    height: 100%;
    background: var(--accent-color);
    border-radius: inherit;
    transition: width 0.35s ease;
}

.page-indicator {
    font-size: 0.85rem;
    margin-top: 0.4rem;
    opacity: 0.8;
}

/* =====================================================
== 4. ESTILOS DO LIVRO E DAS PÁGINAS
=====================================================
*/
.flipbook {
    box-shadow: 0 25px 60px var(--shadow-color);
    /* O tamanho (width/height) é definido no app.js */
}

.flipbook .page {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    overflow: hidden; /* Garante que o conteúdo não vaze */
}

.flipbook .page--cover {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.15), rgba(236, 72, 153, 0.12)), var(--card-bg);
}

.flipbook .page--end {
    background: var(--card-bg);
}

.page-content {
    height: 100%;
    padding: clamp(2rem, 2.5vw + 1rem, 3rem); /* Aumentado padding para mais espaço interno */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    overflow-x: hidden; /* Evita overflow horizontal */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color-soft) transparent;
    box-sizing: border-box; /* Garante que padding não cause overflow */
}

.page-content::-webkit-scrollbar { width: 6px; }
.page-content::-webkit-scrollbar-thumb {
    background: var(--accent-color-soft);
    border-radius: 999px;
}

.page h2, .page h3 {
    margin: 0;
    font-family: var(--title-font);
    font-size: clamp(1.6rem, 2.2vw + 1rem, 2.5rem); /* Aumentado */
    line-height: 1.3;
}
.page h2.book-title {
    font-size: clamp(2.2rem, 3.5vw + 1rem, 3.5rem); /* Aumentado */
}

.page p {
    margin: 0;
    line-height: 1.7; /* Aumentado para melhor legibilidade */
    font-size: clamp(1rem, 1.1vw + 0.5rem, 1.15rem); /* Aumentado */
}

.page .lead {
    font-size: clamp(1.1rem, 1.2vw + 0.6rem, 1.3rem); /* Aumentado */
    font-weight: 600;
}

.page .signature {
    font-style: italic;
    opacity: 0.9;
    margin-top: auto;
}

.tagline {
    font-style: italic;
    opacity: 0.85;
}

.cta-button {
    align-self: flex-start;
    margin-top: auto;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    border: none;
    background: var(--accent-color);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.cta-button:hover {
    transform: translateY(-3px);
}

.guide-list {
    margin: 0;
    padding-left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.guide-list li { line-height: 1.4; }
.hint { font-size: 0.9rem; opacity: 0.7; }

/* =====================================================
== 4.1. ESTILOS MODERNOS PARA PÁGINAS CENTRALIZADAS
=====================================================
*/

/* Conteúdo centralizado verticalmente */
.page-content--centered {
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* === CAPA MODERNA === */
.cover-ornament {
    font-size: 2rem;
    color: var(--accent-color);
    opacity: 0.6;
    animation: ornamentPulse 3s ease-in-out infinite;
}

.cover-ornament--bottom {
    margin-top: 2rem;
    animation-delay: 1.5s;
}

@keyframes ornamentPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.cover-title {
    font-size: clamp(2.5rem, 4vw + 1rem, 4rem) !important;
    font-weight: 700;
    line-height: 1.2;
    margin: 1rem 0 !important;
    background: linear-gradient(135deg, var(--accent-color), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlight-text {
    display: block;
    font-size: 1.2em;
    font-weight: 800;
}

.cover-divider {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    margin: 1.5rem 0;
    border-radius: 999px;
}

.cover-subtitle {
    font-size: clamp(0.9rem, 1vw + 0.5rem, 1.1rem) !important;
    line-height: 1.8;
    opacity: 0.8;
    margin: 1rem 0 !important;
}

.cover-subtitle strong {
    color: var(--accent-color);
    font-weight: 700;
}

.tagline {
    font-style: italic;
    opacity: 0.75;
    font-size: clamp(0.95rem, 1vw + 0.5rem, 1.05rem) !important;
    line-height: 1.6;
    margin: 1rem 0 2rem !important;
}

/* Botão CTA Moderno */
.cta-button--modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--accent-color), #7c3aed);
    box-shadow: 0 8px 20px var(--accent-color-soft);
    transition: all 0.3s ease;
    margin-top: 1.5rem;
}

.cta-button--modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px var(--accent-color-soft);
}

.cta-button--modern svg {
    transition: transform 0.3s ease;
}

.cta-button--modern:hover svg {
    transform: translateX(4px);
}

/* === CARTA DE ABERTURA === */
.letter-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.letter-icon {
    font-size: 2.5rem;
}

.letter-header h3 {
    margin: 0;
    font-size: clamp(1.8rem, 2.5vw + 1rem, 2.5rem);
    color: var(--accent-color);
}

.letter-text {
    text-align: left;
    max-width: 90%;
    line-height: 1.8 !important;
    margin: 0.8rem 0 !important;
}

.inline-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--accent-color-soft);
    color: var(--accent-color);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
}

.signature {
    margin-top: 2rem !important;
    text-align: center;
    font-style: italic;
    opacity: 0.9;
    position: relative;
    padding-top: 1rem;
}

.signature-line {
    display: block;
    width: 100px;
    height: 2px;
    background: var(--accent-color);
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* === INSTRUÇÕES === */
.instructions-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.instructions-icon {
    font-size: 2.5rem;
}

.instructions-header h3 {
    margin: 0;
    font-size: clamp(1.8rem, 2.5vw + 1rem, 2.5rem);
    color: var(--accent-color);
}

.guide-list--modern {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
    width: 100%;
    max-width: 500px;
}

.guide-list--modern li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--accent-color-soft);
    border-left: 3px solid var(--accent-color);
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.guide-list--modern li:hover {
    transform: translateX(4px);
}

.list-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.hint--modern {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(249, 115, 22, 0.1));
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    text-align: left;
    max-width: 500px;
}

.hint--modern p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hint-icon {
    font-size: 1.3rem;
}

/* =====================================================
== 5. ESTILOS DOS COMPONENTES (Poemas, Jardim, etc.)
=====================================================
*/

/* --- Poemas --- */
.poem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    color: var(--accent-color);
    opacity: 0.8;
}

.bookmark-button {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.45rem 3rem;
    background: var(--card-bg);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.25s ease;
    margin: 0 20%;
}

.bookmark-button[aria-pressed="true"] {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

.bookmark-button:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px var(--accent-color-soft);
}

.poem-title {
    font-family: var(--title-font);
    font-size: clamp(1.6rem, 2.2vw + 0.8rem, 2.2rem); /* Ajustado para evitar corte */
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--accent-color);
    line-height: 1.2; /* Reduzido para títulos longos */
    word-wrap: break-word; /* Quebra palavras longas */
    overflow-wrap: break-word;
}

.poem-author {
    font-size: clamp(0.95rem, 1.1vw + 0.5rem, 1.15rem); /* Ajustado */
    font-style: italic;
    opacity: 0.8;
    margin: 0 0 1.5rem 0;
}

.poem-body {
    flex: 1;
    line-height: 1.75; /* Aumentado */
    font-size: clamp(1rem, 1.05vw + 0.5rem, 1.12rem); /* Ajustado */
    overflow-y: auto; /* Permite scroll se o conteúdo for muito grande */
}

.poem-body p {
    margin: 0 0 1rem 0;
}

.poem-body p:last-child {
    margin-bottom: 0;
}

.poem-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.poem-ornament {
    font-size: 1.5rem;
    color: var(--accent-color);
    opacity: 0.4;
}

/* --- Placeholders Editáveis --- */
.poem-title,
.poem-author,
.poem-body,
.poem-note,
.inspiration-card,
.reader-reflection {
    border: 1px dashed transparent;
    border-radius: 12px;
    padding: 0.4rem 0.6rem;
    transition: border 0.2s ease, background 0.2s ease;
}
[contenteditable="true"]:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--accent-color-soft);
}
.poem-body p {
    margin-bottom: 0.8rem;
}
.poem-footer {
    margin-top: auto;
}

/* --- Mural de Afeto --- */
.inspirations {
    gap: 1.5rem;
}

.inspiration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 600px;
}

.inspiration-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-color-soft), rgba(236, 72, 153, 0.1));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.05rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: default;
}

[data-theme="aurora"] .inspiration-card,
[data-contrast="high"] .inspiration-card {
    background: rgba(255, 255, 255, 0.08);
}

/* --- Jardim de Sementes --- */
.seed-garden {
    position: relative;
    min-width: 250px;
    min-height: 220px;
    border-radius: 18px;
    border: 1px dashed rgba(88, 101, 242, 0.45);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), var(--accent-color-soft) 60%, rgba(250, 204, 21, 0.25));
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}
[data-theme="aurora"] .seed-garden {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), var(--accent-color-soft) 60%, rgba(250, 204, 21, 0.25));
}
.seed-garden:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-color-soft);
}
.seed-garden__hint {
    color: var(--text-color);
    opacity: 0.65;
    font-weight: 600;
    text-align: center;
}
.garden-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
}
.garden-button {
    align-self: flex-start;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--accent-color-soft);
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, border 0.2s ease;
}
.garden-button:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
}
.garden-note {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.75;
}
.seed {
    position: absolute;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(249, 115, 22, 0.6));
    border-radius: 45% 55% 50% 50%;
    transform-origin: center bottom;
    animation: seedGrow 0.9s ease-out forwards, seedSway 6s ease-in-out infinite 0.9s;
    transition: all 0.5s ease-in-out;
}
.seed::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, rgba(56, 189, 248, 0) 70%);
    opacity: 0.6;
}
.seed.is-bloomed {
    /* Esconde o conteúdo do span original e mostra o emoji via ::before */
    font-size: 0; /* Ou display: none; */
}

.seed.is-bloomed::before {
    content: attr(data-flower); /* Pega o emoji do atributo data-flower */
    position: absolute;
    font-size: 2.5em; /* Tamanho maior para a flor */
    line-height: 1; /* Para evitar espaçamento extra */
    transform: translate(-50%, -50%) scale(0.5); /* Começa pequeno */
    animation: bloomEffect 0.8s ease-out forwards; /* Animação de "florescer" */
    display: block; /* Garante que o pseudo-elemento seja visível */
}

/* Animação para o florescimento */
@keyframes bloomEffect {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    70% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Se você quiser que o broto inicial seja visível antes de florescer */
.seed::before {
    content: '🌱'; /* Um brotinho padrão antes de florescer */
    position: absolute;
    font-size: 1em;
    line-height: 1;
    display: block;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

.seed.is-bloomed::before {
    opacity: 1;
}

.seed.is-bloomed > span { /* Esconde o conteúdo original do span para mostrar o ::before */
    display: none;
}
.seed.variant-bloom { background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.95), rgba(168, 85, 247, 0.6)); }
.seed.variant-sunrise { background: radial-gradient(circle at 45% 45%, rgba(255, 255, 255, 0.95), rgba(234, 179, 8, 0.65)); }
.seed.variant-ocean { background: radial-gradient(circle at 45% 45%, rgba(255, 255, 255, 0.95), rgba(59, 130, 246, 0.6)); }
.seed-shadow {
    position: absolute;
    width: 40px;
    height: 12px;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: shadowFade 1.1s ease-out forwards;
}
@keyframes seedGrow {
    0% { transform: translate(-50%, 20%) scale(0); opacity: 0; }
    40% { transform: translate(-50%, -10%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -40%) scale(1); opacity: 1; }
}
@keyframes seedSway {
    0%, 100% { transform: translate(-50%, -40%) rotate(-2deg); }
    50% { transform: translate(-50%, -44%) rotate(3deg); }
}
@keyframes shadowFade {
    0% { opacity: 0; transform: translate(-50%, 20%) scale(0.4); }
    100% { opacity: 0.35; transform: translate(-50%, 20%) scale(1); }
}

/* --- Celebração --- */
.reader-reflection {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--accent-color-soft);
}
[data-theme="aurora"] .reader-reflection,
[data-contrast="high"] .reader-reflection {
    background: rgba(255, 255, 255, 0.1);
}
.celebrate-button {
    align-self: flex-start;
    padding: 0.75rem 1.4rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f97316, #facc15);
    color: #1d1f2b;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-left: 27%;
}
.celebrate-button:hover {
    transform: translateY(-3px) scale(1.02);
}

/* =====================================================
== 6. OVERLAYS (Respiração, Confete, Tooltip)
=====================================================
*/
.calm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 19, 36, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.2rem;
    color: #f0f6ff;
    z-index: 100;
    text-align: center;
    padding: 1rem;
    backdrop-filter: blur(10px);
}
.calm-overlay__pulse {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.35), transparent 70%);
    animation: calmPulse 5s ease-in-out infinite;
}
@keyframes calmPulse {
    0%, 100% { transform: scale(0.85); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
}
body.is-calm .calm-overlay {
    display: flex;
}

.celebration-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 110;
}

.tooltip {
    position: fixed; /* 'fixed' é melhor que 'absolute' para tooltips */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 0.8rem;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    font-size: 0.85rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 120;
}
.tooltip.is-active {
    opacity: 1;
    transform: translateY(0);
}

/* Leitor de tela */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =====================================================
== 7. RESPONSIVIDADE
=====================================================
*/
@media (max-width: 900px) {
    body {
        padding: 1rem;
        gap: 1rem;
    }
    .top-bar {
        position: static; /* Deixa de ser sticky */
        width: 100%;
    }
    .brand h1 { font-size: 1.5rem; }
    .brand p { font-size: 0.8rem; }
    
    .reader-controls {
        width: 100%;
        padding: 0.75rem;
    }
    .ghost-btn, .primary-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    .reader-progress { padding: 0 0.5rem; }
    
    /* A biblioteca page-flip cuida do layout do livro em mobile */
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
