:root {
  /* light-dark() suit le thème du système, ou celui choisi avec le bouton Thème. */
  color-scheme: light dark;
  --ink: light-dark(#232844, #ece6f6);
  --muted: light-dark(#514d65, #bab2cd);
  --paper: light-dark(#fff9ec, #17131f);
  --plum: light-dark(#503378, #cdaef7);
  --accent: light-dark(#503378, #6f4aa8);
  --line: light-dark(#dcd0c7, #3d3452);
  --white: light-dark(#fffdf8, #221c2e);
  --soft: light-dark(#f4e4ff, #33264a);
  --soft-ink: light-dark(#4e2d70, #e6d4ff);
  --hover: light-dark(#efe3fb, #3a2c52);
  --focus: light-dark(#4f2da0, #dcc6ff);
  --shadow: light-dark(#e9dccf, #0c0910);
  --glow: light-dark(#eedffc, #2a1f3d);
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at 90% 0, var(--glow), transparent 36rem), var(--paper); }
button, a { -webkit-tap-highlight-color: transparent; }
button {
  font: inherit;
  font-weight: 750;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: .5rem .8rem;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}
a { color: var(--plum); }
button:hover, .index a:hover { background: var(--hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h2:focus, h3:focus { outline: 3px solid var(--focus); outline-offset: 4px; }
.layout { width: min(70rem, calc(100% - 2rem)); margin-inline: auto; }
.skip { position: fixed; z-index: 5; top: .7rem; left: .7rem; padding: .65rem; background: var(--white); }
.skip:not(:focus), .sr-only { clip-path: inset(50%); position: absolute; width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.site-header, .game-header, .game-footer, .resume-header, .site-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; }
.site-header { padding-block: 1rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 850; }
.brand span, .site-footer > span:first-child { color: var(--plum); font-size: 1.25em; }
.switch, .controls { display: flex; flex-wrap: wrap; gap: .4rem; }
.switch button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: white; }
.header-tools, .resume-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.theme-toggle { font-weight: 700; }
.intro { padding-block: clamp(1.5rem, 4vw, 3.25rem) 1.25rem; }
.intro > * { margin: 0; }
.eyebrow { font-size: .75rem; font-weight: 850; letter-spacing: .13em; color: var(--plum); margin: 0; }
h1, h2, h3, h4 { line-height: 1.16; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.35rem, 7vw, 4.8rem); letter-spacing: -.065em; padding-block: .15rem; }
h2 { margin: .25rem 0 0; font-size: clamp(1.35rem, 4vw, 2.15rem); letter-spacing: -.04em; }
.job-title { font-size: clamp(1rem, 2.2vw, 1.35rem); font-weight: 720; }
.intro p:last-child:not(.job-title) { margin-top: .5rem; color: var(--muted); }
.index { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--white); }
.index p { margin: 0; }
.index p span { color: var(--muted); font-size: .9rem; }
.index ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; flex-wrap: wrap; }
.index a { display: inline-flex; align-items: center; min-height: 44px; padding: .25rem .65rem; border-radius: .55rem; font-size: .9rem; font-weight: 700; text-underline-offset: .15em; }

.game, .resume { margin-block: 1rem 2rem; }
.game { background: var(--white); border: 1px solid var(--line); border-radius: 1.25rem; padding: clamp(.55rem, 2vw, 1.25rem); box-shadow: 0 6px 0 var(--shadow); }
.badge { margin: 0; background: var(--soft); color: var(--soft-ink); border-radius: 2rem; padding: .35rem .7rem; font-weight: 800; font-size: .85rem; }
.instructions { color: var(--muted); font-size: .9rem; margin: .7rem 0; }
kbd { border: 1px solid var(--line); background: var(--soft); padding-inline: .25em; border-radius: .3em; color: var(--ink); font: inherit; font-weight: 750; }
.viewport { position: relative; height: 330px; overflow: clip; border-radius: .8rem; border: 2px solid #4a6c65; background: #c6ead9; }
.world { position: relative; width: max(3020px, 100%); height: 100%; isolation: isolate; }
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; background: linear-gradient(#91bee2 0%, #daeaf0 54%, #f5dcbd 86%); }
.mist { position: absolute; inset: auto 0 0; height: 110px; background: linear-gradient(transparent, #dedcf280 52%, #a997cde6); pointer-events: none; }
.island { position: absolute; left: var(--left); width: var(--width); bottom: calc(84px + var(--rise) - 82px); height: 82px; background: linear-gradient(72deg, #564475 18%, #74547e 19% 41%, #5c4778 42% 57%, #9a6881 58% 75%, #694b75 76%); clip-path: polygon(0 0, 100% 0, 100% 22%, 87% 48%, 72% 57%, 53% 98%, 42% 87%, 32% 64%, 15% 54%, 0 31%); }
.island::before { content: ''; display: block; height: 15px; background: radial-gradient(ellipse at top, #568357 51%, transparent 54%) 1px 5px / 19px 10px repeat-x, linear-gradient(#dcf0a1 0 3px, #77ad65 3px 8px, transparent 8px); }
.island::after { content: ''; position: absolute; inset: 21px 8px 0; background: repeating-linear-gradient(155deg, transparent 0 15px, #e3a6853d 15px 17px, transparent 17px 27px); }
.waterfall { position: absolute; left: var(--x); bottom: 0; width: 26px; height: calc(84px + var(--rise) - 12px); opacity: .7; background: repeating-linear-gradient(90deg, #a7f3f1 0 4px, #67b0d7 4px 8px); border-radius: 0 0 35% 35%; }
.rail { position: absolute; left: 1512px; width: 373px; bottom: 112px; border-top: 2px dashed #536484; opacity: .7; }
.ferry { position: absolute; z-index: 1; left: var(--left); width: var(--width); bottom: calc(84px + var(--rise) - 28px); height: 28px; border: 2px solid #2f395c; border-top: 5px solid #fcdc79; border-radius: 3px 3px 24px 24px; background: linear-gradient(#638cac 0 36%, #39557d 36%); box-shadow: 0 3px #26395755; }
.ferry span { position: absolute; inset: 3px 0 auto; height: 13px; background: radial-gradient(circle, #fff5ad 0 2px, #294263 3px 4px, transparent 5px) center / 21px 13px repeat-x; }
.scenery i { position: absolute; left: var(--x); bottom: calc(84px + var(--rise)); width: 9px; height: 57px; background: #795459; box-shadow: inset -3px 0 #573a57; transform: skewX(-3deg); }
.scenery i::before, .scenery i::after { content: ''; position: absolute; border-radius: 55% 45% 48% 52%; background: #609480; box-shadow: inset -9px -8px #477d72, inset 7px 5px #b4d694; }
.scenery i::before { bottom: 25px; left: -27px; width: 64px; height: 55px; transform: rotate(-15deg); }
.scenery i::after { bottom: 47px; left: -15px; width: 47px; height: 43px; }
.scenery i:nth-child(even)::before, .scenery i:nth-child(even)::after { background: #c97a9a; box-shadow: inset -9px -8px #a66089, inset 7px 5px #efb6a5; }
.station { position: absolute; z-index: 1; left: var(--x); bottom: calc(84px + var(--rise)); transform: translateX(-50%); display: grid; place-items: center; width: 48px; height: 48px; color: #2d2342; border: 2px solid #473755; border-radius: .5rem; background: var(--tone); box-shadow: inset 0 4px #fff9, inset -5px -5px #49345c33, 3px 3px #473755; font-weight: 900; font-size: .93rem; text-decoration: none; }
.station::after { content: ''; position: absolute; inset: 5px; border: 1px solid #47375550; border-radius: .25rem; pointer-events: none; }
.station[data-read] { box-shadow: inset 0 4px #fff9, inset -5px -5px #49345c33, 3px 3px #473755, 0 0 0 3px #fff8d299; }
@media (prefers-reduced-motion: no-preference) {
  .station.bumped { animation: block-bump .24s ease-out; }
  @keyframes block-bump { 45% { transform: translate(-50%, -9px); } }
}
.station:hover, .station[data-near] { background: #fff9ec; }
.station:focus-visible { outline-color: #28133e; }
.avatar { position: absolute; z-index: 2; pointer-events: none; left: 0; bottom: 84px; width: 31px; height: 47px; }
.avatar svg { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); overflow: visible; }
.avatar[data-direction="left"] svg { transform: translateX(-50%) scaleX(-1); }
.sprite { transform-origin: 22px 52px; }
.avatar[data-pose="air"] .sprite { transform: rotate(-9deg) scale(.96, 1.04); }
@media (prefers-reduced-motion: no-preference) {
  .avatar[data-pose="run"] .sprite { animation: stride .22s alternate infinite ease-in-out; }
  @keyframes stride { from { transform: rotate(-6deg) scale(1.04, .94); } to { transform: translateY(-3px) rotate(6deg); } }
}
.game-footer { margin-top: .75rem; }
.controls button { touch-action: manipulation; }
.controls [data-move] { touch-action: none; }
.controls [data-held] { background: var(--accent); color: white; }
#lire[aria-disabled="true"] { border-style: dashed; cursor: default; }
#proximite { margin: 0; color: var(--muted); font-size: .9rem; }

.resume-header { margin-block: 1.5rem 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1rem; }
.card { padding: 1rem 1.15rem; background: var(--white); border: 1px solid var(--line); border-top: 5px solid #a381c8; border-radius: 1rem; scroll-margin-block: 1rem; overflow-wrap: anywhere; }
.card:nth-child(even) { border-top-color: #d58a67; }
.card:target { border-color: var(--plum); }
.card h3 { font-size: 1.25rem; margin: .3rem 0 .65rem; }
.card h4, .card p:not(.eyebrow), .card ul { margin: .45rem 0; }
.card ul { padding-left: 1.2rem; }
.site-footer { justify-content: flex-start; border-top: 1px solid var(--line); padding-block: 1rem 1.5rem; color: var(--muted); }
.footer-note { margin-left: auto; }
@media (max-width: 33rem) {
  .layout { width: calc(100% - 1.15rem); }
  .footer-note { margin-left: 0; }
}

/* En mode jeu, la scène est le contenu principal, non une carte du portfolio. */
body.playing { min-height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 15% 0, light-dark(#e7eff7, #1f2433), transparent 55%), light-dark(#f7edf2, #15111c); }
.playing .site-header, .playing main { width: calc(100% - clamp(1rem, 3vw, 3rem)); }
.playing .site-header { padding-block: .45rem; }
.playing main { flex: 1; display: flex; flex-direction: column; }
.playing .intro, .playing .index, .playing .site-footer { display: none; }
.playing .skip { display: initial; }
.game { flex: 1; display: flex; flex-direction: column; margin-block: .5rem; padding: clamp(.45rem, 1vw, 1rem); background: var(--white); border-color: var(--line); box-shadow: 0 5px 0 var(--shadow); }
.game-header h2 { font-family: Georgia, serif; font-size: clamp(1.35rem, 3vw, 2.2rem); letter-spacing: -.035em; }
.game-hud { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.badge { white-space: nowrap; }
.badge strong { font-variant-numeric: tabular-nums; }
.badge-gold { background: #ffe196; color: #5d3216; }
.score-rules { margin: 0 0 .5rem; color: var(--muted); font-size: .85rem; }
.score-rules summary { width: fit-content; cursor: pointer; color: var(--plum); font-weight: 750; }
.score-rules p { margin: .3rem 0; max-width: 70ch; }
.viewport { height: auto; flex: 1; min-height: 380px; background: #daeaf0; border-color: #514b71; }
.block-tip { position: absolute; z-index: 4; inset: .7rem .7rem auto auto; width: min(21rem, calc(100% - 1.4rem)); padding: .45rem .65rem .65rem; border: 2px solid #514b71; border-radius: .85rem; color: var(--ink); background: var(--white); box-shadow: 0 4px 0 #514b7166; font-size: .85rem; line-height: 1.35; }
.block-tip-header { display: flex; align-items: center; gap: .45rem; }
.block-tip h3 { flex: 1; margin: 0; font-size: .95rem; }
.block-tip-icon { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border: 2px solid #473755; border-radius: .35rem; background: #f9bc72; font-weight: 900; box-shadow: inset -3px -3px #49345c33; }
.block-tip button { flex: 0 0 44px; padding: 0; border-color: var(--line); font-size: 1.35rem; line-height: 1; }
.block-tip p { margin: .3rem 0 0; }
.world { position: absolute; inset: 0 auto 0 0; }
.game-messages { flex: 1 1 15rem; }
.controls #sauter { color: white; background: #503378; border-color: #503378; }
.controls #sauter:hover { background: #674394; }
#objectif { margin: 0; font-weight: 740; font-size: .9rem; }
.seed, .checkpoint, .greenhouse { position: absolute; pointer-events: none; }
.seed { left: var(--x); bottom: calc(84px + var(--rise)); transform: translate(-50%, 50%); z-index: 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 55% 42% 53% 43%; color: #713710; background: #ffdb63; border: 2px solid #9a531c; box-shadow: 0 0 0 4px #fff4bbab; }
.seed.bonus { color: white; background: #773eb6; border-color: #3c205c; border-radius: .5rem; box-shadow: 0 0 0 4px #e6d3ffb3; }
.pickup-points { position: absolute; left: var(--x); bottom: calc(84px + var(--rise)); z-index: 3; pointer-events: none; background: #352753; color: white; border-radius: .5rem; padding: .1rem .4rem; font-weight: 850; animation: pickup .68s ease-out both; }
@keyframes pickup { from { transform: translate(-50%, -5px); } to { transform: translate(-50%, -54px); opacity: 0; } }
.checkpoint { left: var(--x); bottom: 84px; width: 5px; height: 47px; border-radius: 3px; background: #3c3257; }
.checkpoint::after { content: ''; position: absolute; top: 2px; left: 4px; width: 24px; height: 17px; background: #7454a5; clip-path: polygon(0 0, 100% 0, 78% 50%, 100% 100%, 0 100%); }
.checkpoint.active::after { background: #ffe196; }
.greenhouse { left: calc(var(--x) + 24px); bottom: 83px; transform: translateX(-50%); width: 148px; height: 133px; border: 5px solid #294b59; border-radius: 50% 50% 7px 7px; background: repeating-linear-gradient(90deg, transparent 0 27px, #2f657e 28px 31px), linear-gradient(135deg, #f5fff4 18%, #ace5da 19% 42%, #6daea9 80%); box-shadow: 10px 4px #567f85, inset 0 -8px #3a736f; display: grid; place-content: end center; text-align: center; }
.greenhouse span { background: #293d58; color: #fff5d6; border: 2px solid #d9ad66; border-radius: .35rem; padding: .15rem .5rem; font-size: .72rem; font-weight: 850; letter-spacing: .1em; }
.greenhouse i { justify-self: center; margin-top: 4px; width: 43px; height: 45px; border: 3px solid #3a6570; border-bottom: 0; border-radius: 20px 20px 0 0; background: #e4f4cf; font-style: normal; font-size: 1.5rem; color: #32615a; }
.greenhouse.complete i { color: #812c63; background: #ffe4a2; box-shadow: 0 0 28px 8px #ffe5a8; }
dialog { width: min(32rem, calc(100% - 2rem)); max-height: 85dvh; overflow: auto; border: 2px solid var(--plum); border-radius: 1rem; background: var(--white); color: var(--ink); padding: 1rem; }
dialog::backdrop { background: #211831a0; }
dialog form { display: flex; justify-content: flex-end; }
.result { background: radial-gradient(ellipse at 0 0, var(--soft), transparent 72%), var(--white); }
.result-score { margin: .5rem 0; font-size: clamp(2rem, 8vw, 3.5rem); font-weight: 900; letter-spacing: -.07em; color: var(--plum); }
.result dl { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; border-block: 1px solid var(--line); padding-block: .65rem; }
.result dd { margin: 0; text-align: right; font-weight: 750; }
.result-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
#rejouer-bilan { background: var(--accent); border-color: var(--accent); color: white; }
@media (max-width: 33rem) {
  .playing .brand { font-size: .9rem; }
  .playing #vue-jeu { display: none; }
  .playing .instructions { font-size: .78rem; margin-block: .35rem; }
  .game-footer { margin-top: .4rem; gap: .25rem; }
  .game-messages p { font-size: .8rem !important; }
}
/* Transitions entre la vue jeu et la vue CV (API View Transitions). */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Quatre univers : l’attribut data-univers de #jeu suit la zone traversée. */
.sky i { position: absolute; inset: 0; opacity: 0; background: var(--decor) repeat-x var(--horizon-offset, 0px) bottom / 255vh 100%; }
[data-univers="papier"] .sky i:nth-child(1), [data-univers="neon"] .sky i:nth-child(2),
[data-univers="pixel"] .sky i:nth-child(3), [data-univers="liquide"] .sky i:nth-child(4), [data-univers="final"] .sky i { opacity: 1; }
[data-univers="final"] .sky i:nth-child(2) { clip-path: inset(0 0 0 25%); }
[data-univers="final"] .sky i:nth-child(3) { clip-path: inset(0 0 0 50%); }
[data-univers="final"] .sky i:nth-child(4) { clip-path: inset(0 0 0 75%); }

[data-univers="papier"] h2 { font-family: 'Marker Felt', 'Comic Sans MS', cursive; }
[data-univers="papier"] .mist { background: linear-gradient(transparent, #fff3d9); }
[data-univers="papier"] .island { background: repeating-linear-gradient(90deg, #c99a63 0 6px, #bd8d57 6px 12px); }
[data-univers="papier"] .island::before { background: linear-gradient(#fffaf0 0 6px, #e4572e 6px 11px, transparent 11px); }
[data-univers="papier"] .island::after { background: none; }
[data-univers="papier"] .avatar svg { filter: drop-shadow(2px 0 #fff) drop-shadow(-2px 0 #fff) drop-shadow(0 -2px #fff) drop-shadow(3px 4px #5b463688); }

[data-univers="neon"] h2 { font-family: 'Avenir Next Condensed', 'Arial Narrow', sans-serif; text-transform: uppercase; letter-spacing: .08em; }
[data-univers="neon"] .mist { background: linear-gradient(transparent, #ff2fa088); }
[data-univers="neon"] .island { background: repeating-linear-gradient(90deg, #7a3cff55 0 2px, transparent 2px 18px), linear-gradient(#1b1145, #0a0620); }
[data-univers="neon"] .island::before { background: linear-gradient(#00e5ff 0 4px, #00e5ff66 4px 8px, transparent 14px); }
[data-univers="neon"] .island::after { background: none; }
[data-univers="neon"] .scenery i { filter: hue-rotate(150deg) saturate(2.5) brightness(.8); }
[data-univers="neon"] .waterfall { filter: hue-rotate(110deg) saturate(3); }
[data-univers="neon"] .avatar svg { filter: hue-rotate(255deg) saturate(1.7) drop-shadow(0 0 2px #fff) drop-shadow(0 0 7px #00e5ff); }
[data-univers="neon"] .station { box-shadow: 0 0 0 2px #fff, 0 0 18px var(--tone); }

[data-univers="pixel"] h2 { font-family: 'Courier New', monospace; letter-spacing: 0; }
[data-univers="pixel"] .mist { background: linear-gradient(transparent 50%, #23703f 50%); }
[data-univers="pixel"] .island { clip-path: none; height: 60px; bottom: calc(84px + var(--rise) - 60px); background: conic-gradient(#8a5a35 25%, #75492a 0 50%, #8a5a35 0 75%, #75492a 0) 0 0 / 24px 24px; border: 3px solid #3c2413; }
[data-univers="pixel"] .island::before { margin: -3px; background: linear-gradient(#8ee06a 0 8px, #3a9a5c 8px); }
[data-univers="pixel"] .island::after { background: none; }
[data-univers="pixel"] :is(.station, .seed, .ferry, .scenery i::before, .scenery i::after) { border-radius: 0; }
[data-univers="pixel"] .avatar svg { shape-rendering: crispEdges; filter: hue-rotate(60deg) contrast(1.5) saturate(1.5); }

[data-univers="liquide"] h2 { font-family: 'Arial Rounded MT Bold', ui-rounded, system-ui, sans-serif; }
[data-univers="liquide"] .mist { background: linear-gradient(transparent, #4cc9c4cc); }
[data-univers="liquide"] .island { clip-path: none; border-radius: 16px 16px 45% 45% / 16px 16px 85% 85%; background: linear-gradient(120deg, #ff6fa8, #8f5bff 55%, #2bb8b3); box-shadow: inset 0 -10px 18px #fff5; }
[data-univers="liquide"] .island::before { margin: 0; border-radius: 16px; background: linear-gradient(#fffc 0 4px, transparent); }
[data-univers="liquide"] .island::after { background: radial-gradient(circle, #fff8 0 4px, transparent 5px) 0 0 / 46px 34px; }
[data-univers="liquide"] .station { border-radius: 40% 60% 55% 45%; }
[data-univers="liquide"] .scenery i { filter: hue-rotate(170deg) saturate(1.4); }
[data-univers="liquide"] .avatar svg { filter: hue-rotate(300deg) saturate(1.4) drop-shadow(0 3px 5px #8f5bff); }

[data-univers="final"] .greenhouse { background: conic-gradient(#e4572e 25%, #00e5ff 0 50%, #8ee06a 0 75%, #ff6fa8 0); }
@media (prefers-reduced-motion: no-preference) {
  .sky i { transition: opacity .6s; }
  .island, .station { transition: border-radius .4s, background-color .4s; }
  [data-univers="liquide"] .avatar[data-pose="idle"] .sprite { animation: wobble 1.2s alternate infinite ease-in-out; }
  @keyframes wobble { to { transform: scale(1.07, .93); } }
  .accueil-decor i { animation: drift 40s linear infinite; }
  .accueil-decor svg { animation: hop .9s alternate infinite cubic-bezier(.3, 0, .4, 1); }
  @keyframes hop { to { transform: translateY(-26px); } }
  .accueil-nom span { animation: letter .6s calc(var(--i) * 45ms) both cubic-bezier(.2, 1.6, .4, 1); transition: translate .2s, rotate .2s, color .2s; }
  @keyframes letter { from { opacity: 0; transform: translateY(60px) rotate(12deg); } }
  @keyframes drift { from { background-position: 0 0, 0 100%; } to { background-position: 0 0, -255vh 100%; } }
}
.dust { position: absolute; left: var(--x); bottom: calc(84px + var(--rise)); z-index: 2; width: 12px; height: 7px; border-radius: 50%; pointer-events: none; background: #fffc; box-shadow: -14px 0 #fff9, 14px 0 #fff9; animation: dust .4s ease-out both; }
@keyframes dust { from { transform: translateX(-50%) scale(.5); } to { transform: translate(-50%, -12px) scale(1.7); opacity: 0; } }
.pickup-points::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; border-radius: 50%; color: #ffdb63; background: currentColor; box-shadow: 26px -20px, -26px -20px, 34px 6px, -34px 6px, 0 -32px, 16px 24px, -16px 24px; }
.confetti { position: fixed; left: var(--x); top: -20px; width: 10px; height: 16px; background: var(--tone); pointer-events: none; animation: confetti 2.6s var(--delay) ease-in both; }
@keyframes confetti { to { transform: translateY(105vh) rotate(var(--spin)); } }

.raccourci { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--white); color: var(--ink); font-weight: 750; text-decoration: none; }
.raccourci:hover { background: var(--hover); }
.raccourci.principal { color: white; background: var(--accent); border-color: var(--accent); }
.raccourci.principal:hover { filter: brightness(1.15); }
#son[aria-pressed="true"] { color: white; background: var(--accent); border-color: var(--accent); }
#son[aria-pressed="false"] span { opacity: .4; }
.accueil { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; padding: clamp(1rem, 6vw, 5rem); color: white; background: #1a0b33; overflow: hidden auto; isolation: isolate; }
.accueil-decor { position: absolute; z-index: -1; inset: 0; display: flex; }
.accueil-decor i { flex: 1; background: linear-gradient(#150729e0, #150729a8 60%, #15072940), var(--decor) center bottom / 255vh 100%; }
.accueil-decor svg { position: absolute; right: 8%; bottom: 8%; width: clamp(90px, 14vw, 190px); height: auto; }
.accueil[open] { display: flex; flex-direction: column; justify-content: safe center; gap: 1rem; }
.accueil p { margin: 0; }
.accueil .eyebrow { color: #ffe196; }
.accueil-nom { font-size: clamp(3rem, 13vw, 11rem); font-weight: 900; line-height: .95; letter-spacing: -.05em; overflow-wrap: anywhere; }
.accueil-nom span { display: inline-block; white-space: pre; translate: 0 calc(var(--near, 0) * -24px); rotate: calc(var(--near, 0) * -8deg); color: color-mix(in srgb, #ffdb63 calc(var(--near, 0) * 100%), white); }
.accueil-nom span:nth-child(4n+1) { font-family: Georgia, serif; }
.accueil-nom span:nth-child(4n+3) { font-family: 'Courier New', monospace; }
.accueil #jouer { color: #2d2342; background: #ffdb63; border-color: #ffdb63; font-size: 1.15rem; padding-inline: 1.5rem; }
.accueil .raccourci { color: white; background: #0005; border-color: #fff9; }
.accueil :focus-visible { outline-color: white; }
@media (max-width: 33rem) {
  .playing .brand, .playing .game-header h2 { display: none; }
  .playing .header-tools { gap: .25rem; }
  .playing .header-tools :is(button, a) { padding-inline: .45rem; font-size: .8rem; }
  .playing .viewport { min-height: 340px; }
  #theme-libelle { clip-path: inset(50%); position: absolute; width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
}

/* Partie en cours : le terrain remplit la fenêtre, l’interface flotte au-dessus. */
.world { transform-origin: 0 100%; }
.playing .viewport { position: fixed; inset: 0; min-height: 0; border: 0; border-radius: 0; }
.playing .viewport:focus-visible { outline-offset: -3px; }
.playing .game { margin: 0; padding: 0 0 .6rem; border: 0; background: none; box-shadow: none; }
.playing :is(.site-header, .game-header, .score-rules, .game-footer) { position: relative; z-index: 2; pointer-events: none; }
.playing :is(.site-header, .game-header, .game-footer) :is(a, button), .playing .score-rules { pointer-events: auto; }
.playing .site-header { border: 0; padding-block: .6rem .3rem; }
.playing :is(.brand, .game-header > div:first-child, .score-rules, .game-messages) { width: fit-content; padding: .3rem .75rem; border-radius: .75rem; color: var(--ink); background: var(--white); }
.playing .score-rules { margin: .4rem 0 0; max-width: 46rem; }
.playing .game-footer { margin-top: auto; justify-content: flex-start; }
.playing .game-messages { flex: 0 1 auto; }
.playing .block-tip { top: 9.5rem; }
@media (max-width: 33rem) {
  .playing .viewport { bottom: 8rem; }
  .playing .game-footer { min-height: 7rem; align-content: flex-start; }
  .playing .block-tip { top: 14.5rem; }
}
@media (max-height: 30rem) {
  .playing :is(.brand, .game-header h2, .score-rules, #proximite) { display: none; }
  .playing .block-tip { top: 9.2rem; }
}

/* Niveau Tryhard. */
.saw { position: absolute; z-index: 2; left: calc(var(--x) - 20px); bottom: calc(64px + var(--rise)); width: 40px; height: 40px; pointer-events: none; }
.saw::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, #2b2233 0 5px, #ff3b3b 6px 9px, #e9edf5 10px); clip-path: polygon(50% 0, 60% 15%, 78% 7%, 79% 25%, 97% 29%, 87% 45%, 100% 58%, 83% 65%, 85% 84%, 67% 82%, 59% 100%, 47% 86%, 31% 96%, 27% 79%, 8% 78%, 15% 61%, 0 50%, 15% 39%, 7% 22%, 26% 21%, 30% 4%, 43% 15%); }
#jeu .island.cracked::after { inset: 15px 0 0; background: repeating-linear-gradient(62deg, transparent 0 9px, #ff3b3b 9px 11px); }
@media (prefers-reduced-motion: no-preference) {
  .saw::before { animation: saw .5s linear infinite; }
  @keyframes saw { to { transform: rotate(1turn); } }
}

/* Impression et export PDF : uniquement le CV, sur fond blanc. */
@media print {
  :root { color-scheme: light; }
  @page { margin: 1.5cm; }
  body, body.playing { display: block; background: white; color: black; font-size: 10.5pt; }
  .skip, .site-header, .index, #jeu, .resume-actions, .site-footer, dialog { display: none !important; }
  .playing .intro, #cv[hidden] { display: block !important; }
  .layout, .playing main { width: auto; }
  .intro { padding: 0 0 .5rem; }
  h1 { font-size: 26pt; }
  .resume-header { margin-block: .5rem; }
  .resume-header .eyebrow { display: none; }
  .cards { display: block; }
  .card { break-inside: avoid; margin-bottom: .6rem; border: 1px solid #bbb; border-top: 3px solid #503378; background: white; }
  .card .eyebrow { color: #503378; }
  a { color: black; }
  .card a[href^="http"]::after, .card a[href^="mailto:"]::after { content: " (" attr(href) ")"; font-size: .9em; }
}
