:root {
    --green: #58cc02; --green-d: #46a302;
    --blue: #1cb0f6; --blue-d: #1899d6;
    --red: #ff4b4b; --text: #3c3c3c;
    --gray: #e5e5e5;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body, html { 
    margin: 0; padding: 0; 
    height: 100dvh; width: 100vw;
    font-family: 'Segoe UI', Roboto, sans-serif; 
    background: #fff; overflow: hidden;
}

#app-root { width: 100%; height: 100%; position: relative; }

.view { 
    position: fixed; inset: 0; 
    display: none; flex-direction: column; 
    background: white; z-index: 10;
}
.view.active { display: flex; }

/* HEADER FIXO */
header, .lesson-header { 
    height: 65px; border-bottom: 2px solid var(--gray); 
    display: flex; align-items: center; justify-content: space-around; 
    font-weight: bold; flex-shrink: 0; background: #fff; padding: 0 10px;
}

.scroll-area, .exercise-body { 
    flex: 1; overflow-y: auto; padding: 20px; 
    display: flex; flex-direction: column; align-items: center;
    width: 100%; max-width: 500px; margin: 0 auto;
}

/* CARD DIFICULDADE 1-100 */
.card-lvl { width: 100%; background: var(--green); color: white; padding: 20px; border-radius: 20px; box-shadow: 0 6px 0 var(--green-d); text-align: center; margin-bottom: 30px; flex-shrink: 0; }
.ai-bar-bg { background: rgba(0,0,0,0.2); height: 14px; border-radius: 7px; margin: 15px 0; overflow: hidden; }
.ai-bar-fill { height: 100%; background: white; width: 0%; transition: 1s ease; }

/* BOTÕES 3D */
.btn-big { width: 100%; max-width: 350px; min-height: 60px; border: none; border-radius: 18px; font-size: 18px; font-weight: bold; cursor: pointer; text-transform: uppercase; transition: 0.1s; flex-shrink: 0; }
.btn-big:active { transform: translateY(4px); box-shadow: none !important; }
.blue-btn { background: var(--blue); color: white; box-shadow: 0 6px 0 #1899d6; }
.green-btn { background: var(--green); color: white; box-shadow: 0 6px 0 var(--green-d); }
.white-btn { background: white; color: var(--blue); box-shadow: 0 6px 0 #ddd; }
.outline-btn { background: transparent; border: 2px solid white; color: white; margin-top: 15px; box-shadow: none; }

/* EXERCÍCIO */
.phrase-box { font-size: 24px; padding: 25px; border: 2px solid var(--gray); border-radius: 18px; background: #f9f9f9; margin-bottom: 20px; width: 100%; text-align: center; font-weight: 500; flex-shrink: 0; }
.ans-zone { width: 100%; min-height: 100px; border-bottom: 2px solid var(--gray); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-content: flex-start; margin-bottom: 20px; padding: 10px; }
.word-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding-bottom: 40px; }
.chip { padding: 14px 20px; background: white; border: 2px solid var(--gray); border-radius: 15px; font-weight: bold; font-size: 18px; box-shadow: 0 4px 0 var(--gray); }
.chip.used { opacity: 0.15; box-shadow: none; pointer-events: none; }

/* FOOTER FIXO */
.footer { height: 110px; border-top: 2px solid var(--gray); display: flex; align-items: center; justify-content: center; padding: 0 20px; flex-shrink: 0; background: #fff; }
.feedback { position: absolute; bottom: 0; left: 0; right: 0; height: 190px; transform: translateY(100%); transition: 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); padding: 20px; z-index: 100; border-top-left-radius: 25px; border-top-right-radius: 25px; display: flex; flex-direction: column; }
.feedback.show { transform: translateY(0); }
.correct { background: #d7ffb8; color: #58a700; border-top: 2px solid #58a700; }
.wrong { background: #ffdfe0; color: #ea2b2b; border-top: 2px solid #ea2b2b; }

.loader { position: fixed; inset: 0; background: rgba(255,255,255,0.95); z-index: 2000; display: none; align-items: center; justify-content: center; font-weight: bold; color: var(--blue); }
.loader.active { display: flex; }

#view-placement { background: var(--blue); color: white; z-index: 1000; justify-content: center; align-items: center; text-align: center; padding: 40px; }

.hidden { display: none !important; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.shake { animation: shake 0.2s ease-in-out 0s 2; }