/* One map coordinate system for the ground, the stepping stones and the travellers. */
#jeu:has(.adventure) {
  width: 100%;
  max-width: none;
  padding: 0;
  background: #91a75e;
}
.adventure .trail-map {
  position: relative;
  isolation: isolate;
  width: 100%;
  margin: 0;
  background: linear-gradient(#9bb664 8%, #d2a463 24%, #605480 40%, #4fb3b9 58%, #666899 78%, #573a68 94%);
}
.adventure .trail-map-head {
  position: absolute;
  z-index: 4;
  inset: 14px 14px auto auto;
  margin: 0;
}
.trail-resume {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 13em;
  padding: .6em 1em;
  border: 2px solid #55462d;
  border-radius: 2em;
  background: #fff3d4;
  color: #38281b;
  box-shadow: 0 3px 0 #614829;
  font-weight: 780;
  text-decoration: none;
}
.adventure .trail-worlds {
  position: relative;
  z-index: 2;
  display: block;
  isolation: isolate;
  overflow: clip;
}
.terrain-ground {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.terrain-strip {
  position: absolute;
  left: 0;
  width: 100%;
  display: block;
}
.trail-world { position: relative; }
.adventure .trail-world-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-block-size: clamp(144px, 13vw, 202px);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.adventure .trail-world-header::after { content: none; }
.adventure .trail-world:first-child .trail-world-header {
  min-block-size: max(144px, calc((100svh - var(--topbar-height)) / 2 - clamp(48px, 4.3vw, 68px)));
}
.adventure .trail-world:last-child::after {
  content: "";
  display: block;
  block-size: max(0px, calc((100svh - var(--topbar-height)) / 2 - clamp(48px, 4.3vw, 68px)));
  pointer-events: none;
}
.adventure .trail-world-copy {
  position: relative;
  align-self: flex-start;
  padding: clamp(20px, 3.2vw, 48px) clamp(18px, 4vw, 70px) 18px;
  color: #2f251c;
  text-shadow: 0 1px 1px #fffae8, 0 0 4px #fff6d7;
}
.adventure .trail-world-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -18px -22% -10px -8%;
  background: radial-gradient(ellipse 52% 50% at 45% 50%, #fff5d8fa 18%, #fff3d4eb 52%, #fff1d1b3 68%, transparent 100%);
  pointer-events: none;
}
.adventure .trail-world-copy h2,
.adventure .trail-world-copy h3 {
  max-width: min(18ch, 51vw);
  margin: 5px 0 2px;
  color: #33251c;
  font-weight: 820;
  font-size: clamp(1.75rem, 3.9vw, 4.15rem);
  line-height: .96;
  letter-spacing: -.055em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.adventure .trail-world-copy .trail-chapter,
.adventure .trail-world-copy .trail-world-status {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #39291e;
  font-family: inherit;
  font-size: .79rem;
  font-weight: 790;
}
.adventure .trail-world-copy .trail-chapter { letter-spacing: .12em; text-transform: uppercase; }
.adventure .trail-world-copy .trail-world-status { margin-top: .5em; }
.adventure .trail-steps { width: 100%; max-width: none; background: transparent; }
.adventure .trail-step {
  --node-size: calc(51px + var(--step-tier) * 1.25px);
  position: relative;
  display: block;
  min-height: 0;
  height: clamp(100px, 8.6vw, 136px);
  padding: 0;
  isolation: auto;
}
.adventure .trail-step::before, .adventure .trail-step::after { content: none; }
.adventure .trail-stop {
  position: absolute;
  z-index: 2;
  left: var(--terrain-x, var(--point));
  top: 50%;
  display: grid;
  place-items: center;
  width: var(--node-size);
  height: var(--node-size);
  min-width: 44px;
  min-height: 44px;
  max-width: none;
  margin: 0;
  transform: translate(-50%, -50%);
  touch-action: manipulation;
  cursor: pointer;
}
.adventure .trail-node {
  position: relative;
  width: 100%;
  height: 100%;
  border: 2px solid #745b40;
  border-bottom-width: 3px;
  border-radius: 46% 52% 43% 47% / 49% 45% 51% 49%;
  background: radial-gradient(ellipse at 38% 25%, #f5e1b5, #e6ca94 55%, #c39b68 89%);
  box-shadow: inset 0 2px 0 #fff6cc, 0 4px 0 #806449, 1px 7px 5px #48351c60;
  color: #4a2d18;
}
.adventure .trail-icon {
  display: block;
  width: 80%;
  height: 79%;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px #422b216b);
  pointer-events: none;
}
.adventure .trail-number {
  position: absolute;
  inset: auto auto -8px 50%;
  transform: translateX(-50%);
  min-width: 18px;
  padding: 1px 5px;
  border: 1px solid #ffedba;
  border-radius: 10px;
  background: #513f2c;
  color: #fff5d5;
  font-size: .65rem;
  line-height: 1.12;
  text-align: center;
}
.adventure .trail-step[data-state="locked"] .trail-node { background: linear-gradient(155deg,#f3e5c4,#ded1b1 64%,#baaa8c); }
.adventure .trail-step[data-state="locked"] .trail-icon { filter: saturate(.72) drop-shadow(0 1px 1px #422b216b); }
.adventure .trail-step[data-state="done"] .trail-node {
  border-color: #3e5942;
  background: radial-gradient(ellipse at 38% 25%, #fcffd1, #a9cb8d 80%);
  box-shadow: inset 0 2px 0 #f7ffc8, 0 4px 0 #365443, 1px 7px 5px #45371d60;
}
.adventure .trail-step[data-state="current"] .trail-node {
  border-color: #784b14;
  background: radial-gradient(ellipse at 37% 22%, #fff7bc, #ffc852 75%, #cc8e37);
  box-shadow: inset 0 2px 0 #fffad8, 0 4px 0 #825728, 0 0 0 5px #fff3b1, 0 0 0 7px #c28d3b, 1px 9px 7px #654c2666;
}
.trail-play-tag {
  position: absolute;
  z-index: 1;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #ffdf71;
  border-radius: 14px;
  padding: 2px 8px;
  background: #563a19;
  color: #fff8cc;
  font-size: .69rem;
  line-height: 1.1;
  font-weight: 800;
}
.trail-tick {
  position: absolute;
  right: -9px;
  top: -3px;
  padding: 2px 4px;
  border: 1px solid #f3ffd5;
  border-radius: 50%;
  background: #2b563e;
  color: white;
  font-size: .75rem;
}
.adventure .trail-stop:focus-visible { z-index: 4; outline: 0; }
.adventure .trail-stop:focus-visible .trail-node {
  outline: 3px solid #301d57;
  outline-offset: 5px;
  box-shadow: 0 0 0 5px white;
}
.adventure .trail-passage { height: clamp(48px, 8vw, 118px); }
@media (max-width: 600px) {
  .adventure .trail-world-copy { padding: 20px 15px 10px; }
  .adventure .trail-world-copy h2, .adventure .trail-world-copy h3 { max-width: 65vw; }
  .adventure .trail-world-header { min-block-size: 134px; }
  .adventure .trail-map-head { inset: 12px 8px auto auto; }
  .trail-resume { max-width: 9.5em; padding: 5px 8px; font-size: .73rem; }
  .adventure .trail-step { --node-size: calc(47px + var(--step-tier) * .85px); height: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .adventure .trail-stop .trail-node { transition: none; }
}
@media (forced-colors: active) {
  .terrain-ground { display: none; }
  .adventure .trail-world-copy, .adventure .trail-node, .adventure .trail-play-tag, .adventure .trail-number {
    color: CanvasText; background: Canvas; border-color: CanvasText; text-shadow: none;
  }
  .adventure .trail-step[data-state="current"] .trail-node { outline: 2px solid Highlight; }
  .adventure .trail-stop:focus-visible .trail-node { outline: 4px solid Highlight; }
}
/* Game disclosures retain their native controls and keyboard behaviour. */
.player-panel {
  margin-block-end: .7rem;
  border: 1px solid #dfcfef;
  border-radius: .8rem;
  background: #fffaf5;
}
.player-panel > summary {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  gap: .62rem;
  padding: .55rem .8rem;
  border-radius: .75rem;
  color: #38264e;
  cursor: pointer;
  font-weight: 825;
  list-style: none;
  text-align: start;
  touch-action: manipulation;
}
.player-panel > summary::-webkit-details-marker { display: none; }
.player-panel > summary::before {
  box-sizing: border-box;
  inline-size: .47rem;
  block-size: .47rem;
  flex: none;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);
  content: "";
}
.player-panel[open] > summary::before { transform: translateY(-2px) rotate(45deg); }
.player-panel[open] > summary {
  border-radius: .75rem .75rem 0 0;
  border-block-end: 1px solid #e8dbf4;
  background: #f2eafa;
}
.player-panel > summary:hover { background-color: #f2eafb; }
.player-panel > summary:focus-visible { outline: 3px solid #5e32b3; outline-offset: -4px; }
.player-panel-body { min-inline-size: 0; padding: clamp(.45rem, 2vw, .8rem); }
.player-panel-body > :last-child { margin-block-end: 0; }

@media (prefers-reduced-motion: no-preference) {
  .player-panel > summary::before { transition: transform 165ms ease-out; }
  .player-panel[open] > .player-panel-body { animation: trail-panel-reveal 200ms ease-out both; }

  @supports (interpolate-size: allow-keywords) and selector(details::details-content) {
    .player-panel::details-content {
      interpolate-size: allow-keywords;
      overflow: clip;
      contain: layout;
      transition: block-size 220ms ease, content-visibility 220ms ease;
      transition-behavior: allow-discrete;
    }
    .player-panel:not([open])::details-content { block-size: 0; }
  }
}

@keyframes trail-panel-reveal {
  from { opacity: .6; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

