:root { color: #1c1915; background: #f3f0e8; font-family: "Iowan Old Style", Palatino, Georgia, serif; }
* { box-sizing: border-box; }
body { margin: 0; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
a { color: #244536; }
header, main { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }
header { padding: 22px 0 8px; }
.back { font: 600 14px/1.4 system-ui, sans-serif; }
h1 { margin: 4px 0 8px; font-size: 32px; font-weight: 500; }
.lede { margin: 0 0 16px; max-width: 62ch; font-size: 18px; line-height: 1.45; }
.stage { position: relative; aspect-ratio: 16 / 9; background: #d5e1e8; border-radius: 14px; overflow: hidden; }
.stage img, #view { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; touch-action: none; }
#mini-map {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  width: clamp(102px, 17%, 166px);
  aspect-ratio: 1;
  border: 1px solid #73888c;
  border-radius: 14px;
  box-shadow: 0 5px 20px #0b1518a0;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
}
#town-map {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: #11191e;
  touch-action: none;
}
#town-map canvas { width: 100%; height: 100%; display: block; }
#town-map button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #42545b;
  border-radius: 9px;
  background: #172227;
  color: #e5efee;
  font: 650 12px/1 system-ui, sans-serif;
  cursor: pointer;
}
#town-map button:hover, #town-map button:focus-visible {
  border-color: #83e0c8;
  background: #233638;
}
#town-map-close { position: absolute; top: 14px; right: 14px; }
.town-map-title {
  position: absolute; top: 14px; left: 14px;
  display: grid; gap: 3px; padding: 12px 15px;
  border: 1px solid #42545b; border-radius: 11px; background: #172227ec;
  color: #f0f6f5; font: 500 12px system-ui, sans-serif;
  pointer-events: none;
}
.town-map-title strong { font-size: 18px; font-weight: 700; }
.town-map-title span { color: #a6b8bc; }
.town-map-controls {
  position: absolute; top: 64px; right: 14px;
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px;
}
.town-map-controls button:nth-child(-n+2) { min-width: 40px; font-size: 17px; }
.town-map-credit {
  position: absolute; bottom: 48px; right: 18px;
  color: #a6b8bc; font: 500 10px system-ui, sans-serif;
}
@media (max-width: 560px) {
  .town-map-controls { top: 74px; }
  .town-map-title strong { font-size: 15px; }
}
#town-map:not([hidden]) { animation: town-map-in .18s ease-out both; }
@keyframes town-map-in { from { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { @media (max-width: 560px) {
  .town-map-controls { top: 74px; }
  .town-map-title strong { font-size: 15px; }
}
#town-map:not([hidden]) { animation: none; } }
[hidden] { display: none !important; }
#enter, #fullscreen, #walk-controls button, .tools button { font: 600 15px/1 system-ui, sans-serif; min-height: 44px; border-radius: 999px; border: 0; padding: 0 16px; cursor: pointer; }
#enter { position: absolute; left: 16px; bottom: 16px; background: #1c1915; color: #f6f3ec; }
#fullscreen {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  color: #fffdf8;
  background: rgba(28, 25, 21, 0.87);
  border: 1px solid rgba(255, 253, 248, 0.65);
  touch-action: manipulation;
}
#fullscreen svg { display: block; width: 22px; height: 22px; pointer-events: none; }
#fullscreen .icon-exit { display: none; }
#fullscreen[aria-pressed="true"] { background: #244536; border-color: #fffdf8; }
#fullscreen[aria-pressed="true"] .icon-enter { display: none; }
#fullscreen[aria-pressed="true"] .icon-exit { display: block; }
#fullscreen:focus-visible { outline: 2px solid #fffdf8; outline-offset: 2px; }
#walk-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; position: absolute; z-index: 2; top: 12px; right: 12px; left: 64px; }
#walk-controls button { touch-action: manipulation; background: rgba(28, 25, 21, 0.87); color: #fffdf8; border: 1px solid rgba(255, 253, 248, 0.65); }
#walk-controls button[aria-pressed="true"] { background: #244536; border-color: #fffdf8; box-shadow: inset 0 0 0 1px #fffdf8; }
.stage canvas:focus-visible { outline: 2px solid #fffdf8; outline-offset: -3px; }
#joy { display: none; position: absolute; z-index: 2; left: 16px; bottom: 16px; width: 112px; height: 112px; border-radius: 50%; background: rgba(28, 25, 21, 0.32); touch-action: none; }
#joy-knob { position: absolute; left: 36px; top: 36px; width: 40px; height: 40px; border-radius: 50%; background: #fffdf8; }
#look-hint { display: none; }
@media (max-width: 799px), (any-pointer: coarse) {
  .stage.is-walk #joy { display: block; }
  #look-hint {
    display: block;
    position: absolute;
    right: 12px;
    bottom: 18px;
    pointer-events: none;
    margin: 0;
    padding: 7px 10px;
    max-width: calc(100% - 24px);
    background: rgba(28, 25, 21, 0.72);
    color: #fffdf8;
    border-radius: 8px;
    font: 600 13px/1.25 system-ui, sans-serif;
  }
  .stage.is-walk #look-hint { max-width: calc(100% - 150px); }
  .stage:has(#mini-map:not([hidden])) #look-hint { bottom: calc(clamp(102px, 17vw, 166px) + 24px); }
}
#enter:disabled, .tools button:disabled { opacity: 0.7; cursor: progress; }
.bourg-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #e6e9e3;
  color: #23332d;
}
.bourg-loading[hidden] { display: none; }
.bourg-loading-card { width: min(76%, 23rem); }
.bourg-loading-card p { margin: 0 0 .75rem; font-weight: 650; }
.bourg-loading-card progress { display: block; width: 100%; height: .7rem; accent-color: #32624f; }
#gl-fail { position: absolute; left: 16px; right: 16px; bottom: 16px; margin: 0; padding: 12px 14px; background: #fff8ee; border-radius: 10px; }
@media (max-width: 690px) {
  #walk-controls button { min-height: 35px; padding: 0 10px; font-size: 12px; }
}
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0; font: 600 14px/1.4 system-ui, sans-serif; }
.modes, .places, .ambience { display: flex; align-items: center; gap: 7px; }
.modes { flex-wrap: wrap; }
.places select { min-width: 0; width: min(245px, 64vw); }
.guide-status { flex-basis: 100%; margin: 0; color: #244536; }
.arrivee-ecran {
  position: absolute;
  z-index: 5;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(26rem, calc(100% - 24px));
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(28, 25, 21, 0.82);
  color: #fffdf8;
  text-align: center;
  pointer-events: none;
}
.arrivee-ecran p {
  margin: 0;
  font: 600 15px/1.3 system-ui, sans-serif;
}
.ambience select { min-width: 0; width: min(178px, 52vw); }
.tools select, .settings summary { min-height: 44px; border-radius: 8px; padding: 10px; font: inherit; border: 1px solid #d5cfc3; color: inherit; background: #fffdf8; }
.settings summary { cursor: pointer; }
.settings { position: relative; }
.settings-panel { position: absolute; z-index: 3; inset-inline-end: 0; top: calc(100% + 5px); width: min(305px, 88vw); padding: 12px; background: #fffdf8; border: 1px solid #d5cfc3; border-radius: 9px; box-shadow: 0 8px 28px #201b1629; }
.setting-action { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.settings-panel .weather { margin: 10px 0 0; }
@media (max-width: 620px) {
  .settings-panel { position: static; margin-top: 5px; }
}
.tools button { background: #fff; color: #1c1915; border: 1px solid #d5cfc3; }
.tools button[aria-pressed="true"] { background: #244536; color: #f6f3ec; border-color: #244536; }
#walk-hint, #nuage { margin: 0 0 12px; padding: 12px 14px; background: #fff8ee; border-radius: 10px; }
footer { padding: 12px 0 28px; }
.documentation { width: min(850px, calc(100% - 32px)); }
.documentation .panel { margin-bottom: 28px; }
.panel { background: #fffdf8; border: 1px solid #e4ddd0; border-radius: 14px; padding: 14px 16px 18px; }
.panel h2 { margin: 0 0 8px; font-size: 20px; }
dl { margin: 0; }
dt { margin-top: 10px; font: 600 12px/1.3 system-ui, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: #5c564c; }
dd { margin: 2px 0 0; }
.sources p, .sources li { line-height: 1.45; }
.sources ul { margin: 8px 0 0; padding-left: 18px; }
@media (max-width: 799px) {
  h1 { font-size: 26px; }
  header, main { width: calc(100% - 20px); }
  .stage { height: clamp(300px, 65svh, 620px); aspect-ratio: auto; }
}

html.is-fs-lock,
body.is-fs-lock { overflow: hidden; }
.stage.is-pseudo-fullscreen {
  position: fixed;
  z-index: 30;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  margin: 0;
  border-radius: 0;
  aspect-ratio: auto;
}
.stage:fullscreen {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  aspect-ratio: auto;
  background: #d5e1e8;
}
.stage:-webkit-full-screen {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  aspect-ratio: auto;
  background: #d5e1e8;
}
.stage.is-pseudo-fullscreen > img,
.stage.is-pseudo-fullscreen > #view,
.stage:fullscreen > img,
.stage:fullscreen > #view {
  top: env(safe-area-inset-top, 0px);
  right: auto;
  bottom: auto;
  left: env(safe-area-inset-left, 0px);
  width: calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}
.stage:-webkit-full-screen > img,
.stage:-webkit-full-screen > #view {
  top: env(safe-area-inset-top, 0px);
  right: auto;
  bottom: auto;
  left: env(safe-area-inset-left, 0px);
  width: calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}
.stage.is-pseudo-fullscreen #fullscreen,
.stage:fullscreen #fullscreen {
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(12px + env(safe-area-inset-left, 0px));
}
.stage:-webkit-full-screen #fullscreen {
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(12px + env(safe-area-inset-left, 0px));
}
.stage.is-pseudo-fullscreen #walk-controls,
.stage:fullscreen #walk-controls {
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  left: calc(176px + env(safe-area-inset-left, 0px));
}
.stage:-webkit-full-screen #walk-controls {
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  left: calc(176px + env(safe-area-inset-left, 0px));
}
.stage.is-pseudo-fullscreen #enter,
.stage.is-pseudo-fullscreen #joy,
.stage:fullscreen #enter,
.stage:fullscreen #joy {
  left: calc(16px + env(safe-area-inset-left, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.stage:-webkit-full-screen #enter,
.stage:-webkit-full-screen #joy {
  left: calc(16px + env(safe-area-inset-left, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.stage.is-pseudo-fullscreen #mini-map,
.stage:fullscreen #mini-map {
  right: calc(14px + env(safe-area-inset-right, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}
.stage:-webkit-full-screen #mini-map {
  right: calc(14px + env(safe-area-inset-right, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}
.stage.is-pseudo-fullscreen #vehicle-hud,
.stage:fullscreen #vehicle-hud {
  top: calc(65px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
}
.stage:-webkit-full-screen #vehicle-hud {
  top: calc(65px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
}
.stage.is-pseudo-fullscreen #vehicle-status,
.stage:fullscreen #vehicle-status {
  top: calc(106px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
}
.stage:-webkit-full-screen #vehicle-status {
  top: calc(106px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
}

#fs-menu {
  position: absolute;
  z-index: 6;
  top: 12px;
  left: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0 14px;
  color: #fffdf8;
  background: rgba(28, 25, 21, 0.87);
  border: 1px solid rgba(255, 253, 248, 0.65);
  border-radius: 999px;
  touch-action: manipulation;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  font: 600 15px/1 system-ui, sans-serif;
}
#fs-menu svg { display: block; width: 18px; height: 18px; pointer-events: none; }
#fs-menu span { pointer-events: none; }
#fs-menu:focus-visible { outline: 2px solid #fffdf8; outline-offset: 2px; }
#fs-menu[aria-expanded="true"] { background: #244536; border-color: #fffdf8; }
.stage.is-pseudo-fullscreen #fs-menu,
.stage:fullscreen #fs-menu,
.stage:-webkit-full-screen #fs-menu {
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(64px + env(safe-area-inset-left, 0px));
}
#fs-menu-panel {
  position: absolute;
  z-index: 8;
  top: 64px;
  left: 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: min(640px, calc(100% - 24px));
  max-height: calc(100% - 80px);
  overflow: auto;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.97);
  color: #1c1915;
  box-shadow: 0 12px 32px #17252166;
  touch-action: manipulation;
  pointer-events: auto;
  overscroll-behavior: contain;
}
.stage.is-pseudo-fullscreen #fs-menu-panel,
.stage:fullscreen #fs-menu-panel,
.stage:-webkit-full-screen #fs-menu-panel {
  top: calc(64px + env(safe-area-inset-top, 0px));
  left: calc(12px + env(safe-area-inset-left, 0px));
  width: min(640px, calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  max-height: calc(100% - 80px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}
#fs-menu-panel .tools { margin: 0; }
#fs-menu-panel .settings { position: static; }
#fs-menu-panel .settings-panel { position: static; width: auto; margin-top: 6px; box-shadow: none; }
#fs-menu-panel #fs-leave,
#fs-menu-panel #vehicle-action {
  align-self: flex-start;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #d5cfc3;
  background: #1c1915;
  color: #fffdf8;
  cursor: pointer;
  touch-action: manipulation;
  font: 600 15px/1 system-ui, sans-serif;
}

#cloud-status:empty { display: none; }
#cloud-status { padding: 10px 14px; background: #fffdf8; border-radius: 8px; }
#nuage { color: #fff; background: #26373b; }
.ground-key, .building-key, .leaf-key { font-weight: 700; }
.ground-key { color: #e3cdaa; }
.building-key { color: #b6daff; }
.leaf-key { color: #9ce7ad; }


.weather {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 14px;
  font: 500 14px/1.4 system-ui, sans-serif;
}
.weather select {
  min-height: 40px;
  padding: 6px 9px;
  background: #fffdf8;
  border: 1px solid #cfc7b9;
  border-radius: 8px;
  font: inherit;
  color: inherit;
}
#weather-status { color: #524b42; }


#vehicle-hud, #vehicle-status:not(:empty) {
  position: absolute;
  z-index: 2;
  right: 12px;
  color: #fffdf8;
  background: rgba(28, 25, 21, .87);
  padding: .45rem .75rem;
  border-radius: .7rem;
  pointer-events: none;
}
#vehicle-hud { top: 65px; font-variant-numeric: tabular-nums; }
.stage.is-bus #walk-controls, .stage.is-bus #joy, .stage.is-bus #look-joy, .stage.is-bus #look-hint { display: none; }
#bus-wait-status {
  position: absolute;
  top: 62px;
  right: 12px;
  z-index: 4;
  max-width: min(390px, calc(100% - 24px));
  margin: 0;
  padding: .5rem .7rem;
  color: #fffdf8;
  background: #152228ef;
  border-radius: .65rem;
  font: 600 13px/1.3 system-ui, sans-serif;
  pointer-events: none;
}
#bus-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  max-width: min(390px, calc(100% - 130px));
  padding: .6rem .8rem;
  color: #fffdf8;
  background: #152228ef;
  border: 1px solid #536e72;
  border-radius: .8rem;
  font: 600 14px/1.3 system-ui, sans-serif;
}
#bus-route { margin: 0; font-size: 15px; }
#bus-next-stop { margin: .25rem 0 .45rem; color: #a1d8cd; }
#bus-panel div { display: flex; flex-wrap: wrap; gap: .4rem; }
#bus-panel button {
  min-height: 37px;
  padding: .35rem .65rem;
  color: inherit;
  background: #28564d;
  border: 1px solid #7d9996;
  border-radius: .55rem;
  font: inherit;
}
#bus-panel button:disabled { opacity: .7; }
#race-hud {
  position: absolute;
  z-index: 4;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 148px;
  padding: .35rem .8rem .45rem;
  text-align: center;
  color: #fffdf8;
  background: #152228e8;
  border: 1px solid #42545b;
  border-radius: .8rem;
  pointer-events: none;
}
#race-clock { margin: 0; font: 700 28px/1.05 ui-monospace, monospace; font-variant-numeric: tabular-nums; }
#race-target, #race-best, #race-note { margin: .12rem 0 0; font: 600 13px/1.2 system-ui, sans-serif; }
#race-hud[data-phase="finished"] { border-color: #83e0c8; }
#race-note { color: #a1d8cd; letter-spacing: .04em; text-transform: uppercase; }
#race-finish-actions, #race-vehicle-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  margin-top: .55rem;
  pointer-events: auto;
}
#race-hud[data-phase="finished"] { width: min(328px, calc(100% - 24px)); }
#race-finish-actions button, #race-vehicle-form button, #race-vehicle-form select {
  min-height: 36px;
  padding: .3rem .6rem;
  border: 1px solid #6f8a8b;
  border-radius: .55rem;
  background: #203439;
  color: #fffdf8;
  font: 600 13px/1.2 system-ui, sans-serif;
}
#race-restart { background: #286044; }
#course-action {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #1f8a4c;
  color: #fffdf8;
  font: 700 15px/1 system-ui, sans-serif;
  cursor: pointer;
  pointer-events: auto;
}
#course-panel { flex: 1 0 100%; margin: 0; }
#course-panel h2 { margin: 0 0 4px; font: 700 13px/1.2 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
#course-list { margin: 0; padding: 0; list-style: none; }
#course-list li { margin: 0; padding: .35rem 0; border-top: 1px solid #e4ddd0; }
#course-list li:first-child { border-top: 0; }
#course-list .course-name { display: block; }
#course-list .course-meta { display: block; margin-top: .1rem; font-size: 12px; font-weight: 600; color: #5c564c; }
#course-list li.is-locked { color: #8a847a; }
.stage.is-boosting #vehicle-hud { box-shadow: 0 0 0 1px #82e8ffc9, 0 0 24px #27baff70; }
#vehicle-status { top: 106px; max-width: min(240px, 65%); margin: 0; }

/* Page Couverture de la commune (/labs/bourg/couverture) */
.coverage-total { margin: 4px 0 12px; font-size: 18px; line-height: 1.45; }
.coverage-total strong { font-size: 34px; font-weight: 600; }
.coverage-bar { display: block; margin: 0 0 16px; }
.coverage-map { display: block; height: auto; margin-top: 4px; border-radius: 10px; background: #fffdf8; }
.coverage-table { width: 100%; border-collapse: collapse; font: 15px/1.4 system-ui, sans-serif; }
.coverage-table th, .coverage-table td { padding: 7px 8px; border-top: 1px solid #e4ddd0; text-align: left; vertical-align: middle; font-weight: 400; }
.coverage-table td { text-align: right; white-space: nowrap; }
.coverage-table td:first-child { text-align: left; white-space: normal; }
.coverage-table thead th { border-top: 0; font: 600 12px/1.3 system-ui, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: #5c564c; }
.coverage-table tbody th { font-weight: 600; }
.swatch { margin-right: 6px; vertical-align: -2px; }
.coverage-legend { margin: 10px 0 0; font: 14px/1.5 system-ui, sans-serif; color: #5c564c; }
.coverage-stamp { margin: -12px 0 8px; font: 13px/1.4 system-ui, sans-serif; color: #5c564c; }
@media (max-width: 520px) {
  .coverage-table { font-size: 13px; }
  .coverage-table th, .coverage-table td { padding: 6px 4px; }
  .coverage-table thead th { font-size: 10px; letter-spacing: 0.02em; }
  .coverage-total strong { font-size: 28px; }
}


#flight-toggle { background: #523247; }
.stage.is-flight #flight-toggle { background: #692d43; border-color: #ffdcbf; }
.stage.is-flight :is(#run-toggle, #camera-toggle, #jump, #vehicle-action, #greet) { display: none; }
#rencontre {
  position: absolute;
  z-index: 5;
  max-width: 12rem;
  margin: 0;
  padding: 6px 10px;
  border-radius: 12px;
  background: #fffdf8;
  color: #1c1915;
  font: 600 13px/1.3 system-ui, sans-serif;
  pointer-events: none;
  transform: translate(-50%, -125%);
  box-shadow: 0 6px 16px #17252144;
}
#rencontre.is-speech::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fffdf8;
  border-bottom: 0;
}
#greet.is-ready { box-shadow: inset 0 0 0 2px #f3d48a; }
#flight-hud {
  position: absolute; z-index: 2; top: 67px; right: 12px; display: flex;
  background: #171827dc; color: #fff8ef; border: 1px solid #fff3d65c;
  border-radius: 13px; font: 600 12px/1.2 system-ui, sans-serif; pointer-events: none;
}
#flight-hud > div { min-width: 92px; padding: 8px 11px; }
#flight-hud > div + div { border-left: 1px solid #fff3d645; }
#flight-hud > div > span { display: block; color: #dfd5dc; }
#flight-hud strong { display: block; margin-top: 3px; font-size: 20px; font-variant-numeric: tabular-nums; }
.stage.is-boosting #flight-hud { border-color: #e6bda2; }
#flight-status {
  position: absolute; z-index: 2; top: 13px; left: 50%; transform: translateX(-50%);
  max-width: min(57%, 27rem); margin: 0; padding: 8px 12px; border-radius: 11px;
  background: #222131e8; color: #fff8ef; text-align: center; pointer-events: none;
  font: 600 12px/1.35 system-ui, sans-serif;
}
#flight-effect-status {
  position: absolute;
  z-index: 2;
  top: 131px;
  right: 12px;
  max-width: calc(100% - 24px);
  margin: 0;
  padding: .42rem .65rem;
  color: #fff8ef;
  background: #222131e8;
  border-radius: .65rem;
  font: 600 12px/1.35 system-ui, sans-serif;
  pointer-events: none;
}
#flight-pad { display: none; }
@media (max-width: 799px), (any-pointer: coarse) {
  .stage.is-flight #look-hint { display: none; }
  #flight-pad {
    position: absolute; z-index: 3; right: 13px; bottom: calc(clamp(102px, 17vw, 166px) + 20px);
    display: grid; grid-template-columns: 1fr 1fr; gap: 5px; touch-action: none;
  }
  #flight-pad button {
    min-height: 43px; padding: 0 10px; border: 1px solid #fff3d67d; border-radius: 11px;
    background: #242238ea; color: #fff8ef; font: 650 12px/1 system-ui, sans-serif;
    touch-action: none; user-select: none;
  }
  #flight-pad button:last-child { grid-column: span 2; background: #573147f2; }
  #flight-pad button.is-held { background: #794458; border-color: #ffe3be; }
  #flight-status { top: 66px; left: 12px; max-width: max(128px, calc(100% - 195px)); transform: none; }
  #flight-hud { top: 60px; }
  #flight-hud > div { min-width: 72px; padding: 7px 8px; }
  #flight-hud > div > span { font-size: 10px; }
  #flight-hud strong { font-size: 16px; }
}
@media (max-height: 450px) and (orientation: landscape) {
  #flight-pad { grid-template-columns: repeat(3, auto); right: calc(clamp(102px, 17vw, 166px) + 24px); bottom: 14px; }
  #flight-pad button:last-child { grid-column: auto; }
}

#look-joy, #touch-brake, #rotate-hint { display: none; }

@media (any-pointer: coarse) and (orientation: portrait) {
  .stage.is-walk:is(.is-pseudo-fullscreen, :fullscreen, :-webkit-full-screen) #rotate-hint {
    display: block; position: absolute; top: calc(68px + env(safe-area-inset-top, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px)); max-width: 145px; margin: 0;
    padding: 6px 8px; border-radius: 8px; background: #122521dc; color: #fffdf8;
    font: 600 11px/1.25 system-ui, sans-serif; pointer-events: none;
  }
}

@media (any-pointer: coarse) and (orientation: landscape) {
  .stage.is-walk {
    --pad-size: clamp(78px, 25dvh, 116px);
    --pad-left: calc(14px + env(safe-area-inset-left, 0px));
    --pad-right: calc(14px + env(safe-area-inset-right, 0px));
    --pad-bottom: calc(13px + env(safe-area-inset-bottom, 0px));
    --pad-top: calc(11px + env(safe-area-inset-top, 0px));
  }
  .stage.is-walk:not(:is(.is-pseudo-fullscreen, :fullscreen, :-webkit-full-screen)) {
    height: min(86svh, 56vw); min-height: 245px; aspect-ratio: auto;
  }
  .stage.is-walk #look-hint { display: none; }
  .stage.is-walk #walk-controls {
    bottom: var(--pad-bottom); align-content: flex-start; pointer-events: none;
  }
  .stage.is-walk #walk-controls button { min-height: 44px; font-size: 13px; pointer-events: auto; }
  .stage.is-walk #jump { position: absolute; right: calc(var(--pad-size) + 11px); bottom: 0; }
  .stage.is-walk #joy, .stage.is-walk:not(.is-driving) #look-joy {
    display: grid; place-items: center; position: absolute; z-index: 3;
    bottom: var(--pad-bottom); width: var(--pad-size); height: var(--pad-size);
    border-radius: 50%; border: 1px solid #fffdf86b; background: #101b24a8;
    box-shadow: inset 0 1px 1px #fffdf82c, 0 6px 18px #0b17194f;
    touch-action: none; user-select: none;
  }
  .stage.is-walk #joy { left: var(--pad-left); }
  .stage.is-walk #look-joy { right: var(--pad-right); }
  .stage.is-walk .touch-stick span {
    position: static; width: 36%; height: 36%; border-radius: 50%;
    background: #f5f3dfd6; box-shadow: 0 2px 8px #0912117a; pointer-events: none;
  }
  .stage.is-walk #look-knob { background: #bad3cfe6; }
  .stage.is-walk #mini-map {
    top: calc(var(--pad-top) + 55px); left: var(--pad-left); bottom: auto; right: auto;
    width: clamp(66px, 20dvh, 104px); border-color: #ffebc59c;
  }
  .stage.is-walk #flight-pad {
    grid-template-columns: repeat(3, auto); bottom: var(--pad-bottom);
    right: calc(var(--pad-right) + var(--pad-size) + 9px);
  }
  .stage.is-walk #flight-pad button:last-child { grid-column: auto; }
  .stage.is-walk #flight-hud { top: calc(var(--pad-top) + 51px); right: var(--pad-right); }
  .stage.is-walk #flight-status {
    top: auto; bottom: calc(var(--pad-bottom) + var(--pad-size) + 8px);
    left: 50%; max-width: 45%; transform: translateX(-50%);
  }
  .stage.is-walk #vehicle-hud { top: calc(var(--pad-top) + 51px); right: var(--pad-right); }
  .stage.is-walk #vehicle-status { top: calc(var(--pad-top) + 89px); right: var(--pad-right); }
  .stage.is-driving #touch-brake {
    display: block; position: absolute; z-index: 3; right: var(--pad-right); bottom: var(--pad-bottom);
    width: calc(var(--pad-size) * .82); height: calc(var(--pad-size) * .82);
    border: 1px solid #ffdfd2a8; border-radius: 27%; color: #fffdf8; background: #682a32ef;
    font: 700 14px/1 system-ui, sans-serif; touch-action: none; user-select: none;
  }
  .stage.is-driving #touch-brake.is-held { background: #a64549; }
  .stage.is-driving #touch-boost {
    display: block; position: absolute; z-index: 3; right: var(--pad-right);
    bottom: calc(var(--pad-bottom) + var(--pad-size) * .88 + 10px);
    width: calc(var(--pad-size) * .82); height: calc(var(--pad-size) * .82);
    border: 1px solid #a8edff; border-radius: 27%; color: #f5fdff; background: #155d78ef;
    font: 700 13px/1 system-ui, sans-serif; touch-action: none; user-select: none;
  }
  .stage.is-driving #touch-boost.is-held { background: #20a9d0; box-shadow: 0 0 23px #51d9ffbd; }
}

#flight-tilt {
  position: absolute; z-index: 4; right: calc(13px + env(safe-area-inset-right, 0px));
  top: 122px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px;
  max-width: min(53%, 240px);
}
#flight-tilt button {
  min-height: 44px; padding: 0 11px; border: 1px solid #fff3d67d; border-radius: 11px;
  background: #242238ea; color: #fff8ef; font: 650 12px/1 system-ui, sans-serif;
}
#flight-tilt button[aria-pressed="true"] { background: #3a5757; }
#tilt-status {
  flex-basis: 100%; padding: 6px 8px; border-radius: 7px; background: #222131e8;
  color: #fff8ef; font: 600 11px/1.35 system-ui, sans-serif;
}
.stage.is-flight.is-tilt #look-joy { display: none; }
@media (any-pointer: coarse) and (orientation: landscape) {
  .stage.is-walk.is-flight.is-tilt #flight-pad { right: var(--pad-right); }
  #flight-tilt { top: calc(var(--pad-top, 11px) + 108px); }
}

/* Contrôles horaires, visite guidée & caméra cinématique */
.hour-control {
  width: 100%;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hour-control label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.hour-control input[type="range"] {
  width: 100%;
  accent-color: #244536;
  cursor: pointer;
}

#tour-panel {
  position: absolute;
  z-index: 5;
  left: 14px;
  bottom: 14px;
  width: min(370px, calc(100% - 28px));
  padding: 13px 15px 14px;
  border-radius: 13px;
  background: rgba(24, 22, 19, 0.90);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 244, 218, 0.34);
  color: #fffdf8;
  box-shadow: 0 10px 30px rgba(10, 12, 14, 0.42);
  font: 400 13.5px/1.42 system-ui, sans-serif;
}
.tour-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.tour-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 200, 87, 0.22);
  border: 1px solid rgba(255, 208, 112, 0.55);
  color: #ffe29a;
  font: 700 11px/1.4 system-ui, sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
#tour-panel h3 {
  margin: 0 0 5px;
  font: 650 16px/1.25 system-ui, sans-serif;
  color: #fffaf0;
}
#tour-panel p {
  margin: 0 0 10px;
  color: #e6dfd2;
}
.tour-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tour-actions button, .tour-icon-btn, #cinema-banner button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 253, 248, 0.38);
  background: rgba(255, 253, 248, 0.11);
  color: #fffdf8;
  font: 600 12.5px/1 system-ui, sans-serif;
  cursor: pointer;
}
.tour-icon-btn {
  min-height: 28px;
  width: 28px;
  padding: 0;
}
.tour-actions .tour-primary {
  margin-left: auto;
  background: #2b5944;
  border-color: #9be0bd;
}

.stage.is-cinema::before,
.stage.is-cinema::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: clamp(18px, 5.5%, 42px);
  background: #0d0c0b;
  z-index: 3;
  pointer-events: none;
}
.stage.is-cinema::before { top: 0; }
.stage.is-cinema::after { bottom: 0; }

#cinema-banner {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: clamp(24px, 7%, 52px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 28px);
  padding: 7px 10px 7px 14px;
  border-radius: 999px;
  background: rgba(20, 19, 17, 0.88);
  border: 1px solid rgba(255, 244, 218, 0.35);
  color: #fffdf8;
  font: 600 13px/1.25 system-ui, sans-serif;
  white-space: nowrap;
}
#cinema-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.cinema-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #f0b44c;
  box-shadow: 0 0 8px #f0b44c;
}
@media (max-width: 690px) {
  #tour-panel { padding: 10px 12px; font-size: 12.5px; }
  #tour-panel h3 { font-size: 14.5px; }
  #cinema-banner { font-size: 12px; padding: 6px 8px 6px 11px; }
}

