/**
 * SAN CMS - Lettori d'epoca: registratore a cassette (audio) e televisore con videoregistratore (video)
 * Sono i blocchi "tape" e "vcr" (admin/blocks.php, admin/render.php); la meccanica sta in js/lettori.js.
 * Questo foglio si carica solo nelle pagine che hanno un lettore, dopo motore.css e prima di
 * sito/stile.css: il sito puo' correggere quello che vuole.
 *
 * I colori sono variabili --lt-*. Quelle qui sotto valgono per tutta la pagina (le usano anche i
 * tasti che caricano un nastro da fuori del lettore); le altre hanno il loro valore di partenza
 * scritto nella regola. Quello che si sceglie nel pannello arriva come variabile sul blocco.
 * Nati sul sito del Teatro CTH: l'aspetto di partenza e' quello.
 */
:root {
  --lt-edge: #151515;      /* bordi */
  --lt-key-bg: #f1ede4;    /* tasti: fondo */
  --lt-key-fg: #151515;    /* tasti: scritta */
  --lt-accent: #d33682;    /* colore d'accento: tasto premuto, marca, riga di stato */
  --lt-paper: #faf9f6;
  --lt-muted: #555555;
  --lt-red: #d01010;       /* tasto MUTE che lampeggia */
  --lt-mono: "Courier New", Courier, monospace;
  --lt-bold: "Helvetica Neue", Arial, sans-serif;
}

/* Cassette Realista in CSS Puro (Fanzine Vector Style) */
.cassette-player-container {
  display: flex;
  justify-content: center;
  margin: 40px 0;
}

/* ── SCOCCA FISICO DECK REGISTRATORE A CASSETTE ── */
.audio-deck-housing {
  background: var(--lt-body, linear-gradient(180deg, #2a2a2a 0%, #1c1c1c 60%, #111 100%));
  border: 3px solid #111;
  border-radius: 8px;
  box-shadow:
    0 2px 0 #444 inset,        /* bordo superiore highlight */
    0 -2px 0 #000 inset,       /* bordo inferiore ombra */
    4px 0 0 #333 inset,        /* bordo sinistro */
    -4px 0 0 #333 inset,       /* bordo destro */
    0 12px 40px -5px rgba(0,0,0,0.7),
    0 4px 10px rgba(0,0,0,0.4);
  padding: 0;
  width: 580px;
  max-width: 100%;
  overflow: hidden;
  transition: background 0.3s, border-color 0.3s;
}

/* Barra superiore: branding + VU meter */
.audio-deck-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px 6px;
  background: var(--lt-panel, linear-gradient(90deg, #1a1a1a, #222, #1a1a1a));
  border-bottom: 2px solid #000;
}
.audio-deck-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.audio-deck-brand-name {
  font-family: var(--lt-mono);
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--lt-brand, var(--lt-accent));
  letter-spacing: 0.12em;
}
.audio-deck-brand-model {
  font-family: var(--lt-mono);
  font-size: 0.6rem;
  color: var(--lt-brand2, #888);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* VU Meter barre */
.audio-deck-top-controls {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
.vu-meter {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
}
.vu-meter span {
  display: block;
  width: 4px;
  background: #2a5c2a;
  border-radius: 1px;
  transition: transform 0.08s ease, opacity 0.08s ease;
  transform-origin: bottom;
  opacity: 0; /* Spento di default */
}
.vu-meter span:nth-child(1) { height: 4px; }
.vu-meter span:nth-child(2) { height: 8px; }
.vu-meter span:nth-child(3) { height: 14px; background: #3a7a3a; }
.vu-meter span:nth-child(4) { height: 10px; background: #3a7a3a; }
.vu-meter span:nth-child(5) { height: 18px; background: #6aaa2a; }
.vu-meter span:nth-child(6) { height: 12px; background: #6aaa2a; }
.vu-meter span:nth-child(7) { height: 7px; background: #c8a000; }
.vu-meter span:nth-child(8) { height: 3px; background: #c84000; }

/* VU animato quando in play: animazione sweep sinistra/destra avanti/indietro */
.vu-meter.playing span {
  opacity: 1;
}
.vu-meter.playing span:nth-child(1) { animation: vu-sweep-1 1.2s ease-in-out infinite; }
.vu-meter.playing span:nth-child(2) { animation: vu-sweep-2 1.2s ease-in-out infinite; }
.vu-meter.playing span:nth-child(3) { animation: vu-sweep-3 1.2s ease-in-out infinite; }
.vu-meter.playing span:nth-child(4) { animation: vu-sweep-4 1.2s ease-in-out infinite; }
.vu-meter.playing span:nth-child(5) { animation: vu-sweep-5 1.2s ease-in-out infinite; }
.vu-meter.playing span:nth-child(6) { animation: vu-sweep-6 1.2s ease-in-out infinite; }
.vu-meter.playing span:nth-child(7) { animation: vu-sweep-7 1.2s ease-in-out infinite; }
.vu-meter.playing span:nth-child(8) { animation: vu-sweep-8 1.2s ease-in-out infinite; }

/* Sfalsamento canali per effetto stereo */
#vu-meter-right.playing span {
  animation-delay: -0.2s;
}

@keyframes vu-sweep-1 {
  0%, 100% { opacity: 0.15; transform: scaleY(0.2); }
  6%, 94% { opacity: 1; transform: scaleY(1); }
}
@keyframes vu-sweep-2 {
  0%, 5%, 95%, 100% { opacity: 0.15; transform: scaleY(0.2); }
  12%, 88% { opacity: 1; transform: scaleY(1); }
}
@keyframes vu-sweep-3 {
  0%, 11%, 89%, 100% { opacity: 0.15; transform: scaleY(0.2); }
  18%, 82% { opacity: 1; transform: scaleY(1); }
}
@keyframes vu-sweep-4 {
  0%, 17%, 83%, 100% { opacity: 0.15; transform: scaleY(0.2); }
  25%, 75% { opacity: 1; transform: scaleY(1); }
}
@keyframes vu-sweep-5 {
  0%, 24%, 76%, 100% { opacity: 0.15; transform: scaleY(0.2); }
  31%, 69% { opacity: 1; transform: scaleY(1); }
}
@keyframes vu-sweep-6 {
  0%, 30%, 70%, 100% { opacity: 0.15; transform: scaleY(0.2); }
  37%, 63% { opacity: 1; transform: scaleY(1); }
}
@keyframes vu-sweep-7 {
  0%, 36%, 64%, 100% { opacity: 0.15; transform: scaleY(0.2); }
  43%, 57% { opacity: 1; transform: scaleY(1); }
}
@keyframes vu-sweep-8 {
  0%, 42%, 58%, 100% { opacity: 0.15; transform: scaleY(0.2); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* Pannello principale (cassette bay + right panel) */
.audio-deck-main-panel {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 14px 16px 10px;
  background: var(--lt-panel, linear-gradient(180deg, #222 0%, #1a1a1a 100%));
}

/* Vano cassetta (slot fisico) */
.audio-deck-cassette-bay {
  position: relative;
  background: var(--lt-bay, #111);
  border: 2px solid #000;
  border-radius: 4px;
  box-shadow:
    inset 0 3px 8px rgba(0,0,0,0.8),
    inset 0 0 0 1px #333;
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 200px;
}
/* Sportellino del vano (etichetta) */
.audio-deck-bay-door {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  border-bottom: 1px solid #333;
  margin-bottom: 4px;
}
.audio-deck-bay-label {
  font-family: var(--lt-mono);
  font-size: 0.6rem;
  color: var(--lt-bay-ink, #555);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
/* Il cassette-deck dentro il vano perde il bordo generico */
.audio-deck-cassette-bay .cassette-deck {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  gap: 0;
}

/* Pannello destra: counter + luci */
.audio-deck-right-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0 6px 14px;
  min-width: 100px;
  gap: 12px;
}
/* Counter nastro (stile retrò meccanico) */
.audio-deck-counter {
  background: var(--lt-disp-bg, #0a0a0a);
  border: 1px solid #000;
  border-radius: 3px;
  padding: 6px 10px;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.9), 0 1px 0 #333;
  width: 100%;
}
.audio-deck-counter-label {
  font-family: var(--lt-mono);
  font-size: 0.52rem;
  color: #555;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.audio-deck-counter-digits {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--lt-disp-fg, #e8e000);
  letter-spacing: 0.08em;
  line-height: 1;
  text-shadow: 0 0 8px rgba(232,224,0,0.6);
}
.audio-deck-counter-reset {
  margin-top: 5px;
  font-family: var(--lt-mono);
  font-size: 0.5rem;
  background: #222;
  color: #666;
  border: 1px solid #333;
  border-radius: 2px;
  padding: 2px 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.2s, color 0.2s;
}
.audio-deck-counter-reset:hover { background: #333; color: #aaa; }

/* Luci di stato (pallini LED) */
.audio-deck-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.audio-deck-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
  transition: background 0.2s, box-shadow 0.2s;
}
.audio-deck-dot.active-play {
  background: #00c853;
  box-shadow: 0 0 6px rgba(0,200,83,0.8);
}
.audio-deck-dot-label {
  font-family: var(--lt-mono);
  font-size: 0.5rem;
  color: #555;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Pannello pulsantiera in basso */
.audio-deck-controls-panel {
  padding: 10px 16px 12px;
  background: var(--lt-panel, linear-gradient(180deg, #1a1a1a 0%, #141414 100%));
  border-top: 2px solid #000;
}
.audio-deck-controls-panel .deck-controls {
  flex-wrap: wrap;
}

/* cassette-deck standalone (vecchio stile, usato fuori dal deck housing) */
.cassette-deck {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background-color: var(--lt-paper);
  border: 3px solid var(--lt-edge);
  padding: 30px;
  border-radius: 6px;
  box-shadow: 
    0 4px 6px rgba(0,0,0,0.05),
    0 15px 35px -15px rgba(0,0,0,0.1);
  transition: background-color 0.3s, border-color 0.3s;
}

.cassette-body {
  position: relative;
  width: 360px;
  height: 220px;
  background: var(--lt-tape, linear-gradient(135deg, #2c2c2c 0%, #151515 100%));
  border: 4px solid var(--lt-edge);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.1);
  /* PUNTO 5: cassetta caricata nel deck → 'schiacciata' (più piccola) */
  transform: translateY(4px) scale(0.88);
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease, filter 0.4s ease, box-shadow 0.4s ease, border-color 0.3s;
}

/* Cassetta espulsa/smontata: torna a grandezza piena, esce fuori dal deck */
.cassette-body.ejected {
  transform: translateY(0px) scale(1);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  pointer-events: none; /* Disattiva le interazioni finché non caricata */
}

/* Dettagli Angoli: Viti della cassetta */
.screw {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #666;
  border: 1.5px solid #111;
  border-radius: 50%;
}
.screw::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 1.5px;
  background-color: #222;
  transform: translateY(-50%) rotate(45deg);
}
.screw-tl { top: 8px; left: 8px; }
.screw-tr { top: 8px; right: 8px; }
.screw-bl { bottom: 8px; left: 8px; }
.screw-br { bottom: 8px; right: 8px; }

/* Etichetta Write-on Vintage */
.cassette-label-area {
  position: relative;
  width: 100%;
  height: 95px;
  background: var(--lt-label, #f7f4ec); /* Carta invecchiata */
  border: 2px solid var(--lt-edge);
  border-radius: 4px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cassette-label-lines {
  border-top: 2px solid var(--lt-line1, #3b5998); /* Linea blu vintage */
  border-bottom: 2px solid var(--lt-line2, #d01010); /* Linea rossa vintage */
  height: 45px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cassette-label-title {
  font-family: var(--lt-mono);
  font-weight: bold;
  font-size: 0.85rem;
  color: var(--lt-ink, #111);
  text-transform: uppercase;
  text-align: center;
}

.cassette-label-brand {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: bold;
  font-family: var(--lt-bold);
  color: var(--lt-ink2, #555);
  text-transform: uppercase;
}

/* Finestra Trasparente Centrale */
.cassette-window-glass {
  position: relative;
  width: 190px;
  height: 62px;
  background-color: #111;
  border: 3px solid var(--lt-edge);
  border-radius: 4px;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

/* Metro di misurazione del nastro stampato sul vetro */
.cassette-window-glass::before {
  content: "I  I  I  0  I  I  I";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  color: #555;
  font-weight: bold;
  letter-spacing: 2px;
}

/* Nastro Magnetico Avvolto (Marrone) */
.tape-wind {
  position: absolute;
  width: 65px;
  height: 65px;
  background-color: var(--lt-reel, #4a2f13); /* Colore nastro magnetico ossido di ferro */
  border-radius: 50%;
  z-index: 1;
}
.tape-wind-left {
  left: 15px;
  width: 60px; /* Più nastro a sinistra all'inizio */
  height: 60px;
}
.tape-wind-right {
  right: 15px;
  width: 42px; /* Meno nastro a destra */
  height: 42px;
}

/* Bobine rotanti (Ingranaggi Ciclostilati CSS) */
.cassette-hub {
  position: relative;
  width: 34px;
  height: 34px;
  background-color: #eee;
  border: 3px solid #333;
  border-radius: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hub-teeth {
  width: 100%;
  height: 100%;
  position: absolute;
  border-radius: 50%;
  border: 3.5px dashed #111;
  animation: spin-hub 4s linear infinite paused;
}

.cassette-body.playing .hub-teeth {
  animation-play-state: running;
}

/* Animazione ingranaggi */
@keyframes spin-hub {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Foro centrale passante */
.hub-center {
  width: 14px;
  height: 14px;
  background-color: #111;
  border-radius: 50%;
  border: 2px solid #555;
  z-index: 3;
}

/* Trapezio in basso tipico della cassetta */
.cassette-bottom-plate {
  width: 140px;
  height: 25px;
  background-color: #1f1f1f;
  border-top: 3px solid var(--lt-edge);
  margin: 0 auto;
  border-radius: 3px 3px 0 0;
  position: relative;
}

/* Controlli del Deck */
.deck-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.cassette-btn {
  font-family: var(--lt-bold);
  font-size: 0.85rem;
  font-weight: bold;
  background-color: var(--lt-key-bg);
  color: var(--lt-key-fg);
  border: 2px solid var(--lt-key-bd, var(--lt-edge));
  padding: 6px 16px;
  cursor: pointer;
  border-radius: 3px;
  text-transform: uppercase;
  transition: transform 0.1s, background-color 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-icon {
  font-size: 0.85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-play {
  transform: translateY(-0.5px); /* Allineamento millimetrico triangolo */
}

.btn-icon-stop {
  transform: translateY(-0.5px); /* Allineamento millimetrico quadrato */
}

.cassette-btn:hover {
  background-color: var(--lt-key-on, var(--lt-accent));
  color: var(--lt-key-on-fg, #fff);
}

.cassette-btn:active {
  transform: scale(0.95);
}

.cassette-btn.active {
  background-color: var(--lt-key-on, var(--lt-accent)) !important;
  color: var(--lt-key-on-fg, #fff) !important;
  transform: scale(0.95);
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.4);
}

@keyframes mute-blink {
  0%, 100% {
    background-color: var(--lt-red);
    color: #fff;
    border-color: var(--lt-red);
  }
  50% {
    background-color: var(--lt-key-bg);
    color: var(--lt-red);
    border-color: var(--lt-red);
  }
}

.cassette-btn.muted {
  animation: mute-blink 1.5s infinite;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.4) !important;
}

/* LED di stato del registratore */
.led-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
}

.led-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #444; /* Spento (Grigio scuro) */
  border: 1.5px solid var(--lt-edge);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

/* LED acceso: Rosso fluorescente con bagliore realistico */
.led-light.active {
  background-color: var(--lt-led, #ff3c3c);
  box-shadow: 
    0 0 8px #ff3c3c,
    0 0 3px rgba(255, 60, 60, 0.5);
}

.led-label {
  font-family: var(--lt-mono);
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--lt-muted);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   VINTAGE VHS PLAYER (CRT TV + VCR DECK)
   ========================================================================== */
.vhs-player-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  margin: 40px auto;
  max-width: 880px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 500px) {
  .vhs-player-container {
    gap: 15px;
  }
}

/* CRT TV Bezels and Cabinet */
.crt-tv {
  width: 100%;
  background: var(--lt-body, #2b2b2b); /* Cabinet in legno finto o plastica scura */
  border: 4px solid var(--lt-edge);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 
    0 10px 25px rgba(0,0,0,0.3),
    inset 0 4px 10px rgba(255,255,255,0.05);
  position: relative;
}

.crt-bezel {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 25px;
  background: var(--lt-panel, #1a1a1a);
  border: 3px solid var(--lt-edge);
  border-radius: 12px;
  padding: 20px;
  align-items: center;
}

@media (max-width: 500px) {
  .crt-bezel {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* CRT Screen Area */
.crt-screen-container {
  position: relative;
  aspect-ratio: 4 / 3; /* Rapporto storico 4:3 */
  background-color: #0c0c0c;
  border: 4px solid #333;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: inset 0 0 25px rgba(0,0,0,0.9);
}

.crt-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
}

/* Scanlines and screen curve effects */
.crt-scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.12) 50%
  ), linear-gradient(
    90deg, 
    rgba(255, 0, 0, 0.04), 
    rgba(0, 255, 0, 0.02), 
    rgba(0, 0, 255, 0.04)
  );
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
  z-index: 12;
}

/* CRT Static Noise Overlay (Animated) */
.crt-noise-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 10;
}

/* Simulated CRT TV Snow (When no tape loaded) */
.crt-noise-overlay.snowing {
  opacity: 0.85;
  animation: crt-snow 0.25s steps(4) infinite;
  background-color: #333;
}

@keyframes crt-snow {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-0.4px, 0.2px); }
  100% { transform: translate(0.4px, -0.2px); }
}

/* TV Controls Dial */
.crt-tv-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  justify-content: center;
}

.tv-dial {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #333;
  border: 3px solid var(--lt-edge);
  position: relative;
  cursor: pointer;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
}

.tv-dial::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-family: var(--font-primary), monospace;
  font-weight: 600;
  color: #ccc;
  letter-spacing: 1px;
  pointer-events: none;
  opacity: 0.8;
}

.tv-dial-channel::after {
  top: -16px;
}

.tv-dial-volume::after {
  bottom: -16px;
}

.dial-marker {
  position: absolute;
  width: 4px;
  height: 12px;
  background-color: var(--lt-edge);
  top: 4px;
  left: calc(50% - 2px);
  border-radius: 2px;
  transform-origin: bottom center;
}

/* Speaker Grille */
.tv-speaker-grille {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 60px;
  margin-top: 10px;
}

.tv-speaker-grille span {
  display: block;
  height: 3px;
  background-color: var(--lt-edge);
  width: 100%;
  opacity: 0.7;
}

/* VCR DECK cabinet */
.vcr-deck {
  width: 100%;
  background: var(--lt-body2, #1f1f1f);
  border: 4px solid var(--lt-edge);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 
    0 10px 20px rgba(0,0,0,0.25),
    inset 0 2px 5px rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vcr-front-panel {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 20px;
  align-items: center;
}

@media (max-width: 500px) {
  .vcr-front-panel {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* VHS Loading Slot */
.vhs-slot-container {
  background-color: #0c0c0c;
  border: 3px solid var(--lt-edge);
  height: 60px;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vhs-slot-door {
  width: 96%;
  height: 84%;
  background-color: var(--lt-bay, #2c2c2c);
  border: 1px solid #444;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lt-bay-ink, #888);
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform-origin: top center;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.vhs-slot-door.loaded {
  transform: rotateX(-90deg) translate3d(0, -5px, 0);
  background-color: #050505;
}

.vhs-slot-text {
  font-family: var(--lt-mono);
}

/* VCR Digital LED Display */
.vcr-led-display {
  background-color: var(--lt-disp-bg, #0a1f0a); /* Display verde fluorescente retrò */
  border: 3px solid var(--lt-edge);
  padding: 8px 12px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--lt-mono);
  color: var(--lt-disp-fg, #39ff14); /* Verde fosfori attivi */
  text-shadow: 0 0 4px rgba(57, 255, 20, 0.6);
  min-height: 50px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.vcr-display-status {
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0.08em;
}

.vcr-display-time {
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Power Indicator */
.vcr-power-led-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.65rem;
  font-weight: bold;
  color: var(--lt-key-fg);
}

.vcr-power-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--lt-led-off, #ff3c3c); /* Rosso di stand-by */
  box-shadow: 0 0 4px rgba(255, 60, 60, 0.5);
  transition: background-color 0.3s, box-shadow 0.3s;
}

.vcr-power-led.active {
  background-color: var(--lt-led, #39ff14); /* Verde di accensione */
  box-shadow: 0 0 6px rgba(57, 255, 20, 0.8);
}

/* VCR Buttons Controls */
.vcr-controls {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  border-top: 2px dashed var(--lt-edge);
  padding-top: 15px;
}

/* Fissa la larghezza del bottone STOP per evitare shift quando diventa PAUSE */
.btn-vhs-stop {
  min-width: 98px;
}

.vcr-btn {
  font-family: var(--lt-mono);
  font-size: 0.75rem;
  font-weight: bold;
  background-color: var(--lt-paper);
  color: var(--lt-key-fg);
  border: 2px solid var(--lt-edge);
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 3px;
  box-shadow: 2px 2px 0px var(--lt-edge);
  transition: transform 0.1s, box-shadow 0.1s, background-color 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vcr-btn:hover {
  background-color: var(--lt-accent);
  color: #fff;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px var(--lt-edge);
  transition-delay: 0.12s;
}

.vcr-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--lt-edge);
}

.vcr-btn.active {
  background-color: var(--lt-accent);
  color: #fff;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.5);
}


/* CRT Standby Screen with glitched logo */
.crt-standby-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0c0c0c;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  overflow: hidden;
}

.crt-standby-logo {
  width: 42%;
  height: auto;
  opacity: 0.8;
  filter: drop-shadow(0 0 10px var(--lt-accent));
  animation: crt-logo-glitch 5s infinite;
}

@keyframes crt-logo-glitch {
  0%, 40%, 45%, 90%, 95%, 100% {
    opacity: 0.85;
    transform: scale(1) skewX(0deg);
    filter: drop-shadow(0 0 10px var(--lt-accent)) grayscale(0);
  }
  41% {
    opacity: 0.1;
    transform: scale(1.05) skewX(10deg);
    filter: drop-shadow(0 0 15px var(--lt-red)) grayscale(0.5);
  }
  42% {
    opacity: 0.8;
    transform: scale(0.95) skewX(-5deg);
  }
  43% {
    opacity: 0.4;
    transform: scale(1) skewX(0deg);
  }
  44% {
    opacity: 0.9;
    transform: scale(1.02) skewX(3deg);
  }
  91% {
    opacity: 0;
    transform: scale(1.1) skewX(15deg);
    filter: drop-shadow(0 0 20px var(--lt-accent));
  }
  92% {
    opacity: 0.7;
    transform: scale(0.9) skewX(-10deg);
  }
  93% {
    opacity: 0.1;
    transform: scale(1) skewX(0deg);
  }
  94% {
    opacity: 0.85;
    transform: scale(1.03) skewX(-2deg);
  }
}
@media (max-width: 768px) {
  /* ── Cassette audio deck ─────────────────────────────────────────── */
  /* Pannello principale: da riga a colonna su mobile */
  .audio-deck-main-panel {
    flex-direction: column;
    align-items: center;
    padding: 10px 10px 8px;
  }
  .audio-deck-cassette-bay {
    min-height: unset;
    width: 100%;
  }
  /* Scala la cassette-body (360×220) al 75%: 270×165 px visuali.
     Margini negativi compensano lo spazio di layout lasciato dal transform. */
  .audio-deck-cassette-bay .cassette-body {
    transform: scale(0.75);
    transform-origin: center;
    margin: calc((1 - 0.75) * -220px / 2) calc((1 - 0.75) * -360px / 2);
  }
  /* Pannello counter: in riga, centrato sotto la cassetta */
  .audio-deck-right-panel {
    flex-direction: row;
    min-width: unset;
    width: 100%;
    padding: 0;
    gap: 16px;
    justify-content: center;
    align-items: center;
  }
  .audio-deck-counter { width: auto; }

  /* ── VCR controls ────────────────────────────────────────────────── */
  .vcr-controls {
    justify-content: space-evenly;
    gap: 8px;
  }
}

/* ---------- Schede dei nastri (blocco "tapes"): le stesse del Teatro CTH, coi colori dei lettori */
.lt-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 40px;
}

.lt-card {
  position: relative;
  padding: 30px;
  background-color: var(--lt-paper);
  color: var(--lt-card-ink, var(--lt-key-fg));
  border: 3px solid var(--lt-edge);
  border-radius: 3px 4px 3px 5px / 5px 3px 4px 3px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.05),
    0 8px 18px -8px rgba(0, 0, 0, 0.15),
    0 5px 10px -10px rgba(0, 0, 0, 0.1);
}

.lt-card.off {
  filter: grayscale(1);
  opacity: 0.42;
}

.lt-card.off button {
  pointer-events: none;
  cursor: not-allowed;
}

.lt-card-tag {
  position: absolute;
  top: -15px;
  right: 20px;
  padding: 2px 8px;
  font-family: var(--lt-bold);
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  background-color: var(--lt-accent);
  color: #fff;
  border: 2px solid var(--lt-edge);
}

.lt-card h3 {
  margin: 0 0 10px;
  font-family: var(--lt-mono);
  font-size: 1.25rem;
  font-weight: bold;
  color: inherit;
}

.lt-card-text {
  margin: 0 0 15px;
  font-size: 0.85rem;
  color: var(--lt-card-ink, var(--lt-muted));
}

.lt-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.lt-stamp {
  display: inline-block;
  padding: 4px 12px;
  font-family: var(--lt-bold);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  background-color: var(--lt-edge);
  color: var(--lt-paper);
}

.lt-stamp.ok {
  background-color: var(--lt-green, #008f39);
  color: #fff;
}

.lt-card .cassette-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--lt-card-key, var(--lt-key-fg));
}

@media (max-width: 768px) {
  .lt-cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}
