* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --background: #f6f6f3;
    --card: #ffffff;
    --text: #171717;
    --secondary: #737373;
    --border: #e7e7e3;
    --accent: #171717;
}

html {
    background: var(--background);
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "SF Pro Text",
        "Helvetica Neue",
        Arial,
        sans-serif;

    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

button {
    font: inherit;
}

#app {
    width: 100%;
    max-width: 520px;
    min-height: 100vh;
    margin: 0 auto;
    padding:
        max(24px, env(safe-area-inset-top))
        20px
        max(30px, env(safe-area-inset-bottom));
}

/* HEADER */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 35px;
}

.app-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.8px;
}

.level {
    font-size: 13px;
    color: var(--secondary);
    background: #eeeeeb;
    padding: 7px 11px;
    border-radius: 20px;
}

/* WELCOME */

.welcome {
    margin-bottom: 28px;
}

.eyebrow {
    color: var(--secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.welcome h2 {
    font-size: 31px;
    line-height: 1.08;
    letter-spacing: -1.2px;
    margin-bottom: 12px;
}

.welcome > p:last-child {
    color: var(--secondary);
    font-size: 16px;
    line-height: 1.5;
    max-width: 430px;
}

/* PROGRESS */

.progress-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 14px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 14px;
}

.progress-header strong {
    font-size: 14px;
}

.progress-bar {
    width: 100%;
    height: 7px;
    background: #eeeeeb;
    border-radius: 20px;
    overflow: hidden;
}

.progress-value {
    width: 0%;
    height: 100%;
    background: var(--accent);
    border-radius: 20px;
    transition: width 0.4s ease;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    color: var(--secondary);
    font-size: 12px;
}

/* LESSON CARD */

.continue-card {
    background: var(--accent);
    color: white;
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 14px;
}

.continue-card .eyebrow {
    color: #a5a5a5;
}

.continue-card h3 {
    font-size: 23px;
    letter-spacing: -0.5px;
    margin-bottom: 7px;
}

.continue-card p:not(.eyebrow) {
    color: #bdbdbd;
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 20px;
}

#startLesson {
    width: 100%;
    border: none;
    border-radius: 13px;
    padding: 14px 18px;
    background: white;
    color: #171717;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease;
}

#startLesson:active {
    transform: scale(0.98);
}

/* STATS */

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 17px 10px;
    text-align: center;
}

.stat strong {
    display: block;
    font-size: 22px;
    margin-bottom: 4px;
}

.stat span {
    color: var(--secondary);
    font-size: 11px;
}

/* DESKTOP */

@media (min-width: 700px) {
    body {
        padding: 30px 0;
    }

    #app {
        min-height: auto;
    }
}
/* =========================
   ÉCRAN D'APPRENTISSAGE
   ========================= */

.lesson-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 32px;
}

.back-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--card);
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
}

.lesson-progress {
    font-size: 14px;
    color: var(--secondary);
}

.lesson-progress span:first-child {
    color: var(--text);
    font-weight: 700;
}

.lesson {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 110px);
}

.phrase-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px 22px;
    margin-top: 8px;
}

.phrase-number {
    color: var(--secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 30px;
}

.german-phrase {
    font-size: 38px;
    line-height: 1.12;
    letter-spacing: -1.2px;
    margin-bottom: 28px;
}

.listen-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    background: #eeeeeb;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.listen-button:active {
    transform: scale(0.98);
}

.translation {
    border-top: 1px solid var(--border);
    margin-top: 28px;
    padding-top: 24px;
    color: var(--secondary);
    font-size: 19px;
    line-height: 1.4;
}

.lesson-instruction {
    padding: 22px 4px;
    color: var(--secondary);
    font-size: 14px;
    line-height: 1.5;
}

.lesson-instruction p + p {
    margin-top: 5px;
}

.primary-button {
    width: 100%;
    border: none;
    border-radius: 15px;
    padding: 16px 20px;
    margin-top: auto;
    background: var(--accent);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.primary-button:active {
    transform: scale(0.98);
}
/* =========================
   MÉMO
   ========================= */

.category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-card {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    text-align: left;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 18px;
    color: var(--text);
    cursor: pointer;
}

.category-card h3 {
    font-size: 17px;
    margin-bottom: 5px;
}

.category-card p {
    color: var(--secondary);
    font-size: 13px;
    line-height: 1.4;
}

.category-meta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--secondary);
}

.category-meta span {
    font-size: 11px;
}

.category-meta strong {
    color: var(--text);
    font-size: 25px;
    font-weight: 400;
}

.category-count {
    color: var(--secondary);
    font-size: 13px;
}

.category-title {
    margin-bottom: 25px;
}

.category-title h1 {
    font-size: 32px;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.category-title > p:last-child {
    color: var(--secondary);
    font-size: 14px;
    line-height: 1.5;
}

.phrase-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.memo-phrase {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 18px;
}

.memo-content h2 {
    font-size: 20px;
    line-height: 1.3;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}

.memo-content p {
    color: var(--secondary);
    font-size: 15px;
    line-height: 1.4;
}

.audio-button {
    border: none;
    background: #eeeeeb;
    color: var(--text);
    border-radius: 10px;
    padding: 9px 12px;
    margin-top: 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.audio-button:active {
    transform: scale(0.97);
}
