/* The sounds site: the look of the A1 stories (sky, thick outlines, solid offset shadows) with the games' Inter font.
   Sized for the classroom projector: large type, high-contrast cards. No dark theme. */
@font-face {
  font-family: Inter; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("assets/fonts/inter-latin-ext.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+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --sky: #9fd8ff; --sky-2: #e9f7ff; --ink: #1d2b4f; --blue: #13598b; --gold: #f5b51b;
  --green: #17743f; --paper: #fffdf6; --line: #1d2b4f; --muted: #e6ecf2; --muted-ink: #3d4a66;
  --font: Inter, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--font); font-weight: 600; overflow-wrap: anywhere;
  background: radial-gradient(circle at 15% 10%, #fff 0 60px, transparent 61px), radial-gradient(circle at 80% 6%, #fff 0 40px, transparent 41px), linear-gradient(var(--sky), var(--sky-2) 60%) fixed;
}
button { font: inherit; color: inherit; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 24px 16px 60px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.hero { min-width: 0; }
.hero h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; text-shadow: 3px 3px 0 #fff; }
.subtitle { margin: 8px 0 0; font-size: clamp(1.1rem, 1.8vw, 1.5rem); font-weight: 700; }
.tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.language-selector { display: flex; gap: 6px; flex-wrap: wrap; }
.language-button { border: 3px solid var(--line); border-radius: 999px; background: #fff; padding: 4px 12px; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.language-button[aria-pressed="true"] { background: var(--gold); }

.btn { display: inline-block; border: 4px solid var(--line); border-radius: 20px; background: #fff; padding: 8px 18px; font-weight: 800; font-size: clamp(1.1rem, 1.7vw, 1.5rem); line-height: 1.2; color: var(--ink); text-decoration: none; cursor: pointer; box-shadow: 0 5px 0 var(--line); }
.btn.small { padding: 4px 14px; border-width: 3px; border-radius: 16px; font-size: 1rem; box-shadow: 0 3px 0 var(--line); }
.btn.go { background: var(--gold); text-align: center; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.btn:focus-visible, .language-button:focus-visible, .activity-link:focus-visible { outline: 4px solid #3aa0ff; outline-offset: 3px; }

.activities { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.activity { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; min-height: 260px; padding: 22px 22px 20px; background: var(--paper); border: 4px solid var(--line); border-radius: 26px; box-shadow: 0 8px 0 var(--line); }
.activity-icon { font-size: clamp(2.6rem, 5vw, 3.6rem); line-height: 1; }
.activity h3 { margin: 0; font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 800; line-height: 1.1; }
.activity p { margin: 0; font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.35; }
.activity.open { background: var(--gold); transition: transform 0.15s; }
.activity.open:hover { transform: translateY(-4px) rotate(-0.6deg); }
.activity-link { color: inherit; text-decoration: none; }
/* The whole card is the link's target. */
.activity-link::after { content: ""; position: absolute; inset: 0; border-radius: 22px; }
.activity-go { justify-self: end; display: grid; place-items: center; width: 56px; height: 56px; border: 4px solid var(--line); border-radius: 50%; background: #fff; font-size: 1.8rem; font-weight: 800; box-shadow: 0 4px 0 var(--line); }
.activity.soon { background: var(--muted); color: var(--muted-ink); border-style: dashed; box-shadow: none; }
.activity.soon .activity-icon { filter: grayscale(0.7); opacity: 0.75; }
.soon-badge { justify-self: start; border: 3px solid var(--line); border-radius: 12px; padding: 2px 12px; background: #fff; color: var(--ink); font-size: 1.05rem; font-weight: 800; }

.foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 36px; font-size: 1.15rem; font-weight: 700; }

.offline-page { max-width: 640px; text-align: center; padding-top: 60px; }
.offline-page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.offline-page p { font-size: 1.2rem; line-height: 1.4; }

/* Teacher's voice: header menu, 🎙 buttons, recording panel (voice-teacher.js). */
.voice-teacher { position: relative; }
.voice-menu-button.signed-in { background: #d8f5e3; }
.voice-popover { position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; width: min(320px, calc(100vw - 32px)); padding: 10px; background: var(--paper); border: 3px solid var(--line); border-radius: 18px; box-shadow: 0 5px 0 var(--line); }
.voice-menu { display: grid; gap: 6px; }
.voice-menu-item { width: 100%; text-align: left; border: 3px solid var(--line); border-radius: 14px; background: #fff; padding: 8px 12px; font-weight: 800; cursor: pointer; }
.voice-menu-item:hover, .voice-menu-item:focus-visible { background: var(--gold); outline: none; }
.voice-menu-state { margin: 0 0 8px; font-size: 0.95rem; color: var(--muted-ink); }
.voice-menu-status, .voice-panel-status { margin: 8px 0 0; font-size: 1rem; }
.voice-menu-status:empty { display: none; }
.voice-menu-status.error, .voice-panel-status.error { color: #a4161a; }
.voice-record { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 3px solid var(--line); border-radius: 50%; background: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; box-shadow: 0 3px 0 var(--line); vertical-align: middle; }
.voice-record:focus-visible, .voice-menu-item:focus-visible, .voice-panel button:focus-visible, .voice-panel input:focus-visible { outline: 4px solid #3aa0ff; outline-offset: 3px; }
.voice-dot { position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: var(--green); display: none; }
.voice-record[data-recorded="true"] .voice-dot { display: block; }
.voice-panel { width: min(560px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); overflow: auto; padding: 20px; color: var(--ink); background: var(--paper); border: 4px solid var(--line); border-radius: 24px; box-shadow: 0 8px 0 var(--line); }
.voice-panel::backdrop { background: rgba(29, 43, 79, 0.5); }
.voice-panel-title { margin: 0 0 6px; font-size: 1.3rem; font-weight: 800; }
.voice-panel-text { margin: 6px 0; font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 800; line-height: 1.2; }
.voice-panel-label { margin: 0 0 8px; font-size: 1.2rem; color: var(--muted-ink); }
.voice-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.voice-meter-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.voice-meter { flex: 1; height: 16px; overflow: hidden; border: 3px solid var(--line); border-radius: 999px; background: #fff; }
.voice-meter span { display: block; width: 0; height: 100%; background: var(--green); transition: width 0.06s linear; }
.voice-clock { font-variant-numeric: tabular-nums; white-space: nowrap; }
.voice-player { display: block; width: 100%; margin-top: 12px; }
.voice-setup { display: grid; gap: 8px; margin-top: 8px; }
.voice-setup input { font: inherit; padding: 8px 12px; border: 3px solid var(--line); border-radius: 14px; background: #fff; }
.voice-setup .btn { justify-self: start; }
.voice-close { margin-top: 16px; }

/* Chasse au son (chasse.html). The text size follows the screen; in full screen it follows its height too, so an
   8-line comptine fits a 1280 × 720 projector without scrolling. */
.hero .back-link { margin-bottom: 10px; }
.hunt-page .top { margin-bottom: 18px; }
.comptine-choices h2 { margin: 0 0 16px; font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 800; }
.comptine-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.comptine-choice { display: grid; gap: 8px; height: 100%; padding: 20px 22px; color: var(--ink); text-decoration: none; background: var(--paper); border: 4px solid var(--line); border-radius: 24px; box-shadow: 0 6px 0 var(--line); transition: transform 0.15s; }
.comptine-choice:hover { transform: translateY(-3px); }
.comptine-choice:focus-visible { outline: 4px solid #3aa0ff; outline-offset: 3px; }
.comptine-sound { font-size: clamp(1.3rem, 2vw, 1.6rem); }
.comptine-symbol, .hunt-symbol { display: inline-block; padding: 0 0.3em; border: 3px solid var(--line); border-radius: 12px; background: var(--gold); font-weight: 800; }
.comptine-key { font-weight: 800; }
.comptine-title { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 800; line-height: 1.15; }
.hunt-empty { padding: 20px 22px; font-size: 1.3rem; background: var(--paper); border: 4px dashed var(--line); border-radius: 24px; }

.hunt { --hunt-size: clamp(1.45rem, 3.4vw, 2.8rem); }
.hunt-bar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.hunt-bar > p { margin: 0; }
.hunt-sound { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: clamp(1.4rem, 2.6vw, 2.2rem); }
.hunt-count { padding: 4px 16px; border: 4px solid var(--line); border-radius: 999px; background: #fff; font-size: clamp(1.3rem, 2.4vw, 2rem); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hunt-recorded { padding: 2px 12px; border: 3px solid var(--line); border-radius: 999px; background: #d8f5e3; font-size: 1rem; white-space: nowrap; }
.hunt-end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hunt-end-message { margin: 0; padding: 4px 14px; border: 4px solid var(--line); border-radius: 16px; background: var(--gold); font-size: clamp(1.1rem, 2vw, 1.6rem); font-weight: 800; }
.hunt-voice-status { font-size: 1rem; color: #a4161a; }
.hunt-voice-status:empty { display: none; }
.hunt-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.hunt-title { margin: 16px 0 4px; font-size: clamp(1.5rem, 2.8vw, 2.4rem); font-weight: 800; }
.hunt-help { margin: 0 0 12px; font-size: 1.1rem; color: var(--muted-ink); }
.hunt-text { display: grid; gap: 4px; margin: 0; padding: clamp(10px, 2vw, 24px); list-style: none; background: var(--paper); border: 4px solid var(--line); border-radius: 26px; box-shadow: 0 8px 0 var(--line); }
.hunt-line { display: flex; align-items: center; gap: 10px; padding: 2px 6px; border-radius: 14px; font-size: var(--hunt-size); line-height: 1.3; }
.hunt-line.reading { background: #fff1b8; }
.hunt-line-text { flex: 1; min-width: 0; word-spacing: 0.2em; }
.hunt-unit { white-space: nowrap; }
.hunt-tools { display: inline-flex; gap: 8px; flex: none; font-size: 1rem; }
.hunt-sound .hunt-tools { font-size: 1rem; }
/* The box overlaps the space after the word (negative right margin), so punctuation keeps its place
   (« Margot, »); the left margin stays, so two neighbouring boxes always keep a visible gap. */
.hunt-word { margin: 0 calc(-0.06em - 2px) 0 0; padding: 0 0.06em; border: 2px solid transparent; border-radius: 12px; background: transparent; font: inherit; font-weight: 700; line-height: 1.2; color: inherit; cursor: pointer; touch-action: manipulation; }
.hunt-word:hover { background: rgba(255, 255, 255, 0.9); border-color: var(--muted); }
.hunt-word:focus-visible, .hunt-listen:focus-visible { outline: 4px solid #3aa0ff; outline-offset: 2px; }
.hunt-word[data-state="found"] { background: var(--gold); border-color: var(--line); }
.hunt-word[data-state="revealed"] { background: #d8f5e3; border-color: var(--line); border-style: dashed; }
.hunt-word[data-state="found"] .hunt-spelling, .hunt-word[data-state="revealed"] .hunt-spelling { color: #8a1c1c; text-decoration-line: underline; text-decoration-thickness: 0.12em; text-underline-offset: 0.14em; }
.hunt-word[data-state="bad"] { background: #ffd9d9; border-color: #a4161a; animation: hunt-shake 0.5s; }
@keyframes hunt-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-0.18em); } 40%, 80% { transform: translateX(0.18em); } }
@media (prefers-reduced-motion: reduce) { .hunt-word[data-state="bad"] { animation: none; } .comptine-choice { transition: none; } }
.hunt-listen { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 3px solid var(--line); border-radius: 50%; background: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.hunt-listen:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }

/* Full screen: only the hunt, sized on the screen height. */
html.hunt-fullscreen, html.hunt-fullscreen body { height: 100%; overflow: hidden; }
html.hunt-fullscreen .wrap { max-width: none; height: 100%; padding: 1.5vh 2vw; }
html.hunt-fullscreen .top, html.hunt-fullscreen .hunt-help, html.hunt-fullscreen .hunt-back { display: none; }
html.hunt-fullscreen main, html.hunt-fullscreen .hunt { height: 100%; }
html.hunt-fullscreen .hunt { --hunt-size: clamp(1.3rem, min(5.2vh, 3.4vw), 4.4rem); display: flex; flex-direction: column; }
html.hunt-fullscreen .hunt-title { margin: 1vh 0; font-size: clamp(1.2rem, 4vh, 2.6rem); }
html.hunt-fullscreen .hunt-text { flex: 1; min-height: 0; overflow: auto; align-content: safe center; padding: 1.5vh 2vw; gap: 0.6vh; }
html.hunt-fullscreen .hunt-sound { font-size: clamp(1.2rem, 4.4vh, 2.6rem); }

@media (max-width: 480px) {
  .wrap { padding: 16px 16px 40px; }
  .activity { min-height: 0; padding: 18px; }
  .hunt-actions { margin-left: 0; }
  .hunt-line { gap: 6px; padding: 2px 0; }
  .hunt-tools { flex-direction: column; gap: 6px; }
}
