/* 马上说 v2 : feuille de style. Sobre, adulte, chaleureux. Rouge et or pour les victoires et les alertes. */
:root {
  --navy: #1B2A4A; --navy-2: #24365E; --gold: #D4A017; --gold-soft: #FFF4D6;
  --red: #C8341F; --red-soft: #FDE8E4; --green: #1F8A4C; --green-soft: #E6F6EC;
  --brick: #9B3B2A; --forest: #1F5F4A; --violet: #4B3F8F;
  --bg: #F6F7FB; --card: #FFFFFF; --text: #1A1F2B; --muted: #6B7280; --line: #E6E8EF;
  --radius: 16px; --shadow: 0 2px 10px rgba(27, 42, 74, 0.08); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif; font-size: 17px; line-height: 1.55; }
button { font: inherit; cursor: pointer; }
b { color: var(--navy); }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }

.screen { padding: 16px 16px calc(96px + var(--safe-b)); animation: fade .22s ease; }
.screen.no-nav { padding-bottom: calc(24px + var(--safe-b)); }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }
h1 { font-size: 26px; margin: 8px 0 6px; color: var(--navy); line-height: 1.25; }
h2 { font-size: 20px; margin: 20px 0 8px; color: var(--navy); }
h3 { font-size: 17px; margin: 16px 0 6px; color: var(--navy); }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 15px; } .small { font-size: 13px; } .center { text-align: center; }
.lead { font-size: 18px; margin-top: 14px; line-height: 1.6; }
.sub { color: #C9D1E3; margin: 4px 0 0; }

/* En-tete avec retour */
.hdr { display: flex; align-items: center; gap: 6px; padding: 10px 8px 0; }
.hdr .back { background: none; border: 0; font-size: 34px; line-height: 1; color: var(--navy); padding: 0 10px; }
.hdr-title { color: var(--muted); font-size: 14px; letter-spacing: 1px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 12px 0; }
.card.gold { background: var(--gold-soft); border: 1px solid #F1D98A; }
.card.navy { background: var(--navy); color: #fff; } .card.navy b { color: var(--gold); }
.card.note { background: var(--red-soft); border-left: 4px solid var(--red); } .card.note b { color: var(--red); }
.card.never ul { margin: 0; padding-left: 20px; } .card.never li { margin: 6px 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .grow { flex: 1; } .center-row { justify-content: center; margin: 12px 0; }

.btn { display: block; width: 100%; padding: 15px 18px; border: 0; border-radius: 14px; background: var(--navy); color: #fff; font-size: 18px; font-weight: 600; margin-top: 12px; transition: transform .08s; }
.btn:active { transform: scale(.985); }
.btn.secondary { background: #fff; color: var(--navy); border: 2px solid var(--navy); }
.btn.ghost { background: transparent; color: var(--muted); font-weight: 500; }
.btn.gold { background: var(--gold); color: #1A1F2B; }
.btn.danger { background: var(--red); }
.btn.half { flex: 1; width: auto; }
.btn:disabled { opacity: .45; }
.link { background: none; border: 0; color: var(--navy); text-decoration: underline; padding: 0; font-size: 15px; }

.hero { padding: 30px 8px 8px; text-align: center; }
.hero .logo { font-size: 54px; font-weight: 800; color: var(--navy); letter-spacing: 2px; line-height: 1; }
.hero .tompoko { color: var(--gold); font-weight: 700; font-size: 20px; margin-top: 6px; letter-spacing: 1px; }
.benefit { display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.benefit:last-child { border-bottom: 0; } .benefit .ico { font-size: 26px; line-height: 1.2; width: 34px; text-align: center; }
.benefit b { display: block; font-size: 17px; } .benefit span { color: var(--muted); font-size: 14.5px; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; } .choice-grid.one { grid-template-columns: 1fr; }
.choice { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 18px 12px; text-align: center; font-size: 17px; font-weight: 600; color: var(--navy); }
.choice .ico { display: block; font-size: 32px; margin-bottom: 6px; } .choice.on { border-color: var(--gold); background: var(--gold-soft); }
.choice small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 4px 0 8px; gap: 6px; }
.stat { background: #fff; border-radius: 999px; padding: 6px 12px; box-shadow: var(--shadow); font-weight: 700; font-size: 14px; color: var(--navy); white-space: nowrap; }
.stat.fire { color: var(--red); }
.ring { display: flex; align-items: center; gap: 12px; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; flex: 1; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: 999px; transition: width .4s; }

.lesson-item { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: var(--radius); padding: 14px; margin: 10px 0; box-shadow: var(--shadow); border: 2px solid transparent; }
.lesson-item.next { border-color: var(--gold); } .lesson-item.locked { opacity: .55; }
.lesson-item .num { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: none; }
.lesson-item.done .num { background: var(--green); } .lesson-item.locked .num { background: #B8BCC8; }
.lesson-item .t { flex: 1; } .lesson-item .t b { display: block; font-size: 17px; } .lesson-item .t span { color: var(--muted); font-size: 14px; display: block; }
.lesson-item .t .score { color: var(--green); } .lesson-item .go { color: var(--gold); font-weight: 700; white-space: nowrap; }

.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 0; border-radius: 14px; padding: 14px; margin: 8px 0; box-shadow: var(--shadow); color: var(--text); font-size: 17px; }
.menu-item.big { padding: 18px 14px; } .menu-item .ico { font-size: 24px; width: 32px; text-align: center; } .menu-item .chev { color: var(--muted); font-size: 22px; }
.menu-item small { display: block; font-size: 13.5px; }

/* Navigation du bas, cinq espaces */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 0 calc(6px + var(--safe-b)); z-index: 5; }
.nav button { background: none; border: 0; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 1px; width: 70px; padding: 4px 0; }
.nav button .ico { font-size: 22px; } .nav button.on { color: var(--navy); font-weight: 700; }
@media (min-width: 481px) { .nav { max-width: 480px; margin: 0 auto; } }

/* Lecon */
.lesson-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; } .lesson-head .bar { height: 8px; }
.lesson-head .x, .x { background: none; border: 0; font-size: 24px; color: var(--muted); padding: 4px 8px; }
.step-title { font-size: 13px; letter-spacing: 1px; color: var(--muted); margin-top: 10px; }
.word { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; box-shadow: var(--shadow); }
.word .mg { font-size: 21px; font-weight: 700; color: var(--navy); } .word .hint { font-size: 16px; } .hint b { color: var(--red); } .word .zh { color: var(--muted); font-size: 14px; }
.arow { flex-wrap: nowrap; gap: 6px; }
.play { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; font-size: 20px; flex: none; display: flex; align-items: center; justify-content: center; }
.play.small { width: 38px; height: 38px; font-size: 15px; background: #fff; color: var(--navy); border: 2px solid var(--navy); }
.play.zh { background: var(--red); font-size: 15px; font-weight: 700; } .play.zh.small { width: 38px; height: 38px; }
.play.trio { border-color: var(--gold); color: var(--gold); } .play.fs { border-color: var(--brick); }
.play.big { width: 70px; height: 70px; font-size: 28px; } .play.huge { width: 120px; height: 120px; font-size: 52px; background: var(--gold); color: #1A1F2B; margin: 30px auto; }
.play.playing { background: var(--gold); color: #1A1F2B; animation: pulse 1s infinite; } @keyframes pulse { 50% { transform: scale(1.06); } }
.line { background: #fff; border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; box-shadow: var(--shadow); border-left: 4px solid transparent; transition: border-color .2s, background .2s; }
.line.now { border-left-color: var(--gold); background: var(--gold-soft); }
.line.hear { border-left-color: #B8BCC8; } .line.say { border-left-color: var(--brick); }
.line .who { font-size: 13px; color: var(--gold); font-weight: 700; } .line .mg { font-size: 19px; font-weight: 600; color: var(--navy); margin: 2px 0; } .line .zh { color: var(--muted); font-size: 15px; } .line .row { margin-top: 8px; }
.context { font-size: 15px; color: var(--muted); background: var(--gold-soft); border-radius: 12px; padding: 10px 12px; }
.big-mg { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.3; } .big-hint { font-size: 19px; margin: 6px 0; } .big-hint b { color: var(--red); } .zh-big { font-size: 18px; }
.big { font-size: 19px; margin: 0; }
table.gloss { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); font-size: 15px; }
table.gloss th { text-align: left; background: var(--navy); color: #fff; padding: 8px; font-weight: 600; font-size: 13px; }
table.gloss td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; } table.gloss td.mg { font-weight: 700; color: var(--navy); }
.prose p { margin: 8px 0; } .prose ul, .prose ol { padding-left: 20px; } .prose li { margin: 4px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 15px; } .prose th { text-align: left; background: var(--gold-soft); padding: 6px 8px; } .prose td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.prose h2 { font-size: 18px; margin-top: 18px; } .prose h3 { font-size: 16px; }
.manual { background: #fff; border-radius: var(--radius); padding: 4px 16px 16px; box-shadow: var(--shadow); }

/* Exercices */
.q { font-size: 19px; font-weight: 600; color: var(--navy); margin: 8px 0 12px; }
.opt { display: block; width: 100%; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 10px 0; font-size: 18px; color: var(--text); }
.opt.ok { border-color: var(--green); background: var(--green-soft); } .opt.bad { border-color: var(--red); background: var(--red-soft); }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; min-height: 58px; padding: 10px; border-radius: 14px; background: #fff; border: 2px dashed var(--line); margin: 10px 0; }
.tiles.bank { border-style: solid; background: var(--bg); }
.tile { background: #fff; border: 2px solid var(--navy); color: var(--navy); border-radius: 12px; padding: 10px 14px; font-size: 18px; font-weight: 600; } .tile.used { opacity: .25; pointer-events: none; }
.feedback { border-radius: 14px; padding: 14px; margin-top: 12px; font-weight: 600; } .feedback.ok { background: var(--green-soft); color: var(--green); } .feedback.bad { background: var(--red-soft); color: var(--red); }
.feedback .ans { display: block; color: var(--navy); margin-top: 4px; font-weight: 700; }
.fill-text { font-size: 22px; font-weight: 700; color: var(--navy); text-align: center; margin: 10px 0; }

/* Fin de lecon */
.celebrate { text-align: center; padding: 20px 0 8px; } .celebrate .big { font-size: 64px; line-height: 1; margin: 0; } .celebrate h1 { margin-top: 10px; }
.stats { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; } .stats .s { flex: 1; min-width: 90px; background: #fff; border-radius: 14px; padding: 12px 6px; text-align: center; box-shadow: var(--shadow); }
.stats .s b { display: block; font-size: 22px; color: var(--navy); } .stats .s span { color: var(--muted); font-size: 12px; }
.badge { display: inline-block; background: var(--gold); color: #1A1F2B; font-weight: 800; padding: 6px 14px; border-radius: 999px; margin-top: 8px; }
canvas.card-img { width: 100%; border-radius: 14px; box-shadow: var(--shadow); margin-top: 10px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.confetti i { position: absolute; top: -10px; width: 10px; height: 14px; border-radius: 2px; animation: drop 1.4s ease-in forwards; }
@keyframes drop { to { transform: translateY(110vh) rotate(540deg); opacity: .2; } }

/* Flashcards */
.flash { position: relative; min-height: 260px; margin: 12px 0; perspective: 1000px; }
.flash .front, .flash .back-face { position: absolute; inset: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; justify-content: center; gap: 8px; backface-visibility: hidden; transition: transform .45s; }
.flash .back-face { transform: rotateY(180deg); background: var(--gold-soft); }
.flash.flipped .front { transform: rotateY(180deg); } .flash.flipped .back-face { transform: rotateY(0); }

/* Situations, plein ecran */
.fullscreen { min-height: 100vh; min-height: 100dvh; background: var(--navy); color: #fff; padding: 20px 20px 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.fullscreen .x.light { position: absolute; top: 12px; right: 12px; color: #fff; font-size: 28px; }
.fs-mg { font-size: 40px; font-weight: 800; line-height: 1.25; color: #fff; } .fs-zh { font-size: 22px; color: #C9D1E3; margin-top: 14px; } .fs-hint { color: #C9D1E3; font-size: 14px; }

/* Outils */
.search { width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); font-size: 18px; background: #fff; margin: 8px 0; } .search.num { font-size: 28px; font-weight: 700; letter-spacing: 1px; text-align: center; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; } .chip { background: #fff; border: 1.5px solid var(--navy); color: var(--navy); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.dict-entry { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 12px 14px; margin: 8px 0; box-shadow: var(--shadow); }
.dict-entry .mg { font-size: 19px; font-weight: 700; color: var(--navy); } .dict-entry .zh { font-size: 16px; }
table.syll { width: 100%; border-collapse: separate; border-spacing: 4px; background: #fff; border-radius: 12px; padding: 4px; box-shadow: var(--shadow); }
table.syll th { font-size: 14px; color: var(--muted); font-weight: 700; } table.syll td { text-align: center; }
.syl { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 2px; font-size: 20px; color: var(--navy); font-weight: 700; } .syl small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 28px; letter-spacing: 6px; font-weight: 800; color: var(--navy); text-align: center; background: var(--gold-soft); border-radius: 12px; padding: 12px; margin: 8px 0; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 16px; } .switch input { width: 22px; height: 22px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--safe-b)); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; z-index: 9; animation: fade .2s ease; }

/* 今天 (18 novembre 2026) */
.today-head { display: flex; align-items: center; gap: 12px; } .today-head > div { flex: 1; }
.tampon-mini { width: 54px; height: 54px; }
.phrase-jour { border-top: 4px solid var(--gold); } .phrase-jour .tag { display: inline-block; background: var(--navy); color: #fff; font-size: 13px; border-radius: 99px; padding: 2px 12px; margin-bottom: 8px; }
.card.fete .dans { background: var(--gold-soft); color: var(--navy); font-weight: 700; font-size: 14px; border-radius: 99px; padding: 2px 10px; }
.mg-small { font-weight: 600; color: var(--muted); }
.nav .ico { position: relative; } .nav .dot { position: absolute; top: -4px; right: -16px; background: var(--red); color: #fff; font-style: normal; font-size: 10px; line-height: 1; padding: 3px 4px; border-radius: 8px; }
.hero .tampon-hero { width: 110px; height: 110px; display: block; margin: 0 auto 12px; }
/* la video d'ouverture */
.intro { position: fixed; inset: 0; background: #1B2A4A; display: flex; align-items: center; justify-content: center; z-index: 20; }
.intro video { width: 100%; height: 100%; object-fit: contain; background: #1B2A4A; }
.intro-play { position: absolute; bottom: calc(15% + env(safe-area-inset-bottom, 0px)); border: 0; background: rgba(212, 160, 23, .95); color: #1B2A4A; border-radius: 99px; padding: 16px 28px; font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.intro-play span { font-size: 18px; }
.intro-skip { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; border: 0; background: rgba(255, 255, 255, .18); color: #fff; border-radius: 99px; padding: 8px 16px; font-size: 16px; }

/* Dictionnaire par thèmes et Pass (18 novembre 2026) */
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-tile { background: #fff; border: 0; border-radius: 14px; box-shadow: var(--shadow); padding: 12px; text-align: left; display: flex; flex-direction: column; gap: 2px; position: relative; }
.theme-tile .ico { font-size: 26px; } .theme-tile b { font-size: 15px; } .theme-tile small { color: var(--muted); font-size: 12.5px; }
.pill { position: absolute; top: 10px; right: 10px; font-size: 11.5px; background: var(--line); color: var(--navy); border-radius: 99px; padding: 1px 8px; } .pill.free { background: var(--green-soft); color: var(--green); }
.dict-entry .py { color: var(--muted); font-size: 13px; margin-left: 4px; }
.dict-entry.ferme .mg { color: #4B5563; }
.dico-actions { flex-wrap: nowrap; gap: 6px; } .play.fav { color: var(--gold); }
.lock { border: 1.5px dashed var(--muted); background: #fff; color: var(--navy); border-radius: 12px; padding: 8px 10px; font-size: 13.5px; white-space: nowrap; }
.chip.on { background: var(--navy); color: #fff; }
.code.inline { display: inline-block; font-size: 16px; padding: 0 6px; }

/* le repere et 中 dans le dictionnaire (18 novembre 2026) */
.dict-entry { flex-wrap: wrap; } .dict-entry .dico-actions { width: 100%; justify-content: flex-start; margin-top: 4px; }
.dict-entry .hint { font-size: 15px; }

/* la grille des Pass (18 novembre 2026) */
.offres { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 12px 0; }
.offre { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 14px; position: relative; border: 2px solid transparent; }
.offre.top { border-color: var(--gold); }
.offre .ruban { position: absolute; top: -10px; left: 14px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 2px 10px; }
.offre .prix { font-size: 30px; font-weight: 800; color: var(--navy); margin-top: 4px; }
.offre .par-jour { color: var(--red); font-weight: 700; font-size: 15px; }
.offre .pill { position: static; }

/* 紧急 : les numeros d'urgence, un appui = l'appel */
a.btn { text-align: center; text-decoration: none; }
#urgent small { display: block; font-size: 13px; font-weight: 400; opacity: .9; margin-top: 2px; }
.urgent-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.urgent-nums .btn { margin-top: 0; font-size: 20px; }
