/* Shared styles of the FLSCO 2 site; system font stack only (the login page is allowed nothing else). */
:root { --bg: #f6f4ef; --fg: #1d2330; --accent: #2457c5; --danger: #b3261e; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg); font: 18px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.login { min-height: 100vh; display: grid; place-content: center; padding: 1rem; }
.login form { display: grid; gap: .75rem; width: min(20rem, 90vw); }
.login label { font-weight: 600; }
.login input, .login button { font: inherit; padding: .7rem .9rem; border-radius: .5rem; border: 1px solid #9aa3b5; }
.login button { background: var(--accent); color: #fff; border-color: var(--accent); cursor: pointer; }
.login-error { color: var(--danger); font-weight: 600; }

/* Scoreboard (iPad): everything fits the viewport, sizes follow the smaller side */
.board-page { height: 100vh; height: 100dvh; overflow: hidden; background: #fffaf0; color: #1b2a4a; }
.board { height: 100%; display: flex; flex-direction: column; padding: 2.2vmin 3vmin; gap: 1.6vmin; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 2vmin; }
.board-head h1 { margin: 0; font-size: 5vmin; line-height: 1.1; text-align: center; }
.board-head small { display: block; font-size: 3vmin; font-weight: 600; color: #5b6784; }
.board-head button { font: inherit; font-size: 5vmin; width: 9vmin; height: 9vmin; border-radius: 50%; border: 0; background: #fff; color: #1b2a4a; box-shadow: 0 .3vmin 1vmin #0003; cursor: pointer; touch-action: manipulation; }
.board-head button:disabled { opacity: .3; cursor: default; }
.board-rows { flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 1.2vmin; }
.row { flex: 1; min-height: 0; display: grid; grid-template-columns: 24vmin 1fr 12vmin 9vmin; align-items: center; gap: 2vmin; background: #fff; border-radius: 2vmin; padding: 0 2.5vmin; box-shadow: 0 .2vmin .8vmin #0002; }
.name { font-size: 3.6vmin; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name small { font-size: 2.3vmin; font-weight: 600; color: #777; }
.track { height: 55%; border-radius: 99vmax; background: #f3efe4; overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 99vmax; background: linear-gradient(90deg, #f5b700, #ff7a59); transition: width .5s; }
.total { font-size: 6vmin; font-weight: 800; text-align: right; line-height: 1; }
.gain { font-size: 3vmin; font-weight: 700; color: #2f8f4e; }
.board-status { margin: 0; min-height: 1.4em; text-align: center; font-size: 2.4vmin; color: var(--danger); font-weight: 600; }

/* Top bar shared by carnet, tableau and classe */
.topnav { display: flex; align-items: center; gap: .3rem; padding: .4rem .8rem; background: #1d2330; }
.topnav a { color: #fff; text-decoration: none; padding: .45rem .8rem; border-radius: .4rem; font-weight: 600; }
.topnav a[aria-current="page"] { background: #ffffff26; }
.topnav button.logout { margin-left: auto; min-height: 2.4rem; padding: .3rem .8rem; border-radius: .4rem; border: 1px solid #ffffff66; background: transparent; color: #fff; font: inherit; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.pending:not([hidden]) + button.logout { margin-left: .5rem; }
.pending { margin-left: auto; background: #f5b700; color: #1d2330; font-weight: 700; padding: .25rem .7rem; border-radius: 99px; font-size: .9em; }
.notice { margin: 0; padding: 0 1rem; color: var(--danger); font-weight: 600; }
.notice:empty { display: none; }
.board-page { display: flex; flex-direction: column; }
.board-page .topnav { font-size: 2.2vmin; padding: .6vmin 2vmin; }
.board-page .board { flex: 1; min-height: 0; height: auto; }

/* Logbook and class pages */
.page { max-width: 64rem; margin: 0 auto; padding: 1rem; }
.page button, .page input, .page textarea, .page select { font: inherit; }
.page button { min-height: 2.75rem; padding: .4rem .9rem; border-radius: .5rem; border: 1px solid #9aa3b5; background: #fff; color: var(--fg); cursor: pointer; touch-action: manipulation; }
.page button.danger { color: var(--danger); border-color: var(--danger); }
.page button:disabled { opacity: .35; cursor: default; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.day-head h1 { margin: 0; font-size: 1.6rem; text-align: center; }
.day-head button { width: 3.2rem; height: 3.2rem; border-radius: 50%; font-size: 1.4rem; }
.session { margin: 1.2rem 0; padding: 1rem; background: #fff; border-radius: .8rem; box-shadow: 0 1px 4px #0002; scroll-margin-top: 1rem; }
.session.current { outline: 3px solid var(--accent); }
.session h2 { margin: 0 0 .6rem; font-size: 1.2rem; }
.badge { font-size: .8rem; background: var(--accent); color: #fff; padding: .15rem .55rem; border-radius: 99px; vertical-align: middle; }
.session-tools, .games, .actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.activity { border: 1px solid #d7dbe4; border-radius: .6rem; padding: .7rem; margin: .6rem 0; }
.activity.waiting { opacity: .6; border-style: dashed; }
.activity header { display: flex; align-items: baseline; gap: .7rem; }
.activity h3 { margin: 0; font-size: 1.1rem; }
.kind { font-size: .85rem; color: #5b6784; }
.comment { margin: .3rem 0; color: #3b4458; white-space: pre-wrap; }
.activity footer { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .5rem; }
.grades { display: grid; gap: .35rem; margin-top: .5rem; }
.pupil { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.pupil .who { min-width: 8rem; font-weight: 600; }
.who small { color: #777; font-weight: 600; }
.marks { display: inline-flex; gap: .25rem; }
.page .mark { min-width: 2.75rem; padding: .3rem; }
.page .mark[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.bonus { font-weight: 800; color: #2f8f4e; }
.edit { display: grid; gap: .5rem; margin-top: .6rem; }
.edit label { display: grid; gap: .2rem; font-weight: 600; }
.edit input, .edit textarea, .edit select { padding: .5rem .7rem; border: 1px solid #9aa3b5; border-radius: .5rem; }
.empty { text-align: center; color: #5b6784; margin: 2rem 0; }
.students { list-style: none; padding: 0; display: grid; gap: .5rem; }
.student { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; background: #fff; padding: .6rem .8rem; border-radius: .6rem; box-shadow: 0 1px 3px #0002; }
.student.inactive .who { color: #8a8f99; text-decoration: line-through; }
.student.waiting { opacity: .6; }
.student .tools { display: flex; gap: .35rem; flex-wrap: wrap; }
.student-form { background: #fff; padding: 1rem; border-radius: .6rem; }
.student-form h2 { margin: 0; font-size: 1.1rem; }
.notice { display: flex; align-items: center; gap: .6rem; }
.page .notice-close, .notice-close { min-height: 2.2rem; min-width: 2.2rem; border: 1px solid var(--danger); background: #fff; color: var(--danger); border-radius: 50%; font: inherit; cursor: pointer; }

/* Activity frame (projected on the computer screen or the iPad): header, game, name bar at the bottom */
.shell-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #fffaf0; }
.shell-page button { font: inherit; cursor: pointer; touch-action: manipulation; border-radius: .6rem; border: 1px solid #9aa3b5; background: #fff; color: var(--fg); min-height: 3rem; padding: .4rem 1rem; }
.shell-page button:disabled { opacity: .35; cursor: default; }
.shell-head { display: flex; align-items: center; gap: .8rem; padding: .4rem .8rem; background: #1d2330; color: #fff; }
.shell-head h1 { margin: 0; font-size: 1.3rem; flex: 1; text-align: center; }
.shell-head .back { color: #fff; font-weight: 600; text-decoration: none; padding: .6rem .8rem; border-radius: .4rem; background: #ffffff1f; }
.shell-head .pending { margin-left: 0; }
.shell-head .fs { min-height: 2.6rem; background: #ffffff1f; color: #fff; border-color: #ffffff55; }
.offbook { margin: 0; padding: .4rem 1rem; background: #fde7a8; color: #6a4d00; font-weight: 700; text-align: center; }
.shell-main { flex: 1; min-height: 0; overflow: auto; padding: 1rem; }

/* Name bar: one row of 8 (two rows of 4 on a narrow portrait screen); big +1 targets, small but tappable −1 */
.namebar { flex: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .5rem; padding: .5rem; background: #1d2330; }
.nb-cell { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.shell-page .nb-plus { min-height: 4rem; padding: .3rem .2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; background: #fff; border: 0; font-weight: 700; }
.nb-name { font-size: clamp(.95rem, 1.7vw, 1.5rem); max-width: 100%; overflow-wrap: anywhere; }
.nb-plus .score { font-size: clamp(1.2rem, 2.4vw, 2rem); font-weight: 800; color: var(--accent); }
.shell-page .nb-minus { min-height: 2.2rem; padding: 0; font-size: .9rem; background: #ffffff1f; color: #fff; border-color: #ffffff40; }
.nb-plus.bump { animation: bump .25s ease-out; }
@keyframes bump { 40% { transform: scale(1.08); background: #ffe28a; } }
@media (orientation: portrait) and (max-width: 1000px) { .namebar { grid-template-columns: repeat(4, minmax(0, 1fr)); } .nb-name { font-size: clamp(.95rem, 3vw, 1.5rem); } .nb-plus .score { font-size: clamp(1.2rem, 4vw, 2rem); } }

/* Session tools page */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; align-content: start; }
.tool { background: #fff; border-radius: 1rem; padding: 1rem; box-shadow: 0 1px 4px #0002; text-align: center; }
.tool h2 { margin: 0 0 .5rem; font-size: 1.2rem; color: #5b6784; }
.tool-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: .5rem 0; }
.shell-page button.big { font-size: 1.3rem; font-weight: 700; min-height: 3.5rem; }
.tool-note { margin: .3rem 0 0; color: #5b6784; }
.wheel-name { margin: .5rem 0; font-size: clamp(2.2rem, 5vw, 5rem); overflow-wrap: anywhere; font-weight: 800; line-height: 1.1; min-height: 1.2em; color: #1b2a4a; }
.wheel-name.chosen { animation: pop .5s ease-out; color: var(--accent); }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.timer-digits { margin: .5rem 0; font-size: clamp(3rem, 9vw, 7rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.timer-digits.done { color: #2f8f4e; font-size: clamp(2.2rem, 6vw, 4.5rem); }
.teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .6rem; }
.team { border: 2px solid #d7dbe4; border-radius: .8rem; padding: .5rem; }
.team h3 { margin: 0; font-size: 1.05rem; }
.team ul { list-style: none; margin: .3rem 0; padding: 0; font-size: 1.2rem; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .nb-plus.bump, .wheel-name.chosen { animation: none; } }

/* Word of the day (outils) */
.wod-image { margin: 0; font-size: clamp(4rem, 12vw, 9rem); line-height: 1.1; }
.wod-word { margin: .3rem 0 0; font-size: clamp(1.8rem, 4vw, 3.2rem); font-weight: 800; color: #1b2a4a; }

/* Vocabulary and genre games: settings rows, a big prompt, 4 (or 2) big answers, green / red feedback */
.vocab { display: flex; flex-direction: column; align-items: center; }
.vocab-settings { display: grid; gap: .8rem; width: min(60rem, 100%); }
.choice-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.choice-label { min-width: 6rem; font-weight: 700; color: #5b6784; }
.shell-page .choice-row button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.shell-page button.start { justify-self: center; min-width: 14rem; background: #2f8f4e; border-color: #2f8f4e; color: #fff; }
.vocab-card { width: min(64rem, 100%); display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.vocab-progress { margin: 0; font-weight: 700; color: #5b6784; text-align: center; }
.vocab-turn { color: var(--accent); }
.vocab-prompt { margin: 0; text-align: center; line-height: 1.1; }
.vocab-prompt.picture { font-size: clamp(5rem, 22vmin, 12rem); }
.vocab-prompt.word { font-size: clamp(2.4rem, 8vmin, 5rem); font-weight: 800; color: #1b2a4a; }
.genre-prompt { display: flex; flex-direction: column; align-items: center; }
.answers { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.shell-page button.answer { min-height: 5rem; font-size: clamp(1.4rem, 3.5vmin, 2.2rem); font-weight: 700; border-width: 3px; }
.shell-page button.answer.picture { font-size: clamp(3rem, 9vmin, 5rem); line-height: 1.1; }
.shell-page button.genre-answer { min-height: 8rem; font-size: clamp(3rem, 10vmin, 6rem); }
.shell-page button.answer:disabled { opacity: 1; cursor: default; }
.shell-page button.answer.right { background: #d8f3df; border-color: #2f8f4e; color: #1d5c32; }
.shell-page button.answer.wrong { background: #fbe0de; border-color: var(--danger); color: var(--danger); }
.shell-page button.answer:disabled:not(.right):not(.wrong) { opacity: .45; }
.vocab-feedback { min-height: 6rem; text-align: center; }
.verdict { margin: 0; font-size: clamp(1.4rem, 4vmin, 2.4rem); font-weight: 800; }
.verdict.right { color: #2f8f4e; }
.verdict.wrong { color: var(--danger); }
.genre-why { margin: .2rem 0; font-size: clamp(1.2rem, 3.4vmin, 2rem); font-weight: 600; }
.shell-page button.team-point { background: #f5b700; border-color: #f5b700; color: #1d2330; }
.vocab-end { text-align: center; }
.vocab-score { font-size: clamp(1.6rem, 5vmin, 3rem); font-weight: 800; margin: .4rem 0; }

/* Class instructions game: big consigne, items under an SVG overlay that follows mouse and finger alike */
.consigne-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .8rem; }
.consigne-texte { margin: 0; text-align: center; font-size: clamp(1.8rem, 5.5vmin, 3.4rem); font-weight: 800; line-height: 1.15; color: #1b2a4a; }
.cible { position: relative; width: 100%; padding: 1.5rem 1rem; background: #fff; border-radius: 1rem; box-shadow: 0 1px 4px #0002; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.cible-trace { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.cible-trace .trace-live, .cible-trace .mark { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.cible-trace .trace-live { stroke-opacity: .55; }
.cible.barre .mark { stroke: var(--danger); }
.cible-trace line.mark { stroke: #2f8f4e; stroke-width: 6; }
.cible-items { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2.5rem 3rem; }
.shell-page .cible button.cible-item { min-height: 4.5rem; min-width: 5rem; padding: .4rem 1rem; font-size: clamp(1.5rem, 4.5vmin, 2.6rem); font-weight: 700; border: 3px solid transparent; background: #f6f4ef; color: #1d2330; cursor: pointer; touch-action: none; }
.shell-page .cible button.cible-item:disabled { opacity: 1; cursor: default; }
.shell-page .cible.colorie button.cible-item[aria-pressed="true"] { background: #ffd84d; border-color: #e0a800; }
.shell-page .cible.trou button.cible-item[aria-pressed="true"], .shell-page .cible.relie button.cible-item[aria-pressed="true"] { border-color: var(--accent); }
.shell-page .cible.relie button.cible-item.picked { background: #dfe8fb; }
.cible.relie { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(4rem, 18vw, 14rem); }
.relie-col { display: flex; flex-direction: column; gap: 1.2rem; }
.relie-col.gauche { align-items: flex-end; }
.relie-col.droite { align-items: flex-start; }
.cible.trou, .cible.copie { touch-action: manipulation; }
.trou-phrase { margin: 0 0 1.5rem; text-align: center; font-size: clamp(1.8rem, 5vmin, 3rem); font-weight: 700; }
.trou-mot { display: inline-block; min-width: 4em; margin: 0 .2em; border-bottom: 4px solid var(--accent); color: #5b6784; text-align: center; }
.trou-mot.filled { color: var(--accent); }
.copie-modele { margin: 0; text-align: center; font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-size: clamp(2.6rem, 9vmin, 6rem); line-height: 1.3; color: #1b2a4a; }
.teacher-note { align-self: center; font-weight: 700; color: #5b6784; }
.shell-page button.teacher-good { background: #2f8f4e; border-color: #2f8f4e; color: #fff; }
.shell-page button.teacher-again { background: #fff; border-color: var(--danger); color: var(--danger); }

/* Numbers game: big digits, the answer typed, a large digit pad for finger and mouse */
.nombre-grand { margin: .5rem 0; font-size: clamp(4rem, 16vmin, 10rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; color: #1b2a4a; }
.nombre-reponse { display: block; font-size: clamp(2.2rem, 7vmin, 4.5rem); font-weight: 800; font-variant-numeric: tabular-nums; color: #1b2a4a; }
.nombre-lettres { display: block; margin: .2rem 0; font-size: clamp(1.4rem, 4.5vmin, 2.6rem); font-weight: 700; color: var(--accent); }
.nombre-secret { margin: 0; padding: .4rem 1.2rem; border: 3px dashed #5b6784; border-radius: .8rem; background: #fff; text-align: center; }
.probleme-enonce { margin: 0; max-width: 48rem; text-align: center; font-size: clamp(1.5rem, 4.2vmin, 2.6rem); font-weight: 700; line-height: 1.25; color: #1b2a4a; }
.saisie { display: block; min-width: 8ch; padding: .2rem 1rem; border-bottom: 5px solid var(--accent); text-align: center; font-size: clamp(2.6rem, 9vmin, 5.5rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: pre; color: #1b2a4a; }
.saisie.empty { color: #b3b9c6; }
.pad { display: grid; grid-template-columns: repeat(3, minmax(5rem, 8rem)); gap: .6rem; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.shell-page .pad button.pad-key { min-height: clamp(3.6rem, 9vmin, 5rem); font-size: clamp(1.8rem, 5vmin, 2.6rem); font-weight: 800; }
.shell-page .pad button.pad-key.effacer, .shell-page .pad button.pad-key.valider { font-size: clamp(1rem, 2.6vmin, 1.4rem); }
.shell-page .pad button.pad-key.valider { background: #2f8f4e; border-color: #2f8f4e; color: #fff; }
.shell-page .pad button.pad-key:disabled { opacity: .45; }
.shell-page button.hold { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* Sentence game: big word labels in a réserve row and an answer row, moved by tap or drag (mouse and finger) */
.phrase-zone { width: 100%; display: flex; flex-direction: column; gap: .4rem; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.phrase-titre { margin: .3rem 0 0; font-weight: 700; color: #5b6784; }
.phrase-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; min-height: 6rem; padding: 1rem; border-radius: 1rem; }
.phrase-reserve { background: #f6f4ef; }
.phrase-reponse { background: #fff; border: 4px dashed #b3b9c6; box-shadow: 0 1px 4px #0002; }
.phrase-reponse.right { border: 4px solid #2f8f4e; background: #d8f3df; }
.phrase-reponse.wrong { border: 4px solid var(--danger); background: #fbe0de; }
.shell-page .phrase-zone button.etiquette { min-height: 4.5rem; min-width: 4rem; padding: .4rem 1.1rem; font-size: clamp(1.6rem, 5vmin, 3rem); font-weight: 700; border: 3px solid #1b2a4a; border-radius: .7rem; background: #fff; color: #1d2330; cursor: grab; touch-action: none; }
.shell-page .phrase-zone button.etiquette:disabled { opacity: 1; cursor: default; }
.shell-page .phrase-zone button.etiquette.dragging { position: relative; z-index: 2; cursor: grabbing; box-shadow: 0 8px 18px #0004; }
.phrase-solution { margin: .2rem 0; font-size: clamp(1.6rem, 5vmin, 3rem); font-weight: 800; color: #1b2a4a; }

/* Reading game: the paragraph very big beside (landscape) or under (portrait) its picture, then 3 big answers */
.lecture-titre { margin: 0; font-size: clamp(1.6rem, 4.5vmin, 2.6rem); color: #1b2a4a; text-align: center; }
.lecture-bloc { width: 100%; display: flex; align-items: center; gap: 1.2rem; }
.lecture-figure { flex: 0 0 38%; margin: 0; }
.lecture-image { display: block; width: 100%; max-height: 55vh; object-fit: contain; border-radius: 1rem; box-shadow: 0 1px 4px #0002; }
.lecture-texte { flex: 1; margin: 0; font-size: clamp(1.5rem, 4.2vmin, 2.6rem); font-weight: 600; line-height: 1.4; color: #1b2a4a; }
@media (orientation: portrait) { .lecture-bloc { flex-direction: column; } .lecture-figure { flex-basis: auto; width: min(32rem, 100%); } .lecture-image { max-height: 35vh; } }
.lecture-question { margin: 0; max-width: 52rem; text-align: center; font-size: clamp(1.8rem, 5.5vmin, 3.2rem); font-weight: 800; line-height: 1.2; color: #1b2a4a; }
.answers.trois { grid-template-columns: minmax(0, 1fr); max-width: 52rem; }
.lecture-bonne { margin: .2rem 0; font-size: clamp(1.3rem, 3.6vmin, 2.1rem); font-weight: 700; color: #1d5c32; }
.lecture-relire { width: 100%; display: flex; flex-direction: column; gap: 1rem; }
.lecture-relire[hidden] { display: none; }
.lecture-relire .lecture-texte { font-size: clamp(1.2rem, 3.2vmin, 2rem); }
