#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Carrossel de teste — Os 5 Animais Celestiais que moram na sua casa
Prof. Borrello — copy em 1a pessoa dele conversando com o seguidor

V2: substituindo SVGs de "desenho de bicho" por PICTOGRAMAS/CARACTERES chineses
+ diagramas de direcao (posicionamento). Fica mais autoral, mais pro estilo do
guia de estilo do Borrello (simbolismo + tipografia grande + amarelo neon).
Cada slide tem composicao DIFERENTE (feedback do Renato).

Tema: 5 Animais Celestiais (Dragão, Tigre, Tartaruga, Fênix, Serpente)
Copy: 1a pessoa, sem autoridade, sem citar curso.

7 slides, 1080x1350 cada.
"""
import os
from pathlib import Path
from playwright.sync_api import sync_playwright
import tempfile

OUT = Path("/opt/mia/workspace/clientes/borrello/criativos_ig_teste_v2_2026-09-18/carrossel_teste")
OUT.mkdir(parents=True, exist_ok=True)

W, H = 1080, 1350


def head():
    return f"""<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@400;500;600;700;800;900&family=Noto+Serif+SC:wght@400;700;900&display=swap" rel="stylesheet">
<style>
  * {{ margin: 0; padding: 0; box-sizing: border-box; }}
  html, body {{ margin: 0; padding: 0; overflow: hidden; width: {W}px; height: {H}px; font-family: 'Inter', sans-serif; }}
  .canvas {{ position: relative; width: {W}px; height: {H}px; overflow: hidden; }}

  .pill {{
    display: inline-flex; align-items: center; gap: 10px;
    border: 2px solid #F6E600; border-radius: 100px;
    padding: 12px 26px; background: #000;
    font-family: 'Inter', sans-serif; font-weight: 800; font-size: 22px;
    letter-spacing: 2px; color: #FFF;
  }}
  .h1 {{
    font-family: 'Anton', sans-serif; font-weight: 400;
    text-transform: uppercase; line-height: 1.02;
    letter-spacing: -0.5px; color: #FFF;
  }}
  .hl {{
    background: #F6E600; color: #111;
    padding: 4px 18px 10px 18px; border-radius: 8px;
    display: inline-block; line-height: 0.95; margin: 4px 0;
  }}
  .sub {{
    font-family: 'Inter'; font-weight: 500;
    font-size: 30px; line-height: 1.3; color: #EEE;
  }}
  .dash {{
    display: block; width: 60px; height: 4px; background: #F6E600;
    margin-bottom: 22px;
  }}
  .swipe {{
    position: absolute; right: 40px; bottom: 40px;
    display: flex; align-items: center; gap: 14px;
    font-family: 'Inter'; font-weight: 700; font-size: 22px;
    color: #F6E600; letter-spacing: 3px;
    text-transform: uppercase;
    z-index: 10;
  }}
  .swipe .arrow {{
    display: inline-flex; align-items: center; justify-content: center;
    width: 54px; height: 54px; border-radius: 50%;
    background: #F6E600; color: #000; font-size: 30px; font-weight: 900;
  }}
  .footer {{
    position: absolute; left: 40px; bottom: 40px;
    font-family: 'Inter'; font-weight: 600; font-size: 18px;
    color: rgba(255,255,255,0.7);
    letter-spacing: 2px;
    z-index: 10;
  }}
  .badge-num {{
    display: inline-block;
    background: transparent;
    border: 3px solid #F6E600;
    color: #F6E600;
    font-family: 'Anton'; font-size: 50px;
    padding: 6px 24px 10px;
    border-radius: 12px;
    line-height: 1;
  }}
  .dots-grid {{
    position: absolute;
    background-image: radial-gradient(#F6E600 2px, transparent 2px);
    background-size: 12px 12px;
    opacity: 0.5;
  }}
  .kanji {{
    font-family: 'Noto Serif SC', serif;
    font-weight: 900;
    line-height: 1;
  }}
</style>
</head><body>"""


def render(html, dest):
    tmp = tempfile.NamedTemporaryFile(mode="w", suffix=".html", delete=False, encoding="utf-8")
    tmp.write(html)
    tmp.close()
    with sync_playwright() as p:
        browser = p.chromium.launch()
        page = browser.new_page(viewport={"width": W, "height": H}, device_scale_factor=1)
        page.goto("file://" + tmp.name, wait_until="networkidle")
        page.wait_for_timeout(1200)
        page.screenshot(path=dest, clip={"x": 0, "y": 0, "width": W, "height": H})
        browser.close()
    os.unlink(tmp.name)
    print(f"  render OK -> {dest}")


# =============================================================================
# SLIDE 01 — CAPA
# Composicao: mapa de direcoes com kanjis dos 5 animais posicionados nas 5 direcoes
# =============================================================================
s1 = head() + """
<div class="canvas" style="background:
  radial-gradient(ellipse at 50% 60%, #1a1810 0%, #000 65%);">

  <!-- Textura de fundo -->
  <div class="dots-grid" style="right:60px; top:60px; width:100px; height:100px;"></div>
  <div class="dots-grid" style="left:60px; bottom:200px; width:80px; height:80px; opacity:0.35;"></div>

  <!-- Diagrama grande dos 5 animais com kanjis nas 5 direcoes -->
  <div style="position:absolute; left:50%; top:920px; transform:translate(-50%, -50%);
              width:520px; height:520px;">
    <!-- circulos concentricos -->
    <div style="position:absolute; left:0; top:0; width:520px; height:520px;
                border: 2px solid rgba(246,230,0,0.35); border-radius:50%;"></div>
    <div style="position:absolute; left:70px; top:70px; width:380px; height:380px;
                border: 1px dashed rgba(246,230,0,0.3); border-radius:50%;"></div>

    <!-- Fenix (FRENTE - topo) -->
    <div style="position:absolute; top:-10px; left:50%; transform:translateX(-50%);
                text-align:center;">
      <div class="kanji" style="font-size:80px; color:#F6E600;">朱</div>
      <div style="font-family:'Inter'; font-size:13px; font-weight:800; color:#F6E600;
                  letter-spacing:2px; margin-top:2px;">FÊNIX</div>
    </div>

    <!-- Tartaruga (ATRAS - baixo) -->
    <div style="position:absolute; bottom:-10px; left:50%; transform:translateX(-50%);
                text-align:center;">
      <div class="kanji" style="font-size:80px; color:#F6E600;">玄</div>
      <div style="font-family:'Inter'; font-size:13px; font-weight:800; color:#F6E600;
                  letter-spacing:2px; margin-top:2px;">TARTARUGA</div>
    </div>

    <!-- Dragao (ESQUERDA) -->
    <div style="position:absolute; top:50%; left:-10px; transform:translateY(-50%);
                text-align:center;">
      <div class="kanji" style="font-size:80px; color:#F6E600;">青</div>
      <div style="font-family:'Inter'; font-size:13px; font-weight:800; color:#F6E600;
                  letter-spacing:2px; margin-top:2px;">DRAGÃO</div>
    </div>

    <!-- Tigre (DIREITA) -->
    <div style="position:absolute; top:50%; right:-10px; transform:translateY(-50%);
                text-align:center;">
      <div class="kanji" style="font-size:80px; color:#F6E600;">白</div>
      <div style="font-family:'Inter'; font-size:13px; font-weight:800; color:#F6E600;
                  letter-spacing:2px; margin-top:2px;">TIGRE</div>
    </div>

    <!-- Serpente (CENTRO) -->
    <div style="position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
                text-align:center;">
      <div style="width:150px; height:150px; border-radius:50%; background:#F6E600;
                  display:flex; align-items:center; justify-content:center;
                  border: 4px solid #000;">
        <div class="kanji" style="font-size:80px; color:#111;">黄</div>
      </div>
      <div style="font-family:'Inter'; font-size:13px; font-weight:800; color:#F6E600;
                  letter-spacing:2px; margin-top:10px;">SERPENTE</div>
    </div>
  </div>

  <!-- Pill topo -->
  <div style="position:absolute; top:80px; left:60px;">
    <div class="pill">CARROSSEL <span style="color:#F6E600">•</span> ENERGIA DA CASA</div>
  </div>

  <!-- Headline principal (capa) -->
  <div style="position:absolute; top:220px; left:60px; right:60px;">
    <span class="dash"></span>
    <h1 class="h1" style="font-size: 108px;">
      <span class="hl">5 ANIMAIS</span><br>
      MORAM<br>
      NA SUA<br>
      CASA.
    </h1>
    <p class="sub" style="margin-top: 26px; font-size: 30px;">
      Você sabe <b>onde cada um fica</b>?
    </p>
  </div>

  <!-- Footer -->
  <div class="footer">@FRANCISCOBORRELLO</div>
  <div class="swipe">
    ARRASTA<div class="arrow">→</div>
  </div>
</div>
</body></html>
"""
render(s1, str(OUT / "slide_01_capa.png"))


# =============================================================================
# SLIDE 02 — DRAGÃO
# Composicao: kanji gigante à direita ocupando espaco visual + diagrama simplificado
# de casa com seta indicando "ESQUERDA"
# =============================================================================
s2 = head() + """
<div class="canvas" style="background:
  radial-gradient(ellipse at 75% 55%, #0d1a12 0%, #000 65%);">

  <div class="dots-grid" style="right:60px; top:60px; width:100px; height:100px;"></div>

  <!-- Kanji GIGANTE do Dragao (Verde) atras -->
  <div class="kanji" style="position:absolute; right:-40px; top:220px;
              font-size: 620px; color: #22c55e; opacity: 0.95;
              text-shadow: 0 0 60px rgba(34,197,94,0.6);
              line-height: 0.9;">龍</div>
  <div class="kanji" style="position:absolute; right:20px; top:820px;
              font-size: 60px; color: #F6E600; letter-spacing: 12px;">青龍</div>

  <!-- Mini diagrama de casa: seta indica esquerda -->
  <svg width="220" height="180" viewBox="0 0 220 180"
       style="position:absolute; left:60px; bottom:230px;">
    <!-- casa (contorno) -->
    <g fill="none" stroke="#F6E600" stroke-width="3" stroke-linejoin="round">
      <polygon points="110,20 190,70 190,160 30,160 30,70"/>
      <polyline points="30,70 110,20 190,70"/>
    </g>
    <!-- lado dragao (esquerda) - destaque -->
    <rect x="10" y="70" width="20" height="90" fill="#22c55e" opacity="0.85"/>
    <text x="20" y="55" fill="#22c55e" text-anchor="middle" font-family="Inter" font-size="16" font-weight="900">DRAGÃO</text>
    <!-- seta -->
    <path d="M 70 110 L 40 110" stroke="#F6E600" stroke-width="4" fill="none" marker-end="url(#a1)"/>
    <defs>
      <marker id="a1" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="8" markerHeight="8" orient="auto">
        <path d="M 0 0 L 10 5 L 0 10 z" fill="#F6E600"/>
      </marker>
    </defs>
  </svg>

  <!-- Numero + pill topo -->
  <div style="position:absolute; top:80px; left:60px; display:flex; align-items:center; gap:16px;">
    <div class="badge-num">01</div>
    <div class="pill">DRAGÃO <span style="color:#F6E600">•</span> ESQUERDA DA CASA</div>
  </div>

  <!-- Headline -->
  <div style="position:absolute; top:230px; left:60px; width:640px;">
    <span class="dash"></span>
    <h1 class="h1" style="font-size: 96px;">
      À<br>
      <span class="hl">ESQUERDA</span><br>
      MORA A<br>
      CORAGEM<br>
      DE CRESCER.
    </h1>
  </div>

  <!-- Corpo explicativo (embaixo, com espaco pra respirar) -->
  <div style="position:absolute; bottom:230px; left:320px; right:60px; max-width: 700px;">
    <p class="sub" style="font-size: 24px; line-height:1.35;">
      Olha sua casa <b>da rua</b>.<br>
      No seu lado <b>esquerdo</b><br>
      é o dragão. Precisa ser<br>
      <b>maior e mais alto</b> que<br>
      o lado direito.
    </p>
  </div>

  <div class="footer">@FRANCISCOBORRELLO • 01/06</div>
  <div class="swipe">
    <div class="arrow">→</div>
  </div>
</div>
</body></html>
"""
render(s2, str(OUT / "slide_02_dragao.png"))


# =============================================================================
# SLIDE 03 — TIGRE
# Composicao: espelhada — kanji gigante à esquerda, headline à direita
# =============================================================================
s3 = head() + """
<div class="canvas" style="background:
  radial-gradient(ellipse at 25% 55%, #1a1a1a 0%, #000 65%);">

  <div class="dots-grid" style="left:60px; top:60px; width:100px; height:100px;"></div>

  <!-- Kanji GIGANTE do Tigre (Branco) atras -->
  <div class="kanji" style="position:absolute; left:-40px; top:220px;
              font-size: 620px; color: #E5E5E5; opacity: 0.85;
              text-shadow: 0 0 60px rgba(255,255,255,0.4);
              line-height: 0.9;">虎</div>
  <div class="kanji" style="position:absolute; left:20px; top:820px;
              font-size: 60px; color: #F6E600; letter-spacing: 12px;">白虎</div>

  <!-- Mini diagrama de casa: lado direito destaque tigre -->
  <svg width="220" height="180" viewBox="0 0 220 180"
       style="position:absolute; right:60px; bottom:230px;">
    <g fill="none" stroke="#F6E600" stroke-width="3" stroke-linejoin="round">
      <polygon points="110,20 190,70 190,160 30,160 30,70"/>
      <polyline points="30,70 110,20 190,70"/>
    </g>
    <!-- lado tigre (direita) - destaque menor -->
    <rect x="190" y="90" width="20" height="70" fill="#E5E5E5" opacity="0.9"/>
    <text x="200" y="75" fill="#E5E5E5" text-anchor="middle" font-family="Inter" font-size="16" font-weight="900">TIGRE</text>
    <!-- seta -->
    <path d="M 150 130 L 180 130" stroke="#F6E600" stroke-width="4" fill="none" marker-end="url(#a2)"/>
    <defs>
      <marker id="a2" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="8" markerHeight="8" orient="auto">
        <path d="M 0 0 L 10 5 L 0 10 z" fill="#F6E600"/>
      </marker>
    </defs>
  </svg>

  <!-- Numero + pill topo (alinhado a direita) -->
  <div style="position:absolute; top:80px; right:60px; display:flex; align-items:center; gap:16px;">
    <div class="pill">TIGRE <span style="color:#F6E600">•</span> DIREITA DA CASA</div>
    <div class="badge-num">02</div>
  </div>

  <!-- Headline alinhada à direita -->
  <div style="position:absolute; top:230px; right:60px; width:640px; text-align:right;">
    <span class="dash" style="margin-left:auto;"></span>
    <h1 class="h1" style="font-size: 88px;">
      À<br>
      <span class="hl">DIREITA</span><br>
      DORME UM<br>
      TIGRE.<br>
      DEIXA ELE<br>
      <span class="hl">QUIETO</span>.
    </h1>
  </div>

  <!-- Corpo à esquerda embaixo -->
  <div style="position:absolute; bottom:230px; left:60px; right:320px; max-width: 700px;">
    <p class="sub" style="font-size: 24px; line-height:1.35;">
      O tigre é <b>força bruta</b>.<br>
      Se do lado <b>direito</b> tem<br>
      prédio grande, parede alta,<br>
      árvore imensa — <b>ele acorda</b>.<br>
      Traz briga pra dentro.
    </p>
  </div>

  <div class="footer">@FRANCISCOBORRELLO • 02/06</div>
  <div class="swipe">
    <div class="arrow">→</div>
  </div>
</div>
</body></html>
"""
render(s3, str(OUT / "slide_03_tigre.png"))


# =============================================================================
# SLIDE 04 — TARTARUGA
# Composicao NOVA: layout horizontal - headline em cima full-width, kanji ao centro
# com diagrama cabeceira embaixo. Cabeceira da cama diagrama.
# =============================================================================
s4 = head() + """
<div class="canvas" style="background:
  radial-gradient(ellipse at 50% 90%, #0f0f0f 0%, #000 60%);">

  <div class="dots-grid" style="right:60px; top:60px; width:100px; height:100px;"></div>
  <div class="dots-grid" style="left:60px; top:60px; width:80px; height:80px; opacity:0.35;"></div>

  <!-- Numero + pill topo -->
  <div style="position:absolute; top:80px; left:60px; display:flex; align-items:center; gap:16px;">
    <div class="badge-num">03</div>
    <div class="pill">TARTARUGA <span style="color:#F6E600">•</span> ATRÁS DE VOCÊ</div>
  </div>

  <!-- Headline (topo, full width) -->
  <div style="position:absolute; top:230px; left:60px; right:60px;">
    <span class="dash"></span>
    <h1 class="h1" style="font-size: 92px;">
      SEM APOIO<br>
      <span class="hl">ATRÁS</span>,<br>
      O SONO NÃO<br>
      <span class="hl">CURA</span>.
    </h1>
  </div>

  <!-- Diagrama grande: cabeceira ideal vs ruim -->
  <div style="position:absolute; top:820px; left:60px; right:60px; height:280px;
              display:grid; grid-template-columns:1fr 1fr; gap:30px;">
    <!-- BOM: parede solida -->
    <div style="border:2px solid #22c55e; border-radius:12px; padding:20px 16px;
                position:relative;">
      <div style="font-family:'Inter'; font-weight:800; font-size:16px; color:#22c55e;
                  letter-spacing:2px; margin-bottom:10px;">BOM</div>
      <svg viewBox="0 0 220 150" width="100%" height="150">
        <!-- parede solida atras -->
        <rect x="10" y="10" width="200" height="30" fill="#F6E600" opacity="0.8"/>
        <text x="110" y="30" text-anchor="middle" font-family="Inter" font-size="12" font-weight="900" fill="#111">PAREDE SÓLIDA</text>
        <!-- cama -->
        <rect x="40" y="70" width="140" height="60" fill="#666" stroke="#F6E600" stroke-width="2" rx="6"/>
        <rect x="55" y="55" width="30" height="25" fill="#999" stroke="#F6E600" stroke-width="1" rx="4"/>
        <rect x="135" y="55" width="30" height="25" fill="#999" stroke="#F6E600" stroke-width="1" rx="4"/>
      </svg>
    </div>
    <!-- RUIM: janela atras -->
    <div style="border:2px solid #DC2626; border-radius:12px; padding:20px 16px;
                position:relative;">
      <div style="font-family:'Inter'; font-weight:800; font-size:16px; color:#DC2626;
                  letter-spacing:2px; margin-bottom:10px;">RUIM</div>
      <svg viewBox="0 0 220 150" width="100%" height="150">
        <!-- janela vazada atras -->
        <rect x="10" y="10" width="200" height="30" fill="none" stroke="#DC2626" stroke-width="2" stroke-dasharray="6,4"/>
        <text x="110" y="30" text-anchor="middle" font-family="Inter" font-size="12" font-weight="900" fill="#DC2626">JANELA / CANO</text>
        <!-- cama -->
        <rect x="40" y="70" width="140" height="60" fill="#666" stroke="#DC2626" stroke-width="2" rx="6"/>
        <rect x="55" y="55" width="30" height="25" fill="#999" stroke="#DC2626" stroke-width="1" rx="4"/>
        <rect x="135" y="55" width="30" height="25" fill="#999" stroke="#DC2626" stroke-width="1" rx="4"/>
      </svg>
    </div>
  </div>

  <!-- Kanji ao lado da headline -->
  <div class="kanji" style="position:absolute; right:60px; top:250px;
              font-size: 240px; color: #F6E600; opacity: 0.35;
              line-height: 0.85;">龜</div>

  <div class="footer">@FRANCISCOBORRELLO • 03/06</div>
  <div class="swipe">
    <div class="arrow">→</div>
  </div>
</div>
</body></html>
"""
render(s4, str(OUT / "slide_04_tartaruga.png"))


# =============================================================================
# SLIDE 05 — FÊNIX
# Composicao: full-bleed com gradiente vermelho/dourado, kanji no topo
# Headline meio, corpo embaixo. Sem "desenho de fenix" (nao ficou bom antes)
# =============================================================================
s5 = head() + """
<div class="canvas" style="background:
  radial-gradient(ellipse at 50% 25%, #4a1010 0%, #200606 40%, #000 75%);">

  <div class="dots-grid" style="left:60px; bottom:220px; width:100px; height:100px;"></div>

  <!-- Kanji gigante topo centro -->
  <div class="kanji" style="position:absolute; left:50%; top:120px;
              transform:translateX(-50%);
              font-size: 360px; color: #F6E600; opacity: 0.95;
              text-shadow: 0 0 80px rgba(246,230,0,0.5);
              line-height: 0.85;">鳳</div>

  <!-- Raios saindo do kanji -->
  <svg width="1080" height="500" viewBox="0 0 1080 500"
       style="position:absolute; left:0; top:100px; opacity:0.35;">
    <g stroke="#F6E600" stroke-width="2" fill="none">
      <line x1="540" y1="250" x2="200" y2="80"/>
      <line x1="540" y1="250" x2="880" y2="80"/>
      <line x1="540" y1="250" x2="120" y2="250"/>
      <line x1="540" y1="250" x2="960" y2="250"/>
      <line x1="540" y1="250" x2="200" y2="450"/>
      <line x1="540" y1="250" x2="880" y2="450"/>
    </g>
  </svg>

  <!-- Numero + pill topo -->
  <div style="position:absolute; top:80px; right:60px; display:flex; align-items:center; gap:16px;">
    <div class="pill">FÊNIX <span style="color:#F6E600">•</span> FRENTE DA CASA</div>
    <div class="badge-num">04</div>
  </div>

  <!-- Headline embaixo do kanji -->
  <div style="position:absolute; top:600px; left:60px; right:60px; text-align:center;">
    <div style="width:60px; height:4px; background:#F6E600; margin:0 auto 24px;"></div>
    <h1 class="h1" style="font-size: 88px;">
      NA <span class="hl">FRENTE</span>,<br>
      A FÊNIX PRECISA<br>
      DE <span class="hl">ESPAÇO</span><br>
      PRA VOAR.
    </h1>
  </div>

  <!-- Corpo texto centro -->
  <div style="position:absolute; bottom:230px; left:60px; right:60px; text-align:center;">
    <p class="sub" style="font-size: 26px; line-height:1.35;">
      Prédio colado, muro alto,<br>
      garagem fechada = <b>fênix presa</b>.<br>
      Oportunidade não chega.
    </p>
  </div>

  <div class="footer">@FRANCISCOBORRELLO • 04/06</div>
  <div class="swipe">
    <div class="arrow">→</div>
  </div>
</div>
</body></html>
"""
render(s5, str(OUT / "slide_05_fenix.png"))


# =============================================================================
# SLIDE 06 — SERPENTE
# Composicao: kanji amarelo gigante no centro (dominante), headline em volta
# =============================================================================
s6 = head() + """
<div class="canvas" style="background:
  radial-gradient(ellipse at 50% 50%, #2a2010 0%, #000 65%);">

  <div class="dots-grid" style="left:60px; top:60px; width:80px; height:80px; opacity:0.35;"></div>
  <div class="dots-grid" style="right:60px; bottom:220px; width:100px; height:100px;"></div>

  <!-- Circulo amarelo grande centro -->
  <div style="position:absolute; left:50%; top:720px; transform:translate(-50%,-50%);
              width:520px; height:520px; border-radius:50%;
              background: radial-gradient(circle, #F6E600 0%, #B8860B 75%, #6B5008 100%);
              box-shadow: 0 0 100px rgba(246,230,0,0.5);
              display:flex; align-items:center; justify-content:center;">
    <div class="kanji" style="font-size: 380px; color: #111; line-height: 0.85;">蛇</div>
  </div>

  <!-- Numero + pill topo -->
  <div style="position:absolute; top:80px; left:60px; display:flex; align-items:center; gap:16px;">
    <div class="badge-num">05</div>
    <div class="pill">SERPENTE <span style="color:#F6E600">•</span> O CENTRO É VOCÊ</div>
  </div>

  <!-- Headline topo -->
  <div style="position:absolute; top:220px; left:60px; right:60px;">
    <span class="dash"></span>
    <h1 class="h1" style="font-size: 96px;">
      NO CENTRO<br>
      DA CASA<br>
      MORA <span class="hl">VOCÊ</span>.
    </h1>
  </div>

  <!-- Sub embaixo -->
  <div style="position:absolute; bottom:220px; left:60px; right:60px; text-align:center;">
    <p class="sub" style="font-size: 26px; line-height:1.35;">
      Miolo escuro, entulhado ou<br>
      apertado? É <b>isso</b> que vira o<br>
      centro da sua vida.
    </p>
  </div>

  <div class="footer">@FRANCISCOBORRELLO • 05/06</div>
  <div class="swipe">
    <div class="arrow">→</div>
  </div>
</div>
</body></html>
"""
render(s6, str(OUT / "slide_06_serpente.png"))


# =============================================================================
# SLIDE 07 — CTA final
# Composicao: 5 cards com nome+direcao dos 5 animais + CTA amarelo grande
# =============================================================================
s7 = head() + """
<div class="canvas" style="background:
  radial-gradient(ellipse at 50% 50%, #1c1a12 0%, #000 65%);">

  <div class="dots-grid" style="right:60px; top:60px; width:100px; height:100px;"></div>

  <!-- Pill topo -->
  <div style="position:absolute; top:80px; left:60px;">
    <div class="pill">RESUMO <span style="color:#F6E600">•</span> AGORA É COM VOCÊ</div>
  </div>

  <!-- Headline -->
  <div style="position:absolute; top:200px; left:60px; right:60px;">
    <span class="dash"></span>
    <h1 class="h1" style="font-size: 84px;">
      VAI EM <span class="hl">CASA</span><br>
      AGORA E<br>
      REPARA:<br>
      QUEM ESTÁ<br>
      <span class="hl">ONDE</span>?
    </h1>
  </div>

  <!-- Grade dos 5 animais (mini resumo) -->
  <div style="position:absolute; top:850px; left:60px; right:60px;
              display:grid; grid-template-columns: repeat(5, 1fr); gap:8px;">
    <div style="text-align:center; padding:8px 4px; background:rgba(34,197,94,0.15);
                border:1px solid rgba(34,197,94,0.5); border-radius:8px;">
      <div class="kanji" style="font-size:36px; color:#22c55e; line-height:1;">龍</div>
      <div style="font-family:'Inter'; font-size:11px; font-weight:800; color:#22c55e;
                  letter-spacing:1px; margin-top:6px;">DRAGÃO</div>
      <div style="font-family:'Inter'; font-size:10px; color:#EEE; margin-top:2px;">esq</div>
    </div>
    <div style="text-align:center; padding:8px 4px; background:rgba(229,229,229,0.15);
                border:1px solid rgba(229,229,229,0.5); border-radius:8px;">
      <div class="kanji" style="font-size:36px; color:#E5E5E5; line-height:1;">虎</div>
      <div style="font-family:'Inter'; font-size:11px; font-weight:800; color:#E5E5E5;
                  letter-spacing:1px; margin-top:6px;">TIGRE</div>
      <div style="font-family:'Inter'; font-size:10px; color:#EEE; margin-top:2px;">dir</div>
    </div>
    <div style="text-align:center; padding:8px 4px; background:rgba(146,146,146,0.15);
                border:1px solid rgba(200,200,200,0.5); border-radius:8px;">
      <div class="kanji" style="font-size:36px; color:#F6E600; line-height:1;">龜</div>
      <div style="font-family:'Inter'; font-size:11px; font-weight:800; color:#F6E600;
                  letter-spacing:1px; margin-top:6px;">TARTA-<br>RUGA</div>
      <div style="font-family:'Inter'; font-size:10px; color:#EEE; margin-top:2px;">atrás</div>
    </div>
    <div style="text-align:center; padding:8px 4px; background:rgba(220,38,38,0.15);
                border:1px solid rgba(220,38,38,0.5); border-radius:8px;">
      <div class="kanji" style="font-size:36px; color:#DC2626; line-height:1;">鳳</div>
      <div style="font-family:'Inter'; font-size:11px; font-weight:800; color:#DC2626;
                  letter-spacing:1px; margin-top:6px;">FÊNIX</div>
      <div style="font-family:'Inter'; font-size:10px; color:#EEE; margin-top:2px;">frente</div>
    </div>
    <div style="text-align:center; padding:8px 4px; background:rgba(246,230,0,0.2);
                border:1px solid #F6E600; border-radius:8px;">
      <div class="kanji" style="font-size:36px; color:#F6E600; line-height:1;">蛇</div>
      <div style="font-family:'Inter'; font-size:11px; font-weight:800; color:#F6E600;
                  letter-spacing:1px; margin-top:6px;">SER-<br>PENTE</div>
      <div style="font-family:'Inter'; font-size:10px; color:#EEE; margin-top:2px;">centro</div>
    </div>
  </div>

  <!-- CTA em cima do bloco IG -->
  <div style="position:absolute; bottom:160px; left:60px; right:60px;">
    <p style="font-family:'Inter'; font-weight:600; font-size:24px; color:#EEE;
              text-align:center; line-height:1.35; margin-bottom: 20px;">
      <b>Salva</b> pra lembrar. <b>Comenta</b> qual está mais fraco.
    </p>
    <div style="background: #F6E600; color: #000; text-align: center;
                padding: 22px 20px; border-radius: 12px;
                font-family: 'Inter'; font-weight: 900; font-size: 28px;
                text-transform: uppercase; letter-spacing: 1px;">
      TESTA A CASA — LINK NA BIO
    </div>
  </div>

  <div class="footer">@FRANCISCOBORRELLO • 06/06</div>
</div>
</body></html>
"""
render(s7, str(OUT / "slide_07_cta.png"))

print("\nOK, 7 slides do carrossel renderizados em:", OUT)
