* { box-sizing: border-box; }

    html, body {
      margin: 0;
      min-height: 100%;
    }

    body {
  font-family: Georgia, "Times New Roman", serif;
  background-color: #fff;
  color: #222;
}

    .home-link {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 99999;

  width: 42px;
  height: 42px;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(74, 6, 6, 0.82);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);

  -webkit-tap-highlight-color: transparent;
}

    .home-icon {
      width: 30px;
      height: 30px;
      fill: #fcfcfb;
      display: block;
      transition: fill .3s ease, transform .2s ease;
    }

    .home-link:hover .home-icon,
.home-link:active .home-icon,
.home-link:focus .home-icon {
  fill: #fbf9f8;
  transform: scale(1.08);
}
    .page {
      width: min(92vw, 860px);
      margin: 0 auto;
      padding: 60px 0 50px;
      text-align: center;
    }

    h1 {
  margin: 0 0 30px;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 400;

  display: inline-block;
  padding: 4px 18px 7px;

  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(255, 255, 255, 0.78) 55%,
    rgba(255, 255, 255, 0) 100%
  );

  text-shadow:
    0 1px 2px rgba(255, 255, 255, 1),
    0 0 6px rgba(255, 255, 255, 0.95);
}

    .selectors {
      width: min(100%, 700px);
      margin: 0 auto 10px;
      min-height: 44px;
    }

    .selector-row {
      display: grid;
      grid-template-columns: 32fr 68fr;
      gap: 8px;
      width: 100%;
    }

    #category-select,
    .selector-group select,
    .exercise-placeholder,
    .pretty-select-button {
      width: 100%;
      min-width: 0;
      padding: 10px 14px;
      border: 1px solid #c8c8c8;
      border-radius: 10px;
      background: #fff;
      color: #222;
      font: inherit;
      font-size: 16px;
      text-align: center;
      cursor: pointer;
    }

    #category-select {
      padding-left: 4px;
      padding-right: 4px;
      font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
      font-size: clamp(11px, 2.2vw, 15px);
    }

    .exercise-slot {
      width: 100%;
      min-width: 0;
    }

    .selector-group {
      display: none;
      margin: 0;
    }

    .selector-group.active {
      display: block;
      width: 100%;
    }

    .selector-group > label {
      display: none;
    }

    .real-select {
      display: none;
    }

    .pretty-select {
      position: relative;
      width: 100%;
    }

    .pretty-select-menu {
      position: absolute;
      left: 0;
      right: 0;
      top: calc(100% + 5px);
      z-index: 30;
      display: none;
      max-height: 360px;
      overflow-y: auto;
      background: #fff;
      border: 1px solid #c8c8c8;
      border-radius: 10px;
      box-shadow: 0 8px 25px rgba(0,0,0,.13);
      padding: 5px;
    }

    .pretty-select.open .pretty-select-menu {
      display: block;
    }

    .pretty-select-menu button {
      display: block;
      width: 100%;
      padding: 10px 14px;
      border: 0;
      border-radius: 7px;
      background: #fff;
      color: #222;
      font: inherit;
      font-size: 16px;
      text-align: center;
      cursor: pointer;
    }

    .pretty-select-menu button:hover {
      background: #f3f3f3;
    }

    .figured {
      display: inline-flex;
      align-items: baseline;
      gap: 1px;
      margin-right: 4px;
    }

    .lower-number {
      display: inline-block;
      transform: translateY(5px);
    }

    .chord-figure {
      display: inline-flex;
      align-items: flex-start;
      gap: 2px;
    }

    .chord-number {
      position: relative;
      top: 4px;
    }

    .chord-figure .figured {
      position: relative;
      top: 3px;
    }

    .status {
      min-height: 1.4em;
      margin: -7px 0 15px;
      font-size: 14px;
      color: #777;
    }

    .player {
  position: relative;
  width: 100%;
  aspect-ratio: 720 / 940;
  margin: 0 auto;
  overflow: hidden;
  background: transparent;
  border-radius: 0;
}

    .keyboard-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  z-index: 4;
}

/* mt2 visibile solo nella sezione "sinistra" */
.intro-left {
  position: absolute;
  left: 0;
  top: 0;
  width: 50.2778%;
  height: 23.2979%;
  overflow: hidden;
  z-index: 3;
  pointer-events: none;
}

.intro-left img {
  position: absolute;
  left: 0;
  top: 0;
  width: 198.895%;
  height: 429.224%;
  max-width: none;
}

    .keyboard-svg {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  z-index: 2;

  border: 0;
  pointer-events: none;
  opacity: 0;
}

    .interval-overlay {
  position: absolute;

  left: 0;
  top: 23.29787234%;

  width: 100%;
  height: 76.70212766%;

  object-fit: contain;

  z-index: 3;

  transform-origin: 50% 50%;
  transform: rotate(0deg);

  pointer-events: none;
}

.triad-cloud-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: 4;
}

    .play-button {
      position: absolute;
      z-index: 5;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      width: 92px;
      height: 92px;
      padding: 0;
      border: 0;
      border-radius: 50%;
      background: rgba(255,255,255,.92);
      box-shadow: 0 5px 22px rgba(0,0,0,.22);
      cursor: pointer;
      display: grid;
      place-items: center;
    }

    .play-button::before {
      content: "";
      display: block;
      margin-left: 7px;
      width: 0;
      height: 0;
      border-top: 18px solid transparent;
      border-bottom: 18px solid transparent;
      border-left: 29px solid #222;
    }

    .play-button[hidden] { display: none; }

    @media (max-width: 600px) {
      .home-link { top: 18px; left: 16px; }
      .page { width: 94vw; padding-top: 52px; }
      h1 { margin-bottom: 24px; }
      .play-button { width: 72px; height: 72px; }
      .play-button::before {
        border-top-width: 14px;
        border-bottom-width: 14px;
        border-left-width: 23px;
      }
    }

    /* ========================================
   PANNELLO RIGHELLI
   ======================================== */

.righello-panel {
  position: absolute;

  /* area "sinistra" del nostro SVG */
  left: 0;
  top: 0;
  width: 50.2778%;
  height: 23.2979%;

  z-index: 10;

  background: radial-gradient(
  ellipse at center,
  rgba(255, 255, 255, 0.94) 0%,
  rgba(255, 255, 255, 0.78) 55%,
  rgba(255, 255, 255, 0) 100%
);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 10px 14px;

  font-family: Georgia, "Times New Roman", serif;
  color: #222;
}

.righello-row-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.righello-title {
  font-size: 15px;
}

.righello-choice {
  border: 0;
  border-radius: 7px;
  padding: 5px 10px;

  background: #d8d8d8;
  color: #333;

  font: inherit;
  font-size: 13px;

  cursor: pointer;
}

.righello-instruction {
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
}

.righello-close {
  margin-top: 5px;
  padding: 3px 9px;

  border: 1px solid #c94b4b;
  border-radius: 7px;
  background: #fff;

  color: #090000;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;

  cursor: pointer;
}

.righello-close[hidden] {
  display: none;
}

.righello-toni.attivo {
  background: #f4a62a;
  color: #fff;
}

.righello-semitoni.attivo {
  background: #8fd3e8;
  color: #fff;
}

.righello-rotante {
  position: absolute;

  left: 0;
  top: 23.29787234%;

  width: 100%;
  height: 76.70212766%;

  object-fit: fill;

  transform-origin: 50% 50%;

  z-index: 4;
  pointer-events: none;
}

.domanda-panel {
  position: absolute;

  right: 0;
  top: 0;

  width: 49.7222%;
  height: 23.2979%;

  z-index: 10;

  background: radial-gradient(
  ellipse at center,
  rgba(255, 255, 255, 0.94) 0%,
  rgba(255, 255, 255, 0.78) 55%,
  rgba(255, 255, 255, 0) 100%
);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 10px 14px;

  font-family: Georgia, "Times New Roman", serif;
  color: #222;
  text-align: center;
}

.domanda-risposta {
  width: 55px;
  margin-top: 0;
  padding: 4px 5px;

  border: 1px solid #aaa;
  border-radius: 6px;

  background: #fff;
  color: #222;

  font: inherit;
  font-size: 14px;
  text-align: center;
}

.domanda-risposta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 7px;
}

.domanda-esito {
  font-size: 14px;
  font-weight: bold;
}

.domanda-esito.corretto {
  color: green;
}

.domanda-esito.sbagliato {
  color: red;
}

.righello-apri {
  border: 0;
  border-radius: 7px;
  padding: 5px 10px;

  background: #d8d8d8;
  color: #333;

  font: inherit;
  font-size: 13px;

  cursor: pointer;
}

.righello-apri[hidden],
.righello-row-top[hidden] {
  display: none;
}

.player-background {
  position: relative;
  z-index: 10000;
}

.player-background .player {
  position: relative;
  z-index: 1;
}

/* =========================
   GHIRLANDA ROSSA
   ========================= */

.ghirlanda-rossa {
  position: fixed;
  inset: 0;

  width: 100vw;
  height: 100vh;

  object-fit: fill;

  z-index: 9999;

  pointer-events: none;
  user-select: none;
}

/* Titolo e tendine sempre sopra la ghirlanda */
h1,
.selectors {
  position: relative;
  z-index: 10002;
}

/* Durante i video la ghirlanda passa davanti */
.ghirlanda-rossa.sopra-video {
  z-index: 10001;
}

/* =========================
   DISSOLVENZA FINALE
   ========================= */

.white-fade {
  position: absolute;
  inset: 0;
  z-index: 10;

  background: #fff;

  opacity: 0;

  transition:
    opacity 3s ease;
}

.white-fade.visible {
  opacity: 1;
}


/* =========================
   RIPARTI DA CAPO
   ========================= */

.restart-button {
  position: absolute;
  z-index: 11;

  left: 50%;
  top: 50%;

  transform:
    translate(-50%, -50%)
    scale(0.8);

  width: 92px;
  height: 92px;

  padding: 0;
  border: 0;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.96);
  color: #222;

  font-family: Arial, sans-serif;
  font-size: 58px;
  line-height: 1;

  cursor: pointer;
  opacity: 0;

  box-shadow:
    0 5px 22px rgba(0, 0, 0, 0.18);

  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.restart-button.visible {
  opacity: 1;

  transform:
    translate(-50%, -50%)
    scale(1);
}

.restart-button:hover {
  transform:
    translate(-50%, -50%)
    scale(1.06);
}