/* C'quoi ? · Mots rares — application (PWA). Nuit glacée (le ciel) → papier ivoire (la fiche, la bibliothèque). */
:root {
  --night: #060A10; --night2: #0B1018; --ink: #14181D; --slate: #2B333C; --gray: #545C66;
  --paper: #EFE8DA; --paper2: #F7F2E8; --ivory: #E8E2D6;
  --amber: #D9822B; --amber-l: #E9A55E; --amber-ink: #A85A12;
  --ice: #9FB8C8; --ice-l: #C9D8E2; --mute: #7F93A3;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --tabs: calc(76px + var(--sab));
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --serif: "EB Garamond", Garamond, Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--ivory); font-family: var(--sans); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.eyebrow { font-size: 10px; letter-spacing: .26em; color: var(--ice); text-transform: uppercase; }
.eyebrow.dark { color: var(--gray); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- Ciel (canvas plein écran) ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
body:not(.on-ciel) #sky { visibility: hidden; }

/* ---------- En-tête ---------- */
.hud { position: fixed; z-index: 20; left: 0; right: 0; top: 0; padding: calc(14px + var(--sat)) 18px 0 20px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.hud > * { pointer-events: auto; }
.brand { display: flex; flex-direction: column; gap: 5px; text-decoration: none; }
.logo { font-weight: 900; font-size: 24px; letter-spacing: -.02em; color: var(--ivory); }
.logo b { color: var(--amber); }
.sub { font-size: 10px; letter-spacing: .32em; color: var(--mute); }
.hud-r { display: flex; gap: 10px; align-items: center; }
body.on-mot .hud, body.light-ui .hud { display: none; }
.round { width: 44px; height: 44px; border-radius: 22px; border: 1px solid rgba(159,184,200,.28); background: rgba(10,15,22,.7); color: var(--ice-l); display: grid; place-items: center; text-decoration: none; padding: 0; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: border-color .2s, color .2s, transform .2s var(--ease); }
.round:hover { border-color: rgba(232,226,214,.6); color: var(--ivory); }
.round:active { transform: scale(.94); }
.round svg { width: 18px; height: 18px; }
.pill-btn { height: 40px; padding: 0 14px 0 12px; border-radius: 20px; border: 1px solid rgba(217,130,43,.55); background: rgba(217,130,43,.12); color: var(--amber-l); display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.pill-btn svg { width: 16px; height: 16px; }

/* ---------- Écrans ---------- */
#view { position: fixed; inset: 0; }
.screen { position: absolute; inset: 0; display: none; }
.screen.on { display: block; }
.screen.light { background: var(--paper); color: var(--ink); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.page { width: min(100%, 620px); margin: 0 auto; padding: calc(28px + var(--sat)) 22px calc(var(--tabs) + 28px); display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.page-head > div { display: flex; flex-direction: column; gap: 6px; }
.page h1 { margin: 0; font-weight: 900; font-size: 32px; letter-spacing: -.02em; line-height: 1.05; }
.page h1 em, .page h2 em { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--amber-ink); }
.count { font-size: 10px; letter-spacing: .12em; color: var(--gray); padding-bottom: 6px; white-space: nowrap; }

/* entrées d'écran */
.screen.on.enter .page > *, .screen.on.enter .pedestal { animation: rise .55s var(--ease) both; }
.screen.on.enter .page > *:nth-child(2) { animation-delay: .04s; }
.screen.on.enter .page > *:nth-child(3) { animation-delay: .08s; }
.screen.on.enter .page > *:nth-child(n+4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Ciel : interface ---------- */
.skyhit { position: absolute; left: 0; right: 0; top: 0; bottom: 0; touch-action: none; cursor: grab; }
.skyhit.grab { cursor: grabbing; }
.corners i { position: absolute; width: 14px; height: 14px; border: 0 solid rgba(159,184,200,.45); pointer-events: none; }
.corners i:nth-child(1) { left: 16px; top: calc(84px + var(--sat)); border-left-width: 1px; border-top-width: 1px; }
.corners i:nth-child(2) { right: 16px; top: calc(84px + var(--sat)); border-right-width: 1px; border-top-width: 1px; }
.corners i:nth-child(3) { left: 16px; bottom: calc(var(--tabs) + var(--ped, 300px) + 28px); border-left-width: 1px; border-bottom-width: 1px; }
.corners i:nth-child(4) { right: 16px; bottom: calc(var(--tabs) + var(--ped, 300px) + 28px); border-right-width: 1px; border-bottom-width: 1px; }
.zoom { position: absolute; right: 16px; top: calc(110px + var(--sat)); display: flex; flex-direction: column; gap: 8px; }
.skyinfo { position: absolute; left: 36px; right: 36px; bottom: calc(var(--tabs) + var(--ped, 300px) + 18px); transition: bottom .35s var(--ease); display: flex; justify-content: space-between; align-items: center; font-size: 9px; letter-spacing: .16em; color: var(--mute); pointer-events: none; }
.dots { display: flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--c); }
/* Le socle : le mot posé sur un piédestal de lumière, de la couleur du mot dans le ciel (--c) */
.pedestal { --c: #E9A55E; position: absolute; left: 12px; right: 12px; margin: 0 auto; bottom: calc(var(--tabs) + 10px); max-width: 460px; padding: 6px 20px 16px; border-radius: 28px; background: linear-gradient(180deg, rgba(8,12,18,.55), rgba(8,12,18,.86) 45%); border: 1px solid rgba(159,184,200,.14); box-shadow: 0 -20px 60px -30px color-mix(in srgb, var(--c) 45%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: flex; flex-direction: column; align-items: center; text-align: center; transition: box-shadow .6s, padding .35s var(--ease); }
.pedestal::before { content: ""; position: absolute; left: 22%; right: 22%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c) 80%, transparent), transparent); }
.p-grip { width: 64px; height: 20px; border: 0; padding: 0; background: none; position: relative; cursor: pointer; }
.p-grip::after { content: ""; position: absolute; left: 16px; right: 16px; top: 8px; height: 4px; border-radius: 2px; background: rgba(159,184,200,.32); transition: background .2s; }
.p-grip:hover::after { background: rgba(232,226,214,.6); }
.p-head { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.p-day { border: 1px solid rgba(217,130,43,.45); background: rgba(217,130,43,.1); color: var(--amber-l); border-radius: 10px; padding: 4px 9px; font-size: 9px; letter-spacing: .14em; cursor: pointer; }
.p-stage { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; padding-top: 10px; }
.p-beam { position: absolute; left: 50%; bottom: 16px; width: 280px; height: calc(100% + 10px); transform: translateX(-50%); background: linear-gradient(0deg, color-mix(in srgb, var(--c) 34%, transparent), transparent 85%); clip-path: polygon(24% 100%, 76% 100%, 100% 0, 0 0); filter: blur(3px); opacity: .7; pointer-events: none; animation: beam 5s ease-in-out infinite; }
@keyframes beam { 50% { opacity: .45; } }
.p-dust i { position: absolute; bottom: 22px; width: 3px; height: 3px; border-radius: 2px; background: var(--c); box-shadow: 0 0 6px var(--c); opacity: 0; animation: dust 4.2s linear infinite; pointer-events: none; }
.p-dust i:nth-child(1) { left: 38%; animation-delay: 0s; }
.p-dust i:nth-child(2) { left: 47%; animation-delay: 1.1s; }
.p-dust i:nth-child(3) { left: 56%; animation-delay: 2.3s; }
.p-dust i:nth-child(4) { left: 63%; animation-delay: .6s; }
.p-dust i:nth-child(5) { left: 33%; animation-delay: 3s; }
.p-dust i:nth-child(6) { left: 51%; animation-delay: 3.6s; width: 2px; height: 2px; }
.p-dust i:nth-child(7) { left: 43%; animation-delay: 1.8s; width: 2px; height: 2px; }
@keyframes dust { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translate(6px, -96px); opacity: 0; } }
.p-float { position: relative; z-index: 2; max-width: 100%; animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px); } }
.p-word { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(34px, 11vw, 52px); line-height: 1.05; color: var(--ivory); text-shadow: 0 0 26px color-mix(in srgb, var(--c) 55%, transparent), 0 2px 0 rgba(0,0,0,.35); max-width: 100%; overflow-wrap: anywhere; padding: 0 4px; }
.p-word.pop { animation: pop .6s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.96); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.p-plinth { position: relative; width: 232px; height: 36px; margin-top: 2px; }
.p-plinth b { position: absolute; left: 0; right: 0; display: block; }
.p-plinth .top { top: 0; height: 24px; border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--c) 50%, #1B2530) 0%, #121A23 55%, #0B1118 100%); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 0 26px color-mix(in srgb, var(--c) 45%, transparent), inset 0 2px 8px rgba(255,255,255,.1); z-index: 2; }
.p-plinth .top::after { content: ""; position: absolute; left: 34%; right: 34%; top: 7px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.45); filter: blur(3px); animation: shadow 6s ease-in-out infinite; }
@keyframes shadow { 50% { transform: scaleX(.8); opacity: .6; } }
.p-plinth .side { top: 12px; height: 24px; border-radius: 0 0 116px 116px / 0 0 12px 12px; background: linear-gradient(90deg, #070B10, #1F2A36 42%, #2A3644 52%, #0A0F15); border: 1px solid rgba(159,184,200,.16); border-top: 0; }
.p-plinth .ring { top: -4px; left: -14px; right: -14px; height: 32px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); opacity: 0; z-index: 1; }
.p-plinth.flash .ring { animation: ring .9s var(--ease); }
@keyframes ring { from { opacity: .9; transform: scale(.85); } to { opacity: 0; transform: scale(1.18); } }
.p-meta { margin-top: 10px; display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--ice); }
.p-meta i { width: 3px; height: 3px; border-radius: 2px; background: var(--mute); }
#p-tag { font-size: 10px; letter-spacing: .2em; }
#p-tag.v { color: var(--amber-l); }
.p-def { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--ice-l); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-acts { margin-top: 14px; display: flex; gap: 8px; align-items: center; }
.round.sm { width: 46px; height: 46px; border-radius: 23px; flex: none; }
#p-open { white-space: nowrap; padding: 0 18px; }
.round.on { color: var(--amber-l); border-color: rgba(217,130,43,.6); }
#p-fav.on svg { fill: currentColor; }
/* socle réduit : une simple barre, pour voir tout le ciel */
.pedestal.mini { padding: 2px 14px 10px; }
.pedestal.mini :is(.p-beam, .p-dust, .p-plinth, .p-meta, .p-def, #p-say, #p-fav, #p-share) { display: none; }
.pedestal.mini .p-stage { padding-top: 0; }
.pedestal.mini .p-word { font-size: 28px; }
.pedestal.mini .p-acts { margin-top: 6px; }
.pedestal.mini .btn { height: 38px; font-size: 13px; }
.btn { height: 46px; padding: 0 20px; border-radius: 23px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 14px; text-decoration: none; transition: transform .2s var(--ease), background .2s; }
.btn:active { transform: scale(.96); }
.btn svg { width: 16px; height: 16px; }
.btn.amber { background: var(--amber); color: var(--ink); }
.btn.amber:hover { background: #E58F38; }
.btn.ghost { background: transparent; border-color: rgba(159,184,200,.3); color: var(--ice-l); font-weight: 500; }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.line { background: transparent; border-color: rgba(20,24,29,.18); color: var(--ink); font-weight: 600; }
.btn.line.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.wide { width: 100%; }

/* ---------- Fiche ---------- */
#s-mot { overflow-y: auto; background: var(--night); }
.fx-wrap { position: relative; height: 330px; }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-top { position: absolute; left: 0; right: 0; top: 0; padding: calc(14px + var(--sat)) 18px 0; display: flex; justify-content: space-between; align-items: center; }
.fx-pho { position: absolute; left: 0; right: 0; bottom: 46px; display: flex; justify-content: center; align-items: center; gap: 12px; font-size: 13px; color: var(--ice); }
.fx-cat { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; font-size: 9px; letter-spacing: .22em; color: var(--mute); }
.say { height: 34px; min-width: 44px; padding: 0 12px; border-radius: 17px; border: 1px solid rgba(217,130,43,.5); background: rgba(217,130,43,.1); color: var(--amber-l); display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.say svg { width: 15px; height: 15px; }
.say .wave { display: none; }
.say.on .wave { display: inline-flex; }
.say.on svg { display: none; }
.wave i { width: 3px; height: 12px; margin: 0 1px; border-radius: 2px; background: var(--amber); animation: wv .6s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .1s; } .wave i:nth-child(3) { animation-delay: .2s; } .wave i:nth-child(4) { animation-delay: .3s; }
@keyframes wv { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.paper { position: relative; width: min(100%, 640px); margin: 0 auto; min-height: calc(100% - 330px); border-radius: 28px 28px 0 0; background: var(--paper); color: var(--ink); padding: 10px 26px calc(var(--tabs) + 30px); box-shadow: 0 -18px 50px rgba(0,0,0,.45); }
.paper.up { animation: up .9s cubic-bezier(.16,.9,.2,1) both; animation-delay: var(--d, 1.4s); }
@keyframes up { from { transform: translateY(70vh); } to { transform: none; } }
.grip { width: 40px; height: 4px; border-radius: 2px; background: rgba(20,24,29,.18); margin: 0 auto 18px; }
.blk { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.blk .eyebrow { color: var(--gray); letter-spacing: .24em; }
.row-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tag { height: 26px; padding: 0 10px; border-radius: 13px; background: var(--ink); color: var(--amber-l); font-family: var(--mono); font-size: 9px; letter-spacing: .18em; display: inline-flex; align-items: center; white-space: nowrap; }
.tag.soft { background: rgba(20,24,29,.07); color: var(--slate); }
.def { margin: 0; font-weight: 700; font-size: 21px; line-height: 1.4; letter-spacing: -.01em; }
.mk { position: relative; z-index: 0; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.15em; white-space: nowrap; padding: 0 3px; }
.mk::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: .1em; height: .5em; background: rgba(217,130,43,.55); border-radius: 3px; transform-origin: left; animation: mark .6s cubic-bezier(.3,.8,.3,1) both; animation-delay: var(--md, 2.5s); }
@keyframes mark { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.ex { margin: 0; font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.35; color: var(--slate); }
.txt { margin: 0; font-size: 15px; line-height: 1.55; color: var(--slate); }
.senses { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 1.5; }
.senses .dx { margin-top: 4px; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--slate); }
.lab { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 8px; background: rgba(20,24,29,.07); font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: var(--slate); vertical-align: 2px; }
.note { margin: 0 0 20px; padding: 12px 14px; border-radius: 14px; background: rgba(217,130,43,.12); border: 1px solid rgba(168,90,18,.3); font-size: 14px; line-height: 1.5; color: var(--slate); }
.note b { color: var(--ink); }
.pos { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--amber-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 6px 14px; border-radius: 18px; border: 1px solid rgba(20,24,29,.18); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink); background: transparent; text-decoration: none; }
a.chip:hover, button.chip:hover { background: rgba(217,130,43,.1); }
.chip.anti { border-color: rgba(168,90,18,.45); color: #7E420C; }
.chip.serie::after { content: "✦"; color: var(--amber-ink); font-size: 11px; }
.acts { display: flex; gap: 10px; margin: 6px 0 22px; }
.acts .btn { flex: 1 1 0; }
.src { border-top: 1px solid rgba(20,24,29,.12); padding-top: 14px; font-size: 12px; line-height: 1.5; color: var(--gray); }
.src a { color: var(--amber-ink); }
.loading { color: var(--gray); font-size: 14px; }

/* ---------- Recherche ---------- */
.field { position: relative; }
.field > svg { position: absolute; left: 18px; top: 17px; width: 18px; height: 18px; color: var(--gray); }
#q { width: 100%; height: 54px; border-radius: 27px; border: 1px solid rgba(20,24,29,.2); background: var(--paper2); padding: 0 50px 0 46px; font-size: 17px; font-weight: 500; color: var(--ink); outline: none; -webkit-appearance: none; appearance: none; }
#q::placeholder { color: #6B7079; }
#q::-webkit-search-cancel-button { display: none; }
#q:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(217,130,43,.25); }
.clear { position: absolute; right: 5px; top: 5px; width: 44px; height: 44px; border-radius: 22px; border: 0; background: transparent; color: var(--gray); display: grid; place-items: center; }
.clear svg { width: 16px; height: 16px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.flt { height: 38px; padding: 0 15px; border-radius: 19px; border: 1px solid rgba(20,24,29,.18); background: transparent; color: var(--ink); font-size: 13px; font-weight: 500; }
.flt.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
#browse { display: flex; flex-direction: column; gap: 14px; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; }
.letters button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(20,24,29,.14); background: transparent; color: var(--ink); font-weight: 600; font-size: 14px; }
.letters button.on { background: var(--ink); color: var(--paper); }
.rrow { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 10px 4px; border-bottom: 1px solid rgba(20,24,29,.1); text-decoration: none; color: var(--ink); animation: rise .35s var(--ease) both; }
.rrow:hover { background: rgba(217,130,43,.08); }
.rrow .w { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 24px; line-height: 1.05; }
.rrow .w mark { background: rgba(217,130,43,.45); color: inherit; border-radius: 3px; }
.rrow .m { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rrow .d { font-size: 13px; line-height: 1.35; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 36px 8px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty b { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 26px; }
.empty span { font-size: 14px; line-height: 1.5; color: var(--slate); max-width: 300px; }

/* ---------- Quiz ---------- */
.qcard { background: var(--paper2); border: 1px solid rgba(20,24,29,.1); border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 30px rgba(20,24,29,.08); }
.qprog { display: flex; gap: 6px; }
.qprog i { flex: 1; height: 4px; border-radius: 2px; background: rgba(20,24,29,.12); }
.qprog i.ok { background: #2F7D5B; } .qprog i.ko { background: #B3412E; } .qprog i.now { background: var(--amber); }
.qq { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.45; }
.qopts { display: flex; flex-direction: column; gap: 10px; }
.qopt { min-height: 56px; border-radius: 16px; border: 1px solid rgba(20,24,29,.18); background: transparent; font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--ink); text-align: left; padding: 8px 18px; transition: background .2s, border-color .2s, transform .2s var(--ease); }
.qopt:hover:not(:disabled) { background: rgba(217,130,43,.1); }
.qopt.ok { background: #DCEFE4; border-color: #2F7D5B; }
.qopt.ko { background: #F6DDD6; border-color: #B3412E; animation: shake .35s; }
.qopt:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.qfeed { font-size: 14px; line-height: 1.5; color: var(--slate); }
.score { font-family: var(--serif); font-style: italic; font-size: 72px; line-height: 1; color: var(--amber-ink); }

/* ---------- Barre d'onglets ---------- */
.tabs { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--sab)); width: min(100% - 24px, 460px); height: 64px; border-radius: 22px; background: rgba(11,16,24,.86); border: 1px solid rgba(159,184,200,.14); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: flex; justify-content: space-around; align-items: center; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 64px; height: 56px; border-radius: 14px; color: var(--mute); font-size: 11px; font-weight: 500; text-decoration: none; transition: color .2s; }
.tab svg { width: 22px; height: 22px; stroke-width: 1.7; }
.tab:hover { color: var(--ice-l); }
.tab.on { color: var(--amber); }
body.light-ui .tabs { background: rgba(247,242,232,.94); border-color: rgba(20,24,29,.1); box-shadow: 0 10px 30px rgba(20,24,29,.12); }
body.light-ui .tab { color: var(--gray); }
body.light-ui .tab.on { color: var(--amber-ink); }

/* ---------- Message ---------- */
.toast { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs) + 16px); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px; background: var(--ink); color: var(--paper); font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; gap: 12px; align-items: center; animation: rise .3s var(--ease); }
.toast button { border: 0; background: var(--amber); color: var(--ink); font-weight: 700; border-radius: 12px; padding: 8px 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation-duration: .01s !important; animation-delay: 0s !important; transition: none !important; }
}
/* écrans bas (téléphone couché, petite fenêtre) : socle compact */
@media (max-height: 640px) {
  .p-beam, .p-dust, .p-plinth, .p-def, .skyinfo, .corners, .p-grip { display: none; }
  .pedestal { padding: 10px 16px; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 12px; }
  .p-word { margin: 0; font-size: 30px; }
  .p-stage { width: auto; padding: 0; }
  .p-meta, .p-acts { margin-top: 0; }
  .p-head { width: 100%; }
  .zoom { flex-direction: row; top: auto; bottom: calc(var(--tabs) + 130px); }
}
@media (min-width: 900px) {
  .pedestal { left: auto; right: 40px; width: 420px; bottom: 110px; }
  .skyinfo { left: 40px; right: auto; bottom: 110px; gap: 16px; }
  .corners i:nth-child(3), .corners i:nth-child(4) { bottom: 96px; }
}

/* ---------- Favoris synchronisés (compte) ---------- */
.cloud { background: var(--paper2); border: 1px solid rgba(20,24,29,.1); border-radius: 22px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.cloud .cl-top { display: flex; gap: 12px; align-items: center; }
.cloud .cl-ico { width: 40px; height: 40px; border-radius: 20px; background: var(--ink); color: var(--amber-l); display: grid; place-items: center; flex: none; }
.cloud .cl-ico svg { width: 20px; height: 20px; }
.cloud b { font-size: 15px; }
.cloud p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--slate); }
.cloud form { display: flex; gap: 8px; flex-wrap: wrap; }
.cloud input { flex: 1 1 180px; min-width: 0; height: 46px; border-radius: 23px; border: 1px solid rgba(20,24,29,.2); background: #fff; padding: 0 18px; font-size: 16px; color: var(--ink); outline: none; }
.cloud input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(217,130,43,.25); }
.cloud input.code { letter-spacing: .3em; font-family: var(--mono); text-align: center; }
.cloud .btn { flex: none; }
.cloud .cl-links { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.cloud .cl-links button { border: 0; background: none; padding: 4px 0; color: var(--amber-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cloud .cl-st { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--gray); }
.cloud .cl-st.ok { color: #3F7D4E; }
.cloud .cl-st.warn { color: var(--amber-ink); }
.cloud .cl-err { color: #A3341C; font-size: 13px; }

/* ---------- Taille du texte (Réglages) ---------- */
.screen.light .page, .paper { zoom: var(--tz, 1); }

/* ---------- Constellations, liste ---------- */
.cons-pop { position: absolute; right: 70px; top: calc(110px + var(--sat)); z-index: 5; width: min(300px, calc(100vw - 96px)); max-height: calc(100vh - var(--tabs) - 160px); overflow-y: auto; padding: 12px; border-radius: 20px; background: rgba(10,15,22,.92); border: 1px solid rgba(159,184,200,.22); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: flex; flex-direction: column; gap: 4px; animation: rise .3s var(--ease); }
.cons-pop .eyebrow { padding: 4px 8px 8px; }
.cons-pop button { text-align: left; border: 0; background: transparent; color: var(--ivory); padding: 9px 10px; border-radius: 12px; display: flex; flex-direction: column; gap: 2px; }
.cons-pop button:hover { background: rgba(217,130,43,.14); }
.cons-pop b { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 19px; color: var(--amber-l); }
.cons-pop small { font-size: 12px; color: var(--mute); }
.wlist { list-style: none; margin: 0; padding: 0; }
.wlist a { display: flex; flex-direction: column; gap: 2px; padding: 10px 2px; border-bottom: 1px solid rgba(20,24,29,.1); text-decoration: none; }
.wlist b { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 21px; }
.wlist b + span[aria-label] { color: var(--amber-ink); }
.wlist a > span:last-child { font-size: 13px; color: var(--slate); line-height: 1.4; }
h2.eyebrow { margin: 0; font-weight: 400; }

/* ---------- Onglets : 5 + pastille ---------- */
.tab { min-width: 56px; }
.tab-ico { position: relative; display: grid; }
.badge { position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--amber); color: var(--ink); font: 700 10px/18px var(--sans); text-align: center; }
@media (max-width: 360px) { .tab { min-width: 50px; font-size: 10px; } }

/* ---------- Apprendre ---------- */
.light-round { background: transparent; color: var(--slate); border-color: rgba(20,24,29,.16); backdrop-filter: none; }
.light-round:hover { color: var(--ink); border-color: var(--ink); }
.goal-card { display: flex; gap: 18px; align-items: center; background: var(--ink); color: var(--paper); border-radius: 24px; padding: 18px 20px; box-shadow: 0 12px 30px rgba(20,24,29,.18); }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.rg-bg { fill: none; stroke: rgba(232,226,214,.14); stroke-width: 7; }
.rg-fg { fill: none; stroke: var(--amber); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 30px; }
.ring small { font-size: 15px; color: var(--mute); }
.goal-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.goal-txt p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ice-l); }
.flame { font-weight: 800; font-size: 17px; color: var(--mute); }
.flame.on { color: var(--amber-l); }
.qcard .flame.on { color: var(--amber-ink); }
.week { display: flex; gap: 5px; }
.week i { width: 14px; height: 14px; border-radius: 4px; background: rgba(232,226,214,.12); }
.week i.part { background: rgba(217,130,43,.4); }
.week i.ok { background: var(--amber); }
.week i.now { outline: 1.5px solid var(--ivory); outline-offset: 1px; }
.goal-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.learn-card .chips { gap: 6px; }
.learn-card .flt { height: 34px; padding: 0 12px; font-size: 12.5px; }
.lstat { margin-top: 2px; }
.flash { align-items: center; text-align: center; }
.flash .qprog { width: 100%; }
.fl-word { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(40px, 12vw, 60px); line-height: 1.05; margin-top: 10px; overflow-wrap: anywhere; }
.fl-pho { font-size: 13px; color: var(--amber-ink); }
.fl-back { display: flex; flex-direction: column; gap: 10px; }
.flash .acts { width: 100%; }
.plan { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.8; }
.qq.big { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 40px; line-height: 1.1; }
.qq.serif { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 22px; }
.qopt.long { font-family: var(--sans); font-style: normal; font-size: 15px; line-height: 1.4; padding: 12px 16px; }
.qtimebar { height: 6px; border-radius: 3px; background: rgba(20,24,29,.12); overflow: hidden; }
.qtimebar i { display: block; height: 100%; background: var(--amber); transform-origin: left; animation: tbar linear forwards; }
@keyframes tbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.count b { color: var(--amber-ink); font-size: 13px; }

/* ---------- Fiche : vidéo, étymologie, citations, ciel ---------- */
.clip { position: relative; width: min(100%, 300px); aspect-ratio: 9 / 16; margin: 4px auto 0; border-radius: 22px; overflow: hidden; background: var(--ink); box-shadow: 0 14px 34px rgba(20,24,29,.3); }
.clip video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ety { font-family: var(--serif); font-size: 17px; }
.quote { margin: 0 0 6px; padding: 12px 16px; border-left: 3px solid var(--amber); background: rgba(20,24,29,.04); border-radius: 0 14px 14px 0; }
.quote blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.4; color: var(--ink); }
.quote figcaption { margin-top: 6px; font-size: 12px; color: var(--gray); }
.acts .btn { padding: 0 12px; }
.skybtn { margin: -8px 0 22px; }

/* ---------- Réglages, pages légales ---------- */
.set-group { display: flex; flex-direction: column; gap: 2px; background: var(--paper2); border: 1px solid rgba(20,24,29,.1); border-radius: 22px; padding: 14px 16px; }
.set-group > .eyebrow { padding: 2px 2px 8px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 2px; border: 0; border-top: 1px solid rgba(20,24,29,.07); background: none; text-align: left; color: var(--ink); text-decoration: none; width: 100%; }
.set-group > .eyebrow + .set-row { border-top: 0; }
.set-row.col { flex-direction: column; align-items: stretch; }
.set-row > span:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.set-row b { font-size: 15px; font-weight: 600; }
.set-row small { font-size: 12.5px; line-height: 1.45; color: var(--slate); }
.set-row.link > i { font-style: normal; font-size: 20px; color: var(--gray); }
.set-row.link:hover b { color: var(--amber-ink); }
.set-row.danger b { color: #A3341C; }
.seg { display: flex; border: 1px solid rgba(20,24,29,.18); border-radius: 14px; overflow: hidden; flex: none; }
.seg button { border: 0; background: transparent; padding: 8px 11px; font-size: 13px; font-weight: 600; color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--paper); }
.sw { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 14px; background: rgba(20,24,29,.2); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.sw:checked { background: var(--amber); }
.sw:checked::after { transform: translateX(20px); }
.sw:disabled { opacity: .5; }
.dlbar { height: 8px; border-radius: 4px; background: rgba(20,24,29,.1); overflow: hidden; }
.dlbar i { display: block; height: 100%; background: var(--amber); transition: width .3s; }
.prose h2 { font-size: 17px; font-weight: 800; margin: 22px 0 6px; }
.prose .txt { margin: 0 0 8px; }
.prose a { color: var(--amber-ink); }

/* ---------- Accueil (premier lancement) ---------- */
.onb { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; padding: 16px 16px calc(var(--tabs) + 16px); background: rgba(3,6,10,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .3s ease both; }
.onb.out { animation: fade .3s ease reverse both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.onb-card { width: min(100%, 420px); padding: 24px 22px 18px; border-radius: 28px; background: linear-gradient(180deg, #101823, #0A0F16); border: 1px solid rgba(217,130,43,.35); box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 -20px 60px -30px rgba(217,130,43,.5); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: rise .45s var(--ease) both; }
.onb-ico { width: 74px; height: 74px; border-radius: 37px; display: grid; place-items: center; background: rgba(217,130,43,.12); border: 1px solid rgba(217,130,43,.45); color: var(--amber-l); animation: float 3s ease-in-out infinite; }
.onb-ico svg { width: 36px; height: 36px; stroke-width: 1.5; }
.onb h2 { margin: 4px 0 0; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 34px; color: var(--ivory); }
.onb p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ice-l); }
.onb-dots { display: flex; gap: 6px; margin: 6px 0; }
.onb-dots i { width: 7px; height: 7px; border-radius: 4px; background: rgba(159,184,200,.3); transition: width .3s; }
.onb-dots i.on { width: 22px; background: var(--amber); }
.onb-acts { width: 100%; display: flex; justify-content: space-between; gap: 10px; }
.onb-acts .btn { flex: 1; }

/* ---------- Ciel de jour (Réglages, Ciel : Jour) ---------- */
body.sky-light.on-ciel { background: #ECE5D7; }
body.sky-light .hud .logo { color: var(--ink); }
body.sky-light .hud .sub, body.sky-light .skyinfo { color: var(--gray); }
body.sky-light .corners i { border-color: rgba(20,24,29,.3); }
body.sky-light #s-ciel .round { background: rgba(247,242,232,.85); color: var(--slate); border-color: rgba(20,24,29,.16); }
body.sky-light .pedestal { background: linear-gradient(180deg, rgba(247,242,232,.7), rgba(247,242,232,.95) 45%); border-color: rgba(20,24,29,.1); }
body.sky-light .p-word { color: var(--ink); text-shadow: 0 0 22px color-mix(in srgb, var(--c) 45%, transparent); }
body.sky-light .p-meta, body.sky-light .p-def { color: var(--slate); }
body.sky-light.on-ciel .tabs { background: rgba(247,242,232,.94); border-color: rgba(20,24,29,.1); }
body.sky-light.on-ciel .tab { color: var(--gray); }
body.sky-light.on-ciel .tab.on { color: var(--amber-ink); }
body.sky-light .cons-pop { background: rgba(247,242,232,.96); border-color: rgba(20,24,29,.14); }
body.sky-light .cons-pop button { color: var(--ink); }
body.sky-light .cons-pop b { color: var(--amber-ink); }
@media (max-height: 640px) { .zoom #zlist { display: none; } }
@media (max-height: 760px) { .zoom { gap: 6px; } .zoom .round { width: 40px; height: 40px; } }
@media (max-width: 370px) { #p-open { padding: 0 14px; font-size: 13px; } .round.sm { width: 42px; height: 42px; } .p-acts { gap: 6px; } }
/* vérification anti-robot (Turnstile) : invisible, sauf si une petite vérification est demandée */
#ts-box{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:9999;max-width:100vw}
#ts-box:empty{display:none}
