/* ============================================
   LIÇÃO — Premium Lesson Renderer
   ============================================ */

.licao-page {
    background: var(--white);
}

/* ---- HERO ---- */
.licao-hero {
    position: relative;
    min-height: 45vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a0a0a 0%, color-mix(in srgb, var(--cor) 20%, #1a1a2e) 50%, #0a0a1a 100%);
    overflow: hidden;
    text-align: center;
    padding: 5rem 2rem 3rem;
}

.licao-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, color-mix(in srgb, var(--cor) 15%, transparent) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 50%, rgba(212, 160, 23, 0.08) 0%, transparent 50%);
}

.licao-hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.licao-hero .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    transition: color 0.3s;
}

.licao-hero .back-link:hover { color: #fff; }

.licao-numero {
    display: inline-block;
    padding: 0.35rem 1.2rem;
    background: var(--cor);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.licao-titulo {
    font-family: var(--font-chinese), var(--font-display);
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: #fff;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.licao-subtitulo {
    color: rgba(255,255,255,0.55);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.licao-meta-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}

.meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
}

/* Progress bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 1000;
    background: rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--cor, #C41E3A), #D4A017);
    transition: width 0.15s ease;
}

/* ---- NAV LATERAL ---- */
.secao-nav {
    position: fixed;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.secao-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-label {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

.secao-nav-item:hover .nav-label,
.secao-nav-item.active .nav-label {
    opacity: 1;
    transform: translateX(0);
}

.secao-nav-item.active .nav-dot {
    border-color: var(--red-primary);
    background: var(--red-primary);
    box-shadow: 0 0 8px rgba(196, 30, 58, 0.4);
}

/* ---- MAIN LAYOUT ---- */
.licao-main {
    position: relative;
}

.licao-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 2rem;
}

.secao {
    padding: 5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.secao:last-child {
    border-bottom: none;
}

.secao-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.secao-icon {
    font-size: 2rem;
}

.secao-header h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--ink);
}

.secao-desc {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* ---- INTRODUÇÃO ---- */
.secao-intro-card {
    background: linear-gradient(135deg, var(--paper) 0%, #fff 100%);
    padding: 3rem;
    border: 1px solid var(--paper-dark);
    text-align: center;
    position: relative;
}

.intro-ornament {
    font-family: var(--font-chinese);
    font-size: 1rem;
    color: var(--red-primary);
    letter-spacing: 0.3em;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.secao-intro-card h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--ink);
    margin-bottom: 1.5rem;
}

.secao-intro-card p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
    max-width: 600px;
    margin: 0 auto;
}

/* ---- CONCEITO ---- */
.conceito-body p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.conceito-destaque {
    background: var(--paper);
    border-left: 4px solid var(--gold);
    padding: 1.2rem 1.5rem;
    font-size: 0.95rem;
    color: var(--ink);
    margin-bottom: 1.5rem;
    position: relative;
}

.destaque-label {
    display: inline-block;
    background: var(--gold);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.exemplo-inline {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--ink);
    color: #fff;
}

.exemplo-char {
    font-family: var(--font-chinese);
    font-size: 2.5rem;
    font-weight: 700;
}

.exemplo-pinyin {
    font-size: 1.1rem;
    color: var(--gold-light);
}

.exemplo-sig {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}

/* ---- TONS ---- */
.tons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.tom-card {
    padding: 2rem;
    border: 1px solid #eee;
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.tom-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--tom-cor);
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

.tom-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.06);
    border-color: transparent;
}

.tom-card:hover::after {
    transform: scaleX(1);
}

.tom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.tom-numero {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.tom-visual {
    font-size: 1.8rem;
    opacity: 0.5;
}

.tom-card h3 {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.tom-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tom-exemplo {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.tom-pinyin {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ink);
}

.tom-char {
    font-family: var(--font-chinese);
    font-size: 2rem;
    font-weight: 700;
}

.tom-sig {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---- VOCABULÁRIO ---- */
.vocab-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.vocab-card {
    padding: 1.8rem;
    border: 1px solid #eee;
    transition: all 0.5s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.vocab-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--red-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.vocab-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.06);
    border-color: transparent;
}

.vocab-card:hover::before {
    transform: scaleX(1);
}

.vocab-main {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.vocab-char {
    font-family: var(--font-chinese);
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--ink);
    line-height: 1;
}

.vocab-pinyin {
    font-size: 1rem;
    color: var(--red-primary);
    font-weight: 500;
}

.vocab-sig {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.vocab-tipo {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    background: var(--paper);
    padding: 0.15rem 0.5rem;
    margin-bottom: 0.5rem;
}

.vocab-tracos {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.vocab-frase {
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.vf-cn {
    display: block;
    font-family: var(--font-chinese);
    font-size: 1.1rem;
    color: var(--ink);
}

.vf-pinyin {
    display: block;
    font-size: 0.85rem;
    color: var(--red-primary);
    margin-bottom: 0.2rem;
}

.vf-pt {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ---- DIÁLOGO ---- */
.dialogo-personagens {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.personagem-tag {
    padding: 0.6rem 1rem;
    background: var(--paper);
    border: 1px solid var(--paper-dark);
    font-size: 0.85rem;
}

.dialogo-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dialogo-linha {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.dialogo-linha.lado-esquerdo {
    align-self: flex-start;
}

.dialogo-linha.lado-direito {
    align-self: flex-end;
    text-align: right;
}

.dl-nome {
    font-family: var(--font-chinese);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    letter-spacing: 0.05em;
}

.dl-balao {
    background: var(--paper);
    padding: 1.2rem 1.5rem;
    border: 1px solid var(--paper-dark);
    position: relative;
}

.lado-direito .dl-balao {
    background: color-mix(in srgb, var(--red-primary) 6%, #fff);
    border-color: color-mix(in srgb, var(--red-primary) 12%, #eee);
}

.dl-cn {
    font-family: var(--font-chinese);
    font-size: 1.3rem;
    color: var(--ink);
    margin-bottom: 0.3rem;
}

.dl-pinyin {
    font-size: 0.85rem;
    color: var(--red-primary);
    margin-bottom: 0.3rem;
}

.dl-pt {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.dl-nota {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed rgba(0,0,0,0.1);
    font-size: 0.8rem;
    color: var(--gold);
    font-weight: 500;
}

/* ---- GRAMÁTICA ---- */
.gramatica-regras {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.regra-card {
    padding: 2rem;
    border: 1px solid #eee;
    transition: all 0.5s ease;
}

.regra-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-color: transparent;
}

.regra-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--ink);
    margin-bottom: 0.75rem;
}

.regra-card p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 1rem;
}

.regra-formula {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: var(--ink);
    color: var(--gold-light);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 1.2rem;
}

.regra-exemplo {
    padding: 1rem 1.2rem;
    background: var(--paper);
    border-left: 3px solid var(--red-primary);
    margin-top: 0.75rem;
}

.re-cn {
    font-family: var(--font-chinese);
    font-size: 1.3rem;
    color: var(--ink);
    margin-bottom: 0.2rem;
}

.re-cn mark {
    background: color-mix(in srgb, var(--red-primary) 15%, transparent);
    color: var(--red-primary);
    padding: 0 0.2rem;
}

.re-pinyin {
    font-size: 0.85rem;
    color: var(--red-primary);
}

.re-pt {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ---- CULTURA ---- */
.cultura-card {
    background: linear-gradient(135deg, var(--paper) 0%, #fff 100%);
    padding: 2.5rem;
    border: 1px solid var(--paper-dark);
}

.cultura-card > p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
    margin-bottom: 2rem;
}

.cultura-curiosidades h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 1rem;
}

.cultura-curiosidades ul {
    list-style: none;
    padding: 0;
}

.cultura-curiosidades li {
    padding: 0.75rem 0 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
}

.cultura-curiosidades li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--red-primary);
    font-weight: 700;
}

/* ---- EXERCÍCIOS ---- */
.exercicios-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.exercicio-bloco {
    padding: 2rem;
    border: 1px solid #eee;
    background: #fff;
}

.ex-titulo {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.ex-instrucao {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Associação */
.associacao-game {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.assoc-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.assoc-btn {
    padding: 0.8rem 1rem;
    border: 2px solid #e0e0e0;
    background: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.assoc-char {
    font-family: var(--font-chinese);
    font-size: 1.5rem;
}

.assoc-btn:hover {
    border-color: var(--red-primary);
    background: color-mix(in srgb, var(--red-primary) 5%, #fff);
}

.assoc-btn.selected {
    border-color: var(--red-primary);
    background: color-mix(in srgb, var(--red-primary) 10%, #fff);
    color: var(--red-primary);
}

.assoc-btn.correct {
    border-color: #2ECC71;
    background: color-mix(in srgb, #2ECC71 10%, #fff);
    color: #1a8a4a;
    pointer-events: none;
}

.assoc-btn.wrong {
    border-color: #E74C3C;
    background: color-mix(in srgb, #E74C3C 10%, #fff);
    animation: shake 0.4s ease;
}

/* Quiz buttons */
.tq-opcoes, .cq-opcoes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tq-btn, .cq-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-family: inherit;
}

.tq-btn:hover, .cq-btn:hover {
    border-color: var(--red-primary);
}

.tq-btn.correct, .cq-btn.correct {
    border-color: #2ECC71;
    background: color-mix(in srgb, #2ECC71 10%, #fff);
    color: #1a8a4a;
}

.tq-btn.wrong, .cq-btn.wrong {
    border-color: #E74C3C;
    background: color-mix(in srgb, #E74C3C 10%, #fff);
    animation: shake 0.4s ease;
}

.tq-questao, .comp-questao {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.tq-palavra {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.75rem;
}

.cq-frase {
    font-family: var(--font-chinese);
    font-size: 1.3rem;
    color: var(--ink);
    margin-bottom: 0.75rem;
}

.cq-explicacao {
    display: none;
    font-size: 0.85rem;
    color: var(--gold);
    font-style: italic;
    margin-top: 0.5rem;
}

.cq-explicacao.show {
    display: block;
}

.tq-feedback, .cq-feedback, .oq-feedback {
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 1.2em;
}

/* Ordenar */
.ord-questao {
    margin-bottom: 2rem;
}

.oq-meta {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1rem;
}

.oq-area {
    min-height: 50px;
    padding: 0.75rem;
    border: 2px dashed #ddd;
    background: var(--paper);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s;
}

.oq-area:empty::before {
    content: 'Arraste ou clique nas palavras abaixo...';
    color: #bbb;
    font-size: 0.85rem;
}

.oq-area.correct-area {
    border-color: #2ECC71;
    background: color-mix(in srgb, #2ECC71 5%, var(--paper));
}

.oq-area.wrong-area {
    border-color: #E74C3C;
    animation: shake 0.4s ease;
}

.oq-palavras {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.oq-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    background: #fff;
    font-family: var(--font-chinese);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.oq-btn:hover {
    border-color: var(--red-primary);
    transform: translateY(-2px);
}

.oq-btn.used {
    opacity: 0.3;
    pointer-events: none;
}

.oq-area .oq-btn {
    opacity: 1;
    pointer-events: auto;
    border-color: var(--red-primary);
    background: color-mix(in srgb, var(--red-primary) 8%, #fff);
}

.btn-check, .btn-reset {
    padding: 0.5rem 1.2rem;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-right: 0.5rem;
    transition: all 0.3s;
}

.btn-check {
    background: var(--red-primary);
    color: #fff;
}

.btn-check:hover {
    background: var(--red-dark);
}

.btn-reset {
    background: #eee;
    color: var(--text-muted);
}

.btn-reset:hover {
    background: #ddd;
}

/* ---- RESUMO ---- */
.resumo-card {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, var(--paper) 0%, #fff 100%);
    border: 1px solid var(--paper-dark);
}

.resumo-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.resumo-card h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--ink);
    margin-bottom: 2rem;
}

.resumo-lista {
    list-style: none;
    padding: 0;
    text-align: left;
    max-width: 500px;
    margin: 0 auto 2.5rem;
}

.resumo-lista li {
    padding: 0.75rem 0 0.75rem 2rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: relative;
    font-size: 0.95rem;
    line-height: 1.5;
}

.resumo-lista li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2ECC71;
    font-weight: 700;
}

.proximo-licao {
    margin-top: 2rem;
    padding: 2rem;
    border: 1px dashed var(--paper-dark);
    background: rgba(255,255,255,0.6);
}

.proximo-label {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.proximo-licao h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--ink);
    margin-bottom: 0.3rem;
}

.proximo-licao p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.proximo-em-breve {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--text-muted);
    color: #fff;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ---- TTS BUTTONS ---- */
.tts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
    position: relative;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.tts-btn svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: color 0.3s;
}

.tts-btn:hover {
    border-color: var(--red-primary);
    background: color-mix(in srgb, var(--red-primary) 5%, #fff);
    transform: scale(1.1);
}

.tts-btn:hover svg {
    color: var(--red-primary);
}

/* Playing state - pulse animation */
.tts-btn.playing {
    border-color: var(--red-primary);
    background: color-mix(in srgb, var(--red-primary) 10%, #fff);
    animation: tts-pulse 1s ease-in-out infinite;
}

.tts-btn.playing svg {
    color: var(--red-primary);
}

/* Loading state - spinner */
.tts-btn.loading {
    pointer-events: none;
    border-color: #ccc;
}

.tts-btn.loading svg {
    opacity: 0;
}

.tts-btn.loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #ddd;
    border-top-color: var(--red-primary);
    border-radius: 50%;
    animation: tts-spin 0.6s linear infinite;
}

/* Small variant */
.tts-btn.tts-sm {
    width: 28px;
    height: 28px;
    margin-top: 0.4rem;
}

.tts-btn.tts-sm svg {
    width: 12px;
    height: 12px;
}

/* Mini variant (inside buttons) */
.tts-btn.tts-mini {
    width: 24px;
    height: 24px;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    border: none;
    background: transparent;
    opacity: 0.4;
}

.tts-btn.tts-mini:hover {
    opacity: 1;
    background: transparent;
    transform: translateY(-50%) scale(1.15);
}

.tts-btn.tts-mini svg {
    width: 11px;
    height: 11px;
}

/* Make assoc buttons accommodate mini tts */
.assoc-char {
    position: relative;
    padding-right: 2rem;
}

@keyframes tts-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(196, 30, 58, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(196, 30, 58, 0); }
}

@keyframes tts-spin {
    to { transform: rotate(360deg); }
}

/* Vocab card: align main row */
.vocab-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Dialogue: position tts at end */
.dl-balao {
    position: relative;
}

.dl-balao .tts-btn {
    margin-top: 0.5rem;
}

/* Grammar examples: inline tts */
.regra-exemplo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.regra-exemplo .tts-btn {
    margin-left: auto;
    flex-shrink: 0;
}

/* ---- EVOLUÇÃO DOS CARACTERES ---- */
.evolucao-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.evo-card {
    padding: 1.8rem;
    border: 1px solid #eee;
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.evo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--red-primary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.evo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.06);
    border-color: transparent;
}

.evo-card:hover::before { transform: scaleX(1); }

.evo-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.evo-char-big {
    font-family: var(--font-chinese);
    font-size: 3rem;
    font-weight: 900;
    color: var(--ink);
    line-height: 1;
}

.evo-pinyin {
    display: block;
    font-size: 0.95rem;
    color: var(--red-primary);
    font-weight: 500;
}

.evo-sig {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.evo-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--paper);
    border: 1px solid var(--paper-dark);
    margin-bottom: 1rem;
}

.evo-stage {
    text-align: center;
    flex: 1;
}

.evo-stage-icon {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
    min-height: 2rem;
    line-height: 2rem;
}

.evo-stage-icon.evo-modern {
    font-family: var(--font-chinese);
    font-weight: 900;
    color: var(--red-primary);
    font-size: 2rem;
}

.evo-stage-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.evo-arrow {
    color: var(--gold);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.evo-origem {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    font-style: italic;
}

/* ---- PRÁTICA DE ESCRITA (CANVAS) ---- */
.escrita-dicas {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.escrita-dica {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    background: var(--paper);
    border: 1px solid var(--paper-dark);
    font-size: 0.85rem;
    color: var(--text);
}

.dica-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--red-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.escrita-container {
    border: 1px solid #eee;
    padding: 2rem;
    background: #fff;
}

.escrita-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.escrita-char-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #e0e0e0;
    background: #fff;
    font-family: var(--font-chinese);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.escrita-char-btn:hover {
    border-color: var(--red-primary);
    transform: translateY(-2px);
}

.escrita-char-btn.active {
    border-color: var(--red-primary);
    background: color-mix(in srgb, var(--red-primary) 10%, #fff);
    color: var(--red-primary);
    font-weight: 700;
}

.escrita-workspace {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.escrita-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.escrita-info-char {
    font-family: var(--font-chinese);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--ink);
}

.escrita-info-pinyin {
    font-size: 1rem;
    color: var(--red-primary);
    font-weight: 500;
}

.escrita-info-sig {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.escrita-info-tracos {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--paper);
    padding: 0.2rem 0.6rem;
}

.canvas-wrapper {
    position: relative;
    width: 360px;
    height: 360px;
    border: 2px solid #ddd;
    background: #fff;
    cursor: crosshair;
    touch-action: none;
}

.canvas-guide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-chinese);
    font-size: 18rem;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.06);
    pointer-events: none;
    user-select: none;
    line-height: 1;
    z-index: 0;
    transition: opacity 0.3s;
}

.canvas-guide.hidden { opacity: 0; }

#escritaCanvas {
    position: relative;
    z-index: 1;
    display: block;
}

.canvas-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
    background-size: 90px 90px;
}

.canvas-grid::before,
.canvas-grid::after {
    content: '';
    position: absolute;
    background: rgba(196, 30, 58, 0.08);
}

.canvas-grid::before {
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
}

.canvas-grid::after {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
}

.escrita-dica-atual {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gold);
    font-weight: 500;
    margin: 1rem 0;
    font-style: italic;
}

.escrita-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 360px;
    margin-top: 1rem;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.brush-slider {
    width: 80px;
    accent-color: var(--red-primary);
}

.tool-buttons {
    display: flex;
    gap: 0.5rem;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: inherit;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.tool-btn:hover {
    border-color: var(--red-primary);
    color: var(--red-primary);
}

.tool-btn svg {
    flex-shrink: 0;
}

/* ---- ANIMATIONS ---- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .secao-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .tons-grid {
        grid-template-columns: 1fr;
    }
    .vocab-grid {
        grid-template-columns: 1fr;
    }
    .associacao-game {
        grid-template-columns: 1fr;
    }
    .dialogo-linha {
        max-width: 90%;
    }
    .licao-container {
        padding: 0 1rem;
    }
    .secao {
        padding: 3rem 0;
    }
    .evolucao-grid {
        grid-template-columns: 1fr;
    }
    .escrita-dicas {
        grid-template-columns: 1fr;
    }
    .canvas-wrapper,
    .escrita-tools {
        width: 100%;
        max-width: 360px;
    }
    .escrita-tools {
        flex-direction: column;
        gap: 0.75rem;
    }
}
