/* copione.css — Modalità Copione (lancio del testo già scritto).
   Pensata per essere usata SENZA mouse: colori ad alto contrasto e
   posizione della riga corrente sempre al centro dello schermo. */

.cp-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: #14161a;
  color: #e8e8e8;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cp-overlay[hidden] { display: none; }

.cp-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #1d2128;
  border-bottom: 1px solid #2c313a;
  flex-shrink: 0;
}

.cp-title { font-weight: bold; font-size: 15px; letter-spacing: 1px; }
.cp-progress { font-size: 13px; color: #8ab4ff; min-width: 120px; }

.cp-search {
  flex: 1;
  max-width: 420px;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid #3a414d;
  background: #11141a;
  color: #e8e8e8;
  font-size: 13px;
}
.cp-search:focus { outline: none; border-color: #007bff; }

.cp-head button {
  padding: 7px 12px;
  border: none;
  border-radius: 6px;
  background: #3a414d;
  color: #e8e8e8;
  font-size: 13px;
  cursor: pointer;
}
.cp-head button:hover { background: #4a5260; }

/* ---- schermata di incolla ---- */
.cp-setup {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 12px;
  min-height: 0;
}

.cp-setup textarea {
  flex: 1;
  padding: 16px;
  border-radius: 8px;
  border: 2px solid #3a414d;
  background: #11141a;
  color: #e8e8e8;
  font-size: 16px;
  line-height: 1.6;
  resize: none;
}
.cp-setup textarea:focus { outline: none; border-color: #007bff; }

.cp-setup-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.cp-setup-actions button, .cp-file {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  background: #3a414d;
  color: #e8e8e8;
  font-size: 14px;
  cursor: pointer;
}
.cp-setup-actions .cp-primary { background: #28a745; font-weight: bold; }
.cp-hint { color: #8b95a5; font-size: 13px; }

/* ---- lettore ---- */
.cp-reader {
  flex: 1;
  overflow-y: auto;
  padding: 40px 8vw;
  font-size: 26px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-wrap: break-word;
  outline: none;
  scroll-behavior: smooth;
  cursor: text;   /* un clic sul testo sceglie da dove ripartire */
}

.cp-reader:focus-visible { box-shadow: inset 0 0 0 2px #007bff; }

.cp-sent { color: #5a6472; }                 /* già mandato */
.cp-rest { color: #cfd6e0; }                 /* ancora da mandare */

.cp-next {                                    /* prossima frase */
  background: rgba(255, 214, 0, 0.16);
  color: #ffd600;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(255, 214, 0, 0.35);
}

.cp-next-word {                               /* prossima parola dentro la frase */
  text-decoration: underline;
  text-decoration-color: #ffd600;
  text-underline-offset: 4px;
}

.cp-hit { background: rgba(0, 123, 255, 0.35); border-radius: 3px; }

/* ---- riga in onda + improvvisazione ---- */
.cp-air {
  flex-shrink: 0;
  border-top: 2px solid #2c313a;
  background: #1a1e24;
  padding: 10px 16px 12px;
}

.cp-air-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: #8b95a5;
  margin-bottom: 6px;
}

.cp-air-slot textarea {
  width: 100%;
  height: 90px !important;
  flex: none !important;
}

.cp-keys {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 8px 16px;
  background: #1d2128;
  border-top: 1px solid #2c313a;
  font-size: 12px;
  color: #9aa4b2;
}
.cp-keys b { color: #e8e8e8; background: #333a45; border-radius: 4px; padding: 2px 7px; font-weight: normal; }

.cp-flash {
  position: fixed;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #ffd600;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  z-index: 9600;
  pointer-events: none;
}

/* bottone di apertura nella barra stenotipista */
.cp-open-btn {
  background: #6f42c1;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
}
.cp-open-btn:hover { background: #5a34a0; }

@media (max-width: 900px) {
  .cp-reader { padding: 24px; font-size: 20px; }
}
