/* El mateix llenguatge que el hub de referència: rajola freda, tinta i el vermell d'un segell xinès.
   El dia és una línia de metro amb parades. El color diu estats (fet, bé, malament) i els tons del pinyin. */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans"; font-weight: 400; font-display: swap; src: url("/fonts/noto-sans-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }
@font-face { font-family: "Noto Sans"; font-weight: 400; font-display: swap; src: url("/fonts/noto-sans-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1EFF; }
@font-face { font-family: "Noto Sans"; font-weight: 500; font-display: swap; src: url("/fonts/noto-sans-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F; }
@font-face { font-family: "Noto Sans"; font-weight: 500; font-display: swap; src: url("/fonts/noto-sans-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1EFF; }

:root {
  --paper: #eef2f1; --surface: #ffffff; --surface-2: #e3e9e7;
  --ink: #141a1c; --ink-2: #455256; --muted: #6c787c;
  --line: #d3dbd9; --line-strong: #a9b5b2;
  --seal: #c41e2e; --on-seal: #ffffff; --seal-soft: #f7dfe1;
  --done: #127e66; --on-done: #ffffff; --done-soft: #d3ece4;
  --t1: #d60f1f; --t2: #0a8a2a; --t3: #1f3fd6; --t4: #8b1fb6; --t5: #7a8488;
  --focus: #1f3fd6;
  --f-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-zh: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --f-py: "Noto Sans", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1415; --surface: #172022; --surface-2: #1f292b;
    --ink: #e8eeec; --ink-2: #b2bec0; --muted: #8b979a;
    --line: #273234; --line-strong: #3e4c4f;
    --seal: #e5484f; --on-seal: #ffffff; --seal-soft: #3a1c1f;
    --done: #35bd95; --on-done: #07201a; --done-soft: #163a31;
    --t1: #ff6b6b; --t2: #4ad27e; --t3: #8aa5ff; --t4: #d283ff; --t5: #98a3a6;
    --focus: #8aa5ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--paper); }
body { color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
p { margin: 0; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; letter-spacing: .01em; text-wrap: balance; margin: 0; }
main { max-width: 560px; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; gap: 18px;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.creix { flex: 1; }
.zh { font-family: var(--f-zh); }
.py { font-family: var(--f-py); }
.t1 { color: var(--t1); } .t2 { color: var(--t2); } .t3 { color: var(--t3); } .t4 { color: var(--t4); } .t5 { color: var(--t5); }
.eyebrow { font-family: var(--f-display); font-weight: 600; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.meta { color: var(--muted); font-size: 15px; }
.lead { color: var(--ink-2); font-size: 17px; }

/* Botons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; text-align: center; }
.btn.primari { background: var(--seal); border-color: var(--seal); color: var(--on-seal); }
.btn.gran { width: 100%; min-height: 56px; font-family: var(--f-display); font-size: 21px; letter-spacing: .04em; text-transform: uppercase; }
.btn.ple { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.be { border-color: var(--done); color: var(--done); background: var(--done-soft); }
.btn.mal { border-color: var(--seal); color: var(--seal); background: var(--seal-soft); }
.enllac { border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 40px; padding: 6px 8px; font-size: 15px; }
.icona-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; padding: 0; }
.icona-btn svg { width: 18px; height: 18px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dos .btn { min-height: 60px; line-height: 1.2; padding: 8px 10px; }
.peu { display: grid; gap: 10px; position: sticky; bottom: 0; padding: 10px 0 calc(4px + env(safe-area-inset-bottom)); margin-bottom: calc(-1 * env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--paper) 22%); }

/* Capçalera amb el segell */
.cap { display: grid; gap: 6px; }
.cap-titol { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.cap h1 { font-size: 44px; line-height: 1; }
.cap h1.llarg { font-size: 36px; line-height: 1.02; }
.segell { width: 64px; height: 64px; background: var(--seal); color: var(--on-seal); display: grid; place-items: center; align-content: center;
  border-radius: 7px; transform: rotate(-8deg); box-shadow: inset 0 0 0 3px var(--seal), inset 0 0 0 4px color-mix(in srgb, var(--on-seal) 55%, transparent); }
.segell b { font-family: var(--f-display); font-weight: 700; font-size: 30px; line-height: .95; font-variant-numeric: tabular-nums; }
.segell span { font-family: var(--f-zh); font-size: 13px; font-weight: 700; line-height: 1; }
.segell.gros { width: 132px; height: 132px; border-radius: 12px; }
.segell.gros b { font-size: 68px; }
.segell.gros span { font-size: 24px; }
.segell.estampa { animation: estampa .5s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes estampa { from { transform: rotate(-8deg) scale(1.8); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
.barra { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.barra span { height: 6px; border-radius: 3px; background: var(--line); }
.barra span.fet { background: var(--done); }
.barra span.ara { background: var(--seal); }

/* La ruta del dia: parades d'una línia de metro */
.ruta { list-style: none; margin: 6px 0 0; padding: 0; }
.parada { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; padding-bottom: 26px; }
.parada::before { content: ""; position: absolute; left: 18px; top: 40px; bottom: 0; width: 4px; border-radius: 2px; background: var(--line-strong); }
.parada:last-child { padding-bottom: 4px; }
.parada:last-child::before { display: none; }
.parada.fet::before { background: var(--done); }
.punt { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; color: transparent; }
.punt svg { width: 18px; height: 18px; }
.parada.ara .punt { border-color: var(--seal); }
.parada.fet .punt { background: var(--done); border-color: var(--done); color: var(--on-done); }
.parada-cos { min-width: 0; display: grid; gap: 8px; padding-top: 5px; justify-items: start; }
.parada-cap { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.parada-cap h2 { font-size: 26px; line-height: 1.1; }
.min { font-family: var(--f-display); font-weight: 600; font-size: 14px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.parada-cos > p { color: var(--ink-2); }
.parada.fet h2 { color: var(--ink-2); }

/* Blocs i formularis */
.bloc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.bloc-cap { display: flex; align-items: baseline; gap: 10px; }
.bloc-cap .num { font-family: var(--f-display); font-weight: 700; font-size: 15px; color: var(--seal); letter-spacing: .06em; }
.bloc h2 { font-size: 22px; line-height: 1.1; }
.bloc .ajuda { color: var(--muted); font-size: 14px; }
textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink);
  min-height: 132px; resize: vertical; }
textarea::placeholder { color: var(--muted); }
.punts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.punts.cinc { grid-template-columns: repeat(5, 1fr); }
.punts.dos { grid-template-columns: repeat(2, 1fr); }
.punts.dos button { min-height: 44px; font-size: 15px; }
.complements { margin-top: 14px; }
.altra-sessio .complements { margin: 4px 0 12px; }
.punts button { min-height: 52px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-family: var(--f-display);
  font-size: 24px; font-weight: 700; cursor: pointer; display: grid; place-items: center; align-content: center; line-height: 1; padding: 6px 2px; }
.punts button small { font-family: var(--f-body); font-weight: 500; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.punts button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.punts button[aria-pressed="true"] small { color: var(--paper); opacity: .75; }
.segments { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--surface); }
.segments button { border: 0; background: none; padding: 7px 14px; cursor: pointer; font-family: var(--f-display); font-weight: 600; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.segments button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.entre { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* El repàs */
.repas-cap { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.compte { font-family: var(--f-display); font-weight: 600; font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.targeta { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px 18px; display: grid; gap: 12px;
  justify-items: center; align-content: center; text-align: center; min-height: 320px; }
.targeta.nova { border-top: 4px solid var(--seal); }
.targeta .natiu { font-size: 26px; font-weight: 600; line-height: 1.25; text-wrap: balance; }
.targeta .zh { font-size: 40px; line-height: 1.25; font-weight: 500; overflow-wrap: anywhere; }
.targeta .py { font-size: 20px; line-height: 1.4; }
.targeta .sentit { font-size: 18px; color: var(--ink-2); text-wrap: balance; }
.targeta .nota { font-size: 14px; color: var(--muted); max-width: 40ch; }
.play { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; }
.play svg { width: 20px; height: 20px; }
.play.gros { width: 84px; height: 84px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.play.gros svg { width: 30px; height: 30px; }
.mots { list-style: none; margin: 4px 0 0; padding: 12px 0 0; width: 100%; text-align: left; border-top: 1px dashed var(--line-strong);
  display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 6px 12px; align-items: baseline; }
.mots li { display: contents; }
.mots .zh { font-size: 19px; font-weight: 500; }
.mots .py { font-size: 15px; }
.mots .que { font-size: 15px; color: var(--ink-2); }
.resp { display: grid; gap: 2px; justify-items: center; padding-top: 12px; border-top: 1px dashed var(--line-strong); width: 100%; }
.resp .zh { font-size: 26px; }
.resp .py { font-size: 16px; }
.resp .sentit { font-size: 15px; }

/* Esperes i final */
.centre { flex: 1; display: grid; gap: 16px; justify-items: center; align-content: center; text-align: center; }
.centre h1 { font-size: 40px; line-height: 1; }
.passos { list-style: none; margin: 8px 0 0; padding: 0; text-align: left; }
.passos .parada { padding-bottom: 18px; }
.passos .punt { width: 28px; height: 28px; border-width: 3px; }
.passos .parada { grid-template-columns: 28px minmax(0, 1fr); }
.passos .parada::before { left: 12px; top: 28px; }
.passos .parada-cos { padding-top: 2px; color: var(--muted); }
.passos .parada.fet .parada-cos, .passos .parada.ara .parada-cos { color: var(--ink); }
.passos .parada.ara .punt { animation: batega 1.2s ease-in-out infinite; }
@keyframes batega { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--seal) 22%, transparent); } }
.error { color: var(--seal); font-weight: 600; }
.peu-avui { display: grid; justify-items: center; gap: 2px; }

@media (prefers-reduced-motion: reduce) { .segell.estampa, .passos .parada.ara .punt { animation: none; } }
@media (min-width: 700px) { main { padding-top: 40px; } }

/* La ratxa: la setmana d'un cop d'ull */
.ratxa { display: grid; gap: 6px; margin-top: 4px; }
.setmana { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: 100%; max-width: 340px; }
.setmana li { display: grid; justify-items: center; gap: 4px; }
.setmana .dia { font-family: var(--f-display); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.setmana .rodona { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; color: var(--on-done); }
.setmana .rodona svg { width: 14px; height: 14px; }
.setmana li.fet .rodona { background: var(--done); border-color: var(--done); }
.setmana li.avui .dia { color: var(--ink); }
.setmana li.avui:not(.fet) .rodona { border-color: var(--seal); }
.setmana li.rescat .rodona { border-style: dashed; border-color: var(--done); }
.dia-avui { display: grid; gap: 8px; }
.dia-avui .motiu { margin: 0; font-size: 17px; line-height: 1.4; color: var(--ink); }
.dia-avui .enllac { justify-self: start; padding: 0; }
.nit { gap: 10px; }
.centre .setmana { margin-top: 8px; }

/* Escolta */
.repas-cap .eyebrow { text-align: center; }
.opcions { display: grid; gap: 10px; }
.btn.opcio { justify-content: flex-start; text-align: left; min-height: 56px; font-weight: 500; }
.btn.opcio:disabled { opacity: 1; }
.btn.opcio:disabled:not(.be):not(.mal) { opacity: .55; }
.dialeg { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dialeg li { display: flex; }
.dialeg li.ell { justify-content: flex-end; }
.dialeg button { max-width: 86%; display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 14px; cursor: pointer; }
.dialeg li.ell button { background: var(--surface-2); }
.dialeg .zh { font-size: 21px; line-height: 1.3; }
.dialeg .que { font-size: 14px; color: var(--ink-2); }

/* Tu día */
.pestanyes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pestanyes button { min-height: 48px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer;
  font-family: var(--f-display); font-weight: 600; font-size: 16px; letter-spacing: .03em; line-height: 1.1; padding: 6px 4px; }
.pestanyes button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
textarea.curt { min-height: 84px; }
textarea.llarg { min-height: 200px; }
.apunts { display: grid; gap: 8px; }
.apunts ul { list-style: none; margin: 0; padding: 0; display: grid; }
.apunts li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.etiqueta { font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.icona-btn.petit { width: 32px; height: 32px; }
.icona-btn.petit svg { width: 14px; height: 14px; }

/* Lectura: com al hub, el pinyin va a sobre de cada paraula i es pot amagar */
.historia { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 14px 8px; font-size: 23px; line-height: 2.3; overflow-wrap: anywhere; }
.historia.sense-py { line-height: 1.8; }
.historia.sense-py rt { display: none; }
.historia rt { font-family: var(--f-py); font-size: 12px; line-height: 1; font-weight: 400; }
.historia .junt { white-space: nowrap; display: inline-block; }
.historia .mot { font: inherit; color: inherit; line-height: inherit; background: none; border: 0; padding: 0 1px; margin: 0; cursor: pointer; border-radius: 4px; display: inline-block; }
.historia .mot.nova ruby { border-bottom: 1.5px dotted var(--ink-2); }
.historia .mot[aria-pressed="true"] { background: var(--surface-2); box-shadow: 0 2px 0 var(--seal); }
.fitxa { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; min-height: 64px; align-content: center; }
.fitxa .mots { border-top: 0; padding-top: 0; margin: 0; }
.fitxa .frase { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; font-size: 15px; color: var(--ink-2); border-top: 1px dashed var(--line-strong); padding-top: 8px; }
.fitxa .ajuda { color: var(--muted); font-size: 15px; text-align: center; }
.play.petit { width: 34px; height: 34px; }
.play.petit svg { width: 14px; height: 14px; }
.btn.commuta { justify-self: start; justify-content: flex-start; align-self: flex-start; }
.btn.commuta::before { content: ""; flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-strong); }
.btn.commuta[aria-pressed="true"] { background: var(--done-soft); border-color: var(--done); }
.btn.commuta[aria-pressed="true"]::before { background: var(--done); border-color: var(--done); box-shadow: inset 0 0 0 3px var(--done-soft); }
.dialeg .py { font-size: 14px; }

/* Nivell i XP */
.nivell { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.nivell.ample { width: 100%; max-width: 340px; }
.nom-nivell { font-family: var(--f-display); font-weight: 700; font-size: 18px; letter-spacing: .04em; text-transform: uppercase; }
.xp-barra { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.xp-barra i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--done), color-mix(in srgb, var(--done) 70%, #ffd34d)); transition: width .6s ease; }
.xp-brindis { position: fixed; left: 50%; top: 22%; z-index: 50; transform: translateX(-50%); pointer-events: none;
  font-family: var(--f-display); font-weight: 700; font-size: 30px; color: var(--on-done); background: var(--done);
  padding: 6px 18px; border-radius: 999px; box-shadow: 0 8px 24px color-mix(in srgb, var(--done) 35%, transparent);
  animation: brindis 1.3s ease-out forwards; }
@keyframes brindis { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.8); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  70% { opacity: 1; transform: translate(-50%, -16px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -36px); } }
.xp-guany { font-family: var(--f-display); font-weight: 700; font-size: 28px; color: var(--done); }
.btn.xic { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 999px; }

/* Shadowing */
.shadow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--seal); border-radius: 12px; padding: 10px 12px; font-weight: 500; font-size: 15px; line-height: 1.3; }
.shadow-icona { width: 28px; height: 28px; border-radius: 50%; background: var(--seal); color: var(--on-seal); display: grid; place-items: center; }
.shadow-icona svg { width: 12px; height: 12px; }

/* Escolta */
.esc-play { display: grid; justify-items: center; padding: 18px 0; }
.pregunta { font-weight: 600; font-size: 18px; }
.centrat { text-align: center; }
.glossa { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
.glossa li { display: grid; justify-items: center; line-height: 1.25; }
.glossa .zh { font-size: 24px; }
.glossa .py { font-size: 14px; }
.glossa .que { font-size: 12px; color: var(--muted); max-width: 12ch; text-align: center; }
.xifra { font-family: var(--f-display); font-weight: 700; font-size: 72px; line-height: 1; color: var(--done); }

/* Missió */
.missio-frase { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--seal); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; }
.missio-frase .zh { font-size: 30px; line-height: 1.3; }
.missio-frase .py { font-size: 17px; }
.missio-frase .sentit { color: var(--ink-2); }
.objectiu { color: var(--ink-2); }
.missio-text { font-size: 22px; line-height: 1.35; font-weight: 600; text-wrap: pretty; }
.fet-ok { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--f-display); font-weight: 700; font-size: 22px; color: var(--done); min-height: 56px; }
.rodona-ok { width: 32px; height: 32px; border-radius: 50%; background: var(--done); color: var(--on-done); display: grid; place-items: center; }
.rodona-ok svg { width: 16px; height: 16px; }
.converses .btn.gran { text-transform: none; font-size: 19px; letter-spacing: .02em; }

/* Amics */
.codi-bloc { background: var(--ink); color: var(--paper); border-radius: 16px; padding: 16px; display: grid; gap: 6px; }
.codi-bloc .eyebrow, .codi-bloc .ajuda { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.codi { font-family: var(--f-display); font-weight: 700; font-size: 44px; letter-spacing: .12em; line-height: 1; }
.codi-bloc .btn.xic { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 40%, transparent); }
.afegir { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
input[type="text"], input[type="email"] { width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); min-height: 48px; }
.codi-camp { font-family: var(--f-display); font-weight: 600; font-size: 22px; letter-spacing: .14em; text-transform: uppercase; background: var(--surface); }
.botons-cap { display: flex; gap: 8px; }

/* Comptes: el codi en sis caselles; l'input de debò és a sobre, transparent (així el mòbil hi enganxa el codi del correu) */
.caselles { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-width: 360px; width: 100%; }
.caselles span { aspect-ratio: 4 / 5; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-family: var(--f-display); font-weight: 700; font-size: 28px; }
.caselles:focus-within span.ara { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.caselles input[type="text"] { position: absolute; inset: 0; height: 100%; min-height: 0; opacity: 0; font-size: 16px; padding: 0; border: 0; }
.botons-compte { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.botons-compte .enllac, .afegeix-correu { padding-left: 0; padding-right: 0; justify-self: start; text-align: left; }
.enllac:disabled { text-decoration: none; cursor: default; }
.paisos { margin-top: 12px; }
.opcio-tria.pais .pais-nom { display: grid; gap: 2px; }
.opcio-tria.pais small { color: var(--muted); font-weight: 400; font-size: 14px; }
.estat-pais { font-size: 13px; color: var(--muted); flex: none; }
.estat-pais.obert { color: var(--ink); font-weight: 600; }
.segments.llengues { margin: 2px 0 6px; flex-wrap: wrap; }
.bloc-sessio { display: grid; gap: 4px; }
.final-dia { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.nova-sessio { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 16px; }
.nova-sessio h2 { margin: 0; font-size: 21px; }
.nova-sessio .eyebrow { margin: 6px 0 0; }
.nota-opcio { color: var(--muted); font-weight: 400; font-size: 14px; }
.opcio-tria:disabled { cursor: default; opacity: 1; }
.opcio-tria:disabled[aria-pressed="false"] { color: var(--muted); border-style: dashed; }
.motiu { margin: 0; font-size: 17px; line-height: 1.4; color: var(--ink); }
.altra-sessio { display: grid; gap: 8px; justify-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.altra-sessio h2 { margin: 0; font-size: 19px; }
.altra-sessio p { margin: 0; color: var(--ink-2); }
.altra-sessio .punts { justify-self: stretch; }
.consells { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.consells li { display: grid; gap: 6px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.consells li:last-child { border-bottom: 0; }
.consells h2 { font-size: 19px; margin: 0; }
.consells p { margin: 0; color: var(--ink-2); line-height: 1.5; }
.classificacio { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.classificacio li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 56px; gap: 10px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.classificacio li.jo { border-color: var(--seal); box-shadow: inset 4px 0 0 var(--seal); }
.classificacio .pos { font-family: var(--f-display); font-weight: 700; font-size: 24px; color: var(--muted); text-align: center; }
.classificacio li:first-child .pos { color: var(--seal); }
.classificacio .qui { display: grid; min-width: 0; }
.classificacio .qui b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.punts-xp { display: grid; justify-items: end; line-height: 1; font-family: var(--f-display); }
.punts-xp b { font-weight: 700; font-size: 22px; }
.punts-xp small { font-weight: 600; font-size: 11px; letter-spacing: .08em; color: var(--muted); }
/* La ratxa, amb un foc: encès si hi ha ratxa, apagat si no */
.ratxa-foc { display: inline-flex; align-items: center; gap: 3px; min-width: 52px; justify-content: center; padding: 4px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-family: var(--f-display); font-size: 20px; }
.ratxa-foc .foc { width: 20px; height: 20px; display: grid; }
.ratxa-foc .foc svg { width: 100%; height: 100%; }
.ratxa-foc.viva { background: color-mix(in srgb, #ff7a1a 16%, var(--surface)); color: #e8590c; }
@media (prefers-color-scheme: dark) { .ratxa-foc.viva { color: #ff9a4d; background: color-mix(in srgb, #ff7a1a 22%, var(--surface)); } }
@media (prefers-reduced-motion: reduce) { .xp-brindis { animation-duration: .01s; } .xp-barra i { transition: none; } }
.rodona-ok.gran { width: 88px; height: 88px; }
.rodona-ok.gran svg { width: 40px; height: 40px; }

/* Pràctica */
.xat { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.msg { max-width: 88%; border-radius: 16px; padding: 10px 14px; display: grid; gap: 4px; }
.msg.ell { justify-self: start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.tu { justify-self: end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; font-family: var(--f-py); }
.msg.ajuda { justify-self: stretch; max-width: none; background: var(--done-soft); border: 1px solid color-mix(in srgb, var(--done) 40%, transparent); }
.msg.resum { justify-self: stretch; max-width: none; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--seal); gap: 8px; }
.msg .que { font-size: 14px; color: var(--ink-2); }
.linia-ruby { font-size: 24px; line-height: 2.1; margin: 0; }
.linia-ruby rt { font-family: var(--f-py); font-size: 12px; font-weight: 400; }
.frase-p { display: grid; gap: 2px; justify-items: start; }
.frase-p .zh { font-size: 24px; line-height: 1.3; }
.frase-p .py { font-size: 15px; }
.frase-p .sentit { font-size: 15px; color: var(--ink-2); }
.frase-p .nota { font-size: 14px; color: var(--ink-2); }
.frase-p .btn.xic { margin-top: 6px; }
.entrada { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.entrada textarea { min-height: 52px; background: var(--surface); font-family: var(--f-py); }
.consultes { display: grid; gap: 10px; }
.consulta { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; }
.consulta .frase-p + .frase-p { border-top: 1px dashed var(--line-strong); padding-top: 10px; }

/* Pràctica: la missió i les converses */
.missio .missio-frase { border-top-width: 1px; background: var(--paper); }
.comptador-gran { display: flex; align-items: baseline; gap: 10px; }
.comptador-gran b { font-family: var(--f-display); font-weight: 700; font-size: 56px; line-height: 1; color: var(--done); }

/* Nivells: insígnies de rang, de Noob a Leyenda. Tinta; el vermell, només per a Leyenda */
.insignia { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; color: var(--ink); }
.insignia svg { width: 100%; height: 100%; display: block; }
.insignia.n9 { color: var(--seal); }
.insignia.xica { width: 20px; height: 20px; }
.insignia.gran { width: 132px; height: 132px; }
.insignia.estampa { animation: estampa .5s cubic-bezier(.2, .9, .3, 1.3) both; }
.nom-nivell { display: inline-flex; align-items: center; gap: 10px; }
.nivell-amic { display: inline-flex; align-items: center; gap: 6px; }
.capa-nivell { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(6px);
  display: grid; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.capa-nivell .centre { max-width: 480px; margin: 0 auto; width: 100%; }
.capa-nivell h1 { font-size: 36px; line-height: 1.05; }
@media (prefers-reduced-motion: reduce) { .insignia.estampa { animation: none; } }

/* Onboarding */
.opcions-tria { display: grid; gap: 8px; }
.opcio-tria { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; text-align: left; font-weight: 500; font-size: 17px; }
.opcio-tria .marca { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; }
.opcio-tria .marca svg { width: 14px; height: 14px; }
.opcio-tria[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opcio-tria[aria-pressed="true"] .marca { background: var(--seal); border-color: var(--seal); color: var(--on-seal); }
.separa { height: 4px; }
.ob-barra { flex: 1; }
.frases-nivell { display: grid; gap: 8px; }
.situacio { display: grid; gap: 18px; }
.xips-grup { display: grid; gap: 8px; }
.xips-grup .eyebrow { margin: 0; }
.situacio .ajuda { margin: -10px 0 0; color: var(--muted); font-size: 14px; }
.xips { display: flex; flex-wrap: wrap; gap: 8px; }
.xips button { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  cursor: pointer; font-weight: 500; font-size: 16px; color: var(--ink); }
.xips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
#ciutat { scroll-margin: 24px; }
.segments button { padding: 10px 18px; font-size: 16px; }
.rodona-ok.espera { background: var(--surface-2); color: var(--ink-2); }
