@font-face {
    font-family: 'Bravura';
    /* Police servie par le plugin : pas de dépendance externe. */
    src: url('../fonts/Bravura.woff2') format('woff2');
    font-display: block;
}
.tph-app {
    --ink:    #16202b;
    --paper:  #f7f5f0;
    --card:   #ffffff;
    --line:   #dfdbd2;
    --mute:   #77828e;
    --brass:  #a8762c;
    --tph-ok:    #197a4b;
    --tph-retry: #b8541c;
    --tph-help:  #2b5fa8;
    --tph-staff-line: #16202b;
    --tph-staff-note: #16202b;
    --tph-staff-hint: #77828e;
}
.tph-app {
    width: 100%; max-width: 620px; margin: 1.5rem auto;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink); line-height: 1.5;
}
.tph-app *, .tph-app *::before, .tph-app *::after { box-sizing: border-box; }
.tph-app .panel {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 1.75rem; text-align: center;
}
.tph-app [data-screen] > section { display: none; }
.tph-app [data-screen="setup"] .s-setup, .tph-app [data-screen="check"] .s-check, .tph-app [data-screen="play"]  .s-play, .tph-app [data-screen="done"]  .s-done { display: block; }
.tph-app h1 { font-size: 1.4rem; font-weight: 600; margin: 0 0 .4rem; letter-spacing: -.01em; }
.tph-app .sub { color: var(--mute); font-size: .92rem; margin: 0 0 1.5rem; }
.tph-app .fields { display: grid; gap: .85rem; text-align: left; margin-bottom: 1.5rem; }
.tph-app label { display: grid; gap: .25rem; font-size: .78rem; color: var(--mute); font-weight: 500; }
.tph-app select {
    font: inherit; font-size: .95rem; padding: .6rem .7rem; width: 100%;
    border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
}
.tph-app button {
    font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer;
    padding: .7rem 1.4rem; border-radius: 8px; border: 1px solid var(--line);
    background: var(--card); color: var(--ink);
}
.tph-app button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tph-app button:disabled { opacity: .35; cursor: not-allowed; }
.tph-app button:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.tph-app .picker { text-align: left; margin-bottom: 1.4rem; }
.tph-app .picker-h { font-size: .78rem; color: var(--mute); font-weight: 500; margin: 0 0 .1rem; }
.tph-app .picker-sub { font-size: .84rem; margin: 0 0 .5rem; }
.tph-app .picker-sub strong { color: var(--brass); }
.tph-app .picker-staff {
    overflow-x: auto; overflow-y: hidden;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--paper); padding: .4rem .2rem;
    -webkit-overflow-scrolling: touch;
}
.tph-app .picker-staff svg { min-width: 100%; }
.tph-app .tph-staff-hit:hover { fill: rgba(168, 118, 44, .10); }
.tph-app .hud {
    display: flex; justify-content: space-between;
    font-size: .78rem; color: var(--mute); font-variant-numeric: tabular-nums;
    margin-bottom: .5rem;
}
.tph-app .staff { min-height: 190px; display: flex; align-items: center; justify-content: center; }
.tph-app .staff-sm { margin: 1rem 0; }
.tph-app .gauge { position: relative; height: 8px; background: #ece8e0; border-radius: 4px; margin: 1.2rem 0 0; }
.tph-app .gauge .mid { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--line); }
.tph-app .gauge .cur {
    position: absolute; top: -5px; width: 5px; height: 18px; border-radius: 3px;
    background: #c9c3b8; transform: translateX(-50%); left: 50%; transition: left .07s linear;
}
.tph-app .cur.ok { background: var(--tph-ok); }
.tph-app .cur.low { background: var(--tph-help); }
.tph-app .cur.high { background: var(--tph-retry); }
.tph-app .verdict { font-size: 1.3rem; font-weight: 650; margin: 1.1rem 0 0; min-height: 3.1em; }
.tph-app .verdict span { display: block; font-size: .85rem; font-weight: 400; color: var(--mute); margin-top: .3rem; }
.tph-app .verdict.ok { color: var(--tph-ok); }
.tph-app .verdict.low { color: var(--tph-help); }
.tph-app .verdict.high { color: var(--tph-retry); }
.tph-app .helpbox:not(:empty) {
    background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
    padding: .8rem; margin-top: .5rem; font-size: .88rem;
}
.tph-app .fing strong { font-size: 1.6rem; display: block; color: var(--brass); font-variant-numeric: tabular-nums; }
.tph-app .fing em { font-style: normal; color: var(--mute); font-size: .82rem; display: block; margin-top: .2rem; }
.tph-app .fing em b { color: var(--brass); font-weight: 650; }
.tph-app .actions { display: flex; gap: .6rem; justify-content: center; margin-top: 1.2rem; }
.tph-app .level { height: 8px; background: #ece8e0; border-radius: 4px; overflow: hidden; margin: 1.2rem 0 .8rem; }
.tph-app .level > div { height: 100%; width: 0; background: var(--brass); transition: width .07s linear; }
.tph-app .score { font-size: 1.05rem; margin: 0 0 .3rem; }
.tph-app .score strong { font-size: 1.6rem; display: block; }
.tph-app .score span { font-size: .85rem; color: var(--mute); }
.tph-app .legend { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; font-size: .75rem; color: var(--mute); margin: 1rem 0 .3rem; }
.tph-app .legend i { font-style: normal; }
.tph-app .legend i::before { content: '●'; margin-right: .3rem; }
.tph-app .l-ok::before { color: var(--tph-ok); }
.tph-app .l-retry::before { color: var(--tph-retry); }
.tph-app .l-help::before { color: var(--tph-help); }
.tph-app .weak { text-align: left; font-size: .88rem; margin-top: 1rem; }
.tph-app .weak h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin: 0 0 .4rem; }
.tph-app .weak ul { margin: 0; padding-left: 1.1rem; }
.tph-app .weak li { margin-bottom: .2rem; }
.tph-app .msg { font-size: .85rem; color: var(--mute); min-height: 2.4em; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


/* Historique des séances, pour les élèves connectés */
.tph-app .history { margin-top: 1.25rem; text-align: left; }
.tph-app .history h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--mute); margin: 0 0 .5rem; }
.tph-app .history table { width: 100%; border-collapse: collapse; font-size: .82rem;
    font-variant-numeric: tabular-nums; }
.tph-app .history th { text-align: left; font-weight: 500; color: var(--mute);
    font-size: .72rem; padding: .3rem .4rem; }
.tph-app .history td { padding: .3rem .4rem; border-top: 1px solid var(--line); }
.tph-app .saved { font-size: .78rem; color: var(--mute); margin-top: .6rem; }
