* {
  box-sizing: border-box;
}

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

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

.page {
  width: min(92vw, 860px);
  margin: 0 auto;
  padding: 34px 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);
}


/* =========================
   MENU SEQUENZE
   ========================= */


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


/* Le tendine sono nascoste finché
   non viene scelta una categoria */

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

.selector-group.active {
  display: block;
}


/* Non servono più i titoli
   INTERVALLI / TRIADI ecc.
   sopra alle tendine */

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


/* Tendine normali:
   Intervalli e Scale */

.selector-group select {
  width: 100%;

  padding: 10px 14px;

  border: 1px solid #c8c8c8;
  border-radius: 10px;

  background: #fff;
  color: #222;

  font: inherit;
  font-size: 16px;

  text-align: center;
  cursor: pointer;
}

.selector-group select:focus {
  outline: 2px solid #bbb;
  outline-offset: 2px;
}

/* =========================
   DUE TENDINE AFFIANCATE
   ========================= */

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


/* Tendina piccola a sinistra */

#category-select {
  width: 100%;
  min-width: 0;

  padding: 10px 4px;

  border: 1px solid #c8c8c8;
  border-radius: 10px;

  background: #fff;
  color: #222;

  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;

  /* il carattere si adatta alla larghezza dello schermo */
  font-size: clamp(11px, 2.2vw, 15px);

  text-align: center;
  cursor: pointer;
}


/* Zona della tendina grande */

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


/* --- iniziale */

.exercise-placeholder {
  width: 100%;

  padding: 10px 14px;

  border: 1px solid #c8c8c8;
  border-radius: 10px;

  background: #fff;
  color: #222;

  font: inherit;
  font-size: 16px;

  text-align: center;
}


/* Il pannello scelto deve occupare
   tutta la tendina di destra */

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


/* Evita che le tendine escano
   dalla loro colonna */

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

/* =========================
   STATO
   ========================= */

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


/* =========================
   PLAYER
   ========================= */

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


/* Video, mostrino e SVG
   occupano esattamente
   lo stesso spazio */

.player video,
.player .clock-base,
.player .clock-sections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.player video,
.clock-base {
  object-fit: contain;
}

.player video {
  background: #fff;
}

.clock-base {
  background: transparent;
}


/* SVG sovrapposto a mostrino.png */

.clock-sections {
  z-index: 2;
  border: 0;
  pointer-events: none;
}

/* =========================
   NUVOLA DELLA SEQUENZA
   ========================= */

.cloud-overlay {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: contain;

  z-index: 3;
  pointer-events: none;

  opacity: 0;

  transition:
    opacity 2.5s ease;
}

.cloud-overlay.visible {
  opacity: 1;
}

.cloud-overlay.no-transition {
  transition: none;
}

.home-clock {
  z-index: 1;
}

/* =========================
   NUMERO DELL'INTERVALLO
   ========================= */

.number-overlay {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: contain;

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

  opacity: 0;

  transition:
    opacity 2.5s ease;
}

.number-overlay.visible {
  opacity: 1;
}

.number-overlay.no-transition {
  transition: none;
}

/* =========================
   BOTTONE PLAY
   ========================= */

.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, 0.92);

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

  cursor: pointer;

  display: grid;
  place-items: center;

  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

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

  background: #fff;
}

.play-button:active {
  transform:
    translate(-50%, -50%)
    scale(0.97);
}


/* Triangolo PLAY */

.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;
}


/* =========================
   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);
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 600px) {

  .category-tabs {
  display: flex;
  width: 100%;
  gap: 3px;
}

.category-tab {
  flex: 1 1 25%;
  width: 25%;
  min-width: 0;

  padding: 9px 1px;

  font-size: 12px;
  letter-spacing: 0;
  white-space: nowrap;
}

  .page {
    width: 94vw;
    padding-top: 24px;
  }

  h1 {
    margin-bottom: 24px;
  }

  .selector-group label {
    font-size: 18px;
  }

  .play-button {
    width: 72px;
    height: 72px;
  }

  .play-button::before {
    border-top-width: 14px;
    border-bottom-width: 14px;
    border-left-width: 23px;
  }

  .restart-button {
  width: 72px;
  height: 72px;
  min-width: 0;
  padding: 0;
  font-size: 46px;
}

}

/* ==================================
   TENDINA PERSONALIZZATA
   ================================== */

.real-select {
  display: none;
}

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

.pretty-select-button {
  width: 100%;
  padding: 11px 14px;

  border: 1px solid #c8c8c8;
  border-radius: 10px;

  background: #fff;
  color: #222;

  font: inherit;
  font-size: 16px;

  cursor: pointer;
}

.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, 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;
}


/* Notazione 6-4 */

.figured {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;

  margin-right: 4px;
}

.lower-number {
  display: inline-block;

  font-size: 1em;

  transform: translateY(5px);
}

/* =========================
   SIGLE ACCORDI TRIADI
   ========================= */

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

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

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

/* =========================
   HOME
   ========================= */

.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(26, 63, 47, 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: #fbf3f5;
  display: block;

  transition:
    fill 0.3s ease,
    transform 0.2s ease;
}

.home-link:hover .home-icon {
  fill: #fbfafa;
  transform: scale(1.08);
}


/* Abbassa leggermente tutta la pagina */

.page {
  padding-top: 60px;
}


@media (max-width: 600px) {

  .home-link {
    top: 18px;
    left: 16px;
  }

  .page {
    padding-top: 52px;
  }

}

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

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

/* =========================
   GHIRLANDA VERDE
   ========================= */

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

  width: 100vw;
  height: 100vh;

  object-fit: fill;

  z-index: 9999;

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

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

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



