@import url("core/ui/foundations.css?v=20260906-unified-type-v1");

.notalix-skip-link {
  position: fixed;
  top: 8px;
  left: var(--nl-safe-left);
  z-index: 10000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--nl-navy);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform .15s ease;
}

.notalix-skip-link:focus {
  transform: translateY(0);
}

.notalix-gamepad-status {
  position: fixed;
  right: var(--nl-safe-right);
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(420px, calc(100vw - 20px));
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  background: rgba(16,45,95,.94);
  color: #fff;
  box-shadow: 0 8px 24px rgba(16,45,95,.22);
  font-size: .76rem;
  font-weight: 750;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .16s ease, transform .16s ease;
}

.notalix-gamepad-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.notalix-gamepad-status::before {
  content: "🎮";
  font-size: 1rem;
}

/* Notification émise par le gestionnaire de manette commun. Elle doit rester
   superposée à l’interface et ne jamais créer une ligne dans la page. */
.rh-gamepad-toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 10020;
  max-width: calc(100vw - 24px);
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(23,63,112,.95);
  color: #fff;
  box-shadow: 0 12px 24px rgba(0,0,0,.18);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%,18px);
  transition: opacity .18s ease,transform .18s ease;
}

.rh-gamepad-toast.show {
  opacity: 1;
  transform: translate(-50%,0);
}

/* Les entêtes gardent leur identité locale mais partagent le même gabarit. */
body.notalix-module-intervalles .nl-topbar,
body.notalix-module-lecture-rythmique .nl-topbar,
body.notalix-module-histoire-musique .topbar,
body.notalix-module-accords .module-titlebar,
body.notalix-module-cadences .module-titlebar,
body.notalix-module-chiffrage-accords .module-titlebar {
  width: min(1240px, calc(100% - var(--nl-safe-left) - var(--nl-safe-right)));
  min-height: 62px;
  margin-inline: auto;
  border-radius: 16px;
}

body.notalix-module-accords .module-titlebar,
body.notalix-module-cadences .module-titlebar,
body.notalix-module-chiffrage-accords .module-titlebar {
  border: 1px solid var(--nl-line);
  background: rgba(255,255,255,.94);
  box-shadow: 0 7px 22px rgba(16,45,95,.07);
}

body.notalix-module-intervalles .it-page,
body.notalix-module-lecture-rythmique .rh-page,
body.notalix-module-histoire-musique #app,
body.notalix-module-accords > main,
body.notalix-module-cadences > main,
body.notalix-module-chiffrage-accords > main {
  width: min(1240px, calc(100% - var(--nl-safe-left) - var(--nl-safe-right)));
  margin-inline: auto;
}

body.notalix-module-accords .mode-card,
body.notalix-module-cadences .mode-card,
body.notalix-module-chiffrage-accords .mode-card,
body.notalix-module-accords .notalix-return,
body.notalix-module-cadences .notalix-return,
body.notalix-module-chiffrage-accords .notalix-return,
.notalix-bar a,
.nl-topbar a,
body.notalix-module-histoire-musique .topbar a {
  min-height: 44px;
}

/* La notation reste la première surface et ne peut plus déborder de l'écran. */
.staff,
.response-staff,
[id*="staff"],
[class*="notation"],
.score-wrap,
.score-stage,
.music-sheet {
  max-width: 100%;
}

.staff svg,
.response-staff svg,
[id*="staff"] svg,
.score-wrap svg,
.score-stage svg,
.music-sheet svg {
  display: block;
  max-width: 100%;
  margin-inline: auto;
}

.screen[hidden],
[hidden] {
  display: none !important;
}

@media (pointer: coarse) {
  button,
  select,
  input[type="button"],
  input[type="submit"],
  a.module-tile,
  a.mode-card,
  [role="button"] {
    min-height: 48px;
  }

  button:hover,
  a:hover,
  [role="button"]:hover {
    transform: none !important;
  }
}

@media (max-width: 720px) {
  :root {
    --nl-radius: 14px;
  }

  html {
    scroll-padding-top: 64px;
  }

  body.notalix-module-intervalles .nl-topbar,
  body.notalix-module-lecture-rythmique .nl-topbar,
  body.notalix-module-histoire-musique .topbar,
  body.notalix-module-accords .module-titlebar,
  body.notalix-module-cadences .module-titlebar,
  body.notalix-module-chiffrage-accords .module-titlebar {
    width: calc(100% - 12px);
    min-height: 54px;
    border-radius: 13px;
  }

  body.notalix-module-intervalles .it-page,
  body.notalix-module-lecture-rythmique .rh-page,
  body.notalix-module-histoire-musique #app,
  body.notalix-module-accords > main,
  body.notalix-module-cadences > main,
  body.notalix-module-chiffrage-accords > main {
    width: calc(100% - 12px);
  }

  body.notalix-module-accords #home .mode-grid {
    grid-template-columns: 1fr !important;
  }

  body.notalix-module-accords #home .mode-card {
    min-height: 116px;
    padding: 16px;
  }

  .notalix-gamepad-status {
    right: 7px;
    bottom: max(7px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 14px);
    border-radius: 12px;
    font-size: .7rem;
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  body.notalix-module-intervalles .nl-topbar,
  body.notalix-module-lecture-rythmique .nl-topbar,
  body.notalix-module-histoire-musique .topbar,
  body.notalix-module-accords .module-titlebar,
  body.notalix-module-cadences .module-titlebar,
  body.notalix-module-chiffrage-accords .module-titlebar {
    min-height: 48px;
    margin-bottom: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
