.ha-yt-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(8px);
}

.ha-yt-modal[hidden] {
  display: none;
}

.ha-yt-modal__card {
  position: relative;
  width: min(960px, 100%);
  max-height: 90vh;
  padding: 18px 18px 22px;
  background: #111a2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.ha-yt-modal__card h2 {
  margin: 0 44px 12px 0;
  font-size: clamp(17px, 3vw, 22px);
  line-height: 1.2;
  color: #f5c400;
}

.ha-yt-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  font-size: 26px;
  line-height: 1;
  color: #edf3ff;
  background: #22304f;
  cursor: pointer;
}

.ha-yt-modal__close:hover {
  background: #2d3d63;
}

.ha-yt-modal__wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border-radius: 12px;
}

.ha-yt-modal__host {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ha-yt-modal__host iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}

.aide-tuto-link {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--gold, #f5c400);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.aide-tuto-link:hover {
  filter: brightness(1.08);
}

.aide-panel-tuto-btn {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 72px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  color: #1a1200;
  background: #f5c400;
  cursor: pointer;
}

body.aide-carte-seule .aide-panel-tuto-btn {
  display: inline-flex;
}

body.aide-carte-seule .wrap {
  position: relative;
  padding-right: 84px;
}

.aide-panel-tuto-btn__line {
  display: block;
}

/* Vignette YouTube (popup carte) */
.ha-youtube-facade {
  position: relative;
  margin: 10px 0;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.ha-youtube-facade__play {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: #000;
  text-decoration: none;
  color: inherit;
}

a.ha-youtube-facade__play:hover {
  filter: brightness(1.05);
}

.ha-youtube-facade__hint {
  margin: 8px 10px 0;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
}

.ha-youtube-facade__thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  vertical-align: top;
}

.ha-youtube-facade__icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 50px;
  margin: -25px 0 0 -36px;
  border-radius: 14px;
  background: rgba(220, 0, 0, 0.92);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.ha-youtube-facade__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -11px 0 0 -5px;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
}

.ha-youtube-facade__link {
  display: inline-block;
  margin: 8px 10px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #f5c400;
  text-decoration: underline;
}

.ha-youtube-facade__link:hover {
  filter: brightness(1.08);
}

.ha-youtube-facade__player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.ha-youtube-facade__player iframe,
.ha-youtube-embed {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 200px;
  border: 0;
  border-radius: 10px;
  background: #000;
}

#tuto3dYtHost .ha-youtube-facade,
#tuto3dYtHost .ha-youtube-facade__player {
  height: 100%;
  min-height: 240px;
  margin: 0;
  border-radius: 12px;
}

#tuto3dYtHost .ha-youtube-facade__play,
#tuto3dYtHost .ha-youtube-facade__player {
  height: 100%;
}

#tuto3dYtHost .ha-youtube-facade__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
