/* ---------- Card principali (riuso tuoi stili + hover/attivo) ---------- */
.videobox {
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background-color .3s ease, color .3s ease;
}
.videobox:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
/* Card principale attiva = blu + testo bianco */
.videobox.active {
  background-color: #0055a8 !important;
  background-image: none !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.videobox.active .vboxHeader,
.videobox.active .vidsub,
.videobox.active span,
.videobox.active .vboxArrow {
  color: #fff !important;
  filter: brightness(0) invert(1);
}

/* ---------- Subgrid (step 2) ---------- */
.subgrid-wrap {
  margin: 24px auto 20px;
  max-width: 1100px;
  padding: 12px 0 6px;
  transition: opacity .25s ease, transform .25s ease;
  opacity: 0; transform: translateY(6px);
}
.subgrid-wrap.is-open { opacity: 1; transform: none; }

.subgrid-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding: 0 4px;
}
.subgrid-title { font-weight: 700; font-size: 1.05rem; margin: 0; }
.subgrid-close {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 10px; border-radius: 10px;
}
.subgrid-close:hover { background:#f2f4f7; }

/* Griglia responsive 2x2 (4 sub-card) */
.subgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .subgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .subgrid { grid-template-columns: 1fr; } }

/* Sub-card */
/* Sub-card */
.subcard {
  position: relative;
  min-height: 160px;
  border-radius: 12px;
  /* colore richiesto */
  background-color: #D44E93;
  /* Niente background-image: vogliamo il colore pieno */
  background-image: none !important;
  background-size: cover;
  background-position: center;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background-color .3s ease, color .3s ease;
  color: #fff; /* testi bianchi per contrasto */
}

.subcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

.subcard .sc-title { font-weight: 700; font-size: 0.98rem; color: #fff; }
.subcard .sc-sub   { font-size: 0.9rem;  opacity: .95;    color: #fff; }

/* Sub-card attiva = colore richiesto + testi bianchi */
.subcard.active {
  background-color: #00394A !important;
  background-image: none !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.subcard.active .sc-title,
.subcard.active .sc-sub,
.subcard.active span { color: #fff !important; }


/* ---------- Player video (animato) ---------- */
.video-player-wrap {
  margin: 12px auto 48px;
  max-width: 1100px;
  padding: 20px;
  border: 1px solid #e3e6ea;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(0,0,0,.06);
  opacity: 0; transform: translateY(10px);
  transition: opacity .28s ease, transform .28s ease;
}
.video-player-wrap.is-open { opacity:1; transform:none; }
.video-player-wrap.is-closing { opacity:0; transform: translateY(10px); }

.video-player-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:14px; }
.video-player-title { font-size:1.25rem; font-weight:700; margin:0; }
.video-player-sub { font-size:.95rem; color:#5b6675; margin-top:4px; }
.video-player-meta { font-size:.9rem; color:#7a8696; margin-top:2px; }
.video-player-close { border:none; background:transparent; font-size:.95rem; cursor:pointer; padding:6px 10px; border-radius:10px; line-height:1; }
.video-player-close:hover { background:#f2f4f7; }
.video-player { width:100%; height:auto; border-radius:10px; display:block; background:#000; }

/* griglia sottocard quadrate (4 per riga) */
.subgrid {
  display: flex;
  gap: 16px;
  margin: 16px 0 8px 0;
  flex-wrap: wrap;
}

.subcard {
  flex: 1 1 calc(25% - 16px);
  aspect-ratio: 1 / 1;
  background: #d44e93;
  color: #fff;
  border-radius: 8px;
  display: flex;
  flex-direction: column; /* titolo sopra, sottotitolo sotto */
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
  padding: 12px;
}

.subcard:hover { background: #b93f7c; transform: scale(1.03); }
.subcard.active { outline: 4px solid #00394A; }

.subcard .grade-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.subcard .grade-sub   { font-size: 13px; opacity: .9; line-height: 1.3; }

/* wrapper player */
/* Contenitore player */
.audio-player {
  margin: 30px auto;
  max-width: 900px;
  text-align: center;
}

/* Riga player: canvas sopra, controlli sotto */
.player-row {
  display: flex;
  flex-direction: column;   
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

/* Canvas oscilloscopio */
#osc {
  width: 100%;
  max-width: 880px;
  height: 160px;
  background: #f4f5f7;
  border: 2px solid #00394A;
  border-radius: 8px;
}

/* Pulsanti audio */
.audio-controls {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 16px;
}
.playbtn, .stopbtn {
  background: #0066cc;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.playbtn:hover, .stopbtn:hover {
  background: #b93f7c;
  transform: scale(1.05);
}

/* Layout della griglia delle sottocard */
.subgrid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 20px 0;
  justify-content: center;
}

/* Ogni sottocard quadrata rosa */
.subcard {
  flex: 0 1 200px;            /* larghezza base ~160px */
  aspect-ratio: 1 / 1;        /* quadrata */
  background: #d44e93;
  color: #fff;
  border-radius: 10px;
  display: flex;
  flex-direction: column;     /* titolo sopra, sottotitolo sotto */
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  padding: 10px;
  transition: transform 0.15s ease, background 0.2s ease;
}

.subcard:hover {
  background: #b93f7c;
  transform: scale(1.05);
}

.subcard.active {
  border: 3px solid #00394A;  /* evidenziazione card selezionata */
}

/* Titolo e sottotitolo */
.subcard .grade-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 4px;
}

.subcard .grade-sub {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.3;
}

.player-hint {
  margin-top: 10px;
  font-size: 16px;
  font-family: Arial, Helvetica, sans-serif;
  color: #000;
  opacity: 0.8;
  text-align: center;
  font-weight: 700 ;
}

